Share

HtmlUnit

Tracker: Bugs

5 Parsing <body> through innerHTML causes a cycle in a tree - ID: 2473342
Last Update: Comment added ( sf-robot )

If you run something like x.innerHTML =
"<html><body><h2>test</h2></body></html>" in JavaScript, the resulting DOM
tree will contain a cycle. This is because HTMLParser has a special
handling for <body>, which is incorrect in this case.

Patch attached.


Kohsuke Kawaguchi ( kkawa ) - 2008-12-28 19:03

5

Closed

None

Daniel Gredler

None

None

Public


Comments ( 4 )

Date: 2009-03-18 18:47
Sender: sf-robotSourceForge.net Site Admin

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).


Date: 2008-12-30 22:55
Sender: sdanigProject Admin

A (very) slightly modified version of your test case works for me with the
code in trunk. What version of the codebase are you running against? We
just released 2.4, which has some new dependencies like NekoHtml 1.9.11
(not sure if it matters).


Date: 2008-12-30 21:43
Sender: kkawa

Test case attached. This causes StackOverflowError without my patch.
File Added: DIFF-testcase


Date: 2008-12-30 20:06
Sender: sdanigProject Admin

Can you attach a unit test which fails with the current codebase? I'm
having trouble seeing where our current handling falls short.


Attached Files ( 2 )

Filename Description Download
DIFF Download
DIFF-testcase Download

Changes ( 8 )

Field Old Value Date By
close_date 2009-01-02 17:54 2009-03-18 18:47 sf-robot
allow_comments 1 2009-03-18 18:47 sf-robot
status_id Pending 2009-03-18 18:47 sf-robot
close_date - 2009-01-02 17:54 sdanig
status_id Open 2009-01-02 17:54 sdanig
assigned_to nobody 2009-01-02 17:54 sdanig
File Added 307227: DIFF-testcase 2008-12-30 21:43 kkawa
File Added 306926: DIFF 2008-12-28 19:03 kkawa