зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1690845. Don't ask Windows for the icon of an empty file extension because it returns the c: drive icon, which is not what we want. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D105736
This commit is contained in:
Родитель
45b135164f
Коммит
f0236001ca
|
@ -503,6 +503,12 @@ nsresult nsIconChannel::GetHIconFromFile(bool aNonBlocking, HICON* hIcon) {
|
||||||
filePath = u"."_ns + NS_ConvertUTF8toUTF16(defFileExt);
|
filePath = u"."_ns + NS_ConvertUTF8toUTF16(defFileExt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!localFile && !fileExists &&
|
||||||
|
((filePath.Length() == 1 && filePath.Last() == '.') ||
|
||||||
|
filePath.Length() == 0)) {
|
||||||
|
filePath = u".MozBogusExtensionMoz"_ns;
|
||||||
|
}
|
||||||
|
|
||||||
if (aNonBlocking) {
|
if (aNonBlocking) {
|
||||||
RefPtr<nsIEventTarget> target = DecodePool::Singleton()->GetIOEventTarget();
|
RefPtr<nsIEventTarget> target = DecodePool::Singleton()->GetIOEventTarget();
|
||||||
RefPtr<IconAsyncOpenTask> task = new IconAsyncOpenTask(
|
RefPtr<IconAsyncOpenTask> task = new IconAsyncOpenTask(
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- this should draw an icon similar to a blank document but with writing on it -->
|
||||||
|
<img src="moz-icon://.txt?size=16">
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- this draws the icon for current directory on the c: drive on windows -->
|
||||||
|
<img src="moz-icon:file:///C:/?size=16">
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- this draws the icon for the c: drive on windows -->
|
||||||
|
<img src="moz-icon:file:///C://?size=16">
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- this should draw a blank document icon -->
|
||||||
|
<img src="moz-icon://bogus-unrecognized-icon.bogusunknown845?size=16">
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!-- this should draw a blank document icon -->
|
||||||
|
<img src="moz-icon://test?size=16&contentType=application/octet-stream">
|
|
@ -1,2 +1,6 @@
|
||||||
HTTP == accept-image-catchall.html accept-image-catchall-ref.html
|
HTTP == accept-image-catchall.html accept-image-catchall-ref.html
|
||||||
skip-if(Android) != moz-icon-1.html about:blank
|
skip-if(Android) != moz-icon-1.html about:blank
|
||||||
|
== moz-icon-blank-1.html moz-icon-blank-1-ref.html
|
||||||
|
skip-if(Android) != moz-icon-blank-1-ref.html moz-icon-blank-1-antiref.html
|
||||||
|
skip-if(Android) != moz-icon-blank-1-ref.html moz-icon-blank-1-antiref2.html
|
||||||
|
fuzzy-if(OSX,44-44,335-335) fuzzy-if(winWidget,64-78,45-68) == moz-icon-blank-1-almostref.html moz-icon-blank-1-ref.html
|
||||||
|
|
Загрузка…
Ссылка в новой задаче