This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 227 - Document.implementation misgenerated as Document.getImplementation()
Summary: Document.implementation misgenerated as Document.getImplementation()
Status: RESOLVED FIXED
Alias: None
Product: DOM TS
Classification: Unclassified
Component: ECMAScript Binding (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Curt Arnold
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-20 12:52 UTC by Curt Arnold
Modified: 2003-06-20 20:09 UTC (History)
0 users

See Also:


Attachments

Description Curt Arnold 2003-06-20 12:52:43 UTC
test-to-ecmascript misgenerates 

<implementation obj="doc" var="impl"/> 

as

impl = doc.getImplementation();

instead of 

impl = doc.implementation;
Comment 1 Philippe Le Hegaret 2003-06-20 14:18:36 UTC
Fixed.
Comment 2 Curt Arnold 2003-06-20 15:22:33 UTC
It is just a little more complicated than that.  There are two "forms" of the
implementation element, one to get an implementation from the framework and one
to access Document.implementation.  A couple of months ago, I implemented the
framework form for ECMAScript and botched the Document.implementation form. 

<implementation var="impl"/>

should generate

impl = getImplementation();

to get an implementation from the framework and 

<implementation var="impl" obj="doc"/>

should generate

impl = doc.implementation;

I'll fix this within the hour.
Comment 3 Curt Arnold 2003-06-20 15:25:47 UTC
Patch relative to revision 1.20.


Index: test-to-ecmascript.xsl
===================================================================
RCS file: /sources/public/2001/DOM-Test-Suite/transforms/test-to-ecmascript.xsl,v
retrieving revision 1.20
diff -u -r1.20 test-to-ecmascript.xsl
--- test-to-ecmascript.xsl	21 May 2003 05:00:33 -0000	1.20
+++ test-to-ecmascript.xsl	20 Jun 2003 19:23:53 -0000
@@ -377,12 +377,17 @@
 <xsl:template match="*[local-name()='implementation']" mode="body">
 	<xsl:value-of select="@var"/>
 	<xsl:text> = </xsl:text>
-	<xsl:if test="@obj">
-		<xsl:value-of select="@obj"/>
-		<xsl:text>.</xsl:text>
-	</xsl:if>
-	<xsl:text>getImplementation();
+	<xsl:choose>
+		<xsl:when test="@obj">
+			<xsl:value-of select="@obj"/>
+			<xsl:text>.implementation;
 </xsl:text>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:text>getImplementation();
+</xsl:text>
+		</xsl:otherwise>
+	</xsl:choose>
 </xsl:template>
 
 <xsl:template match="*[local-name()='createXPathEvaluator']" mode="body">