mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibWeb: Fire iframe load event for frames with badly encoded XML
When loading an XML resource into an iframe and the resource fails to decode (e.g due to invalid UTF-8), we must still fire a load event. This fixes the regression in subtest 69 of Acid3.
This commit is contained in:
parent
bad86ca6b4
commit
fa43321938
Notes:
sideshowbarker
2024-07-17 23:00:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fa43321938 Pull-request: https://github.com/SerenityOS/serenity/pull/24011
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,10 @@
|
||||
<iframe id="i1"></iframe>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
i1.src = "data:application/xml;charset=utf-8;base64,vwo=";
|
||||
i1.onload = function() {
|
||||
println("OK");
|
||||
}
|
||||
});
|
||||
</script>
|
@ -219,12 +219,14 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_xml_document(HT
|
||||
if (!decoder->validate(data)) {
|
||||
// FIXME: Insert error message into the document.
|
||||
dbgln("XML Document contains improperly-encoded characters");
|
||||
document->completely_finish_loading();
|
||||
return;
|
||||
}
|
||||
auto source = decoder->to_utf8(data);
|
||||
if (source.is_error()) {
|
||||
// FIXME: Insert error message into the document.
|
||||
dbgln("Failed to decode XML document: {}", source.error());
|
||||
document->completely_finish_loading();
|
||||
return;
|
||||
}
|
||||
XML::Parser parser(source.value(), { .resolve_external_resource = resolve_xml_resource });
|
||||
|
Loading…
Reference in New Issue
Block a user