Bug 40619 - HTML DOM entities are not encoded(escaped) as expected
Summary: HTML DOM entities are not encoded(escaped) as expected
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 416.x
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 04:49 PDT by kokilakr@gmail.com
Modified: 2010-06-15 10:40 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kokilakr@gmail.com 2010-06-15 04:49:36 PDT
Using javascript innerHTML or OuterHTML from DOM returns the decoded HTML entity.
Example <div id='id1'>sample &copy; text</div> decodes the &copy; and is returned.

Whereas few of the entities like &amp; are properly encoded.

Expected result: The entities should not be decoded.
Comment 1 Alexey Proskuryakov 2010-06-15 10:40:42 PDT
Why do you expect this? It's not how any browser works to the best of my knowledge.

More specifically, implementing that would involve preserving entity nodes in DOM, which would be incompatible with other browsers and slow.

If you have a test case that works in other browser engines, but not in WebKit, please attach it.