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

Side by Side Diff: Source/WebKit/chromium/src/WebPageSerializer.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 namespace { 61 namespace {
62 62
63 KURL getSubResourceURLFromElement(Element* element) 63 KURL getSubResourceURLFromElement(Element* element)
64 { 64 {
65 ASSERT(element); 65 ASSERT(element);
66 const QualifiedName* attributeName = 0; 66 const QualifiedName* attributeName = 0;
67 if (element->hasTagName(HTMLNames::imgTag) || element->hasTagName(HTMLNames: :scriptTag)) 67 if (element->hasTagName(HTMLNames::imgTag) || element->hasTagName(HTMLNames: :scriptTag))
68 attributeName = &HTMLNames::srcAttr; 68 attributeName = &HTMLNames::srcAttr;
69 else if (element->hasTagName(HTMLNames::inputTag)) { 69 else if (element->hasTagName(HTMLNames::inputTag)) {
70 HTMLInputElement* input = static_cast<HTMLInputElement*>(element); 70 if (toHTMLInputElement(element)->isImageButton())
71 if (input->isImageButton())
72 attributeName = &HTMLNames::srcAttr; 71 attributeName = &HTMLNames::srcAttr;
73 } else if (element->hasTagName(HTMLNames::bodyTag) 72 } else if (element->hasTagName(HTMLNames::bodyTag)
74 || element->hasTagName(HTMLNames::tableTag) 73 || element->hasTagName(HTMLNames::tableTag)
75 || element->hasTagName(HTMLNames::trTag) 74 || element->hasTagName(HTMLNames::trTag)
76 || element->hasTagName(HTMLNames::tdTag)) 75 || element->hasTagName(HTMLNames::tdTag))
77 attributeName = &HTMLNames::backgroundAttr; 76 attributeName = &HTMLNames::backgroundAttr;
78 else if (element->hasTagName(HTMLNames::blockquoteTag) 77 else if (element->hasTagName(HTMLNames::blockquoteTag)
79 || element->hasTagName(HTMLNames::qTag) 78 || element->hasTagName(HTMLNames::qTag)
80 || element->hasTagName(HTMLNames::delTag) 79 || element->hasTagName(HTMLNames::delTag)
81 || element->hasTagName(HTMLNames::insTag)) 80 || element->hasTagName(HTMLNames::insTag))
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 292
294 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get) 293 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar get)
295 { 294 {
296 if (baseTarget.isEmpty()) 295 if (baseTarget.isEmpty())
297 return String(ASCIILiteral("<base href=\".\">")); 296 return String(ASCIILiteral("<base href=\".\">"));
298 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">"; 297 String baseString = "<base href=\".\" target=\"" + static_cast<const String& >(baseTarget) + "\">";
299 return baseString; 298 return baseString;
300 } 299 }
301 300
302 } // namespace WebKit 301 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebInputElement.cpp ('k') | Source/WebKit/chromium/src/WebSearchableFormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698