You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Paul Field (JIRA)" <ji...@apache.org> on 2009/08/05 14:56:14 UTC

[jira] Created: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Element#addClassName can create an additional new 'class' attribute
-------------------------------------------------------------------

                 Key: TAP5-804
                 URL: https://issues.apache.org/jira/browse/TAP5-804
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.18
            Reporter: Paul Field


When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.

I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:

<e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>


--------------------------------------

package test.com.db.fusion.iface.web.tapestry5.mixins;

import junit.framework.TestCase;

import org.apache.tapestry5.dom.DefaultMarkupModel;
import org.apache.tapestry5.dom.Document;
import org.apache.tapestry5.dom.Element;

public class AddClassNameTest extends TestCase {

    public void test() {
        Document document = new Document(new DefaultMarkupModel());
        Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
        element.attribute("class", "a");
        element.addClassName("b");
        assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Canfield reassigned TAP5-804:
----------------------------------

    Assignee: Josh Canfield

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922689#action_12922689 ] 

Hudson commented on TAP5-804:
-----------------------------

Integrated in tapestry-5.2-freestyle #212 (See [https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/212/])
    

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>             Fix For: 5.2.2
>
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Canfield resolved TAP5-804.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 5.2.2

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>             Fix For: 5.2.2
>
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773661#action_12773661 ] 

Josh Canfield commented on TAP5-804:
------------------------------------

This is related to TAP5-708

Element.addClassName uses Element.forceAttributes which uses the elements namespace to search for the attributes, which have a null namespace.

I'm submitting a patch for TAP5-708 which resolves this.



> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922689#action_12922689 ] 

Hudson commented on TAP5-804:
-----------------------------

Integrated in tapestry-5.2-freestyle #212 (See [https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/212/])
    

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>             Fix For: 5.2.2
>
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773661#action_12773661 ] 

Josh Canfield commented on TAP5-804:
------------------------------------

This is related to TAP5-708

Element.addClassName uses Element.forceAttributes which uses the elements namespace to search for the attributes, which have a null namespace.

I'm submitting a patch for TAP5-708 which resolves this.



> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Canfield resolved TAP5-804.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 5.2.2

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>             Fix For: 5.2.2
>
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TAP5-804) Element#addClassName can create an additional new 'class' attribute

Posted by "Josh Canfield (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Canfield reassigned TAP5-804:
----------------------------------

    Assignee: Josh Canfield

> Element#addClassName can create an additional new 'class' attribute
> -------------------------------------------------------------------
>
>                 Key: TAP5-804
>                 URL: https://issues.apache.org/jira/browse/TAP5-804
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: Paul Field
>            Assignee: Josh Canfield
>
> When writing a mixin that uses Element#addClassName, I noticed that I was getting two 'class' attributes in my element - rather than the one I was expecting.
> I've narrowed the problem down to a problem with how namespaces are used in Element and the following test case shows the problem. The "actual" output is:
> <e class="a b" class="a" xmlns="http://www.w3.org/1999/xhtml"></e>
> --------------------------------------
> package test.com.db.fusion.iface.web.tapestry5.mixins;
> import junit.framework.TestCase;
> import org.apache.tapestry5.dom.DefaultMarkupModel;
> import org.apache.tapestry5.dom.Document;
> import org.apache.tapestry5.dom.Element;
> public class AddClassNameTest extends TestCase {
>     public void test() {
>         Document document = new Document(new DefaultMarkupModel());
>         Element element = document.newRootElement("http://www.w3.org/1999/xhtml", "e");
>         element.attribute("class", "a");
>         element.addClassName("b");
>         assertEquals("<e class=\"a b\" xmlns=\"http://www.w3.org/1999/xhtml\"></e>", element.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.