Closed Bug 946585 Opened 6 years ago Closed 6 years ago

Change how the form element pointer affects parsing template elements, to reduce weirdness in templates

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: rniwa, Assigned: wchen)

Details

Attachments

(1 file)

Make HTML5 parser changes to match the HTML5 specification change: http://html5.org/tools/web-apps-tracker?from=8330&to=8331

Change how the form element pointer affects parsing <template> elements, to reduce weirdness in templates (e.g. before you couldn't have a template that contained a form if it was itself inside a form).

Also see https://bugs.webkit.org/show_bug.cgi?id=125279
Assignee: nobody → wchen
WebKit merged this change in http://trac.webkit.org/changeset/160182.
I'll attach my tests when I feel I have sufficient coverage for the changes.
Comment on attachment 8343554 [details] [diff] [review]
update implementation to match latest spec changes

>+nsIContent**
>+nsHtml5TreeBuilder::getFormPointerForContext(nsIContent** aContext)
>+{

r+ provided that you add an assertion here to check that we are on the main thread when getFormPointerForContext runs.
Attachment #8343554 - Flags: review?(hsivonen) → review+
Do you know if there's a test in web-platform-tests? If not, can you please write one?
Flags: needinfo?(wchen)
Spec was updated to remove special casing of template elements when trying to find the form pointer for a context element. (https://www.w3.org/Bugs/Public/show_bug.cgi?id=24017#c4).

(In reply to :Ms2ger from comment #5)
> Do you know if there's a test in web-platform-tests? If not, can you please
> write one?

I don't see any. Almost all of the changes here are better covered with parser tests, but I'll add a test to web-platform-tests for making sure that we have the correct form pointer when parsing fragments.
Flags: needinfo?(wchen)
https://hg.mozilla.org/mozilla-central/rev/d7b0c3b046b2
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.