Last Comment Bug 445166 - innerHTML setter in XHTML document rejects HTML entities such as  
: innerHTML setter in XHTML document rejects HTML entities such as  
Status: RESOLVED INVALID
: testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
: 444576 675061 (view as bug list)
Depends on:
Blocks: 325581
  Show dependency treegraph
 
Reported: 2008-07-14 09:51 PDT by Jesse Ruderman
Modified: 2011-07-29 03:41 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (458 bytes, application/xhtml+xml)
2008-07-14 09:51 PDT, Jesse Ruderman
no flags Details

Description Jesse Ruderman 2008-07-14 09:51:40 PDT
Created attachment 329474 [details]
testcase

(Re-reporting bug 444576, which got a little messy.)

The innerHTML in an XHTML document setter accepts "pure XML" entities such as & but rejects HTML-specific entities such as &nsbp;.  I think it should accept both.  (It would be even better if it went beyond that and took the DTD into consideration; see bug 325581 for an example with MathML entities.)

Quick survey of browser behaviors on Tiger:

* Firefox trunk: NS_ERROR_INVALID_POINTER

* Firefox 2: NS_ERROR_DOM_SYNTAX_ERR

* Safari: NO_MODIFICATION_ALLOWED_ERR (clearly a lie, since it allows &)

* Opera: Works.
Comment 1 Jesse Ruderman 2008-07-14 09:53:25 PDT
*** Bug 444576 has been marked as a duplicate of this bug. ***
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2008-07-14 11:00:51 PDT
What does HTML5 say here?
Comment 3 Anne (:annevk) 2008-07-14 11:16:20 PDT
That Firefox is correct. http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#innerhtml basically says to create a new XML parser. The only bits you feed to it are the element start tag including namespace prefixes and the default namespace in scope. No entity declarations and such.
Comment 4 j.j. 2011-07-29 03:41:49 PDT
*** Bug 675061 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.