RESOLVED FIXED44833
Each EntityMaskIn* needs explanation
https://bugs.webkit.org/show_bug.cgi?id=44833
Summary Each EntityMaskIn* needs explanation
Ryosuke Niwa
Reported 2010-08-28 22:57:52 PDT
Darin brought up in https://bugs.webkit.org/show_bug.cgi?id=44831 that we should explain why each entity are escaped in CDATA, PCDATA, attribute value, and why we also escape nbsp in HTML documents. In particular, we need the explanation for the following contants: http://trac.webkit.org/browser/trunk/WebCore/editing/markup.cpp?rev=66326#L103 103 EntityMaskInCDATA = EntityNone, 104 EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt, 105 EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp, 106 EntityMaskInAttributeValue = EntityAmp | EntityLt | EntityGt | EntityQuot, 107 EntityMaskInHTMLAttributeValue = EntityMaskInAttributeValue | EntityNbsp,
Attachments
adds explanation (1.56 KB, patch)
2010-09-17 13:54 PDT, Ryosuke Niwa
tkent: review+
Ryosuke Niwa
Comment 1 2010-08-28 23:07:09 PDT
http://trac.webkit.org/changeset/32879 and http://trac.webkit.org/changeset/34197 explain why we should escape nbsp only in HTML documents. For compatibility reason, nbsp should be converted to an entity reference in innerHTML but cannot be converted in XML documents because it'll invalidates XSL. http://trac.webkit.org/changeset/33451 also clarifies the reason why replace > with > that WebKit fails jQuery test without it.
Darin Adler
Comment 2 2010-08-28 23:27:22 PDT
I also realized that we have no need for the constant EntityNone. We can just use 0 for it.
Ryosuke Niwa
Comment 3 2010-09-17 13:54:58 PDT
Created attachment 67946 [details] adds explanation
Ryosuke Niwa
Comment 4 2010-09-21 22:57:05 PDT
Note You need to log in before you can comment on or make changes to this bug.