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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 PassRefPtr<DocumentParser> MediaDocument::createParser() 128 PassRefPtr<DocumentParser> MediaDocument::createParser()
129 { 129 {
130 return MediaDocumentParser::create(this); 130 return MediaDocumentParser::create(this);
131 } 131 }
132 132
133 static inline HTMLVideoElement* descendentVideoElement(Node* root) 133 static inline HTMLVideoElement* descendentVideoElement(Node* root)
134 { 134 {
135 ASSERT(root); 135 ASSERT(root);
136 136
137 for (Node* node = root; node; node = NodeTraversal::next(node, root)) { 137 for (Node* node = root; node; node = NodeTraversal::next(*node, root)) {
138 if (isHTMLVideoElement(node)) 138 if (isHTMLVideoElement(node))
139 return toHTMLVideoElement(node); 139 return toHTMLVideoElement(node);
140 } 140 }
141 141
142 return 0; 142 return 0;
143 } 143 }
144 144
145 void MediaDocument::defaultEventHandler(Event* event) 145 void MediaDocument::defaultEventHandler(Event* event)
146 { 146 {
147 Node* targetNode = event->target()->toNode(); 147 Node* targetNode = event->target()->toNode();
(...skipping 12 matching lines...) Expand all
160 if (video->canPlay()) 160 if (video->canPlay())
161 video->play(); 161 video->play();
162 } else 162 } else
163 video->pause(); 163 video->pause();
164 event->setDefaultHandled(); 164 event->setDefaultHandled();
165 } 165 }
166 } 166 }
167 } 167 }
168 168
169 } 169 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/html/forms/RadioInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698