« Return to Thread: [HtmlUnit] [ htmlunit-Bugs-2968697 ] Tag balancing differences in HtmlUnit and real browsers

[HtmlUnit] [ htmlunit-Bugs-2968697 ] Tag balancing differences in HtmlUnit and real browsers

by SourceForge.net :: Rate this Message:

| View in Thread

Bugs item #2968697, was opened at 2010-03-11 06:39
Message generated for change (Settings changed) made by rbri
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2968697&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: NekoHTML
Group: Latest code in SVN
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Joerg Werner (bug55cv)
>Assigned to: RBRi (rbri)
Summary: Tag balancing differences in HtmlUnit and real browsers

Initial Comment:
In case of incomplete/unbalanced HTML source code, browsers like Firefox and Chrome might create different DOM trees depending on the document type. For example, "<p><table></table>" is balanced to "<p><table></table></p>" in Quirks mode and to "<p></p><table></table>" in Standard mode. HtmlUnit seems to apply the Quirks balancing strategy in Standard mode as well. This is not a big deal except that XPaths copied from one of these browsers might or might not work in HtmlUnit without modification.

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

Comment By: Joerg Werner (bug55cv)
Date: 2011-10-20 01:57

Message:
There are more examples, especially if the HTML code is not valid (with
respect to the specs). For example, the following snippet (btw. generated
by a GUI framework):

<a><table>...</table></a>

was rebalanced to:

<a></a><table>...</table>

FF leaves this as is. So when clicking somewhere inside the table:

* the XPath needed is different across browsers (causes problems when
Selenium is used with different drivers) and
* the anchor will not be triggered when using HtmlUnit.

I extended the test case to cover this issue as well.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2968697&group_id=47038

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop

 « Return to Thread: [HtmlUnit] [ htmlunit-Bugs-2968697 ] Tag balancing differences in HtmlUnit and real browsers