Implement overflow-block and overflow-inline media features.

In current implementation only printing vs other devices is differentiated.

Currently overflow-block will not support (none) as there is no way
to understand we have a billboard.

https://drafts.csswg.org/mediaqueries-4/#mf-overflow-block
https://drafts.csswg.org/mediaqueries-4/#mf-overflow-inline

Fixed: 790911
Change-Id: I6462b1685716f66f5a6267d26bf3f96e864bd58d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4279967
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108951}
diff --git a/css/mediaqueries/overflow-media-features.html b/css/mediaqueries/overflow-media-features.html
new file mode 100644
index 0000000..fb98331
--- /dev/null
+++ b/css/mediaqueries/overflow-media-features.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>CSS Media Queries Test: overflow media features</title>
+<link rel="help" href="https://drafts.csswg.org/mediaqueries-4/#descdef-media-update">
+<meta assert="The test is supposed to be run on computer displays as it will no match otherwise">
+<script type="text/javascript" src="/resources/testharness.js"></script>
+<script type="text/javascript" src="/resources/testharnessreport.js"></script>
+<script type="text/javascript" src="resources/matchmedia-utils.js"></script>
+
+<script>
+query_should_be_known("(overflow-inline)");
+query_should_be_known("(overflow-inline: none)");
+query_should_be_known("(overflow-inline: scroll)");
+
+query_should_be_unknown("overflow-inline");
+query_should_be_unknown("(overflow-inline: ?)");
+query_should_be_unknown("(overflow-inline: 10px)");
+query_should_be_unknown("(overflow-inline: 0)");
+
+query_should_be_known("(overflow-block)");
+query_should_be_known("(overflow-block: none)");
+query_should_be_known("(overflow-block: scroll)");
+query_should_be_known("(overflow-block: paged)");
+
+query_should_be_unknown("overflow-block");
+query_should_be_unknown("(overflow-block: ?)");
+query_should_be_unknown("(overflow-block: 10px)");
+query_should_be_unknown("(overflow-block: 0)");
+
+test(() => {
+  let match_standard = window.matchMedia("(overflow-inline: scroll)");
+  assert_true(match_standard.matches);
+}, "Check that overflow-inline: scroll always matches non printing documents");
+
+test(() => {
+  let match_standard = window.matchMedia("(overflow-block: scroll)");
+  assert_true(match_standard.matches);
+}, "Check that overflow-block: scroll always matches non printing documents");
+
+test(() => {
+  let match_standard = window.matchMedia("(overflow-inline: none)");
+  assert_false(match_standard.matches);
+}, "Check that overflow-inline: none doesn't match non printing documents");
+
+test(() => {
+  let match_standard = window.matchMedia("(overflow-block: none)");
+  assert_false(match_standard.matches);
+}, "Check that overflow-block: none doesn't match non printing documents");
+
+test(() => {
+  let match_standard = window.matchMedia("(overflow-block: paged)");
+  assert_false(match_standard.matches);
+}, "Check that overflow-block: paged doesn't match non printing documents");
+</script>
diff --git a/css/mediaqueries/test_media_queries.html b/css/mediaqueries/test_media_queries.html
index 6a91c11..fe3ba81 100644
--- a/css/mediaqueries/test_media_queries.html
+++ b/css/mediaqueries/test_media_queries.html
@@ -589,7 +589,7 @@
     expression_should_be_known("overflow-block: none")
     expression_should_be_known("overflow-block: paged")
     expression_should_be_known("overflow-block: scroll")
-    expression_should_be_known("overflow-block: optional-paged")
+    expression_should_be_unknown("overflow-block: optional-paged")
     expression_should_be_unknown("overflow-block: some-random-invalid-thing")
 
     // Sanity check for overflow-block