mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 03:02:55 +00:00
HTMLImageElement: Improve decoding stub
Add an enum and warn when setting to sync/async.
This commit is contained in:
parent
03f9915054
commit
977e77bd4a
Notes:
github-actions[bot]
2024-09-04 07:56:27 +00:00
Author: https://github.com/jdahlin 🔰
Commit: 977e77bd4a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1250
3 changed files with 40 additions and 1 deletions
|
@ -1145,4 +1145,30 @@ void HTMLImageElement::animate()
|
|||
paintable()->set_needs_display();
|
||||
}
|
||||
|
||||
StringView HTMLImageElement::decoding() const
|
||||
{
|
||||
switch (m_decoding_hint) {
|
||||
case ImageDecodingHint::Sync:
|
||||
return "sync"sv;
|
||||
case ImageDecodingHint::Async:
|
||||
return "async"sv;
|
||||
case ImageDecodingHint::Auto:
|
||||
return "auto"sv;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLImageElement::set_decoding(String decoding)
|
||||
{
|
||||
if (decoding == "sync"sv) {
|
||||
dbgln("FIXME: HTMLImageElement.decoding = 'sync' is not implemented yet");
|
||||
m_decoding_hint = ImageDecodingHint::Sync;
|
||||
} else if (decoding == "async"sv) {
|
||||
dbgln("FIXME: HTMLImageElement.decoding = 'async' is not implemented yet");
|
||||
m_decoding_hint = ImageDecodingHint::Async;
|
||||
} else
|
||||
m_decoding_hint = ImageDecodingHint::Auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue