layout/style/nsCSSPseudoClassList.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* atom list for CSS pseudo-classes */
michael@0 7
michael@0 8 /*
michael@0 9 * This file contains the list of nsIAtoms and their values for CSS
michael@0 10 * pseudo-classes. It is designed to be used as inline input to
michael@0 11 * nsCSSPseudoClasses.cpp *only* through the magic of C preprocessing.
michael@0 12 * All entries must be enclosed in the macros CSS_PSEUDO_CLASS,
michael@0 13 * CSS_STATE_DEPENDENT_PSEUDO_CLASS, or CSS_STATE_PSEUDO_CLASS which
michael@0 14 * will have cruel and unusual things done to them. The entries should
michael@0 15 * be kept in some sort of logical order. The first argument to
michael@0 16 * CSS_PSEUDO_CLASS is the C++ identifier of the atom. The second
michael@0 17 * argument is the string value of the atom. The third argument is the
michael@0 18 * name of the preference controlling whether the pseudo-class is
michael@0 19 * recognized by the parser, or the empty string if it's unconditional.
michael@0 20 *
michael@0 21 * CSS_STATE_DEPENDENT_PSEUDO_CLASS and CSS_STATE_PSEUDO_CLASS also take
michael@0 22 * the name of the state bits that the class corresponds to. Only one
michael@0 23 * of the bits needs to match for a CSS_STATE_PSEUDO_CLASS to match;
michael@0 24 * CSS_STATE_DEPENDENT_PSEUDO_CLASS matching depends on a customized per-class
michael@0 25 * algorithm which should be defined in SelectorMatches() in
michael@0 26 * nsCSSRuleProcessor.cpp.
michael@0 27 *
michael@0 28 * If CSS_STATE_PSEUDO_CLASS is not defined, it'll be automatically
michael@0 29 * defined to CSS_STATE_DEPENDENT_PSEUDO_CLASS;
michael@0 30 * if CSS_STATE_DEPENDENT_PSEUDO_CLASS is not defined, it'll be
michael@0 31 * automatically defined to CSS_PSEUDO_CLASS.
michael@0 32 */
michael@0 33
michael@0 34 // OUTPUT_CLASS=nsCSSPseudoClasses
michael@0 35 // MACRO_NAME=CSS_PSEUDO_CLASS
michael@0 36
michael@0 37 #ifdef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 38 #error "CSS_STATE_DEPENDENT_PSEUDO_CLASS shouldn't be defined"
michael@0 39 #endif
michael@0 40
michael@0 41 #ifndef CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 42 #define CSS_STATE_DEPENDENT_PSEUDO_CLASS(_name, _value, _pref, _bit) \
michael@0 43 CSS_PSEUDO_CLASS(_name, _value, _pref)
michael@0 44 #define DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 45 #endif
michael@0 46
michael@0 47 #ifdef DEFINED_CSS_STATE_PSEUDO_CLASS
michael@0 48 #error "CSS_STATE_PSEUDO_CLASS shouldn't be defined"
michael@0 49 #endif
michael@0 50
michael@0 51 #ifndef CSS_STATE_PSEUDO_CLASS
michael@0 52 #define CSS_STATE_PSEUDO_CLASS(_name, _value, _pref, _bit) \
michael@0 53 CSS_STATE_DEPENDENT_PSEUDO_CLASS(_name, _value, _pref, _bit)
michael@0 54 #define DEFINED_CSS_STATE_PSEUDO_CLASS
michael@0 55 #endif
michael@0 56
michael@0 57 // The CSS_PSEUDO_CLASS entries should all come before the
michael@0 58 // CSS_STATE_PSEUDO_CLASS entries. The CSS_PSEUDO_CLASS entry order
michael@0 59 // must be the same as the order of cases in SelectorMatches. :not
michael@0 60 // must be the last CSS_PSEUDO_CLASS.
michael@0 61
michael@0 62 CSS_PSEUDO_CLASS(empty, ":empty", "")
michael@0 63 CSS_PSEUDO_CLASS(mozOnlyWhitespace, ":-moz-only-whitespace", "")
michael@0 64 CSS_PSEUDO_CLASS(mozEmptyExceptChildrenWithLocalname, ":-moz-empty-except-children-with-localname", "")
michael@0 65 CSS_PSEUDO_CLASS(lang, ":lang", "")
michael@0 66 CSS_PSEUDO_CLASS(mozBoundElement, ":-moz-bound-element", "")
michael@0 67 CSS_PSEUDO_CLASS(root, ":root", "")
michael@0 68 CSS_PSEUDO_CLASS(any, ":-moz-any", "")
michael@0 69
michael@0 70 CSS_PSEUDO_CLASS(firstChild, ":first-child", "")
michael@0 71 CSS_PSEUDO_CLASS(firstNode, ":-moz-first-node", "")
michael@0 72 CSS_PSEUDO_CLASS(lastChild, ":last-child", "")
michael@0 73 CSS_PSEUDO_CLASS(lastNode, ":-moz-last-node", "")
michael@0 74 CSS_PSEUDO_CLASS(onlyChild, ":only-child", "")
michael@0 75 CSS_PSEUDO_CLASS(firstOfType, ":first-of-type", "")
michael@0 76 CSS_PSEUDO_CLASS(lastOfType, ":last-of-type", "")
michael@0 77 CSS_PSEUDO_CLASS(onlyOfType, ":only-of-type", "")
michael@0 78 CSS_PSEUDO_CLASS(nthChild, ":nth-child", "")
michael@0 79 CSS_PSEUDO_CLASS(nthLastChild, ":nth-last-child", "")
michael@0 80 CSS_PSEUDO_CLASS(nthOfType, ":nth-of-type", "")
michael@0 81 CSS_PSEUDO_CLASS(nthLastOfType, ":nth-last-of-type", "")
michael@0 82
michael@0 83 // Match nodes that are HTML but not XHTML
michael@0 84 CSS_PSEUDO_CLASS(mozIsHTML, ":-moz-is-html", "")
michael@0 85
michael@0 86 // Matches anything when the specified look-and-feel metric is set
michael@0 87 CSS_PSEUDO_CLASS(mozSystemMetric, ":-moz-system-metric", "")
michael@0 88
michael@0 89 // -moz-locale-dir(ltr) and -moz-locale-dir(rtl) may be used
michael@0 90 // to match based on the locale's chrome direction
michael@0 91 CSS_PSEUDO_CLASS(mozLocaleDir, ":-moz-locale-dir", "")
michael@0 92
michael@0 93 // -moz-lwtheme may be used to match a document that has a lightweight theme
michael@0 94 CSS_PSEUDO_CLASS(mozLWTheme, ":-moz-lwtheme", "")
michael@0 95
michael@0 96 // -moz-lwtheme-brighttext matches a document that has a dark lightweight theme
michael@0 97 CSS_PSEUDO_CLASS(mozLWThemeBrightText, ":-moz-lwtheme-brighttext", "")
michael@0 98
michael@0 99 // -moz-lwtheme-darktext matches a document that has a bright lightweight theme
michael@0 100 CSS_PSEUDO_CLASS(mozLWThemeDarkText, ":-moz-lwtheme-darktext", "")
michael@0 101
michael@0 102 // Matches anything when the containing window is inactive
michael@0 103 CSS_PSEUDO_CLASS(mozWindowInactive, ":-moz-window-inactive", "")
michael@0 104
michael@0 105 // Matches any table elements that have a nonzero border attribute,
michael@0 106 // according to HTML integer attribute parsing rules.
michael@0 107 CSS_PSEUDO_CLASS(mozTableBorderNonzero, ":-moz-table-border-nonzero", "")
michael@0 108
michael@0 109 // Matches whatever the contextual reference elements are for the
michael@0 110 // matching operation.
michael@0 111 CSS_PSEUDO_CLASS(scope, ":scope", "layout.css.scope-pseudo.enabled")
michael@0 112
michael@0 113 // :not needs to come at the end of the non-bit pseudo-class list, since
michael@0 114 // it doesn't actually get directly matched on in SelectorMatches.
michael@0 115 CSS_PSEUDO_CLASS(notPseudo, ":not", "")
michael@0 116
michael@0 117 // :-moz-dir(ltr) and :-moz-dir(rtl) match elements whose resolved
michael@0 118 // directionality in the markup language is ltr or rtl respectively
michael@0 119 CSS_STATE_DEPENDENT_PSEUDO_CLASS(dir, ":-moz-dir", "",
michael@0 120 NS_EVENT_STATE_LTR | NS_EVENT_STATE_RTL)
michael@0 121
michael@0 122 CSS_STATE_PSEUDO_CLASS(link, ":link", "", NS_EVENT_STATE_UNVISITED)
michael@0 123 // what matches :link or :visited
michael@0 124 CSS_STATE_PSEUDO_CLASS(mozAnyLink, ":-moz-any-link", "",
michael@0 125 NS_EVENT_STATE_VISITED | NS_EVENT_STATE_UNVISITED)
michael@0 126 CSS_STATE_PSEUDO_CLASS(visited, ":visited", "", NS_EVENT_STATE_VISITED)
michael@0 127
michael@0 128 CSS_STATE_PSEUDO_CLASS(active, ":active", "", NS_EVENT_STATE_ACTIVE)
michael@0 129 CSS_STATE_PSEUDO_CLASS(checked, ":checked", "", NS_EVENT_STATE_CHECKED)
michael@0 130 CSS_STATE_PSEUDO_CLASS(disabled, ":disabled", "", NS_EVENT_STATE_DISABLED)
michael@0 131 CSS_STATE_PSEUDO_CLASS(enabled, ":enabled", "", NS_EVENT_STATE_ENABLED)
michael@0 132 CSS_STATE_PSEUDO_CLASS(focus, ":focus", "", NS_EVENT_STATE_FOCUS)
michael@0 133 CSS_STATE_PSEUDO_CLASS(hover, ":hover", "", NS_EVENT_STATE_HOVER)
michael@0 134 CSS_STATE_PSEUDO_CLASS(mozDragOver, ":-moz-drag-over", "", NS_EVENT_STATE_DRAGOVER)
michael@0 135 CSS_STATE_PSEUDO_CLASS(target, ":target", "", NS_EVENT_STATE_URLTARGET)
michael@0 136 CSS_STATE_PSEUDO_CLASS(indeterminate, ":indeterminate", "",
michael@0 137 NS_EVENT_STATE_INDETERMINATE)
michael@0 138
michael@0 139 CSS_STATE_PSEUDO_CLASS(mozDevtoolsHighlighted, ":-moz-devtools-highlighted", "",
michael@0 140 NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED)
michael@0 141
michael@0 142 // Matches the element which is being displayed full-screen, and
michael@0 143 // any containing frames.
michael@0 144 CSS_STATE_PSEUDO_CLASS(mozFullScreen, ":-moz-full-screen", "", NS_EVENT_STATE_FULL_SCREEN)
michael@0 145
michael@0 146 // Matches any element which is an ancestor of the DOM full-screen element,
michael@0 147 // or an ancestor of a containing frame of the full-screen element.
michael@0 148 CSS_STATE_PSEUDO_CLASS(mozFullScreenAncestor, ":-moz-full-screen-ancestor", "", NS_EVENT_STATE_FULL_SCREEN_ANCESTOR)
michael@0 149
michael@0 150 // Matches if the element is focused and should show a focus ring
michael@0 151 CSS_STATE_PSEUDO_CLASS(mozFocusRing, ":-moz-focusring", "", NS_EVENT_STATE_FOCUSRING)
michael@0 152
michael@0 153 // Image, object, etc state pseudo-classes
michael@0 154 CSS_STATE_PSEUDO_CLASS(mozBroken, ":-moz-broken", "", NS_EVENT_STATE_BROKEN)
michael@0 155 CSS_STATE_PSEUDO_CLASS(mozUserDisabled, ":-moz-user-disabled", "",
michael@0 156 NS_EVENT_STATE_USERDISABLED)
michael@0 157 CSS_STATE_PSEUDO_CLASS(mozSuppressed, ":-moz-suppressed", "",
michael@0 158 NS_EVENT_STATE_SUPPRESSED)
michael@0 159 CSS_STATE_PSEUDO_CLASS(mozLoading, ":-moz-loading", "", NS_EVENT_STATE_LOADING)
michael@0 160 CSS_STATE_PSEUDO_CLASS(mozTypeUnsupported, ":-moz-type-unsupported", "",
michael@0 161 NS_EVENT_STATE_TYPE_UNSUPPORTED)
michael@0 162 CSS_STATE_PSEUDO_CLASS(mozTypeUnsupportedPlatform, ":-moz-type-unsupported-platform", "",
michael@0 163 NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM)
michael@0 164 CSS_STATE_PSEUDO_CLASS(mozHandlerClickToPlay, ":-moz-handler-clicktoplay", "",
michael@0 165 NS_EVENT_STATE_TYPE_CLICK_TO_PLAY)
michael@0 166 CSS_STATE_PSEUDO_CLASS(mozHandlerPlayPreview, ":-moz-handler-playpreview", "",
michael@0 167 NS_EVENT_STATE_TYPE_PLAY_PREVIEW)
michael@0 168 CSS_STATE_PSEUDO_CLASS(mozHandlerVulnerableUpdatable, ":-moz-handler-vulnerable-updatable", "",
michael@0 169 NS_EVENT_STATE_VULNERABLE_UPDATABLE)
michael@0 170 CSS_STATE_PSEUDO_CLASS(mozHandlerVulnerableNoUpdate, ":-moz-handler-vulnerable-no-update", "",
michael@0 171 NS_EVENT_STATE_VULNERABLE_NO_UPDATE)
michael@0 172 CSS_STATE_PSEUDO_CLASS(mozHandlerDisabled, ":-moz-handler-disabled", "",
michael@0 173 NS_EVENT_STATE_HANDLER_DISABLED)
michael@0 174 CSS_STATE_PSEUDO_CLASS(mozHandlerBlocked, ":-moz-handler-blocked", "",
michael@0 175 NS_EVENT_STATE_HANDLER_BLOCKED)
michael@0 176 CSS_STATE_PSEUDO_CLASS(mozHandlerCrashed, ":-moz-handler-crashed", "",
michael@0 177 NS_EVENT_STATE_HANDLER_CRASHED)
michael@0 178
michael@0 179 CSS_STATE_PSEUDO_CLASS(mozMathIncrementScriptLevel,
michael@0 180 ":-moz-math-increment-script-level", "",
michael@0 181 NS_EVENT_STATE_INCREMENT_SCRIPT_LEVEL)
michael@0 182
michael@0 183 // CSS 3 UI
michael@0 184 // http://www.w3.org/TR/2004/CR-css3-ui-20040511/#pseudo-classes
michael@0 185 CSS_STATE_PSEUDO_CLASS(required, ":required", "", NS_EVENT_STATE_REQUIRED)
michael@0 186 CSS_STATE_PSEUDO_CLASS(optional, ":optional", "", NS_EVENT_STATE_OPTIONAL)
michael@0 187 CSS_STATE_PSEUDO_CLASS(valid, ":valid", "", NS_EVENT_STATE_VALID)
michael@0 188 CSS_STATE_PSEUDO_CLASS(invalid, ":invalid", "", NS_EVENT_STATE_INVALID)
michael@0 189 CSS_STATE_PSEUDO_CLASS(inRange, ":in-range", "", NS_EVENT_STATE_INRANGE)
michael@0 190 CSS_STATE_PSEUDO_CLASS(outOfRange, ":out-of-range", "", NS_EVENT_STATE_OUTOFRANGE)
michael@0 191 CSS_STATE_PSEUDO_CLASS(defaultPseudo, ":default", "", NS_EVENT_STATE_DEFAULT)
michael@0 192 CSS_STATE_PSEUDO_CLASS(mozReadOnly, ":-moz-read-only", "",
michael@0 193 NS_EVENT_STATE_MOZ_READONLY)
michael@0 194 CSS_STATE_PSEUDO_CLASS(mozReadWrite, ":-moz-read-write", "",
michael@0 195 NS_EVENT_STATE_MOZ_READWRITE)
michael@0 196 CSS_STATE_PSEUDO_CLASS(mozSubmitInvalid, ":-moz-submit-invalid", "",
michael@0 197 NS_EVENT_STATE_MOZ_SUBMITINVALID)
michael@0 198 CSS_STATE_PSEUDO_CLASS(mozUIInvalid, ":-moz-ui-invalid", "",
michael@0 199 NS_EVENT_STATE_MOZ_UI_INVALID)
michael@0 200 CSS_STATE_PSEUDO_CLASS(mozUIValid, ":-moz-ui-valid", "",
michael@0 201 NS_EVENT_STATE_MOZ_UI_VALID)
michael@0 202 CSS_STATE_PSEUDO_CLASS(mozMeterOptimum, ":-moz-meter-optimum", "",
michael@0 203 NS_EVENT_STATE_OPTIMUM)
michael@0 204 CSS_STATE_PSEUDO_CLASS(mozMeterSubOptimum, ":-moz-meter-sub-optimum", "",
michael@0 205 NS_EVENT_STATE_SUB_OPTIMUM)
michael@0 206 CSS_STATE_PSEUDO_CLASS(mozMeterSubSubOptimum, ":-moz-meter-sub-sub-optimum", "",
michael@0 207 NS_EVENT_STATE_SUB_SUB_OPTIMUM)
michael@0 208
michael@0 209 // Those values should be parsed but do nothing.
michael@0 210 CSS_STATE_PSEUDO_CLASS(mozPlaceholder, ":-moz-placeholder", "", NS_EVENT_STATE_IGNORE)
michael@0 211
michael@0 212 #ifdef DEFINED_CSS_STATE_PSEUDO_CLASS
michael@0 213 #undef DEFINED_CSS_STATE_PSEUDO_CLASS
michael@0 214 #undef CSS_STATE_PSEUDO_CLASS
michael@0 215 #endif
michael@0 216
michael@0 217 #ifdef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 218 #undef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 219 #undef CSS_STATE_DEPENDENT_PSEUDO_CLASS
michael@0 220 #endif

mercurial