Closed Bug 545402 Opened 10 years ago Closed 10 years ago

[HTML5][Patch] dom/tests/mochitest/bugs/test_bug42976.html fails due to null documentElement

Categories

(Core :: DOM: HTML Parser, defect, P1)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: hsivonen, Assigned: hsivonen)

Details

Attachments

(1 file, 1 obsolete file)

dom/tests/mochitest/bugs/test_bug42976.html fails. The test code seems to run before the iframe contents have been parsed.
Priority: -- → P1
The test case expected data: URLs to be parsed immediately. Changed the test to run from onload instead.

The HTML5 parser assumed that the owner document of a fragment context always has a docshell. That's not true for synthetic documents. Removed the null check, because the context gets passed to nsContentSink which does its own null check and deals.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Attachment #426671 - Flags: review?(Olli.Pettay)
Summary: [HTML5] dom/tests/mochitest/bugs/test_bug42976.html fails due to null documentElement → [HTML5][Patch] dom/tests/mochitest/bugs/test_bug42976.html fails due to null documentElement
(In reply to comment #1)
> The test case expected data: URLs to be parsed immediately. Changed the test to
> run from onload instead.
I assume HTML5 defines currently the behavior you want to have here?
Comment on attachment 426671 [details] [diff] [review]
Make the test run from onload; make the HTML5 parser accept fragment parsing without docshell

Sorry for the delay.

Please use -U 8 -p when creating patches.
(In reply to comment #2)
> (In reply to comment #1)
> > The test case expected data: URLs to be parsed immediately. Changed the test to
> > run from onload instead.
> I assume HTML5 defines currently the behavior you want to have here?

HTML5 allows the parser to spin the event loop between any two input characters, so test cases shouldn't expect inputs to parse as one event queue task.

(In reply to comment #3)
> (From update of attachment 426671 [details] [diff] [review])
> Sorry for the delay.
> 
> Please use -U 8 -p when creating patches.

Attaching a diff with those switches. They don't seem to have a useful effect, though.

The test case change is suppose to be simply wrapping the test body in a function that runs from onload and making the test harness wait for explicit finish. There should be no other change to the test except reindenting the test body accordingly.
Attachment #426671 - Flags: review?(Olli.Pettay)
Attachment #428182 - Flags: review?(Olli.Pettay)
Attachment #426671 - Attachment is obsolete: true
Comment on attachment 428182 [details] [diff] [review]
Patch with different flags

Much nicer to read with -U 8 and it is useful too in this case. I can see the iframe elements in the testcase.
Attachment #428182 - Flags: review?(Olli.Pettay) → review+
Thanks. Pushed:
http://hg.mozilla.org/mozilla-central/rev/ec03b787ac5b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.