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

Side by Side Diff: Source/core/rendering/HitTestResult.cpp

Issue 255563004: Implement "Save image as" for canvas (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 KURL HitTestResult::absoluteImageURL() const 277 KURL HitTestResult::absoluteImageURL() const
278 { 278 {
279 if (!m_innerNonSharedNode) 279 if (!m_innerNonSharedNode)
280 return KURL(); 280 return KURL();
281 281
282 if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()-> isImage())) 282 if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()-> isImage()))
283 return KURL(); 283 return KURL();
284 284
285 AtomicString urlString; 285 AtomicString urlString;
286 if (isHTMLEmbedElement(*m_innerNonSharedNode) 286 if (isHTMLCanvasElement(*m_innerNonSharedNode)
Justin Novosad 2014/04/24 14:19:39 This may work, but it is way too cumbersome. It im
287 || isHTMLEmbedElement(*m_innerNonSharedNode)
287 || isHTMLImageElement(*m_innerNonSharedNode) 288 || isHTMLImageElement(*m_innerNonSharedNode)
288 || isHTMLInputElement(*m_innerNonSharedNode) 289 || isHTMLInputElement(*m_innerNonSharedNode)
289 || isHTMLObjectElement(*m_innerNonSharedNode) 290 || isHTMLObjectElement(*m_innerNonSharedNode)
290 || isSVGImageElement(*m_innerNonSharedNode) 291 || isSVGImageElement(*m_innerNonSharedNode)
291 ) { 292 ) {
292 urlString = toElement(*m_innerNonSharedNode).imageSourceURL(); 293 urlString = toElement(*m_innerNonSharedNode).imageSourceURL();
293 } else 294 } else
294 return KURL(); 295 return KURL();
295 296
296 return m_innerNonSharedNode->document().completeURL(stripLeadingAndTrailingH TMLSpaces(urlString)); 297 return m_innerNonSharedNode->document().completeURL(stripLeadingAndTrailingH TMLSpaces(urlString));
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 { 486 {
486 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { 487 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) {
487 if (node->isElementNode()) 488 if (node->isElementNode())
488 return toElement(node); 489 return toElement(node);
489 } 490 }
490 491
491 return 0; 492 return 0;
492 } 493 }
493 494
494 } // namespace WebCore 495 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698