Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: Source/core/editing/MarkupAccumulator.h

Issue 117103003: DOM serialization: fix quoting of < and > in HMTL attribute values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: < and > are un-quoted in HTML, quoted in XML. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/dom/dom-parse-serialize-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 EntityLt = 0x0002, 46 EntityLt = 0x0002,
47 EntityGt = 0x0004, 47 EntityGt = 0x0004,
48 EntityQuot = 0x0008, 48 EntityQuot = 0x0008,
49 EntityNbsp = 0x0010, 49 EntityNbsp = 0x0010,
50 50
51 // Non-breaking space needs to be escaped in innerHTML for compatibility rea son. See http://trac.webkit.org/changeset/32879 51 // Non-breaking space needs to be escaped in innerHTML for compatibility rea son. See http://trac.webkit.org/changeset/32879
52 // However, we cannot do this in a XML document because it does not have the entity reference defined (See the bug 19215). 52 // However, we cannot do this in a XML document because it does not have the entity reference defined (See the bug 19215).
53 EntityMaskInCDATA = 0, 53 EntityMaskInCDATA = 0,
54 EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt, 54 EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt,
55 EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp, 55 EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp,
56 EntityMaskInAttributeValue = EntityAmp | EntityLt | EntityGt | EntityQuot, 56 EntityMaskInAttributeValue = EntityAmp | EntityQuot | EntityLt | EntityGt,
57 EntityMaskInHTMLAttributeValue = EntityMaskInAttributeValue | EntityNbsp, 57 EntityMaskInHTMLAttributeValue = EntityAmp | EntityQuot | EntityNbsp,
58 }; 58 };
59 59
60 struct EntityDescription { 60 struct EntityDescription {
61 UChar entity; 61 UChar entity;
62 const String& reference; 62 const String& reference;
63 EntityMask mask; 63 EntityMask mask;
64 }; 64 };
65 65
66 class MarkupAccumulator { 66 class MarkupAccumulator {
67 WTF_MAKE_NONCOPYABLE(MarkupAccumulator); 67 WTF_MAKE_NONCOPYABLE(MarkupAccumulator);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void appendQuotedURLAttributeValue(StringBuilder&, const Element*, const Att ribute&); 113 void appendQuotedURLAttributeValue(StringBuilder&, const Element*, const Att ribute&);
114 void serializeNodesWithNamespaces(Node* targetNode, EChildrenOnly, const Nam espaces*, Vector<QualifiedName>* tagNamesToSkip); 114 void serializeNodesWithNamespaces(Node* targetNode, EChildrenOnly, const Nam espaces*, Vector<QualifiedName>* tagNamesToSkip);
115 115
116 StringBuilder m_markup; 116 StringBuilder m_markup;
117 const EAbsoluteURLs m_resolveURLsMethod; 117 const EAbsoluteURLs m_resolveURLsMethod;
118 }; 118 };
119 119
120 } 120 }
121 121
122 #endif 122 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/dom-parse-serialize-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698