Title: [123880] trunk/Source/WebCore
Revision
123880
Author
[email protected]
Date
2012-07-27 10:17:00 -0700 (Fri, 27 Jul 2012)

Log Message

Microdata: Remove toJs() and toV8Object() custom methods from JSHTMLElementCustom.cpp and V8HTMLElementCustom.cpp respectively.
https://bugs.webkit.org/show_bug.cgi?id=92482

Patch by Arko Saha <[email protected]> on 2012-07-27
Reviewed by Kentaro Hara.

Removed custom methods toJS() and toV8Object(). We should use toJS() method defined in
JSMicroDataItemValueCustom.cpp and toV8() method defined in V8MicroDataItemValueCustom.cpp
in place of custom toJs() and toV8Object().

Existing tests :
        fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html
        fast/dom/MicroData/itemvalue-reflects-href-attr.html
        fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html
        fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html
        fast/dom/MicroData/itemvalue-reflects-the-src-attr.html
        fast/dom/MicroData/itemvalue-returns-element-itself.html
        fast/dom/MicroData/itemvalue-returns-null.html
        fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html
        fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html

* bindings/js/JSHTMLElementCustom.cpp:
(WebCore):
* bindings/v8/custom/V8HTMLElementCustom.cpp:
(WebCore):
(WebCore::V8HTMLElement::itemValueAccessorGetter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123879 => 123880)


--- trunk/Source/WebCore/ChangeLog	2012-07-27 17:14:41 UTC (rev 123879)
+++ trunk/Source/WebCore/ChangeLog	2012-07-27 17:17:00 UTC (rev 123880)
@@ -1,3 +1,31 @@
+2012-07-27  Arko Saha  <[email protected]>
+
+        Microdata: Remove toJs() and toV8Object() custom methods from JSHTMLElementCustom.cpp and V8HTMLElementCustom.cpp respectively.
+        https://bugs.webkit.org/show_bug.cgi?id=92482
+
+        Reviewed by Kentaro Hara.
+
+        Removed custom methods toJS() and toV8Object(). We should use toJS() method defined in
+        JSMicroDataItemValueCustom.cpp and toV8() method defined in V8MicroDataItemValueCustom.cpp
+        in place of custom toJs() and toV8Object().
+
+        Existing tests :
+                fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html
+                fast/dom/MicroData/itemvalue-reflects-href-attr.html
+                fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html
+                fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html
+                fast/dom/MicroData/itemvalue-reflects-the-src-attr.html
+                fast/dom/MicroData/itemvalue-returns-element-itself.html
+                fast/dom/MicroData/itemvalue-returns-null.html
+                fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html
+                fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html
+
+        * bindings/js/JSHTMLElementCustom.cpp:
+        (WebCore):
+        * bindings/v8/custom/V8HTMLElementCustom.cpp:
+        (WebCore):
+        (WebCore::V8HTMLElement::itemValueAccessorGetter):
+
 2012-07-27  Thiago Marcos P. Santos  <[email protected]>
 
         REGRESSION(r123856): Breaks the build when disabling inspector

Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (123879 => 123880)


--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp	2012-07-27 17:14:41 UTC (rev 123879)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp	2012-07-27 17:17:00 UTC (rev 123880)
@@ -30,24 +30,13 @@
 #include "HTMLFormElement.h"
 
 #if ENABLE(MICRODATA)
-#include "MicroDataItemValue.h"
+#include "JSMicroDataItemValue.h"
 #endif
 
 namespace WebCore {
 
 using namespace JSC;
 
-#if ENABLE(MICRODATA)
-static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, MicroDataItemValue* itemValue)
-{
-    if (!itemValue)
-        return jsNull();
-    if (itemValue->isNode())
-        return toJS(exec, globalObject, itemValue->getNode());
-    return jsString(exec, itemValue->getString());
-}
-#endif
-
 ScopeChainNode* JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChainNode* scope) const
 {
     HTMLElement* element = impl();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp (123879 => 123880)


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp	2012-07-27 17:14:41 UTC (rev 123879)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp	2012-07-27 17:17:00 UTC (rev 123880)
@@ -34,8 +34,8 @@
 #include "V8HTMLElementWrapperFactory.h"
 
 #if ENABLE(MICRODATA)
-#include "MicroDataItemValue.h"
 #include "V8Binding.h"
+#include "V8MicroDataItemValue.h"
 #endif
 
 namespace WebCore {
@@ -48,21 +48,10 @@
 }
 
 #if ENABLE(MICRODATA)
-static v8::Handle<v8::Value> toV8Object(MicroDataItemValue* itemValue, v8::Isolate* isolate)
-{
-    if (!itemValue)
-        return v8::Null(isolate);
-
-    if (itemValue->isNode())
-        return toV8(itemValue->getNode(), isolate);
-
-    return v8String(itemValue->getString(), isolate);
-}
-
 v8::Handle<v8::Value> V8HTMLElement::itemValueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     HTMLElement* impl = V8HTMLElement::toNative(info.Holder());
-    return toV8Object(impl->itemValue().get(), info.GetIsolate());
+    return toV8(impl->itemValue().get(), info.GetIsolate());
 }
 
 void V8HTMLElement::itemValueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to