mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1170207 - allow overrides of chrome://../skin/ URIs with other chrome://../skin/ URIs within skin manifests, r=bsmedberg
This commit is contained in:
parent
8e85bbdf4a
commit
ad6bd576e5
@ -947,6 +947,29 @@ nsChromeRegistryChrome::ManifestOverride(ManifestProcessingContext& cx, int line
|
||||
return;
|
||||
}
|
||||
|
||||
if (cx.mType == NS_SKIN_LOCATION) {
|
||||
bool chromeSkinOnly = false;
|
||||
nsresult rv = chromeuri->SchemeIs("chrome", &chromeSkinOnly);
|
||||
chromeSkinOnly = chromeSkinOnly && NS_SUCCEEDED(rv);
|
||||
if (chromeSkinOnly) {
|
||||
rv = resolveduri->SchemeIs("chrome", &chromeSkinOnly);
|
||||
chromeSkinOnly = chromeSkinOnly && NS_SUCCEEDED(rv);
|
||||
}
|
||||
if (chromeSkinOnly) {
|
||||
nsAutoCString chromePath, resolvedPath;
|
||||
chromeuri->GetPath(chromePath);
|
||||
resolveduri->GetPath(resolvedPath);
|
||||
chromeSkinOnly = StringBeginsWith(chromePath, NS_LITERAL_CSTRING("/skin/")) &&
|
||||
StringBeginsWith(resolvedPath, NS_LITERAL_CSTRING("/skin/"));
|
||||
}
|
||||
if (!chromeSkinOnly) {
|
||||
LogMessageWithContext(cx.GetManifestURI(), lineno, nsIScriptError::warningFlag,
|
||||
"Cannot register non-chrome://.../skin/ URIs '%s' and '%s' as overrides and/or to be overridden from a skin manifest.",
|
||||
chrome, resolved);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!CanLoadResource(resolveduri)) {
|
||||
LogMessageWithContext(cx.GetManifestURI(), lineno, nsIScriptError::warningFlag,
|
||||
"Cannot register non-local URI '%s' for an override.", resolved);
|
||||
|
@ -135,7 +135,9 @@ static const ManifestDirective kParsingTable[] = {
|
||||
nullptr, &nsChromeRegistry::ManifestStyle, nullptr
|
||||
},
|
||||
{
|
||||
"override", 2, false, true, true, true, false,
|
||||
// NB: note that while skin manifests can use this, they are only allowed
|
||||
// to use it for chrome://../skin/ URLs
|
||||
"override", 2, false, false, true, true, false,
|
||||
nullptr, &nsChromeRegistry::ManifestOverride, nullptr
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user