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

Unified Diff: third_party/WebKit/Source/core/svg/SVGURIReference.h

Issue 1842643003: Iframe with srcDoc should resolve FragmentURIs internally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/LayoutTests/svg/as-iframe/svg-in-iframe-srcdoc-with-fragment-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGURIReference.h
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.h b/third_party/WebKit/Source/core/svg/SVGURIReference.h
index 4653189df74101d1862cfa08e07e2a1298d1bae9..4d846d8ff7d993843e4950bf90c56ecfaf1c0c82 100644
--- a/third_party/WebKit/Source/core/svg/SVGURIReference.h
+++ b/third_party/WebKit/Source/core/svg/SVGURIReference.h
@@ -50,9 +50,9 @@ public:
static inline bool isExternalURIReference(const String& uri, const Document& document)
{
- // Fragment-only URIs are always internal if the baseURL is same as the document URL.
+ // Fragment-only URIs are always internal if the baseURL is same as the document URL or for srcdoc document.
// This is common case, so check that first to avoid resolving URL (which is relatively expensive). See crbug.com/557979
- if (document.baseURL() == document.url() && uri.startsWith('#'))
+ if ((document.isSrcdocDocument() || document.baseURL() == document.url()) && uri.startsWith('#'))
return false;
// If the URI matches our documents URL, we're dealing with a local reference.
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/as-iframe/svg-in-iframe-srcdoc-with-fragment-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698