Menu

#154 Add getAttributeNS and setAttributeNS to Element class

closed
RBRi
None
5
2012-10-21
2009-09-11
lexicore
No

Currently the Element class does not implement getAttributeNS and setAttributeNS for any of the browsers.
However at least FF3 does support these methods.
Currently we have to patch HtmlUnit to make our test work, it would be nice if these methods would be added to the Element class.

I'mm attaching a patch. The patch adds required methods to the com.gargoylesoftware.htmlunit.javascript.host.Element class and modifies the JavaScriptConfiguration.xml file accordingly.

Discussion

  • Marc Guillemot

    Marc Guillemot - 2009-09-11

    Unit test?

     
  • lexicore

    lexicore - 2009-09-11

    Gladly, but I need some guidelines concerning what should the unit test cover. Usage of these two methods in a script? Something similar to
    com.gargoylesoftware.htmlunit.javascript.host.ElementTest?

     
  • Marc Guillemot

    Marc Guillemot - 2009-09-11

    Doc for patches: http://htmlunit.sourceforge.net/submittingPatches.html

    ElementTest is a good example to follow. Usage in a script is the best way as it is easy to check in real browser if expectations are correct or not.

     
  • lexicore

    lexicore - 2009-09-11

    Ok, I think I'll just extend the ElementTest, seems to be a right place.

     
  • lexicore

    lexicore - 2009-09-21

    Patch - including a test case.

     
  • lexicore

    lexicore - 2009-09-21

    I've just uploaded a new patch which includes a unit test as well.
    I've made sure that all the tests go green.
    BTW I've also added removeAttributeNS and hasAttributeNS methods.

     
  • RBRi

    RBRi - 2012-09-23

    Now fixed in SVN. Thanks for the patch.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.