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

Side by Side Diff: sky/engine/core/rendering/HitTestResult.cpp

Issue 689373003: Remove most of the media stack. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/core/rendering/HitTestResult.h ('k') | sky/engine/core/rendering/RenderMedia.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) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 24
25 #include "core/HTMLNames.h" 25 #include "core/HTMLNames.h"
26 #include "core/dom/DocumentMarkerController.h" 26 #include "core/dom/DocumentMarkerController.h"
27 #include "core/dom/NodeRenderingTraversal.h" 27 #include "core/dom/NodeRenderingTraversal.h"
28 #include "core/dom/shadow/ShadowRoot.h" 28 #include "core/dom/shadow/ShadowRoot.h"
29 #include "core/editing/FrameSelection.h" 29 #include "core/editing/FrameSelection.h"
30 #include "core/fetch/ImageResource.h" 30 #include "core/fetch/ImageResource.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "core/html/HTMLAnchorElement.h" 32 #include "core/html/HTMLAnchorElement.h"
33 #include "core/html/HTMLImageElement.h" 33 #include "core/html/HTMLImageElement.h"
34 #include "core/html/HTMLMediaElement.h"
35 #include "core/html/parser/HTMLParserIdioms.h" 34 #include "core/html/parser/HTMLParserIdioms.h"
36 #include "core/rendering/RenderImage.h" 35 #include "core/rendering/RenderImage.h"
37 #include "platform/scroll/Scrollbar.h" 36 #include "platform/scroll/Scrollbar.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 HitTestResult::HitTestResult() 40 HitTestResult::HitTestResult()
42 : m_isOverWidget(false) 41 : m_isOverWidget(false)
43 { 42 {
44 } 43 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 if ((allowCanvas && isHTMLCanvasElement(*m_innerNonSharedNode)) 261 if ((allowCanvas && isHTMLCanvasElement(*m_innerNonSharedNode))
263 || isHTMLImageElement(*m_innerNonSharedNode) 262 || isHTMLImageElement(*m_innerNonSharedNode)
264 ) { 263 ) {
265 urlString = toElement(*m_innerNonSharedNode).imageSourceURL(); 264 urlString = toElement(*m_innerNonSharedNode).imageSourceURL();
266 } else 265 } else
267 return KURL(); 266 return KURL();
268 267
269 return m_innerNonSharedNode->document().completeURL(stripLeadingAndTrailingH TMLSpaces(urlString)); 268 return m_innerNonSharedNode->document().completeURL(stripLeadingAndTrailingH TMLSpaces(urlString));
270 } 269 }
271 270
272 KURL HitTestResult::absoluteMediaURL() const
273 {
274 if (HTMLMediaElement* mediaElt = mediaElement())
275 return mediaElt->currentSrc();
276 return KURL();
277 }
278
279 HTMLMediaElement* HitTestResult::mediaElement() const
280 {
281 if (!m_innerNonSharedNode)
282 return 0;
283
284 if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()-> isMedia()))
285 return 0;
286
287 if (isHTMLMediaElement(*m_innerNonSharedNode))
288 return toHTMLMediaElement(m_innerNonSharedNode);
289 return 0;
290 }
291
292 KURL HitTestResult::absoluteLinkURL() const 271 KURL HitTestResult::absoluteLinkURL() const
293 { 272 {
294 if (!m_innerURLElement) 273 if (!m_innerURLElement)
295 return KURL(); 274 return KURL();
296 return m_innerURLElement->hrefURL(); 275 return m_innerURLElement->hrefURL();
297 } 276 }
298 277
299 bool HitTestResult::isLiveLink() const 278 bool HitTestResult::isLiveLink() const
300 { 279 {
301 return m_innerURLElement && m_innerURLElement->isLiveLink(); 280 return m_innerURLElement && m_innerURLElement->isLiveLink();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 { 405 {
427 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { 406 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) {
428 if (node->isElementNode()) 407 if (node->isElementNode())
429 return toElement(node); 408 return toElement(node);
430 } 409 }
431 410
432 return 0; 411 return 0;
433 } 412 }
434 413
435 } // namespace blink 414 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/HitTestResult.h ('k') | sky/engine/core/rendering/RenderMedia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698