Bug 40619
Summary: | HTML DOM entities are not encoded(escaped) as expected | ||
---|---|---|---|
Product: | WebKit | Reporter: | kokilakr <kokilakr> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 416.x | ||
Hardware: | All | ||
OS: | All |
kokilakr@gmail.com
Using javascript innerHTML or OuterHTML from DOM returns the decoded HTML entity.
Example <div id='id1'>sample © text</div> decodes the © and is returned.
Whereas few of the entities like & are properly encoded.
Expected result: The entities should not be decoded.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
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.