Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion 2 new revisions pushed by ja...@hoppipolla.co.uk on 2009-12-24 12:43 GMT

X-BeenThere: html5lib-commits@googlegroups.com
Received: by 10.90.21.34 with SMTP id 34ls359630agu.2.p; Thu, 24 Dec 2009 
	04:44:12 -0800 (PST)
Received: by 10.91.50.27 with SMTP id c27mr9955554agk.2.1261658652500;
        Thu, 24 Dec 2009 04:44:12 -0800 (PST)
Received: by 10.91.50.27 with SMTP id c27mr9955552agk.2.1261658652469;
        Thu, 24 Dec 2009 04:44:12 -0800 (PST)
Return-Path: <3G2IzSxAKAPsfrghvlwh-qruhso1jrrjoh....@codesite.bounces.google.com>
Received: from mail-gx0-f239.google.com (mail-gx0-f239.google.com [209.85.217.239])
        by gmr-mx.google.com with ESMTP id 25si1080895yxe.5.2009.12.24.04.44.11;
        Thu, 24 Dec 2009 04:44:11 -0800 (PST)
Received-SPF: pass (google.com: domain of 3G2IzSxAKAPsfrghvlwh-qruhso1jrrjoh....@codesite.bounces.google.com designates 209.85.217.239 as permitted sender) client-ip=209.85.217.239;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of 3G2IzSxAKAPsfrghvlwh-qruhso1jrrjoh....@codesite.bounces.google.com designates 209.85.217.239 as permitted sender) smtp.mail=3G2IzSxAKAPsfrghvlwh-qruhso1jrrjoh....@codesite.bounces.google.com; dkim=pass (test mode) header...@google.com
Received: by gxk17 with SMTP id 17so84540gxk.0
        for <html5lib-commits@googlegroups.com>; Thu, 24 Dec 2009 04:44:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=beta;
        h=domainkey-signature:mime-version:x-generated-by:received:message-id
         :date:subject:from:to:content-type;
        bh=Fez+7ZgAQXInc3pIwoayYw9e+/OQkLVkEIkQmy9wAt4=;
        b=yWicdblxO0V3EtNUYqfftuPLzWol5bVO1Jo/f/t2XWOtS9C5AYy8hg3FGfye/PIwig
         tflsvnSKM6uvK2lQqk7w==
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=google.com; s=beta;
        h=mime-version:x-generated-by:message-id:date:subject:from:to
         :content-type;
        b=I9xpsSK+8UadsnNxauy3DJH5hOl+5fGAMtiWXvLRKcbU2ctNbvncUmW6/PVn4jfCwv
         C7O6PWHJH+T7/m9v49oA==
MIME-Version: 1.0
X-Generated-By: Google Code
Received: by 10.101.125.18 with SMTP id c18mr7002936ann.17.1261658651399; Thu, 
	24 Dec 2009 04:44:11 -0800 (PST)
Message-ID: <001636ed6b5ebe9c9f047b78c...@google.com>
Date: Thu, 24 Dec 2009 12:44:11 +0000
Subject: [html5lib] 2 new revisions pushed by ja...@hoppipolla.co.uk on 
	2009-12-24 12:43 GMT
From: codesite-nore...@google.com
To: html5lib-commits@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes

2 new revisions:

Revision: 3cb26bf923
Author: jgraham <ja...@hoppipolla.co.uk>
Date: Thu Dec 24 04:33:41 2009
Log: Update form-in-table handling
http://code.google.com/p/html5lib/source/detail?r=3cb26bf923

Revision: 9314e70287
Author: jgraham <ja...@hoppipolla.co.uk>
Date: Thu Dec 24 04:42:37 2009
Log: Move cloneNode into individual node classes
http://code.google.com/p/html5lib/source/detail?r=9314e70287

==============================================================================
Revision: 3cb26bf923
Author: jgraham <ja...@hoppipolla.co.uk>
Date: Thu Dec 24 04:33:41 2009
Log: Update form-in-table handling
http://code.google.com/p/html5lib/source/detail?r=3cb26bf923

Modified:
  /python/src/html5lib/constants.py
  /python/src/html5lib/html5parser.py
  /python/tests/test_parser.py

=======================================
--- /python/src/html5lib/constants.py	Tue Nov 10 11:43:24 2009
+++ /python/src/html5lib/constants.py	Thu Dec 24 04:33:41 2009
@@ -180,6 +180,8 @@
           u"table context caused voodoo mode."),
      "unexpected-hidden-input-in-table":
         _(u"Unexpected input with type hidden in table context."),
+    "unexpected-form-in-table":
+       _(u"Unexpected form in table context."),
      "unexpected-start-tag-implies-table-voodoo":
         _(u"Unexpected start tag (%(name)s) in "
           u"table context caused voodoo mode."),
=======================================
--- /python/src/html5lib/html5parser.py	Wed Nov 25 15:01:55 2009
+++ /python/src/html5lib/html5parser.py	Thu Dec 24 04:33:41 2009
@@ -1535,7 +1535,8 @@
              (("td", "th", "tr"), self.startTagImplyTbody),
              ("table", self.startTagTable),
              (("style", "script"), self.startTagStyleScript),
-            ("input", self.startTagInput)
+            ("input", self.startTagInput),
+            ("form", self.startTagForm)
          ])
          self.startTagHandler.default = self.startTagOther

@@ -1629,6 +1630,11 @@
          else:
              self.startTagOther(token)

+    def startTagForm(self, token):
+        self.parser.parseError("unexpected-form-in-table")
+        self.tree.insertElement(token)
+        self.tree.openElements.pop()
+
      def startTagOther(self, token):
           
self.parser.parseError("unexpected-start-tag-implies-table-voodoo",  
{"name": token["name"]})
          if "tainted" not in self.getCurrentTable()._flags:
=======================================
--- /python/tests/test_parser.py	Sun Nov 29 04:08:22 2009
+++ /python/tests/test_parser.py	Thu Dec 24 04:33:41 2009
@@ -60,7 +60,7 @@
      pass

  #Run the parse error checks
-checkParseErrors = True
+checkParseErrors = False

  #XXX - There should just be one function here but for some reason the  
testcase
  #format differs from the treedump format by a single space character

==============================================================================
Revision: 9314e70287
Author: jgraham <ja...@hoppipolla.co.uk>
Date: Thu Dec 24 04:42:37 2009
Log: Move cloneNode into individual node classes
http://code.google.com/p/html5lib/source/detail?r=9314e70287

Modified:
  /python/src/html5lib/treebuilders/simpletree.py

=======================================
--- /python/src/html5lib/treebuilders/simpletree.py	Wed Oct 21 07:32:27 2009
+++ /python/src/html5lib/treebuilders/simpletree.py	Thu Dec 24 04:42:37 2009
@@ -62,14 +62,7 @@
          node.parent = None

      def cloneNode(self):
-        newNode = type(self)(self.name)
-        if hasattr(self, 'namespace'):
-            newNode.namespace = self.namespace
-        if hasattr(self, 'attributes'):
-            for attr, value in self.attributes.iteritems():
-                newNode.attributes[attr] = value
-        newNode.value = self.value
-        return newNode
+        raise NotImplementedError

      def hasContent(self):
          """Return true if the node has children or text"""
@@ -112,11 +105,17 @@
              tree += child.printTree(2)
          return tree

+    def cloneNode(self):
+        return Document()
+
  class DocumentFragment(Document):
      type = 2
      def __unicode__(self):
          return "#document-fragment"

+    def cloneNode(self):
+        return DocumentFragment()
+
  class DocumentType(Node):
      type = 3
      def __init__(self, name, publicId, systemId):
@@ -140,6 +139,9 @@
      def hilite(self):
          return '<code class="markup doctype">&lt;!DOCTYPE %s></code>' %  
self.name

+    def cloneNode(self):
+        return DocumentType(self.name, self.publicId, self.systemId)
+
  class TextNode(Node):
      type = 4
      def __init__(self, value):
@@ -154,6 +156,9 @@

      hilite = toxml

+    def cloneNode(self):
+        return TextNode(self.value)
+
  class Element(Node):
      type = 5
      def __init__(self, name, namespace=None):
@@ -206,6 +211,12 @@
              tree += child.printTree(indent)
          return tree

+    def cloneNode(self):
+        newNode = Element(self.name)
+        for attr, value in self.attributes.iteritems():
+            newNode.attributes[attr] = value
+        return newNode
+
  class CommentNode(Node):
      type = 6
      def __init__(self, data):
@@ -221,6 +232,9 @@
      def hilite(self):
          return '<code class="markup comment">&lt;!--%s--></code>' %  
escape(self.data)

+    def cloneNode(self):
+        return CommentNode(self.data)
+
  class TreeBuilder(_base.TreeBuilder):
      documentClass = Document
      doctypeClass = DocumentType