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

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

Issue 126443005: Use TreeScope::completeURL and baseURL instead of the Document versions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased again, passes tests 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/html/HTMLAnchorElement.h » ('j') | 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, 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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/html/HTMLAnchorElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698