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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 23591020: Add toHTMLDocument() convenience methods that take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve casting 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 | « no previous file | Source/core/html/HTMLDocument.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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 setAttribute(HTMLNames::classAttr, getClassAttribute()); 2871 setAttribute(HTMLNames::classAttr, getClassAttribute());
2872 } 2872 }
2873 } 2873 }
2874 2874
2875 void Element::updateNamedItemRegistration(const AtomicString& oldName, const Ato micString& newName) 2875 void Element::updateNamedItemRegistration(const AtomicString& oldName, const Ato micString& newName)
2876 { 2876 {
2877 if (!document().isHTMLDocument()) 2877 if (!document().isHTMLDocument())
2878 return; 2878 return;
2879 2879
2880 if (!oldName.isEmpty()) 2880 if (!oldName.isEmpty())
2881 toHTMLDocument(&document())->removeNamedItem(oldName); 2881 toHTMLDocument(document()).removeNamedItem(oldName);
2882 2882
2883 if (!newName.isEmpty()) 2883 if (!newName.isEmpty())
2884 toHTMLDocument(&document())->addNamedItem(newName); 2884 toHTMLDocument(document()).addNamedItem(newName);
2885 } 2885 }
2886 2886
2887 void Element::updateExtraNamedItemRegistration(const AtomicString& oldId, const AtomicString& newId) 2887 void Element::updateExtraNamedItemRegistration(const AtomicString& oldId, const AtomicString& newId)
2888 { 2888 {
2889 if (!document().isHTMLDocument()) 2889 if (!document().isHTMLDocument())
2890 return; 2890 return;
2891 2891
2892 if (!oldId.isEmpty()) 2892 if (!oldId.isEmpty())
2893 toHTMLDocument(&document())->removeExtraNamedItem(oldId); 2893 toHTMLDocument(document()).removeExtraNamedItem(oldId);
2894 2894
2895 if (!newId.isEmpty()) 2895 if (!newId.isEmpty())
2896 toHTMLDocument(&document())->addExtraNamedItem(newId); 2896 toHTMLDocument(document()).addExtraNamedItem(newId);
2897 } 2897 }
2898 2898
2899 PassRefPtr<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType ty pe) 2899 PassRefPtr<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType ty pe)
2900 { 2900 {
2901 if (HTMLCollection* collection = cachedHTMLCollection(type)) 2901 if (HTMLCollection* collection = cachedHTMLCollection(type))
2902 return collection; 2902 return collection;
2903 2903
2904 RefPtr<HTMLCollection> collection; 2904 RefPtr<HTMLCollection> collection;
2905 if (type == TableRows) { 2905 if (type == TableRows) {
2906 ASSERT(hasTagName(tableTag)); 2906 ASSERT(hasTagName(tableTag));
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 return 0; 3634 return 0;
3635 } 3635 }
3636 3636
3637 Attribute* UniqueElementData::attributeItem(unsigned index) 3637 Attribute* UniqueElementData::attributeItem(unsigned index)
3638 { 3638 {
3639 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3639 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3640 return &m_attributeVector.at(index); 3640 return &m_attributeVector.at(index);
3641 } 3641 }
3642 3642
3643 } // namespace WebCore 3643 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698