| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 return true; | 279 return true; |
| 280 } | 280 } |
| 281 | 281 |
| 282 void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicStrin
g& prefix, const AtomicString& namespaceURI, Namespaces& namespaces) | 282 void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicStrin
g& prefix, const AtomicString& namespaceURI, Namespaces& namespaces) |
| 283 { | 283 { |
| 284 namespaces.checkConsistency(); | 284 namespaces.checkConsistency(); |
| 285 if (namespaceURI.isEmpty()) | 285 if (namespaceURI.isEmpty()) |
| 286 return; | 286 return; |
| 287 | 287 |
| 288 // Use emptyAtoms's impl() for both null and empty strings since the HashMap
can't handle 0 as a key | 288 // Use emptyAtoms's impl() for both null and empty strings since the HashMap
can't handle 0 as a key |
| 289 AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl(); | 289 StringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl(); |
| 290 AtomicStringImpl* foundNS = namespaces.get(pre); | 290 StringImpl* foundNS = namespaces.get(pre); |
| 291 if (foundNS != namespaceURI.impl()) { | 291 if (foundNS != namespaceURI.impl()) { |
| 292 namespaces.set(pre, namespaceURI.impl()); | 292 namespaces.set(pre, namespaceURI.impl()); |
| 293 result.append(' '); | 293 result.append(' '); |
| 294 result.append(xmlnsAtom.string()); | 294 result.append(xmlnsAtom.string()); |
| 295 if (!prefix.isEmpty()) { | 295 if (!prefix.isEmpty()) { |
| 296 result.append(':'); | 296 result.append(':'); |
| 297 result.append(prefix); | 297 result.append(prefix); |
| 298 } | 298 } |
| 299 | 299 |
| 300 result.append('='); | 300 result.append('='); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) | 552 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) |
| 553 return; | 553 return; |
| 554 | 554 |
| 555 result.append('<'); | 555 result.append('<'); |
| 556 result.append('/'); | 556 result.append('/'); |
| 557 result.append(toElement(node)->nodeNamePreservingCase()); | 557 result.append(toElement(node)->nodeNamePreservingCase()); |
| 558 result.append('>'); | 558 result.append('>'); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } | 561 } |
| OLD | NEW |