Fixed a failure seen in fast/dom/prototype-inheritance-2.html due to
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 23:20:34 +0000 (23:20 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 23:20:34 +0000 (23:20 +0000)
wrong global object use.

Reviewed by Sam Weinig.

Source/WebCore:

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
(WebCore::JSHTMLDocument::all):
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter): Use the right global object.

LayoutTests:

* fast/dom/prototype-inheritance-2-expected.txt: Expect success!

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84558 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/prototype-inheritance-2-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp

index 7efb9aa..4e8a6c2 100644 (file)
@@ -1,3 +1,12 @@
+2011-04-21  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fixed a failure seen in fast/dom/prototype-inheritance-2.html due to
+        wrong global object use.
+
+        * fast/dom/prototype-inheritance-2-expected.txt: Expect success!
+
 2011-04-21  Dirk Pranke  <dpranke@chromium.org>
 
         Unreviewed, expectations change - flaky tests.
index 26420eb..3eaebe5 100644 (file)
@@ -112,7 +112,7 @@ PASS HTMLButtonElementPrototype from inner.document.getElementsByTagName("canvas
 PASS HTMLCanvasElement from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas
 PASS HTMLCanvasElementConstructor from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas.constructor
 PASS HTMLCanvasElementPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas.__proto__
-FAIL HTMLCollection from inner.document.testForm
+PASS HTMLCollection from inner.document.testForm
 PASS HTMLDListElement from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas.nextElementSibling
 PASS HTMLDListElementConstructor from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas.nextElementSibling.constructor
 PASS HTMLDListElementPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").canvas.nextElementSibling.__proto__
index 5a994d9..22d89ef 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-21  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fixed a failure seen in fast/dom/prototype-inheritance-2.html due to
+        wrong global object use.
+
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        (WebCore::JSHTMLDocument::all):
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::nameGetter): Use the right global object.
+
 2011-04-21  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Geoffrey Garen.
index c33f859..fc815f2 100644 (file)
@@ -75,10 +75,10 @@ JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Iden
         if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
             return toJS(exec, frame);
 
-        return toJS(exec, node);
+        return toJS(exec, thisObj->globalObject(), node);
     } 
 
-    return toJS(exec, collection.get());
+    return toJS(exec, thisObj->globalObject(), collection.get());
 }
 
 // Custom attributes
@@ -90,7 +90,7 @@ JSValue JSHTMLDocument::all(ExecState* exec) const
     if (v)
         return v;
 
-    return toJS(exec, static_cast<HTMLDocument*>(impl())->all().get());
+    return toJS(exec, globalObject(), static_cast<HTMLDocument*>(impl())->all().get());
 }
 
 void JSHTMLDocument::setAll(ExecState* exec, JSValue value)
index 4dd0b81..757b502 100644 (file)
@@ -55,7 +55,7 @@ JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, const I
     if (namedItems.isEmpty())
         return jsUndefined();
     if (namedItems.size() == 1)
-        return toJS(exec, namedItems[0].get());
+        return toJS(exec, jsForm->globalObject(), namedItems[0].get());
 
     // FIXME: HTML5 specifies that this should be a RadioNodeList.
     return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());