Bug 157052

Summary: innerHTML getter for <style> and <script> in XML document is inconsistent with the setter
Product: WebKit Reporter: Boris Zbarsky <bzbarsky>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, cdumez, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase none

Description Boris Zbarsky 2016-04-26 16:55:06 PDT
Created attachment 277423 [details]
Testcase

STEPS TO REPRODUCE: Load attached testcase from a .xhtml filename.

EXPECTED RESULTS: The two alerts should show the same text.

ACTUAL RESULTS: Two alerts showing different text.

ADDITIONAL INFORMATION: Looks like the innerHTML setter on script/style sets the textContent even in XML, but the getter serializes as XML and ends up escaping things.

See also https://github.com/w3c/DOM-Parsing/issues/6 and https://bugs.chromium.org/p/chromium/issues/detail?id=605973 for the Blink equivalent of this bug.
Comment 1 Ahmad Saleem 2022-08-11 14:09:42 PDT
*** Safari 15.6 on macOS 12.5 ***

&lt;foo&gt;&lt;/foo&gt;

&amp;lt;foo&amp;gt;&amp;lt;/foo&amp;gt;


*** Firefox Nightly 105 ***

<foo></foo>

<foo></foo>

*** Chrome Canary 106 ***

&lt;foo&gt;&lt;/foo&gt;

&amp;lt;foo&amp;gt;&amp;lt;/foo&amp;gt;

___________

As can be seen above this is still present and both dialogs are different. Chrome bug has been marked as "External Dependency" without any clarity but just wanted to share updated status. Thanks!
Comment 2 Radar WebKit Bug Importer 2022-08-11 14:11:21 PDT
<rdar://problem/98528339>