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

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

Issue 23680013: Add const versions of some toHTMLFooElement(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/dom/Node.cpp ('k') | Source/core/html/HTMLFormControlElement.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) 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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 bool FormAssociatedElement::isFormControlElementWithState() const 272 bool FormAssociatedElement::isFormControlElementWithState() const
273 { 273 {
274 return false; 274 return false;
275 } 275 }
276 276
277 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement) 277 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement)
278 { 278 {
279 if (associatedElement->isFormControlElement()) 279 if (associatedElement->isFormControlElement())
280 return static_cast<const HTMLFormControlElement*>(associatedElement); 280 return toHTMLFormControlElement(associatedElement);
281 // Assumes the element is an HTMLObjectElement 281 // Assumes the element is an HTMLObjectElement
282 const HTMLElement* element = static_cast<const HTMLObjectElement*>(associate dElement); 282 return toHTMLObjectElement(associatedElement);
283 ASSERT(element->hasTagName(objectTag));
284 return element;
285 } 283 }
286 284
287 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) 285 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement)
288 { 286 {
289 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat edElement*>(associatedElement))); 287 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat edElement*>(associatedElement)));
290 } 288 }
291 289
292 PassOwnPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(cons t AtomicString& id, FormAssociatedElement* element) 290 PassOwnPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(cons t AtomicString& id, FormAssociatedElement* element)
293 { 291 {
294 return adoptPtr(new FormAttributeTargetObserver(id, element)); 292 return adoptPtr(new FormAttributeTargetObserver(id, element));
295 } 293 }
296 294
297 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement* element) 295 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement* element)
298 : IdTargetObserver(toHTMLElement(element)->treeScope().idTargetObserverRegis try(), id) 296 : IdTargetObserver(toHTMLElement(element)->treeScope().idTargetObserverRegis try(), id)
299 , m_element(element) 297 , m_element(element)
300 { 298 {
301 } 299 }
302 300
303 void FormAttributeTargetObserver::idTargetChanged() 301 void FormAttributeTargetObserver::idTargetChanged()
304 { 302 {
305 m_element->formAttributeTargetChanged(); 303 m_element->formAttributeTargetChanged();
306 } 304 }
307 305
308 } // namespace Webcore 306 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/html/HTMLFormControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698