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

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

Issue 171663005: Consistently use ElementTraversal API when looking for an Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/html/HTMLMediaElement.cpp ('k') | Source/core/html/HTMLTableElement.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 // FIXME: This function should not deal with url or serviceType! 140 // FIXME: This function should not deal with url or serviceType!
141 void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S tring>& paramValues, String& url, String& serviceType) 141 void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S tring>& paramValues, String& url, String& serviceType)
142 { 142 {
143 HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames; 143 HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
144 String urlParameter; 144 String urlParameter;
145 145
146 // Scan the PARAM children and store their name/value pairs. 146 // Scan the PARAM children and store their name/value pairs.
147 // Get the URL and type from the params if we don't already have them. 147 // Get the URL and type from the params if we don't already have them.
148 for (Node* child = firstChild(); child; child = child->nextSibling()) { 148 for (Element* child = ElementTraversal::firstWithin(*this); child; child = E lementTraversal::nextSibling(*child)) {
149 if (!child->hasTagName(paramTag)) 149 if (!child->hasTagName(paramTag))
150 continue; 150 continue;
151 151
152 HTMLParamElement* p = toHTMLParamElement(child); 152 HTMLParamElement* p = toHTMLParamElement(child);
153 String name = p->name(); 153 String name = p->name();
154 if (name.isEmpty()) 154 if (name.isEmpty())
155 continue; 155 continue;
156 156
157 uniqueParamNames.add(name.impl()); 157 uniqueParamNames.add(name.impl());
158 paramNames.append(p->name()); 158 paramNames.append(p->name());
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 reattachFallbackContent(); 413 reattachFallbackContent();
414 } 414 }
415 415
416 bool HTMLObjectElement::isExposed() const 416 bool HTMLObjectElement::isExposed() const
417 { 417 {
418 // http://www.whatwg.org/specs/web-apps/current-work/#exposed 418 // http://www.whatwg.org/specs/web-apps/current-work/#exposed
419 for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNod e()) { 419 for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNod e()) {
420 if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->is Exposed()) 420 if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->is Exposed())
421 return false; 421 return false;
422 } 422 }
423 for (Node* node = firstChild(); node; node = NodeTraversal::next(*node, this )) { 423 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) {
424 if (node->hasTagName(objectTag) || node->hasTagName(embedTag)) 424 if (element->hasTagName(objectTag) || element->hasTagName(embedTag))
425 return false; 425 return false;
426 } 426 }
427 return true; 427 return true;
428 } 428 }
429 429
430 bool HTMLObjectElement::containsJavaApplet() const 430 bool HTMLObjectElement::containsJavaApplet() const
431 { 431 {
432 if (MIMETypeRegistry::isJavaAppletMIMEType(getAttribute(typeAttr))) 432 if (MIMETypeRegistry::isJavaAppletMIMEType(getAttribute(typeAttr)))
433 return true; 433 return true;
434 434
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 { 476 {
477 return fastHasAttribute(usemapAttr); 477 return fastHasAttribute(usemapAttr);
478 } 478 }
479 479
480 bool HTMLObjectElement::useFallbackContent() const 480 bool HTMLObjectElement::useFallbackContent() const
481 { 481 {
482 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent; 482 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent;
483 } 483 }
484 484
485 } 485 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/HTMLTableElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698