Merge from Chromium at DEPS revision r213780

This commit was generated by merge_to_master.py.

Change-Id: I702915ad75bd2cc5201b0239db771978b0a8137d
diff --git a/Source/bindings/v8/BindingSecurity.cpp b/Source/bindings/v8/BindingSecurity.cpp
index 92f0f10..0c7c0d1 100644
--- a/Source/bindings/v8/BindingSecurity.cpp
+++ b/Source/bindings/v8/BindingSecurity.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
diff --git a/Source/bindings/v8/BindingSecurity.h b/Source/bindings/v8/BindingSecurity.h
index c8cb741..dedd2f1 100644
--- a/Source/bindings/v8/BindingSecurity.h
+++ b/Source/bindings/v8/BindingSecurity.h
@@ -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
diff --git a/Source/bindings/v8/CustomElementConstructorBuilder.cpp b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
index 1ba1e5b..02fd927 100644
--- a/Source/bindings/v8/CustomElementConstructorBuilder.cpp
+++ b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
@@ -42,7 +42,6 @@
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/UnsafePersistent.h"
 #include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8CustomElementLifecycleCallbacks.h"
 #include "bindings/v8/V8HiddenPropertyName.h"
 #include "bindings/v8/V8PerContextData.h"
 #include "core/dom/CustomElementCallbackDispatcher.h"
@@ -50,7 +49,6 @@
 #include "core/dom/CustomElementDescriptor.h"
 #include "core/dom/Document.h"
 #include "wtf/Assertions.h"
-#include "wtf/RefPtr.h"
 
 namespace WebCore {
 
@@ -145,11 +143,11 @@
     return false;
 }
 
-PassRefPtr<CustomElementLifecycleCallbacks> CustomElementConstructorBuilder::createCallbacks(Document* document)
+PassRefPtr<CustomElementLifecycleCallbacks> CustomElementConstructorBuilder::createCallbacks()
 {
     ASSERT(!m_prototype.IsEmpty());
 
-    RefPtr<Document> protect(document);
+    RefPtr<ScriptExecutionContext> scriptExecutionContext(toScriptExecutionContext(m_context));
 
     v8::TryCatch exceptionCatcher;
     exceptionCatcher.SetVerbose(true);
@@ -160,7 +158,8 @@
     v8::Handle<v8::Function> leftDocument = retrieveCallback(isolate, "leftDocumentCallback");
     v8::Handle<v8::Function> attributeChanged = retrieveCallback(isolate, "attributeChangedCallback");
 
-    return V8CustomElementLifecycleCallbacks::create(document, m_prototype, created, enteredDocument, leftDocument, attributeChanged);
+    m_callbacks = V8CustomElementLifecycleCallbacks::create(scriptExecutionContext.get(), m_prototype, created, enteredDocument, leftDocument, attributeChanged);
+    return m_callbacks.get();
 }
 
 v8::Handle<v8::Function> CustomElementConstructorBuilder::retrieveCallback(v8::Isolate* isolate, const char* name)
@@ -240,14 +239,7 @@
 {
     ASSERT(!m_constructor.IsEmpty());
 
-    V8PerContextData* perContextData = V8PerContextData::from(m_context);
-    if (!perContextData)
-        return false;
-
-    // Bindings retrieve the prototype when needed from per-context data.
-    perContextData->addCustomElementBinding(definition->descriptor().type(), CustomElementBinding::create(m_context->GetIsolate(), m_prototype, m_wrapperType));
-
-    return true;
+    return m_callbacks->setBinding(definition, CustomElementBinding::create(m_context->GetIsolate(), m_prototype, m_wrapperType));
 }
 
 ScriptValue CustomElementConstructorBuilder::bindingsReturnValue() const
diff --git a/Source/bindings/v8/CustomElementConstructorBuilder.h b/Source/bindings/v8/CustomElementConstructorBuilder.h
index 83d5e25..354fd12 100644
--- a/Source/bindings/v8/CustomElementConstructorBuilder.h
+++ b/Source/bindings/v8/CustomElementConstructorBuilder.h
@@ -32,10 +32,12 @@
 #define CustomElementConstructorBuilder_h
 
 #include "bindings/v8/ScriptValue.h"
+#include "bindings/v8/V8CustomElementLifecycleCallbacks.h"
 #include "core/dom/CustomElementLifecycleCallbacks.h"
 #include "core/dom/QualifiedName.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
 #include "wtf/text/AtomicString.h"
 #include <v8.h>
 
@@ -66,7 +68,7 @@
     bool isFeatureAllowed() const;
     bool validateOptions();
     bool findTagName(const AtomicString& customElementType, QualifiedName& tagName);
-    PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(Document*);
+    PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks();
     bool createConstructor(Document*, CustomElementDefinition*);
     bool didRegisterDefinition(CustomElementDefinition*) const;
 
@@ -87,6 +89,7 @@
     WrapperTypeInfo* m_wrapperType;
     AtomicString m_namespaceURI;
     v8::Handle<v8::Function> m_constructor;
+    RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks;
 };
 
 }
diff --git a/Source/bindings/v8/CustomElementWrapper.cpp b/Source/bindings/v8/CustomElementWrapper.cpp
index 19868dd..3aca235 100644
--- a/Source/bindings/v8/CustomElementWrapper.cpp
+++ b/Source/bindings/v8/CustomElementWrapper.cpp
@@ -37,6 +37,7 @@
 #include "V8SVGElementWrapperFactory.h"
 #include "bindings/v8/DOMDataStore.h"
 #include "bindings/v8/V8PerContextData.h"
+#include "core/dom/CustomElement.h"
 #include "core/dom/CustomElementRegistrationContext.h"
 #include "core/html/HTMLElement.h"
 #include "core/html/HTMLUnknownElement.h"
@@ -101,9 +102,7 @@
     if (!perContextData)
         return v8::Handle<v8::Object>();
 
-    CustomElementDescriptor descriptor = CustomElementRegistrationContext::describe(element.get());
-    CustomElementBinding* binding = perContextData->customElementBinding(descriptor.type());
-
+    CustomElementBinding* binding = perContextData->customElementBinding(CustomElement::definitionFor(element.get()));
     v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, binding->wrapperType(), element.get(), isolate);
     if (wrapper.IsEmpty())
         return v8::Handle<v8::Object>();
diff --git a/Source/bindings/v8/DOMWrapperWorld.cpp b/Source/bindings/v8/DOMWrapperWorld.cpp
index 9127964..bb77bf1 100644
--- a/Source/bindings/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/v8/DOMWrapperWorld.cpp
@@ -223,7 +223,7 @@
     isolatedWorldContentSecurityPolicies().remove(worldID);
 }
 
-typedef HashMap<int, OwnPtr<V8DOMActivityLogger>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int> > DOMActivityLoggerMap; 
+typedef HashMap<int, OwnPtr<V8DOMActivityLogger>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int> > DOMActivityLoggerMap;
 static DOMActivityLoggerMap& domActivityLoggers()
 {
     ASSERT(isMainThread());
@@ -234,13 +234,13 @@
 void DOMWrapperWorld::setActivityLogger(int worldId, PassOwnPtr<V8DOMActivityLogger> logger)
 {
     domActivityLoggers().set(worldId, logger);
-} 
+}
 
 V8DOMActivityLogger* DOMWrapperWorld::activityLogger(int worldId)
 {
     DOMActivityLoggerMap& loggers = domActivityLoggers();
-    DOMActivityLoggerMap::iterator it = loggers.find(worldId);   
+    DOMActivityLoggerMap::iterator it = loggers.find(worldId);
     return it == loggers.end() ? 0 : it->value.get();
-} 
+}
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/DOMWrapperWorld.h b/Source/bindings/v8/DOMWrapperWorld.h
index 22128c6..849b865 100644
--- a/Source/bindings/v8/DOMWrapperWorld.h
+++ b/Source/bindings/v8/DOMWrapperWorld.h
@@ -88,7 +88,7 @@
     bool isolatedWorldHasContentSecurityPolicy();
 
     // Associate a logger with the world identified by worldId (worlId may be 0
-    // identifying the main world).  
+    // identifying the main world).
     static void setActivityLogger(int worldId, PassOwnPtr<V8DOMActivityLogger>);
     static V8DOMActivityLogger* activityLogger(int worldId);
 
diff --git a/Source/bindings/v8/DateExtension.cpp b/Source/bindings/v8/DateExtension.cpp
index 58d9e1d..d06983b 100644
--- a/Source/bindings/v8/DateExtension.cpp
+++ b/Source/bindings/v8/DateExtension.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
diff --git a/Source/bindings/v8/DateExtension.h b/Source/bindings/v8/DateExtension.h
index 647f32a..daa98b2 100644
--- a/Source/bindings/v8/DateExtension.h
+++ b/Source/bindings/v8/DateExtension.h
@@ -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
diff --git a/Source/bindings/v8/NPV8Object.cpp b/Source/bindings/v8/NPV8Object.cpp
index 621a99c..80f29f6 100644
--- a/Source/bindings/v8/NPV8Object.cpp
+++ b/Source/bindings/v8/NPV8Object.cpp
@@ -111,7 +111,7 @@
 
 NPObject* v8ObjectToNPObject(v8::Handle<v8::Object> object)
 {
-    return reinterpret_cast<NPObject*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)); 
+    return reinterpret_cast<NPObject*>(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
 }
 
 NPObject* npCreateV8ScriptObject(NPP npp, v8::Handle<v8::Object> object, DOMWindow* root)
@@ -382,7 +382,7 @@
 
         v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
         v8::Local<v8::Value> v8result = obj->Get(npIdentifierToV8Identifier(propertyName));
-        
+
         if (v8result.IsEmpty())
             return false;
 
diff --git a/Source/bindings/v8/PageScriptDebugServer.h b/Source/bindings/v8/PageScriptDebugServer.h
index 96a98a1..4ffbb76 100644
--- a/Source/bindings/v8/PageScriptDebugServer.h
+++ b/Source/bindings/v8/PageScriptDebugServer.h
@@ -62,7 +62,7 @@
 private:
     PageScriptDebugServer();
     virtual ~PageScriptDebugServer() { }
-    
+
     virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>);
     virtual void runMessageLoopOnPause(v8::Handle<v8::Context>);
     virtual void quitMessageLoopOnPause();
diff --git a/Source/bindings/v8/RetainedDOMInfo.cpp b/Source/bindings/v8/RetainedDOMInfo.cpp
index 01b3448..15a83f2 100644
--- a/Source/bindings/v8/RetainedDOMInfo.cpp
+++ b/Source/bindings/v8/RetainedDOMInfo.cpp
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  *     * Redistributions of 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
@@ -65,7 +65,7 @@
 {
     return PtrHash<void*>::hash(m_root);
 }
-    
+
 const char* RetainedDOMInfo::GetGroupLabel()
 {
     return m_root->inDocument() ? "(Document DOM trees)" : "(Detached DOM trees)";
diff --git a/Source/bindings/v8/RetainedDOMInfo.h b/Source/bindings/v8/RetainedDOMInfo.h
index 6cdae5d..5270999 100644
--- a/Source/bindings/v8/RetainedDOMInfo.h
+++ b/Source/bindings/v8/RetainedDOMInfo.h
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  *     * Redistributions of 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
@@ -49,7 +49,7 @@
     virtual const char* GetLabel();
     virtual intptr_t GetElementCount();
     virtual intptr_t GetEquivalenceClass();
-    
+
 private:
     // V8 guarantees to keep RetainedObjectInfos alive only during a GC or heap snapshotting round, when renderer
     // doesn't get control. This allows us to use raw pointers.
diff --git a/Source/bindings/v8/RetainedObjectInfo.h b/Source/bindings/v8/RetainedObjectInfo.h
index 0368fb1..6593bfd 100644
--- a/Source/bindings/v8/RetainedObjectInfo.h
+++ b/Source/bindings/v8/RetainedObjectInfo.h
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  *     * Redistributions of 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
diff --git a/Source/bindings/v8/ScriptCallStackFactory.cpp b/Source/bindings/v8/ScriptCallStackFactory.cpp
index d6c9d62..22de5f8 100644
--- a/Source/bindings/v8/ScriptCallStackFactory.cpp
+++ b/Source/bindings/v8/ScriptCallStackFactory.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
diff --git a/Source/bindings/v8/ScriptCallStackFactory.h b/Source/bindings/v8/ScriptCallStackFactory.h
index c729cc2..54ae6fa 100644
--- a/Source/bindings/v8/ScriptCallStackFactory.h
+++ b/Source/bindings/v8/ScriptCallStackFactory.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
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index 18e21cc..396b022 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -649,7 +649,7 @@
 
     if (!locationChangeBefore && m_frame->navigationScheduler()->locationChangePending())
         return true;
-        
+
     // DocumentWriter::replaceDocument can cause the DocumentLoader to get deref'ed and possible destroyed,
     // so protect it with a RefPtr.
     if (RefPtr<DocumentLoader> loader = m_frame->document()->loader())
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp
index 7ed6fcc..b78118b 100644
--- a/Source/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/bindings/v8/ScriptDebugServer.cpp
@@ -416,7 +416,7 @@
 void ScriptDebugServer::breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
 {
     ASSERT(2 == args.Length());
-    
+
     ScriptDebugServer* thisPtr = toScriptDebugServer(args.Data());
     v8::Handle<v8::Value> exception;
     v8::Handle<v8::Array> hitBreakpoints;
diff --git a/Source/bindings/v8/ScriptDebugServer.h b/Source/bindings/v8/ScriptDebugServer.h
index dd8189e..0b188da 100644
--- a/Source/bindings/v8/ScriptDebugServer.h
+++ b/Source/bindings/v8/ScriptDebugServer.h
@@ -103,7 +103,7 @@
 protected:
     explicit ScriptDebugServer(v8::Isolate*);
     virtual ~ScriptDebugServer();
-    
+
     ScriptValue currentCallFrame();
 
     virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) = 0;
@@ -133,7 +133,7 @@
     ScopedPersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate;
     HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts;
     v8::Isolate* m_isolate;
-    
+
 private:
     PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> executionState, int maximumLimit);
 
diff --git a/Source/bindings/v8/ScriptGCEvent.cpp b/Source/bindings/v8/ScriptGCEvent.cpp
index 189a074..50b2d8f 100644
--- a/Source/bindings/v8/ScriptGCEvent.cpp
+++ b/Source/bindings/v8/ScriptGCEvent.cpp
@@ -106,6 +106,6 @@
         (*i)->didGC(gcEventData->startTime(), endTime, collectedBytes);
     gcEventData->clear();
 }
-    
+
 } // namespace WebCore
 
diff --git a/Source/bindings/v8/ScriptInstance.cpp b/Source/bindings/v8/ScriptInstance.cpp
index 8248fa4..961e4a9 100644
--- a/Source/bindings/v8/ScriptInstance.cpp
+++ b/Source/bindings/v8/ScriptInstance.cpp
@@ -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
diff --git a/Source/bindings/v8/ScriptInstance.h b/Source/bindings/v8/ScriptInstance.h
index 2fee44c..0b8fc98 100644
--- a/Source/bindings/v8/ScriptInstance.h
+++ b/Source/bindings/v8/ScriptInstance.h
@@ -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
diff --git a/Source/bindings/v8/ScriptSourceCode.h b/Source/bindings/v8/ScriptSourceCode.h
index cff6050..4e69421 100644
--- a/Source/bindings/v8/ScriptSourceCode.h
+++ b/Source/bindings/v8/ScriptSourceCode.h
@@ -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
diff --git a/Source/bindings/v8/ScriptState.h b/Source/bindings/v8/ScriptState.h
index a48122e..16a4a4a 100644
--- a/Source/bindings/v8/ScriptState.h
+++ b/Source/bindings/v8/ScriptState.h
@@ -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
diff --git a/Source/bindings/v8/ScriptValue.cpp b/Source/bindings/v8/ScriptValue.cpp
index 6ac72a1..dd41b0d 100644
--- a/Source/bindings/v8/ScriptValue.cpp
+++ b/Source/bindings/v8/ScriptValue.cpp
@@ -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
diff --git a/Source/bindings/v8/ScriptValue.h b/Source/bindings/v8/ScriptValue.h
index 7fc2a09..bfbc636 100644
--- a/Source/bindings/v8/ScriptValue.h
+++ b/Source/bindings/v8/ScriptValue.h
@@ -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,8 +39,8 @@
 #include "wtf/Vector.h"
 #include "wtf/text/WTFString.h"
 
-#ifndef NDEBUG 
-#include "bindings/v8/V8GCController.h" 
+#ifndef NDEBUG
+#include "bindings/v8/V8GCController.h"
 #endif
 
 namespace WTF {
@@ -72,7 +72,7 @@
 
     static ScriptValue createNull() { return ScriptValue(v8::Null()); }
 
-    ScriptValue& operator=(const ScriptValue& value) 
+    ScriptValue& operator=(const ScriptValue& value)
     {
         if (this != &value)
             m_value = value.m_value;
diff --git a/Source/bindings/v8/ScriptWrappable.h b/Source/bindings/v8/ScriptWrappable.h
index 2a77062..6832a61 100644
--- a/Source/bindings/v8/ScriptWrappable.h
+++ b/Source/bindings/v8/ScriptWrappable.h
@@ -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
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index 1ba1558..2b5400d 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -76,6 +76,7 @@
 #include "wtf/Uint8Array.h"
 #include "wtf/Uint8ClampedArray.h"
 #include "wtf/Vector.h"
+#include "wtf/text/StringBuffer.h"
 #include "wtf/text/StringUTF8Adaptor.h"
 
 // FIXME: consider crashing in debug mode on deserialization errors
@@ -2250,9 +2251,9 @@
     // Decode wire data from big endian to host byte order.
     ASSERT(!(data.size() % sizeof(UChar)));
     size_t length = data.size() / sizeof(UChar);
-    Vector<UChar> buffer(length);
+    StringBuffer<UChar> buffer(length);
     const UChar* src = reinterpret_cast<const UChar*>(data.data());
-    UChar* dst = buffer.data();
+    UChar* dst = buffer.characters();
     for (size_t i = 0; i < length; i++)
         dst[i] = ntohs(src[i]);
 
diff --git a/Source/bindings/v8/V8Binding.cpp b/Source/bindings/v8/V8Binding.cpp
index 59dde88..fcbc7de 100644
--- a/Source/bindings/v8/V8Binding.cpp
+++ b/Source/bindings/v8/V8Binding.cpp
@@ -373,7 +373,7 @@
     v8::HandleScope scope(isolate);
     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode);
     return scope.Close(result);
-}        
+}
 
 PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value> value, v8::Isolate* isolate)
 {
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h
index 0acf81a..7a0ae8c 100644
--- a/Source/bindings/v8/V8Binding.h
+++ b/Source/bindings/v8/V8Binding.h
@@ -75,6 +75,8 @@
 
     v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator();
 
+    v8::Handle<v8::Value> toV8Sequence(v8::Handle<v8::Value>, uint32_t& length, v8::Isolate*);
+
     inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::Value>& args, int index)
     {
         return index >= args.Length() ? v8::Local<v8::Value>() : args[index];
@@ -402,25 +404,29 @@
         }
     };
 
+    // Converts a JavaScript value to an array as per the Web IDL specification:
+    // http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-array
     template <class T, class V8T>
     Vector<RefPtr<T> > toRefPtrNativeArray(v8::Handle<v8::Value> value, v8::Isolate* isolate, bool* success = 0)
     {
         if (success)
             *success = true;
 
-        if (!value->IsArray())
+        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
+        uint32_t length = 0;
+        if (value->IsArray())
+            length = v8::Local<v8::Array>::Cast(v8Value)->Length();
+        else if (toV8Sequence(value, length, isolate).IsEmpty())
             return Vector<RefPtr<T> >();
 
         Vector<RefPtr<T> > result;
-        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
-        v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(v8Value);
-        size_t length = array->Length();
-        for (size_t i = 0; i < length; ++i) {
-            v8::Handle<v8::Value> element = array->Get(i);
+        v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
+        for (uint32_t i = 0; i < length; ++i) {
+            v8::Handle<v8::Value> element = object->Get(i);
 
             if (V8T::HasInstance(element, isolate, worldType(isolate))) {
-                v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(element);
-                result.append(V8T::toNative(object));
+                v8::Handle<v8::Object> elementObject = v8::Handle<v8::Object>::Cast(element);
+                result.append(V8T::toNative(elementObject));
             } else {
                 if (success)
                     *success = false;
@@ -431,19 +437,23 @@
         return result;
     }
 
+    // Converts a JavaScript value to an array as per the Web IDL specification:
+    // http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-array
     template <class T>
-    Vector<T> toNativeArray(v8::Handle<v8::Value> value)
+    Vector<T> toNativeArray(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     {
-        if (!value->IsArray())
+        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
+        uint32_t length = 0;
+        if (value->IsArray())
+            length = v8::Local<v8::Array>::Cast(v8Value)->Length();
+        else if (toV8Sequence(value, length, isolate).IsEmpty())
             return Vector<T>();
 
         Vector<T> result;
         typedef NativeValueTraits<T> TraitsType;
-        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
-        v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(v8Value);
-        size_t length = array->Length();
-        for (size_t i = 0; i < length; ++i)
-            result.append(TraitsType::nativeValue(array->Get(i)));
+        v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
+        for (uint32_t i = 0; i < length; ++i)
+            result.append(TraitsType::nativeValue(object->Get(i)));
         return result;
     }
 
@@ -462,17 +472,25 @@
     Vector<v8::Handle<v8::Value> > toVectorOfArguments(const v8::FunctionCallbackInfo<v8::Value>& args);
 
     // Validates that the passed object is a sequence type per WebIDL spec
-    // http://www.w3.org/TR/2012/WD-WebIDL-20120207/#es-sequence
+    // http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-sequence
     inline v8::Handle<v8::Value> toV8Sequence(v8::Handle<v8::Value> value, uint32_t& length, v8::Isolate* isolate)
     {
-        if (!value->IsObject()) {
+        // Attempt converting to a sequence if the value is not already an array but is
+        // any kind of object except for a native Date object or a native RegExp object.
+        ASSERT(!value->IsArray());
+        // FIXME: Do we really need to special case Date and RegExp object?
+        // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22806
+        if (!value->IsObject() || value->IsDate() || value->IsRegExp()) {
             throwTypeError(isolate);
             return v8Undefined();
         }
 
-        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
+        v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
         v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
 
+        // FIXME: The specification states that the length property should be used as fallback, if value
+        // is not a platform object that supports indexed properties. If it supports indexed properties,
+        // length should actually be one greater than value’s maximum indexed property index.
         V8TRYCATCH(v8::Local<v8::Value>, lengthValue, object->Get(v8::String::NewSymbol("length")));
 
         if (lengthValue->IsUndefined() || lengthValue->IsNull()) {
diff --git a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
index 070f9e9..c733f8d 100644
--- a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
+++ b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
@@ -32,12 +32,14 @@
 #include "bindings/v8/V8CustomElementLifecycleCallbacks.h"
 
 #include "V8Element.h"
+#include "bindings/v8/CustomElementBinding.h"
 #include "bindings/v8/DOMDataStore.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8HiddenPropertyName.h"
+#include "bindings/v8/V8PerContextData.h"
 #include "core/dom/ScriptExecutionContext.h"
-#include "wtf/PassRefPtr.h"
+#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
@@ -94,6 +96,7 @@
     , m_enteredDocument(enteredDocument)
     , m_leftDocument(leftDocument)
     , m_attributeChanged(attributeChanged)
+    , m_owner(0)
 {
     m_prototype.makeWeak(&m_prototype, weakCallback<v8::Object>);
 
@@ -105,6 +108,44 @@
 #undef MAKE_WEAK
 }
 
+V8PerContextData* V8CustomElementLifecycleCallbacks::creationContextData()
+{
+    if (!scriptExecutionContext())
+        return 0;
+
+    v8::Handle<v8::Context> context = toV8Context(scriptExecutionContext(), m_world.get());
+    if (context.IsEmpty())
+        return 0;
+
+    return V8PerContextData::from(context);
+}
+
+V8CustomElementLifecycleCallbacks::~V8CustomElementLifecycleCallbacks()
+{
+    if (!m_owner)
+        return;
+
+    v8::HandleScope handleScope;
+    if (V8PerContextData* perContextData = creationContextData())
+        perContextData->clearCustomElementBinding(m_owner);
+}
+
+bool V8CustomElementLifecycleCallbacks::setBinding(CustomElementDefinition* owner, PassOwnPtr<CustomElementBinding> binding)
+{
+    ASSERT(!m_owner);
+
+    V8PerContextData* perContextData = creationContextData();
+    if (!perContextData)
+        return false;
+
+    m_owner = owner;
+
+    // Bindings retrieve the prototype when needed from per-context data.
+    perContextData->addCustomElementBinding(owner, binding);
+
+    return true;
+}
+
 void V8CustomElementLifecycleCallbacks::created(Element* element)
 {
     if (!canInvokeCallback())
diff --git a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.h b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.h
index 81264c5..71313ee 100644
--- a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.h
+++ b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.h
@@ -35,18 +35,24 @@
 #include "bindings/v8/DOMWrapperWorld.h"
 #include "bindings/v8/ScopedPersistent.h"
 #include "core/dom/CustomElementLifecycleCallbacks.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
 #include <v8.h>
 
 namespace WebCore {
 
+class CustomElementLifecycleCallbacks;
 class Element;
 class ScriptExecutionContext;
+class V8PerContextData;
 
 class V8CustomElementLifecycleCallbacks : public CustomElementLifecycleCallbacks, ActiveDOMCallback {
 public:
     static PassRefPtr<V8CustomElementLifecycleCallbacks> create(ScriptExecutionContext*, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> enteredDocument, v8::Handle<v8::Function> leftDocument, v8::Handle<v8::Function> attributeChanged);
 
-    virtual ~V8CustomElementLifecycleCallbacks() { }
+    virtual ~V8CustomElementLifecycleCallbacks();
+
+    bool setBinding(CustomElementDefinition* owner, PassOwnPtr<CustomElementBinding>);
 
 private:
     V8CustomElementLifecycleCallbacks(ScriptExecutionContext*, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> enteredDocument, v8::Handle<v8::Function> leftDocument, v8::Handle<v8::Function> attributeChanged);
@@ -58,6 +64,9 @@
 
     void call(const ScopedPersistent<v8::Function>& weakCallback, Element*);
 
+    V8PerContextData* creationContextData();
+
+    CustomElementDefinition* m_owner;
     RefPtr<DOMWrapperWorld> m_world;
     ScopedPersistent<v8::Object> m_prototype;
     ScopedPersistent<v8::Function> m_created;
diff --git a/Source/bindings/v8/V8DOMActivityLogger.h b/Source/bindings/v8/V8DOMActivityLogger.h
index bfb7e75..93915a6 100644
--- a/Source/bindings/v8/V8DOMActivityLogger.h
+++ b/Source/bindings/v8/V8DOMActivityLogger.h
@@ -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
diff --git a/Source/bindings/v8/V8DOMWrapper.h b/Source/bindings/v8/V8DOMWrapper.h
index 8fbfe9c..035524e 100644
--- a/Source/bindings/v8/V8DOMWrapper.h
+++ b/Source/bindings/v8/V8DOMWrapper.h
@@ -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
diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp
index 568ebdb..95a5751 100644
--- a/Source/bindings/v8/V8GCController.cpp
+++ b/Source/bindings/v8/V8GCController.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
diff --git a/Source/bindings/v8/V8GCController.h b/Source/bindings/v8/V8GCController.h
index e53258b..b0aa802 100644
--- a/Source/bindings/v8/V8GCController.h
+++ b/Source/bindings/v8/V8GCController.h
@@ -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
diff --git a/Source/bindings/v8/V8GCForContextDispose.cpp b/Source/bindings/v8/V8GCForContextDispose.cpp
index 1ad8aba..a4c58fd 100644
--- a/Source/bindings/v8/V8GCForContextDispose.cpp
+++ b/Source/bindings/v8/V8GCForContextDispose.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
diff --git a/Source/bindings/v8/V8GCForContextDispose.h b/Source/bindings/v8/V8GCForContextDispose.h
index 2bf8fb2..ae338a6 100644
--- a/Source/bindings/v8/V8GCForContextDispose.h
+++ b/Source/bindings/v8/V8GCForContextDispose.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
diff --git a/Source/bindings/v8/V8HiddenPropertyName.cpp b/Source/bindings/v8/V8HiddenPropertyName.cpp
index dd53f10..2da72d3 100644
--- a/Source/bindings/v8/V8HiddenPropertyName.cpp
+++ b/Source/bindings/v8/V8HiddenPropertyName.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
diff --git a/Source/bindings/v8/V8Initializer.h b/Source/bindings/v8/V8Initializer.h
index a73cb7d..5ff4ecd 100644
--- a/Source/bindings/v8/V8Initializer.h
+++ b/Source/bindings/v8/V8Initializer.h
@@ -35,7 +35,7 @@
     static void initializeMainThreadIfNeeded(v8::Isolate*);
     static void initializeWorker(v8::Isolate*);
 };
-    
+
 } // namespace WebCore
 
 #endif // V8Initializer_h
diff --git a/Source/bindings/v8/V8ObjectConstructor.cpp b/Source/bindings/v8/V8ObjectConstructor.cpp
index 9b20421..be00a83 100644
--- a/Source/bindings/v8/V8ObjectConstructor.cpp
+++ b/Source/bindings/v8/V8ObjectConstructor.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2012 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -9,7 +9,7 @@
  * 2.  Redistributions in binary form must 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
diff --git a/Source/bindings/v8/V8PerContextData.cpp b/Source/bindings/v8/V8PerContextData.cpp
index 509013a..9edbdbc 100644
--- a/Source/bindings/v8/V8PerContextData.cpp
+++ b/Source/bindings/v8/V8PerContextData.cpp
@@ -131,27 +131,34 @@
     return function;
 }
 
-void V8PerContextData::addCustomElementBinding(const AtomicString& type, PassOwnPtr<CustomElementBinding> binding)
+void V8PerContextData::addCustomElementBinding(CustomElementDefinition* definition, PassOwnPtr<CustomElementBinding> binding)
 {
-    ASSERT(!m_customElementBindings->contains(type));
-    m_customElementBindings->add(type, binding);
+    ASSERT(!m_customElementBindings->contains(definition));
+    m_customElementBindings->add(definition, binding);
 }
 
-CustomElementBinding* V8PerContextData::customElementBinding(const AtomicString& type)
+void V8PerContextData::clearCustomElementBinding(CustomElementDefinition* definition)
 {
-    CustomElementBindingMap::const_iterator it = m_customElementBindings->find(type);
+    CustomElementBindingMap::iterator it = m_customElementBindings->find(definition);
+    ASSERT(it != m_customElementBindings->end());
+    m_customElementBindings->remove(it);
+}
+
+CustomElementBinding* V8PerContextData::customElementBinding(CustomElementDefinition* definition)
+{
+    CustomElementBindingMap::const_iterator it = m_customElementBindings->find(definition);
     ASSERT(it != m_customElementBindings->end());
     return it->value.get();
 }
 
 
-static v8::Handle<v8::Value> createDebugData(const char* worldName, int debugId) 
+static v8::Handle<v8::Value> createDebugData(const char* worldName, int debugId)
 {
     char buffer[32];
     unsigned wanted;
     if (debugId == -1)
         wanted = snprintf(buffer, sizeof(buffer), "%s", worldName);
-    else 
+    else
         wanted = snprintf(buffer, sizeof(buffer), "%s,%d", worldName, debugId);
 
     if (wanted < sizeof(buffer))
@@ -172,7 +179,7 @@
     context->SetEmbedderData(v8ContextDebugIdIndex, value);
 }
 
-bool V8PerContextDebugData::setContextDebugData(v8::Handle<v8::Context> context, const char* worldName, int debugId) 
+bool V8PerContextDebugData::setContextDebugData(v8::Handle<v8::Context> context, const char* worldName, int debugId)
 {
     if (!debugData(context)->IsUndefined())
         return false;
@@ -182,7 +189,7 @@
     return true;
 }
 
-int V8PerContextDebugData::contextDebugId(v8::Handle<v8::Context> context) 
+int V8PerContextDebugData::contextDebugId(v8::Handle<v8::Context> context)
 {
     v8::HandleScope scope;
     v8::Handle<v8::Value> data = debugData(context);
diff --git a/Source/bindings/v8/V8PerContextData.h b/Source/bindings/v8/V8PerContextData.h
index af9357d..c342ac4 100644
--- a/Source/bindings/v8/V8PerContextData.h
+++ b/Source/bindings/v8/V8PerContextData.h
@@ -45,6 +45,7 @@
 
 namespace WebCore {
 
+class CustomElementDefinition;
 struct V8NPObject;
 typedef WTF::Vector<V8NPObject*> V8NPObjectVector;
 typedef WTF::HashMap<int, V8NPObjectVector> V8NPObjectMap;
@@ -108,8 +109,9 @@
         m_activityLogger = logger;
     }
 
-    void addCustomElementBinding(const AtomicString& type, PassOwnPtr<CustomElementBinding>);
-    CustomElementBinding* customElementBinding(const AtomicString& type);
+    void addCustomElementBinding(CustomElementDefinition*, PassOwnPtr<CustomElementBinding>);
+    void clearCustomElementBinding(CustomElementDefinition*);
+    CustomElementBinding* customElementBinding(CustomElementDefinition*);
 
 private:
     explicit V8PerContextData(v8::Handle<v8::Context> context)
@@ -142,7 +144,7 @@
     v8::Persistent<v8::Context> m_context;
     ScopedPersistent<v8::Value> m_errorPrototype;
 
-    typedef WTF::HashMap<AtomicString, OwnPtr<CustomElementBinding> > CustomElementBindingMap;
+    typedef WTF::HashMap<CustomElementDefinition*, OwnPtr<CustomElementBinding> > CustomElementBindingMap;
     OwnPtr<CustomElementBindingMap> m_customElementBindings;
 };
 
diff --git a/Source/bindings/v8/V8PerIsolateData.cpp b/Source/bindings/v8/V8PerIsolateData.cpp
index c563200..11bb709 100644
--- a/Source/bindings/v8/V8PerIsolateData.cpp
+++ b/Source/bindings/v8/V8PerIsolateData.cpp
@@ -64,10 +64,10 @@
     return data;
 }
 
-void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate) 
+void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate)
 {
     ASSERT(isolate);
-    if (!isolate->GetData()) 
+    if (!isolate->GetData())
         create(isolate);
 }
 
diff --git a/Source/bindings/v8/V8PerIsolateData.h b/Source/bindings/v8/V8PerIsolateData.h
index 5423e7d..830ae6e 100644
--- a/Source/bindings/v8/V8PerIsolateData.h
+++ b/Source/bindings/v8/V8PerIsolateData.h
@@ -59,7 +59,7 @@
     {
         ASSERT(isolate);
         ASSERT(isolate->GetData());
-        return static_cast<V8PerIsolateData*>(isolate->GetData()); 
+        return static_cast<V8PerIsolateData*>(isolate->GetData());
     }
     static void dispose(v8::Isolate*);
 
@@ -94,7 +94,7 @@
 
     V8HiddenPropertyName* hiddenPropertyName() { return m_hiddenPropertyName.get(); }
 
-    void registerDOMDataStore(DOMDataStore* domDataStore) 
+    void registerDOMDataStore(DOMDataStore* domDataStore)
     {
         ASSERT(m_domDataList.find(domDataStore) == notFound);
         m_domDataList.append(domDataStore);
diff --git a/Source/bindings/v8/V8StringResource.h b/Source/bindings/v8/V8StringResource.h
index a54b86d..31f1781 100644
--- a/Source/bindings/v8/V8StringResource.h
+++ b/Source/bindings/v8/V8StringResource.h
@@ -251,7 +251,7 @@
     }
     return prepareBase();
 }
-    
+
 } // namespace WebCore
 
 #endif // V8StringResource_h
diff --git a/Source/bindings/v8/V8ThrowException.cpp b/Source/bindings/v8/V8ThrowException.cpp
index 507507b..5533108 100644
--- a/Source/bindings/v8/V8ThrowException.cpp
+++ b/Source/bindings/v8/V8ThrowException.cpp
@@ -1,6 +1,6 @@
 /*
  * 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:
@@ -9,7 +9,7 @@
  * 2.  Redistributions in binary form must 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
diff --git a/Source/bindings/v8/V8ThrowException.h b/Source/bindings/v8/V8ThrowException.h
index ea12306..6f3ed2d 100644
--- a/Source/bindings/v8/V8ThrowException.h
+++ b/Source/bindings/v8/V8ThrowException.h
@@ -1,6 +1,6 @@
 /*
  * 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:
@@ -9,7 +9,7 @@
  * 2.  Redistributions in binary form must 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
diff --git a/Source/bindings/v8/V8Utilities.cpp b/Source/bindings/v8/V8Utilities.cpp
index 33c07f1..9978fc5 100644
--- a/Source/bindings/v8/V8Utilities.cpp
+++ b/Source/bindings/v8/V8Utilities.cpp
@@ -138,7 +138,7 @@
         }
     }
 }
-    
+
 void transferHiddenDependency(v8::Handle<v8::Object> object, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex, v8::Isolate* isolate)
 {
     if (oldValue) {
diff --git a/Source/bindings/v8/V8Utilities.h b/Source/bindings/v8/V8Utilities.h
index b7f272e..425df2d 100644
--- a/Source/bindings/v8/V8Utilities.h
+++ b/Source/bindings/v8/V8Utilities.h
@@ -57,10 +57,10 @@
     typedef WTF::Vector<RefPtr<ArrayBuffer>, 1> ArrayBufferArray;
 
     // Helper function which pulls the values out of a JS sequence and into a MessagePortArray.
-    // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3 
+    // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3
     // of the HTML5 spec and generates exceptions as appropriate.
     // Returns true if the array was filled, or false if the passed value was not of an appropriate type.
-    bool extractTransferables(v8::Local<v8::Value>, MessagePortArray&, ArrayBufferArray&, v8::Isolate*); 
+    bool extractTransferables(v8::Local<v8::Value>, MessagePortArray&, ArrayBufferArray&, v8::Isolate*);
     bool getMessagePortArray(v8::Local<v8::Value>, MessagePortArray&, v8::Isolate*);
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8ValueCache.cpp b/Source/bindings/v8/V8ValueCache.cpp
index 7e20131..8c2be0f 100644
--- a/Source/bindings/v8/V8ValueCache.cpp
+++ b/Source/bindings/v8/V8ValueCache.cpp
@@ -56,7 +56,7 @@
     stringImpl->deref();
 }
 
-void StringCache::remove(StringImpl* stringImpl) 
+void StringCache::remove(StringImpl* stringImpl)
 {
     ASSERT(m_stringCache.contains(stringImpl));
     m_stringCache.remove(stringImpl);
diff --git a/Source/bindings/v8/V8ValueCache.h b/Source/bindings/v8/V8ValueCache.h
index e7eb52d..69123a6 100644
--- a/Source/bindings/v8/V8ValueCache.h
+++ b/Source/bindings/v8/V8ValueCache.h
@@ -56,7 +56,7 @@
             setReturnValueFromStringSlow(info, stringImpl, isolate);
     }
 
-    void clearOnGC() 
+    void clearOnGC()
     {
         m_lastStringImpl = 0;
         m_lastV8String.clear();
diff --git a/Source/bindings/v8/WorkerScriptDebugServer.cpp b/Source/bindings/v8/WorkerScriptDebugServer.cpp
index c2aaa0d..73a085f 100644
--- a/Source/bindings/v8/WorkerScriptDebugServer.cpp
+++ b/Source/bindings/v8/WorkerScriptDebugServer.cpp
@@ -64,7 +64,7 @@
     v8::Local<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isolate);
     ASSERT(!debuggerScript->IsUndefined());
     v8::Debug::SetDebugEventListener2(&WorkerScriptDebugServer::v8DebugEventCallback, v8::External::New(this));
-    
+
     v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getWorkerScripts")));
     v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScriptsFunction, debuggerScript, 0, 0, m_isolate);
     if (value.IsEmpty())
@@ -101,7 +101,7 @@
         result = m_workerGlobalScope->thread()->runLoop().runInMode(m_workerGlobalScope, m_debuggerTaskMode);
     // Keep waiting until execution is resumed.
     } while (result == MessageQueueMessageReceived && isPaused());
-    
+
     // The listener may have been removed in the nested loop.
     if (m_listener)
         m_listener->didContinue();
diff --git a/Source/bindings/v8/WrapperTypeInfo.h b/Source/bindings/v8/WrapperTypeInfo.h
index 3999eca..5d7fd15 100644
--- a/Source/bindings/v8/WrapperTypeInfo.h
+++ b/Source/bindings/v8/WrapperTypeInfo.h
@@ -34,7 +34,7 @@
 #include <v8.h>
 
 namespace WebCore {
-    
+
     class ActiveDOMObject;
     class DOMDataStore;
     class EventTarget;
@@ -76,8 +76,8 @@
         {
             return reinterpret_cast<WrapperTypeInfo*>(v8::External::Cast(*typeInfoWrapper)->Value());
         }
-        
-        
+
+
         bool equals(const WrapperTypeInfo* that) const
         {
             return this == that;
@@ -92,15 +92,15 @@
 
             return false;
         }
-        
+
         v8::Handle<v8::FunctionTemplate> getTemplate(v8::Isolate* isolate, WrapperWorldType worldType) { return getTemplateFunction(isolate, worldType); }
-        
+
         void derefObject(void* object)
         {
-            if (derefObjectFunction) 
+            if (derefObjectFunction)
                 derefObjectFunction(object);
         }
-        
+
         void installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, v8::Isolate* isolate)
         {
             if (installPerContextPrototypePropertiesFunction)
diff --git a/Source/bindings/v8/custom/V8AlgorithmCustom.cpp b/Source/bindings/v8/custom/V8AlgorithmCustom.cpp
index 172abb3..f230838 100644
--- a/Source/bindings/v8/custom/V8AlgorithmCustom.cpp
+++ b/Source/bindings/v8/custom/V8AlgorithmCustom.cpp
@@ -33,6 +33,7 @@
 
 #include "V8AesCbcParams.h"
 #include "V8AesKeyGenParams.h"
+#include "V8HmacParams.h"
 #include "bindings/v8/V8Binding.h"
 
 namespace WebCore {
@@ -49,6 +50,8 @@
         return wrap(static_cast<AesCbcParams*>(impl), creationContext, isolate);
     case WebKit::WebCryptoAlgorithmParamsTypeAesKeyGenParams:
         return wrap(static_cast<AesKeyGenParams*>(impl), creationContext, isolate);
+    case WebKit::WebCryptoAlgorithmParamsTypeHmacParams:
+        return wrap(static_cast<HmacParams*>(impl), creationContext, isolate);
     }
 
     ASSERT_NOT_REACHED();
diff --git a/Source/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp b/Source/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
index d15ab4d..b5ede7c 100644
--- a/Source/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
@@ -48,7 +48,7 @@
             return;
         }
     }
-    
+
     if (!buffer) {
         throwTypeError("Value is not of type AudioBuffer", info.GetIsolate());
         return;
diff --git a/Source/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/bindings/v8/custom/V8AudioContextCustom.cpp
index b9c84ff..99c8174 100644
--- a/Source/bindings/v8/custom/V8AudioContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8AudioContextCustom.cpp
@@ -46,7 +46,7 @@
     Document* document = currentDocument();
 
     RefPtr<AudioContext> audioContext;
-    
+
     if (!args.Length()) {
         // Constructor for default AudioContext which talks to audio hardware.
         audioContext = AudioContext::create(document);
@@ -68,7 +68,7 @@
         throwError(v8SyntaxError, "Error creating AudioContext", args.GetIsolate());
         return;
     }
-    
+
     // Transform the holder into a wrapper object for the audio context.
     v8::Handle<v8::Object> wrapper = args.Holder();
     V8DOMWrapper::associateObjectWithWrapper<V8AudioContext>(audioContext.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
diff --git a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
index ccd5c35..a72e5a2 100644
--- a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
@@ -53,7 +53,7 @@
             return;
         }
     }
-    
+
     throwTypeError("Illegal BiquadFilterNode type", info.GetIsolate());
 }
 
diff --git a/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
index a079037..8166350 100644
--- a/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
+++ b/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.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
diff --git a/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
index 2d9fa2e..78f8e99 100644
--- a/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
+++ b/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
@@ -1,10 +1,10 @@
 /*
  * Copyright (c) 2009, 2012 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  *     * Redistributions of 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
diff --git a/Source/bindings/v8/custom/V8CustomXPathNSResolver.h b/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
index 21531d8..3ddceae 100644
--- a/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
+++ b/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
@@ -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
diff --git a/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
index 71d75c5..0327c01 100644
--- a/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLAllCollectionCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLCollectionCustom.cpp
index b03ed2b..33fd4ca 100644
--- a/Source/bindings/v8/custom/V8HTMLCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLCollectionCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp
index f2e5af5..4710333 100644
--- a/Source/bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLFormControlsCollectionCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
index 689d6a0..f589ef9 100644
--- a/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-using namespace HTMLNames; 
+using namespace HTMLNames;
 
 void V8HTMLFrameElement::locationAttrSetterCustom(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
 {
diff --git a/Source/bindings/v8/custom/V8HTMLLinkElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLLinkElementCustom.cpp
index b305380..c3b1f4e 100644
--- a/Source/bindings/v8/custom/V8HTMLLinkElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLLinkElementCustom.cpp
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  *     * Redistributions of 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
diff --git a/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
index eb2c91e..089253d 100644
--- a/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
@@ -43,7 +43,7 @@
     }
 
     // 4.8.10.11.2 Media controllers: controller attribute.
-    // On setting, it must first remove the element's mediagroup attribute, if any, 
+    // On setting, it must first remove the element's mediagroup attribute, if any,
     HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
     imp->setMediaGroup(String());
     // and then set the current media controller to the given value.
diff --git a/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
index 7392172..90607e6 100644
--- a/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
index 44db801..2eb0188 100644
--- a/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLSelectElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLSelectElementCustom.cpp
index aee1ff5..7a1b3d9 100644
--- a/Source/bindings/v8/custom/V8HTMLSelectElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLSelectElementCustom.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
diff --git a/Source/bindings/v8/custom/V8HTMLSelectElementCustom.h b/Source/bindings/v8/custom/V8HTMLSelectElementCustom.h
index daaf224..9f29386 100644
--- a/Source/bindings/v8/custom/V8HTMLSelectElementCustom.h
+++ b/Source/bindings/v8/custom/V8HTMLSelectElementCustom.h
@@ -1,11 +1,11 @@
 /*
  * 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
@@ -15,7 +15,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
diff --git a/Source/bindings/v8/custom/V8MessageChannelCustom.cpp b/Source/bindings/v8/custom/V8MessageChannelCustom.cpp
index e865215..3d2364a 100644
--- a/Source/bindings/v8/custom/V8MessageChannelCustom.cpp
+++ b/Source/bindings/v8/custom/V8MessageChannelCustom.cpp
@@ -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
diff --git a/Source/bindings/v8/custom/V8NodeListCustom.cpp b/Source/bindings/v8/custom/V8NodeListCustom.cpp
index c80d847..efb9208 100644
--- a/Source/bindings/v8/custom/V8NodeListCustom.cpp
+++ b/Source/bindings/v8/custom/V8NodeListCustom.cpp
@@ -29,7 +29,7 @@
  */
 
 #include "config.h"
-#include "V8NodeList.h" 
+#include "V8NodeList.h"
 
 #include "V8Node.h"
 #include "bindings/v8/V8Binding.h"
diff --git a/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp b/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
index c1e892b..f98ddab 100644
--- a/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
@@ -53,7 +53,7 @@
             return;
         }
     }
-    
+
     throwTypeError("Illegal OscillatorNode type", info.GetIsolate());
 }
 
diff --git a/Source/bindings/v8/custom/V8PannerNodeCustom.cpp b/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
index 00b9c62..66f89a9 100644
--- a/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
@@ -53,7 +53,7 @@
             return;
         }
     }
-    
+
     throwTypeError("Illegal panningModel", info.GetIsolate());
 }
 
@@ -77,7 +77,7 @@
             return;
         }
     }
-    
+
     throwTypeError("Illegal distanceModel", info.GetIsolate());
 }
 
diff --git a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
index 821948c..01c452c 100644
--- a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
+++ b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.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
diff --git a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp b/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
index 24f7524..ec2f771 100644
--- a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/Source/bindings/v8/custom/V8SVGLengthCustom.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
@@ -27,7 +27,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.
  */
- 
+
 #include "config.h"
 #include "V8SVGLength.h"
 
diff --git a/Source/bindings/v8/custom/V8TrackEventCustom.cpp b/Source/bindings/v8/custom/V8TrackEventCustom.cpp
index 8cd482f..b853ddd 100644
--- a/Source/bindings/v8/custom/V8TrackEventCustom.cpp
+++ b/Source/bindings/v8/custom/V8TrackEventCustom.cpp
@@ -42,7 +42,7 @@
 {
     TrackEvent* trackEvent = V8TrackEvent::toNative(info.Holder());
     TrackBase* track = trackEvent->track();
-    
+
     if (!track) {
         v8SetReturnValueNull(info);
         return;
@@ -53,7 +53,7 @@
         // This should never happen.
         ASSERT_NOT_REACHED();
         break;
-        
+
     case TrackBase::TextTrack:
         v8SetReturnValue(info, toV8Fast(static_cast<TextTrack*>(track), info, trackEvent));
         return;
diff --git a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index fa3532e..8b0783e 100644
--- a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.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
@@ -729,7 +729,7 @@
     }
     bool ok = false;
     WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
-    
+
     bool transpose = args[1]->BooleanValue();
     if (V8Float32Array::HasInstance(args[2], args.GetIsolate(), worldType(args.GetIsolate()))) {
         Float32Array* array = V8Float32Array::toNative(args[2]->ToObject());
diff --git a/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index a5196e7..4302221 100644
--- a/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -154,7 +154,7 @@
 
         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, es);
diff --git a/Source/bindings/v8/custom/V8XSLTProcessorCustom.cpp b/Source/bindings/v8/custom/V8XSLTProcessorCustom.cpp
index 509c504..46b40ff 100644
--- a/Source/bindings/v8/custom/V8XSLTProcessorCustom.cpp
+++ b/Source/bindings/v8/custom/V8XSLTProcessorCustom.cpp
@@ -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