Bug 243204 - ImageDocument should support dark mode
Summary: ImageDocument should support dark mode
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-26 01:32 PDT by Pascal Abresch
Modified: 2024-07-26 05:43 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.83 KB, patch)
2022-08-01 12:47 PDT, Pascal Abresch
nep-webkit: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Abresch 2022-07-26 01:32:17 PDT
Currently images will open with a white frame in epiphany and ios Safari.

Adding color-scheme: light dark; to the document should fix this.

similar to https://bugs.webkit.org/show_bug.cgi?id=242950
Comment 1 Pascal Abresch 2022-07-26 01:36:59 PDT
https://github.com/WebKit/WebKit/pull/2734
Comment 2 Pascal Abresch 2022-08-01 12:47:15 PDT
Created attachment 461339 [details]
Patch
Comment 3 Darin Adler 2022-08-01 14:50:10 PDT
Comment on attachment 461339 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=461339&action=review

Thanks, I think this is a good idea.

> LayoutTests/fast/loader/image-document-dark-mode.html:5
> +<iframe src="resources/image@test.png">

Can we instead construct a test that uses a dark mode document with an image element in it in the expected.html? The reason I suggest this is that an expected.html test is even more useful than a mismatch.html for catching future mistakes. And also, a test structured in that way could probably be turned on everywhere; it would automatically do the right thing on platforms with no dark mode support. The only tricky thing about such a test might be matching the layout that you’d get with an iframe that directly references an image, but I think that’s something likely to stay stable for a long time.
Comment 4 Darin Adler 2022-08-01 14:51:58 PDT
I wish we had done that for bug 242950 too.

I wouldn’t block landing this for that test change, but I think we should improve these tests.
Comment 5 Radar WebKit Bug Importer 2022-08-02 01:33:15 PDT
<rdar://problem/97965029>
Comment 6 Pascal Abresch 2022-08-05 01:18:01 PDT
I can work on improving the test next week.