Revert "Add crossOrigin
property to <img> tag used for decoding (#54961)" (flutter/engine#55042)
This reverts commit acf6660982dff1f924f3438f05a41bcdba649105. Reason for revert: We broke users (including a Google internal customer) that depend on credentialed image requests. See https://github.com/flutter/flutter/issues/154809 Fixes https://github.com/flutter/flutter/issues/154809
This commit is contained in:
parent
2783af7183
commit
4a1b51bdda
@ -45,7 +45,6 @@ abstract class HtmlImageElementCodec implements ui.Codec {
|
|||||||
imgElement = createDomHTMLImageElement();
|
imgElement = createDomHTMLImageElement();
|
||||||
imgElement!.src = src;
|
imgElement!.src = src;
|
||||||
setJsProperty<String>(imgElement!, 'decoding', 'async');
|
setJsProperty<String>(imgElement!, 'decoding', 'async');
|
||||||
setJsProperty<String>(imgElement!, 'crossOrigin', 'anonymous');
|
|
||||||
|
|
||||||
// Ignoring the returned future on purpose because we're communicating
|
// Ignoring the returned future on purpose because we're communicating
|
||||||
// through the `completer`.
|
// through the `completer`.
|
||||||
|
@ -40,7 +40,6 @@ T getJsProperty<T>(Object object, String name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Set<String> _safeJsProperties = <String>{
|
const Set<String> _safeJsProperties = <String>{
|
||||||
'crossOrigin',
|
|
||||||
'decoding',
|
'decoding',
|
||||||
'__flutter_state',
|
'__flutter_state',
|
||||||
};
|
};
|
||||||
|
@ -253,19 +253,6 @@ Future<void> testMain() async {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('crossOrigin requests cause an error', () async {
|
|
||||||
final String otherOrigin =
|
|
||||||
domWindow.location.origin.replaceAll('localhost', '127.0.0.1');
|
|
||||||
bool gotError = false;
|
|
||||||
try {
|
|
||||||
final ui.Codec _ = await renderer.instantiateImageCodecFromUrl(
|
|
||||||
Uri.parse('$otherOrigin/test_images/1x1.png'));
|
|
||||||
} catch (e) {
|
|
||||||
gotError = true;
|
|
||||||
}
|
|
||||||
expect(gotError, isTrue, reason: 'Should have got CORS error');
|
|
||||||
});
|
|
||||||
|
|
||||||
_testCkAnimatedImage();
|
_testCkAnimatedImage();
|
||||||
|
|
||||||
test('isAvif', () {
|
test('isAvif', () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user