Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[MQ4] Implement
update
media feature
https://bugs.webkit.org/show_bug.cgi?id=180245 rdar://35799713 Reviewed by Darin Adler. From https://drafts.csswg.org/mediaqueries/#update : The update media feature is used to query the ability of the output device to modify the appearance of content once it has been rendered. It accepts the following values: - none Once it has been rendered, the layout can no longer be updated. Example: documents printed on paper. - slow The layout may change dynamically according to the usual rules of CSS, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation. Example: E-ink screens or severely under-powered devices. - fast The layout may change dynamically according to the usual rules of CSS, and the output device is not unusually constrained in speed, so regularly-updating things like CSS Animations can be used. Example: computer screens. This is part of Interop 2023. Also update overflow-block: paged to match on print mediums. * LayoutTests/fast/css/media-query-overflow-block-paged-print-expected.html: Added. * LayoutTests/fast/css/media-query-overflow-block-paged-print.html: Added. * LayoutTests/fast/css/media-query-update-none-expected.html: Added. * LayoutTests/fast/css/media-query-update-none.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt: * Source/WebCore/css/query/MediaQueryFeatures.cpp: (WebCore::MQ::Features::update): (WebCore::MQ::Features::overflowBlock): * Source/WebCore/css/query/MediaQueryFeatures.h: Canonical link: https://commits.webkit.org/265277@main
- Loading branch information
Showing
7 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
LayoutTests/fast/css/media-query-overflow-block-paged-print-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<html style="color: green;"><p>This text should be green in paginated mode.</p></html> |
28 changes: 28 additions & 0 deletions
28
LayoutTests/fast/css/media-query-overflow-block-paged-print.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<style> | ||
:root { | ||
color: blue; | ||
} | ||
@media (overflow-block: paged) { | ||
:root { | ||
color: green; | ||
} | ||
} | ||
@media (overflow-block: scroll) { | ||
:root { | ||
color: red; | ||
} | ||
} | ||
@media (overflow-block: none) { | ||
:root { | ||
color: red; | ||
} | ||
} | ||
</style> | ||
<p>This text should be green in paginated mode.</p> | ||
<script> | ||
if (window.internals) | ||
internals.settings.setMediaTypeOverride("print"); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<p style="color: green">This text should be green when printing.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<style> | ||
:root { | ||
color: blue; | ||
} | ||
@media (update: none) { | ||
:root { | ||
color: green; | ||
} | ||
} | ||
@media (update: fast) { | ||
:root { | ||
color: red; | ||
} | ||
} | ||
@media (update: slow) { | ||
:root { | ||
color: red; | ||
} | ||
} | ||
</style> | ||
<p>This text should be green when printing.</p> | ||
<script> | ||
if (window.internals) | ||
internals.settings.setMediaTypeOverride("print"); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters