The last of the V8 binding optimizations.
[WebKit-https.git] / WebCore / bindings / v8 / V8Binding.cpp
index ede85a493604d1e7e5cab6df648ab64c0369fc84..f069c03fae0c803f213f1040039fbb66d2dd9024 100644 (file)
 
 #include "AtomicString.h"
 #include "CString.h"
+#include "Element.h"
 #include "MathExtras.h"
 #include "PlatformString.h"
+#include "QualifiedName.h"
 #include "StdLibExtras.h"
 #include "StringBuffer.h"
 #include "StringHash.h"
@@ -423,5 +425,21 @@ void createCallback(v8::Local<v8::ObjectTemplate> proto,
                v8::FunctionTemplate::New(callback, v8::Handle<v8::Value>(), signature),
                attribute);
 }
+    
+v8::Handle<v8::Value> getElementStringAttr(const v8::AccessorInfo& info,
+                                           const QualifiedName& name) 
+{
+    Element *imp = v8DOMWrapperToNode<Element>(info);
+    return v8ExternalString(imp->getAttribute(name));
+}
+
+void setElementStringAttr(const v8::AccessorInfo& info,
+                          const QualifiedName& name,
+                          v8::Local<v8::Value> value)
+{
+    Element* imp = v8DOMWrapperToNode<Element>(info);
+    AtomicString v = toAtomicWebCoreStringWithNullCheck(value);
+    imp->setAttribute(name, v);
+}
 
 } // namespace WebCore