[HtmlUnit] HTMLTagBalancer

View: New views
3 Messages — Rating Filter:   Alert me  

[HtmlUnit] HTMLTagBalancer

by Ahmed Ashour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi all,
 
For bug #2884462 [1], on initial investigations for the browsers behavior, a test case was created (far below):
 
You will notice <tr> is automatically inserted in <table><thead><tr><td>
 
Now, this behavior seems to come from Neko TagBalancer, and this should be browser specific.
 
Is it time for NekoHtml to know about which browser to support, or we should handle it from HtmlUnit (doing some of things that TagBalancer should do) ? What about allowing TagBalancer to be 'subclassed'?
 
 
 
 
<html>
<head>
  <script>
    function test() {
      alert(debug(myTable1.firstChild));
      alert(debug(myTable1.firstChild.nextSibling));
      alert(debug(myTable1.lastChild));
      alert(debug(myTable2.firstChild));
      alert(debug(myTable2.firstChild.nextSibling));
      alert(debug(myTable2.lastChild));
 }
 function debug(node) {
   return node.nodeValue != null ? node.nodeValue : (node.nodeName + '->' + debug(node.firstChild));
 }
  </script>
</head>
<body onload='test()'>
<table id='myTable1'><thead><td>One</td></thead></table><tr><td>Two</td></tr><thead><td>Three</td></thead></table>
<table id='myTable2'><tr><td>Two</td></tr><thead><td>One</td></thead><thead><td>Three</td></thead></table>
</body>
</html>
 
Ahmed
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop

Re: [HtmlUnit] HTMLTagBalancer

by Marc Guillemot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

what do the different browsers do here?

Cheers,
Marc.

Ahmed Ashour a écrit :

> Hi all,
>  
> For bug #2884462 [1], on initial investigations for the browsers
> behavior, a test case was created (far below):
>  
> You will notice <tr> is automatically inserted in <table><thead>*<tr>*<td>
>  
> Now, this behavior seems to come from Neko TagBalancer, and this should
> be browser specific.
>  
> Is it time for NekoHtml to know about which browser to support, or we
> should handle it from HtmlUnit (doing some of things that TagBalancer
> should do) ? What about allowing TagBalancer to be 'subclassed'?
>  
>  
>  
> [1]
> http://sourceforge.net/tracker/?func=detail&aid=2884462&group_id=47038&atid=448266 
> <http://sourceforge.net/tracker/?func=detail&aid=2884462&group_id=47038&atid=448266>
>  
> <html>
> <head>
>   <script>
>     function test() {
>       alert(debug(myTable1.firstChild));
>       alert(debug(myTable1.firstChild.nextSibling));
>       alert(debug(myTable1.lastChild));
>       alert(debug(myTable2.firstChild));
>       alert(debug(myTable2.firstChild.nextSibling));
>       alert(debug(myTable2.lastChild));
>  }
>  function debug(node) {
>    return node.nodeValue != null ? node.nodeValue : (node.nodeName +
> '->' + debug(node.firstChild));
>  }
>   </script>
> </head>
> <body onload='test()'>
> <table
> id='myTable1'><thead><td>One</td></thead></table><tr><td>Two</td></tr><thead><td>Three</td></thead></table>
> <table
> id='myTable2'><tr><td>Two</td></tr><thead><td>One</td></thead><thead><td>Three</td></thead></table>
> </body>
> </html>
>  
> Ahmed


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop

Re: [HtmlUnit] HTMLTagBalancer

by gredler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interestingly, browser-specific malformed HTML parsing came up at Google last week... no specific requirement or use case, but this was one area I was asked about.



On Wed, Nov 4, 2009 at 10:26 AM, Ahmed Ashour <asashour@...> wrote:
Hi all,
 
For bug #2884462 [1], on initial investigations for the browsers behavior, a test case was created (far below):
 
You will notice <tr> is automatically inserted in <table><thead><tr><td>
 
Now, this behavior seems to come from Neko TagBalancer, and this should be browser specific.
 
Is it time for NekoHtml to know about which browser to support, or we should handle it from HtmlUnit (doing some of things that TagBalancer should do) ? What about allowing TagBalancer to be 'subclassed'?
 
 
 
 
<html>
<head>
  <script>
    function test() {
      alert(debug(myTable1.firstChild));
      alert(debug(myTable1.firstChild.nextSibling));
      alert(debug(myTable1.lastChild));
      alert(debug(myTable2.firstChild));
      alert(debug(myTable2.firstChild.nextSibling));
      alert(debug(myTable2.lastChild));
 }
 function debug(node) {
   return node.nodeValue != null ? node.nodeValue : (node.nodeName + '->' + debug(node.firstChild));
 }
  </script>
</head>
<body onload='test()'>
<table id='myTable1'><thead><td>One</td></thead></table><tr><td>Two</td></tr><thead><td>Three</td></thead></table>
<table id='myTable2'><tr><td>Two</td></tr><thead><td>One</td></thead><thead><td>Three</td></thead></table>
</body>
</html>
 
Ahmed
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop




--
Daniel Gredler
http://daniel.gredler.net/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop