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

Unified Diff: Source/core/rendering/HitTestResult.cpp

Issue 457013002: Avoid absoluteImageURL() creating data URLs for canvas by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix failing copyImageAt unit test Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/HitTestResult.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/HitTestResult.cpp
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index 8adfdb5409e5ae43551ad227af2eec6d83991285..96fdf8f42f756621a563d7b7eb751cdb6f7158c8 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -284,6 +284,16 @@ IntRect HitTestResult::imageRect() const
KURL HitTestResult::absoluteImageURL() const
{
+ return absoluteImageURLInternal(false);
+}
+
+KURL HitTestResult::absoluteImageURLIncludingCanvasDataURL() const
+{
+ return absoluteImageURLInternal(true);
+}
+
+KURL HitTestResult::absoluteImageURLInternal(bool allowCanvas) const
+{
if (!m_innerNonSharedNode)
return KURL();
@@ -292,7 +302,7 @@ KURL HitTestResult::absoluteImageURL() const
return KURL();
AtomicString urlString;
- if (isHTMLCanvasElement(*m_innerNonSharedNode)
+ if ((allowCanvas && isHTMLCanvasElement(*m_innerNonSharedNode))
|| isHTMLEmbedElement(*m_innerNonSharedNode)
|| isHTMLImageElement(*m_innerNonSharedNode)
|| isHTMLInputElement(*m_innerNonSharedNode)
« no previous file with comments | « Source/core/rendering/HitTestResult.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698