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

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

Issue 196723014: Replace Element::isMediaElement() with isHTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: less null checks Created 6 years, 9 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.h ('k') | Source/core/html/HTMLTrackElement.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) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(Document& document) 49 PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(Document& document)
50 { 50 {
51 return adoptRef(new HTMLSourceElement(document)); 51 return adoptRef(new HTMLSourceElement(document));
52 } 52 }
53 53
54 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode * insertionPoint) 54 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode * insertionPoint)
55 { 55 {
56 HTMLElement::insertedInto(insertionPoint); 56 HTMLElement::insertedInto(insertionPoint);
57 Element* parent = parentElement(); 57 Element* parent = parentElement();
58 if (parent && parent->isMediaElement()) 58 if (isHTMLMediaElement(parent))
59 toHTMLMediaElement(parentNode())->sourceWasAdded(this); 59 toHTMLMediaElement(parent)->sourceWasAdded(this);
60 return InsertionDone; 60 return InsertionDone;
61 } 61 }
62 62
63 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) 63 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot)
64 { 64 {
65 Element* parent = parentElement(); 65 Element* parent = parentElement();
66 if (!parent && removalRoot->isElementNode()) 66 if (!parent && removalRoot->isElementNode())
67 parent = toElement(removalRoot); 67 parent = toElement(removalRoot);
68 if (parent && parent->isMediaElement()) 68 if (isHTMLMediaElement(parent))
69 toHTMLMediaElement(parent)->sourceWasRemoved(this); 69 toHTMLMediaElement(parent)->sourceWasRemoved(this);
70 HTMLElement::removedFrom(removalRoot); 70 HTMLElement::removedFrom(removalRoot);
71 } 71 }
72 72
73 void HTMLSourceElement::setSrc(const String& url) 73 void HTMLSourceElement::setSrc(const String& url)
74 { 74 {
75 setAttribute(srcAttr, AtomicString(url)); 75 setAttribute(srcAttr, AtomicString(url));
76 } 76 }
77 77
78 const AtomicString& HTMLSourceElement::media() const 78 const AtomicString& HTMLSourceElement::media() const
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 WTF_LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this); 115 WTF_LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this);
116 dispatchEvent(Event::createCancelable(EventTypeNames::error)); 116 dispatchEvent(Event::createCancelable(EventTypeNames::error));
117 } 117 }
118 118
119 bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const 119 bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const
120 { 120 {
121 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute) ; 121 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute) ;
122 } 122 }
123 123
124 } 124 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698