| Index: Source/core/html/MediaDocument.cpp
|
| diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
|
| index 22dc2f6d7cd12b32c150bd522c46cd3dbfff24d7..b7b902418b7b853ceee71a46db26e24b6db0425a 100644
|
| --- a/Source/core/html/MediaDocument.cpp
|
| +++ b/Source/core/html/MediaDocument.cpp
|
| @@ -29,7 +29,7 @@
|
|
|
| #include "HTMLNames.h"
|
| #include "bindings/v8/ExceptionStatePlaceholder.h"
|
| -#include "core/dom/NodeTraversal.h"
|
| +#include "core/dom/ElementTraversal.h"
|
| #include "core/dom/RawDataDocumentParser.h"
|
| #include "core/events/KeyboardEvent.h"
|
| #include "core/events/ThreadLocalEventNames.h"
|
| @@ -129,18 +129,6 @@ PassRefPtr<DocumentParser> MediaDocument::createParser()
|
| return MediaDocumentParser::create(this);
|
| }
|
|
|
| -static inline HTMLVideoElement* descendentVideoElement(Node* root)
|
| -{
|
| - ASSERT(root);
|
| -
|
| - for (Node* node = root; node; node = NodeTraversal::next(*node, root)) {
|
| - if (node->hasTagName(videoTag))
|
| - return toHTMLVideoElement(node);
|
| - }
|
| -
|
| - return 0;
|
| -}
|
| -
|
| void MediaDocument::defaultEventHandler(Event* event)
|
| {
|
| Node* targetNode = event->target()->toNode();
|
| @@ -148,7 +136,7 @@ void MediaDocument::defaultEventHandler(Event* event)
|
| return;
|
|
|
| if (event->type() == EventTypeNames::keydown && event->isKeyboardEvent()) {
|
| - HTMLVideoElement* video = descendentVideoElement(targetNode);
|
| + HTMLVideoElement* video = Traversal<HTMLVideoElement>::firstWithin(*targetNode);
|
| if (!video)
|
| return;
|
|
|
|
|