[pypy-svn] r34468 - pypy/dist/pypy/translator/js/modules

fijal at codespeak.net fijal at codespeak.net
Fri Nov 10 16:23:32 CET 2006


Author: fijal
Date: Fri Nov 10 16:23:30 2006
New Revision: 34468

Modified:
   pypy/dist/pypy/translator/js/modules/dom.py
Log:
Reverted some changes. We cannot rely on those methods in that way. We need to provide interface ALL THE TIME, because we need to know what we return.


Modified: pypy/dist/pypy/translator/js/modules/dom.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/dom.py	(original)
+++ pypy/dist/pypy/translator/js/modules/dom.py	Fri Nov 10 16:23:30 2006
@@ -262,8 +262,7 @@
 
 Element._fields = Node._fields.copy()
 
-HTMLElement._fields = Element._fields.copy()
-HTMLElement._fields.update({
+Element._fields.update({
     'className' : "aa",
     'clientHeight' : 12,
     'clientWidth' : 12,
@@ -282,7 +281,7 @@
     'scrollLeft' : 12,
     'scrollTop' : 12,
     'scrollWidth' : 12,
-    'style' : NonConstant(Style()),
+    'style' : Style(),
     'tabIndex' : 12,
     'onblur' : MethodDesc([Event()]),
     'onclick' : MethodDesc([MouseEvent()]),
@@ -299,13 +298,14 @@
     'onresize' : MethodDesc([Event()]),
 })
 
+HTMLElement._fields = Element._fields.copy()
 Node._methods = {
-    'appendChild' : MethodDesc([Element()]),
-    'cloneNode' : MethodDesc([12], Element()),
+    'appendChild' : MethodDesc([HTMLElement()]),
+    'cloneNode' : MethodDesc([12], HTMLElement()),
     'hasChildNodes' : MethodDesc([], True),
-    'insertBefore' : MethodDesc([Element(), Element()], Element()),
-    'removeChild' : MethodDesc([Element()], Element()),
-    'replaceChild' : MethodDesc([Element(), Element()], Element()),
+    'insertBefore' : MethodDesc([HTMLElement(), HTMLElement()], HTMLElement()),
+    'removeChild' : MethodDesc([HTMLElement()], HTMLElement()),
+    'replaceChild' : MethodDesc([HTMLElement(), HTMLElement()], HTMLElement()),
 }
 
 Element._methods = Node._methods.copy()
@@ -327,10 +327,6 @@
     'setAttributeNS' : MethodDesc(["aa", "aa", "aa"]),
     'setAttributeNode' : MethodDesc([Element()], Element()),
     'setAttributeNodeNS' : MethodDesc(["ns", Element()], Element()),
-})
-
-HTMLElement._methods = Element._methods.copy()
-HTMLElement._methods.update({
     'blur' : MethodDesc([]),
     'click' : MethodDesc([]),
     'dispatchEvent' : MethodDesc(["aa"], True),
@@ -340,6 +336,8 @@
     'supports' : MethodDesc(["aa", 1.0]),
 })
 
+HTMLElement._methods = Element._methods.copy()
+
 Document._methods = Element._methods.copy()
 Document._methods.update({
     'clear' : MethodDesc([]),



More information about the Pypy-commit mailing list