This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12434 - Spec doesn't match IE when calling insertAdjacentHTML with position afterend or beforebegin on head or body
Summary: Spec doesn't match IE when calling insertAdjacentHTML with position afterend ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM Parsing and Serialization (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ms2ger
QA Contact: public-webapps-bugzilla
URL:
Whiteboard: needs testcase
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 08:52 UTC by Henri Sivonen
Modified: 2011-09-05 10:42 UTC (History)
7 users (show)

See Also:


Attachments

Description Henri Sivonen 2011-04-06 08:52:15 UTC
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/918

IE9, IE8 and IE6 (IE7 not tested) behaves as if the context node for fragment parsing in the insertAdjacentHTML case was "body" when it logically should be "html".

Since it's their API originally, I think it would be prudent to codify this quirk in the spec.

Note that there is precedent: The same quirk exists in Range::createContextualFragment.
Comment 1 Henri Sivonen 2011-04-06 08:54:33 UTC
This should only apply to the HTML case, not the XML case.
Comment 2 Jonas Sicking (Not reading bugmail) 2011-04-06 13:58:32 UTC
Are there pages that depend on this?
Comment 3 Jonas Sicking (Not reading bugmail) 2011-04-06 13:59:12 UTC
Also, does this affect both how content gets parsed and where it gets inserted? Or just how content gets parsed.
Comment 4 Henri Sivonen 2011-04-06 14:19:05 UTC
(In reply to comment #2)
> Are there pages that depend on this?

I don't know.

(In reply to comment #3)
> Also, does this affect both how content gets parsed and where it gets inserted?
> Or just how content gets parsed.

This affects parsing only. Specifically, it affects the creation of implicit head and body nodes.
Comment 5 Ian 'Hixie' Hickson 2011-07-01 22:21:32 UTC
What do other browsers do today?
Comment 6 Ian 'Hixie' Hickson 2011-07-14 22:23:26 UTC
Is there a test case showing the difference? I'd like to study this in other UAs before making a decision on this.
Comment 7 Michael[tm] Smith 2011-08-04 05:33:45 UTC
mass-move component to LC1
Comment 8 Ms2ger 2011-09-05 10:42:35 UTC
https://bitbucket.org/ms2ger/dom-parsing-and-serialization/changeset/a5d7da5a4f86

Henri, could you confirm this is the correct fix?