| marker-probe.py |
Read which token paints a property per state, with marker values on :root.
Lifts the remote-control cue, sets one distinct rgb marker per --token on the
chrome document's root, locks each --state's pseudo-classes on the element (or
on its --lock-on ancestor), finishes the transitions the lock starts, reads
--property off each --element, maps the value back to the token, and restores
the root's style attribute and the cue. Runs in the chrome context through
toolkit/themes/tools/probelib.py, headless, on a throwaway profile:
./mach python --virtualenv wpt -- marker-probe.py --binary <objdir>/dist/bin/firefox \\
--property fill --token x-fill --token x-fill-hover \\
--element '#some-button .toolbarbutton-icon' --lock-on toolbarbutton \\
--state default --state :hover --state :hover:active
A --token is the custom property's name with or without its leading dashes
(argparse rejects a bare "--x" value, so "x" or "--token=--x"). A --state is
"default" or a run of element-state pseudo-classes (":hover:active"); without
any, the run reads default, :hover and :hover:active. :hover and :active lock
on every flat-tree ancestor of the locked element too, as a real pointer sets
them (./mach theme contrast and ./mach theme check-hcm-colors lock the same way); any other pseudo-class
locks on that element only. --lock-on names the ancestor to lock when
--element is the thing read, which matters for the pseudo-classes that do not
climb; --read names the descendant to read when the state is locked on
--element itself. The selectors do not cross shadow roots. Attribute states
([open], [checked]) need a hand-written --async probe. Where forced colors are
`active` (e.g. under a forcedColorsOverride in --chrome-setup), the adjustment
replaces the rgb markers on the properties it forces and the token reads null;
the run then warns on stderr and in the JSON's "warning".
The launch flags, --url, --window-size, --chrome-setup* and --steps are
probelib.py's, as in firefox-probe.py. Exits 1 when an --element matches
nothing, a --read matches no descendant, a --lock-on selector matches no
ancestor, or a lock did not take (InspectorUtils.hasPseudoClassLock is false:
not an element-state pseudo-class, or a typo); the JSON is printed either way.
|
9908 |
- |