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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 | 137 |
138 if (!childrenOnly) | 138 if (!childrenOnly) |
139 appendEndTag(targetNode); | 139 appendEndTag(targetNode); |
140 } | 140 } |
141 | 141 |
142 String MarkupAccumulator::resolveURLIfNeeded(const Element* element, const Strin
g& urlString) const | 142 String MarkupAccumulator::resolveURLIfNeeded(const Element* element, const Strin
g& urlString) const |
143 { | 143 { |
144 switch (m_resolveURLsMethod) { | 144 switch (m_resolveURLsMethod) { |
145 case ResolveAllURLs: | 145 case ResolveAllURLs: |
146 return element->document().completeURL(urlString).string(); | 146 return element->treeScope().completeURL(urlString).string(); |
147 | 147 |
148 case ResolveNonLocalURLs: | 148 case ResolveNonLocalURLs: |
149 if (!element->document().url().isLocalFile()) | 149 if (!element->document().url().isLocalFile()) |
150 return element->document().completeURL(urlString).string(); | 150 return element->treeScope().completeURL(urlString).string(); |
151 break; | 151 break; |
152 | 152 |
153 case DoNotResolveURLs: | 153 case DoNotResolveURLs: |
154 break; | 154 break; |
155 } | 155 } |
156 return urlString; | 156 return urlString; |
157 } | 157 } |
158 | 158 |
159 void MarkupAccumulator::appendString(const String& string) | 159 void MarkupAccumulator::appendString(const String& string) |
160 { | 160 { |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 { | 530 { |
531 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) | 531 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) |
532 return; | 532 return; |
533 | 533 |
534 result.appendLiteral("</"); | 534 result.appendLiteral("</"); |
535 result.append(toElement(node)->nodeNamePreservingCase()); | 535 result.append(toElement(node)->nodeNamePreservingCase()); |
536 result.append('>'); | 536 result.append('>'); |
537 } | 537 } |
538 | 538 |
539 } | 539 } |
OLD | NEW |