OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights
reserved. |
3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 DEFINE_STATIC_LOCAL(const CString, ltReference, ("<")); | 77 DEFINE_STATIC_LOCAL(const CString, ltReference, ("<")); |
78 DEFINE_STATIC_LOCAL(const CString, gtReference, (">")); | 78 DEFINE_STATIC_LOCAL(const CString, gtReference, (">")); |
79 DEFINE_STATIC_LOCAL(const CString, quotReference, (""")); | 79 DEFINE_STATIC_LOCAL(const CString, quotReference, (""")); |
80 DEFINE_STATIC_LOCAL(const CString, nbspReference, (" ")); | 80 DEFINE_STATIC_LOCAL(const CString, nbspReference, (" ")); |
81 | 81 |
82 static const EntityDescription entityMaps[] = { | 82 static const EntityDescription entityMaps[] = { |
83 { '&', ampReference, EntityAmp }, | 83 { '&', ampReference, EntityAmp }, |
84 { '<', ltReference, EntityLt }, | 84 { '<', ltReference, EntityLt }, |
85 { '>', gtReference, EntityGt }, | 85 { '>', gtReference, EntityGt }, |
86 { '"', quotReference, EntityQuot }, | 86 { '"', quotReference, EntityQuot }, |
87 { noBreakSpace, nbspReference, EntityNbsp }, | 87 { noBreakSpaceCharacter, nbspReference, EntityNbsp }, |
88 }; | 88 }; |
89 | 89 |
90 if (!(offset + length)) | 90 if (!(offset + length)) |
91 return; | 91 return; |
92 | 92 |
93 ASSERT(offset + length <= source.length()); | 93 ASSERT(offset + length <= source.length()); |
94 if (source.is8Bit()) | 94 if (source.is8Bit()) |
95 appendCharactersReplacingEntitiesInternal(result, source.characters8() +
offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); | 95 appendCharactersReplacingEntitiesInternal(result, source.characters8() +
offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); |
96 else | 96 else |
97 appendCharactersReplacingEntitiesInternal(result, source.characters16()
+ offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); | 97 appendCharactersReplacingEntitiesInternal(result, source.characters16()
+ offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 namespaces = &namespaceHash; | 550 namespaces = &namespaceHash; |
551 } | 551 } |
552 | 552 |
553 serializeNodesWithNamespaces<Strategy>(accumulator, targetNode, childrenOnly
, namespaces); | 553 serializeNodesWithNamespaces<Strategy>(accumulator, targetNode, childrenOnly
, namespaces); |
554 return accumulator.toString(); | 554 return accumulator.toString(); |
555 } | 555 } |
556 | 556 |
557 template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&, EChil
drenOnly); | 557 template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&, EChil
drenOnly); |
558 | 558 |
559 } | 559 } |
OLD | NEW |