[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 187423] New: insertAdjacentHTML raises RangeException (possibly
From:       Richard Smith <kde () metafoo ! co ! uk>
Date:       2009-03-17 16:38:42
Message-ID: bug-187423-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=187423

           Summary: insertAdjacentHTML raises RangeException (possibly
                    caused by node with no parent)
           Product: konqueror
           Version: 4.2.1
          Platform: Ubuntu Packages
        OS/Version: unspecified
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: khtml
        AssignedTo: konq-bugs@kde.org
        ReportedBy: kde@metafoo.co.uk


Version:            (using KDE 4.2.1)
Installed from:    Ubuntu Packages

The following javascript causes Konqueror to hit a RangeException, but it works
in IE:

  document.createElement("div").insertAdjacentHTML("beforeEnd",
"<span>foo</span>")

The problem appears to be caused by the usage of range.setStartBefore(node) in
the implementation of insertAdjacentHTML -- this fails with RangeException if
the node has no parent. The draft HTML5 spec requires insertAdjacentHTML to be
a (non-throwing) no-op for a parentless node if in "beforeBegin" or "afterEnd"
mode, and to operate normally in the other two modes for a parentless node:

http://www.whatwg.org/specs/web-apps/current-work/#insertadjacenthtml()

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic