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

Unified Diff: Source/core/html/HTMLAppletElement.cpp

Issue 1079953002: Better handling of broken applet codebase (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/plugins/applet-codebase-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAppletElement.cpp
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp
index 91b3cbb7d897d02c00ae4df2189ac6e4fe06c921..b62750492630ba84a99d18c31341ef6932ddaac0 100644
--- a/Source/core/html/HTMLAppletElement.cpp
+++ b/Source/core/html/HTMLAppletElement.cpp
@@ -151,7 +151,12 @@ void HTMLAppletElement::updateWidgetInternal()
// attribute is set, then 'code' points to a class inside the archive, so we need to check the
// url generated by resolving 'archive' against 'codebase'.
KURL urlToCheck;
- KURL rootURL = codeBase.isNull() ? document().url() : document().completeURL(codeBase);
+ KURL rootURL;
+ if (!codeBase.isNull())
+ rootURL = document().completeURL(codeBase);
+ if (rootURL.isNull() || !rootURL.isValid())
+ rootURL = document().url();
+
if (!archive.isNull())
urlToCheck = KURL(rootURL, archive);
else if (!code.isNull())
« no previous file with comments | « LayoutTests/plugins/applet-codebase-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698