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

Unified Diff: Source/core/editing/MarkupAccumulator.cpp

Issue 26193002: XMLSerializer escapes < > & correctly inside <script> and <style> tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed feedback. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/XMLSerializer-entities-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/MarkupAccumulator.cpp
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp
index 1ccbc83f7694b02468b203c8a766b579e1184058..4411ed8104cea3c54559c7848f3eacbff712a1a8 100644
--- a/Source/core/editing/MarkupAccumulator.cpp
+++ b/Source/core/editing/MarkupAccumulator.cpp
@@ -303,14 +303,16 @@ void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicStrin
EntityMask MarkupAccumulator::entityMaskForText(Text* text) const
{
+ if (!text->document().isHTMLDocument())
+ return EntityMaskInPCDATA;
+
const QualifiedName* parentName = 0;
if (text->parentElement())
parentName = &(text->parentElement())->tagQName();
if (parentName && (*parentName == scriptTag || *parentName == styleTag || *parentName == xmpTag))
return EntityMaskInCDATA;
-
- return text->document().isHTMLDocument() ? EntityMaskInHTMLPCDATA : EntityMaskInPCDATA;
+ return EntityMaskInHTMLPCDATA;
}
void MarkupAccumulator::appendText(StringBuilder& result, Text* text)
« no previous file with comments | « LayoutTests/fast/dom/XMLSerializer-entities-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698