Bug 205635 - XMLSerializer doesn't correctly encode entities in <style> element
Summary: XMLSerializer doesn't correctly encode entities in <style> element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-29 20:52 PST by Xidorn Quan
Modified: 2020-01-02 18:54 PST (History)
10 users (show)

See Also:


Attachments
testcase (228 bytes, text/html)
2019-12-29 20:52 PST, Xidorn Quan
no flags Details
Patch (4.13 KB, patch)
2020-01-02 15:11 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xidorn Quan 2019-12-29 20:52:07 PST
Created attachment 386505 [details]
testcase

Please see the testcase, in Safari, it shows:
> <style xmlns="http://www.w3.org/1999/xhtml">/* & */</style>

while in both Firefox and Chrome it shows:
> <style xmlns="http://www.w3.org/1999/xhtml">/* &amp; */</style>

The testcase basically just invokes XMLSerializer's serializeToString to serialize the following element:
> <style>/* & */</style>

and the output from Safari is not a valid XML.
Comment 1 Chris Dumez 2020-01-02 15:11:12 PST
Created attachment 386635 [details]
Patch
Comment 2 WebKit Commit Bot 2020-01-02 18:53:05 PST
Comment on attachment 386635 [details]
Patch

Clearing flags on attachment: 386635

Committed r253988: <https://trac.webkit.org/changeset/253988>
Comment 3 WebKit Commit Bot 2020-01-02 18:53:06 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2020-01-02 18:54:31 PST
<rdar://problem/58289242>