-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement scripting media query support
This change adds support for parsing the scripting media query. This change also implements the logic for matching this query. none matches when script is disabled, enabled matches when enabled. initial-only never matches as per w3c/csswg-drafts#8621. Spec: https://drafts.csswg.org/mediaqueries-5/#scripting Bug: 1467097 Change-Id: I7e6fba0fc4b05d133e177c7e2883b1f22fea48b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4794549 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Luke <lukewarlow156@gmail.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1188355}
- Loading branch information
1 parent
46c79ed
commit 844e122
Showing
23 changed files
with
255 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_CSS_SCRIPTING_H_ | ||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_CSS_SCRIPTING_H_ | ||
|
||
namespace blink { | ||
|
||
enum class Scripting { | ||
// Scripting is not supported or not enabled. | ||
kNone, | ||
// Scripting is supported and enabled, but only for initial page load | ||
// We will never match this value as it is intended for non-browser user | ||
// agents, but it is part of the spec so we should still parse it. | ||
// See https://github.com/w3c/csswg-drafts/issues/8621 | ||
kInitialOnly, | ||
// Scripting is supported and enabled. | ||
kEnabled, | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_CSS_SCRIPTING_H_ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1727,5 +1727,10 @@ | |
// size, | ||
"snap", | ||
// sticky, | ||
|
||
// (scripting:) media feature | ||
"enabled", | ||
"initial-only", | ||
// none | ||
], | ||
} |
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 |
---|---|---|
|
@@ -74,5 +74,6 @@ | |
"snapped", | ||
"stuck", | ||
"inverted-colors", | ||
"scripting", | ||
], | ||
} |
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
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
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
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
Oops, something went wrong.