New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put stylo's pseudo-class into a list file #15153
Merged
+120
−125
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
Put stylo's pseudo-class into a list file
- Loading branch information
commit 4bb982131be1cfb216d08e6feb66fa438d0d47c3
| @@ -0,0 +1,49 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| /* | ||
| * This file contains a helper macro includes all supported non-tree-structural | ||
| * pseudo-classes. | ||
| * | ||
| * This file is NOT INTENDED to be compiled as a standalone module. | ||
|
||
| * | ||
| * FIXME: Find a way to autogenerate this file. | ||
| * | ||
| * Expected usage is as follows: | ||
| * ``` | ||
| * fn use_pseudo_class() { | ||
| * macro_rules! pseudo_class_list { | ||
| * ( $( | ||
| * ($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt), | ||
| * )* ) => { | ||
| * // Do stuff. | ||
| * } | ||
| * } | ||
| * include!("non_ts_pseudo_class_list.rs") | ||
| * } | ||
| * ``` | ||
| * | ||
| * $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType. | ||
| * $state can be either "_" or an expression of type ElementState. | ||
| * $flags can be either "_" or an expression of type NonTSPseudoClassFlag, | ||
| * see selector_parser.rs for more details. | ||
| */ | ||
|
|
||
| pseudo_class_list! { | ||
| ("any-link", AnyLink, anyLink, _, _), | ||
| ("link", Link, link, _, _), | ||
| ("visited", Visited, visited, _, _), | ||
| ("active", Active, active, IN_ACTIVE_STATE, _), | ||
| ("focus", Focus, focus, IN_FOCUS_STATE, _), | ||
| ("fullscreen", Fullscreen, fullscreen, IN_FULLSCREEN_STATE, _), | ||
| ("hover", Hover, hover, IN_HOVER_STATE, _), | ||
emilio
Member
|
||
| ("enabled", Enabled, enabled, IN_ENABLED_STATE, _), | ||
| ("disabled", Disabled, disabled, IN_DISABLED_STATE, _), | ||
| ("checked", Checked, checked, IN_CHECKED_STATE, _), | ||
| ("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), | ||
| ("read-write", ReadWrite, _, IN_READ_WRITE_STATE, _), | ||
| ("read-only", ReadOnly, _, IN_READ_WRITE_STATE, _), | ||
|
|
||
| ("-moz-browser-frame", MozBrowserFrame, mozBrowserFrame, _, PSEUDO_CLASS_INTERNAL), | ||
| } | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This is not autogenerated right? Please note it in this comment (potentially keeping the
FIXMEthat you removed from the other file).