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

Side by Side Diff: Source/core/html/HTMLViewSourceDocument.cpp

Issue 66643004: Remove QualifiedName argument from most HTMLElement::create functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Hack for XML prefix 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 m_current = addSpanWithClassName(className); 263 m_current = addSpanWithClassName(className);
264 } 264 }
265 addText(text, className); 265 addText(text, className);
266 if (!className.isEmpty() && m_current != m_tbody) 266 if (!className.isEmpty() && m_current != m_tbody)
267 m_current = toElement(m_current->parentNode()); 267 m_current = toElement(m_current->parentNode());
268 return end; 268 return end;
269 } 269 }
270 270
271 PassRefPtr<Element> HTMLViewSourceDocument::addBase(const AtomicString& href) 271 PassRefPtr<Element> HTMLViewSourceDocument::addBase(const AtomicString& href)
272 { 272 {
273 RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(baseTag, *this); 273 RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(*this);
274 base->setAttribute(hrefAttr, href); 274 base->setAttribute(hrefAttr, href);
275 m_current->parserAppendChild(base); 275 m_current->parserAppendChild(base);
276 return base.release(); 276 return base.release();
277 } 277 }
278 278
279 PassRefPtr<Element> HTMLViewSourceDocument::addLink(const AtomicString& url, boo l isAnchor) 279 PassRefPtr<Element> HTMLViewSourceDocument::addLink(const AtomicString& url, boo l isAnchor)
280 { 280 {
281 if (m_current == m_tbody) 281 if (m_current == m_tbody)
282 addLine("webkit-html-tag"); 282 addLine("webkit-html-tag");
283 283
284 // Now create a link for the attribute value instead of a span. 284 // Now create a link for the attribute value instead of a span.
285 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(*this); 285 RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(*this);
286 const char* classValue; 286 const char* classValue;
287 if (isAnchor) 287 if (isAnchor)
288 classValue = "webkit-html-attribute-value webkit-html-external-link"; 288 classValue = "webkit-html-attribute-value webkit-html-external-link";
289 else 289 else
290 classValue = "webkit-html-attribute-value webkit-html-resource-link"; 290 classValue = "webkit-html-attribute-value webkit-html-resource-link";
291 anchor->setAttribute(classAttr, classValue); 291 anchor->setAttribute(classAttr, classValue);
292 anchor->setAttribute(targetAttr, "_blank"); 292 anchor->setAttribute(targetAttr, "_blank");
293 anchor->setAttribute(hrefAttr, url); 293 anchor->setAttribute(hrefAttr, url);
294 m_current->parserAppendChild(anchor); 294 m_current->parserAppendChild(anchor);
295 return anchor.release(); 295 return anchor.release();
296 } 296 }
297 297
298 } 298 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698