michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* atom list for CSS pseudo-classes */ michael@0: michael@0: /* michael@0: * This file contains the list of nsIAtoms and their values for CSS michael@0: * pseudo-classes. It is designed to be used as inline input to michael@0: * nsCSSPseudoClasses.cpp *only* through the magic of C preprocessing. michael@0: * All entries must be enclosed in the macros CSS_PSEUDO_CLASS, michael@0: * CSS_STATE_DEPENDENT_PSEUDO_CLASS, or CSS_STATE_PSEUDO_CLASS which michael@0: * will have cruel and unusual things done to them. The entries should michael@0: * be kept in some sort of logical order. The first argument to michael@0: * CSS_PSEUDO_CLASS is the C++ identifier of the atom. The second michael@0: * argument is the string value of the atom. The third argument is the michael@0: * name of the preference controlling whether the pseudo-class is michael@0: * recognized by the parser, or the empty string if it's unconditional. michael@0: * michael@0: * CSS_STATE_DEPENDENT_PSEUDO_CLASS and CSS_STATE_PSEUDO_CLASS also take michael@0: * the name of the state bits that the class corresponds to. Only one michael@0: * of the bits needs to match for a CSS_STATE_PSEUDO_CLASS to match; michael@0: * CSS_STATE_DEPENDENT_PSEUDO_CLASS matching depends on a customized per-class michael@0: * algorithm which should be defined in SelectorMatches() in michael@0: * nsCSSRuleProcessor.cpp. michael@0: * michael@0: * If CSS_STATE_PSEUDO_CLASS is not defined, it'll be automatically michael@0: * defined to CSS_STATE_DEPENDENT_PSEUDO_CLASS; michael@0: * if CSS_STATE_DEPENDENT_PSEUDO_CLASS is not defined, it'll be michael@0: * automatically defined to CSS_PSEUDO_CLASS. michael@0: */ michael@0: michael@0: // OUTPUT_CLASS=nsCSSPseudoClasses michael@0: // MACRO_NAME=CSS_PSEUDO_CLASS michael@0: michael@0: #ifdef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #error "CSS_STATE_DEPENDENT_PSEUDO_CLASS shouldn't be defined" michael@0: #endif michael@0: michael@0: #ifndef CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #define CSS_STATE_DEPENDENT_PSEUDO_CLASS(_name, _value, _pref, _bit) \ michael@0: CSS_PSEUDO_CLASS(_name, _value, _pref) michael@0: #define DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #endif michael@0: michael@0: #ifdef DEFINED_CSS_STATE_PSEUDO_CLASS michael@0: #error "CSS_STATE_PSEUDO_CLASS shouldn't be defined" michael@0: #endif michael@0: michael@0: #ifndef CSS_STATE_PSEUDO_CLASS michael@0: #define CSS_STATE_PSEUDO_CLASS(_name, _value, _pref, _bit) \ michael@0: CSS_STATE_DEPENDENT_PSEUDO_CLASS(_name, _value, _pref, _bit) michael@0: #define DEFINED_CSS_STATE_PSEUDO_CLASS michael@0: #endif michael@0: michael@0: // The CSS_PSEUDO_CLASS entries should all come before the michael@0: // CSS_STATE_PSEUDO_CLASS entries. The CSS_PSEUDO_CLASS entry order michael@0: // must be the same as the order of cases in SelectorMatches. :not michael@0: // must be the last CSS_PSEUDO_CLASS. michael@0: michael@0: CSS_PSEUDO_CLASS(empty, ":empty", "") michael@0: CSS_PSEUDO_CLASS(mozOnlyWhitespace, ":-moz-only-whitespace", "") michael@0: CSS_PSEUDO_CLASS(mozEmptyExceptChildrenWithLocalname, ":-moz-empty-except-children-with-localname", "") michael@0: CSS_PSEUDO_CLASS(lang, ":lang", "") michael@0: CSS_PSEUDO_CLASS(mozBoundElement, ":-moz-bound-element", "") michael@0: CSS_PSEUDO_CLASS(root, ":root", "") michael@0: CSS_PSEUDO_CLASS(any, ":-moz-any", "") michael@0: michael@0: CSS_PSEUDO_CLASS(firstChild, ":first-child", "") michael@0: CSS_PSEUDO_CLASS(firstNode, ":-moz-first-node", "") michael@0: CSS_PSEUDO_CLASS(lastChild, ":last-child", "") michael@0: CSS_PSEUDO_CLASS(lastNode, ":-moz-last-node", "") michael@0: CSS_PSEUDO_CLASS(onlyChild, ":only-child", "") michael@0: CSS_PSEUDO_CLASS(firstOfType, ":first-of-type", "") michael@0: CSS_PSEUDO_CLASS(lastOfType, ":last-of-type", "") michael@0: CSS_PSEUDO_CLASS(onlyOfType, ":only-of-type", "") michael@0: CSS_PSEUDO_CLASS(nthChild, ":nth-child", "") michael@0: CSS_PSEUDO_CLASS(nthLastChild, ":nth-last-child", "") michael@0: CSS_PSEUDO_CLASS(nthOfType, ":nth-of-type", "") michael@0: CSS_PSEUDO_CLASS(nthLastOfType, ":nth-last-of-type", "") michael@0: michael@0: // Match nodes that are HTML but not XHTML michael@0: CSS_PSEUDO_CLASS(mozIsHTML, ":-moz-is-html", "") michael@0: michael@0: // Matches anything when the specified look-and-feel metric is set michael@0: CSS_PSEUDO_CLASS(mozSystemMetric, ":-moz-system-metric", "") michael@0: michael@0: // -moz-locale-dir(ltr) and -moz-locale-dir(rtl) may be used michael@0: // to match based on the locale's chrome direction michael@0: CSS_PSEUDO_CLASS(mozLocaleDir, ":-moz-locale-dir", "") michael@0: michael@0: // -moz-lwtheme may be used to match a document that has a lightweight theme michael@0: CSS_PSEUDO_CLASS(mozLWTheme, ":-moz-lwtheme", "") michael@0: michael@0: // -moz-lwtheme-brighttext matches a document that has a dark lightweight theme michael@0: CSS_PSEUDO_CLASS(mozLWThemeBrightText, ":-moz-lwtheme-brighttext", "") michael@0: michael@0: // -moz-lwtheme-darktext matches a document that has a bright lightweight theme michael@0: CSS_PSEUDO_CLASS(mozLWThemeDarkText, ":-moz-lwtheme-darktext", "") michael@0: michael@0: // Matches anything when the containing window is inactive michael@0: CSS_PSEUDO_CLASS(mozWindowInactive, ":-moz-window-inactive", "") michael@0: michael@0: // Matches any table elements that have a nonzero border attribute, michael@0: // according to HTML integer attribute parsing rules. michael@0: CSS_PSEUDO_CLASS(mozTableBorderNonzero, ":-moz-table-border-nonzero", "") michael@0: michael@0: // Matches whatever the contextual reference elements are for the michael@0: // matching operation. michael@0: CSS_PSEUDO_CLASS(scope, ":scope", "layout.css.scope-pseudo.enabled") michael@0: michael@0: // :not needs to come at the end of the non-bit pseudo-class list, since michael@0: // it doesn't actually get directly matched on in SelectorMatches. michael@0: CSS_PSEUDO_CLASS(notPseudo, ":not", "") michael@0: michael@0: // :-moz-dir(ltr) and :-moz-dir(rtl) match elements whose resolved michael@0: // directionality in the markup language is ltr or rtl respectively michael@0: CSS_STATE_DEPENDENT_PSEUDO_CLASS(dir, ":-moz-dir", "", michael@0: NS_EVENT_STATE_LTR | NS_EVENT_STATE_RTL) michael@0: michael@0: CSS_STATE_PSEUDO_CLASS(link, ":link", "", NS_EVENT_STATE_UNVISITED) michael@0: // what matches :link or :visited michael@0: CSS_STATE_PSEUDO_CLASS(mozAnyLink, ":-moz-any-link", "", michael@0: NS_EVENT_STATE_VISITED | NS_EVENT_STATE_UNVISITED) michael@0: CSS_STATE_PSEUDO_CLASS(visited, ":visited", "", NS_EVENT_STATE_VISITED) michael@0: michael@0: CSS_STATE_PSEUDO_CLASS(active, ":active", "", NS_EVENT_STATE_ACTIVE) michael@0: CSS_STATE_PSEUDO_CLASS(checked, ":checked", "", NS_EVENT_STATE_CHECKED) michael@0: CSS_STATE_PSEUDO_CLASS(disabled, ":disabled", "", NS_EVENT_STATE_DISABLED) michael@0: CSS_STATE_PSEUDO_CLASS(enabled, ":enabled", "", NS_EVENT_STATE_ENABLED) michael@0: CSS_STATE_PSEUDO_CLASS(focus, ":focus", "", NS_EVENT_STATE_FOCUS) michael@0: CSS_STATE_PSEUDO_CLASS(hover, ":hover", "", NS_EVENT_STATE_HOVER) michael@0: CSS_STATE_PSEUDO_CLASS(mozDragOver, ":-moz-drag-over", "", NS_EVENT_STATE_DRAGOVER) michael@0: CSS_STATE_PSEUDO_CLASS(target, ":target", "", NS_EVENT_STATE_URLTARGET) michael@0: CSS_STATE_PSEUDO_CLASS(indeterminate, ":indeterminate", "", michael@0: NS_EVENT_STATE_INDETERMINATE) michael@0: michael@0: CSS_STATE_PSEUDO_CLASS(mozDevtoolsHighlighted, ":-moz-devtools-highlighted", "", michael@0: NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED) michael@0: michael@0: // Matches the element which is being displayed full-screen, and michael@0: // any containing frames. michael@0: CSS_STATE_PSEUDO_CLASS(mozFullScreen, ":-moz-full-screen", "", NS_EVENT_STATE_FULL_SCREEN) michael@0: michael@0: // Matches any element which is an ancestor of the DOM full-screen element, michael@0: // or an ancestor of a containing frame of the full-screen element. michael@0: CSS_STATE_PSEUDO_CLASS(mozFullScreenAncestor, ":-moz-full-screen-ancestor", "", NS_EVENT_STATE_FULL_SCREEN_ANCESTOR) michael@0: michael@0: // Matches if the element is focused and should show a focus ring michael@0: CSS_STATE_PSEUDO_CLASS(mozFocusRing, ":-moz-focusring", "", NS_EVENT_STATE_FOCUSRING) michael@0: michael@0: // Image, object, etc state pseudo-classes michael@0: CSS_STATE_PSEUDO_CLASS(mozBroken, ":-moz-broken", "", NS_EVENT_STATE_BROKEN) michael@0: CSS_STATE_PSEUDO_CLASS(mozUserDisabled, ":-moz-user-disabled", "", michael@0: NS_EVENT_STATE_USERDISABLED) michael@0: CSS_STATE_PSEUDO_CLASS(mozSuppressed, ":-moz-suppressed", "", michael@0: NS_EVENT_STATE_SUPPRESSED) michael@0: CSS_STATE_PSEUDO_CLASS(mozLoading, ":-moz-loading", "", NS_EVENT_STATE_LOADING) michael@0: CSS_STATE_PSEUDO_CLASS(mozTypeUnsupported, ":-moz-type-unsupported", "", michael@0: NS_EVENT_STATE_TYPE_UNSUPPORTED) michael@0: CSS_STATE_PSEUDO_CLASS(mozTypeUnsupportedPlatform, ":-moz-type-unsupported-platform", "", michael@0: NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerClickToPlay, ":-moz-handler-clicktoplay", "", michael@0: NS_EVENT_STATE_TYPE_CLICK_TO_PLAY) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerPlayPreview, ":-moz-handler-playpreview", "", michael@0: NS_EVENT_STATE_TYPE_PLAY_PREVIEW) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerVulnerableUpdatable, ":-moz-handler-vulnerable-updatable", "", michael@0: NS_EVENT_STATE_VULNERABLE_UPDATABLE) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerVulnerableNoUpdate, ":-moz-handler-vulnerable-no-update", "", michael@0: NS_EVENT_STATE_VULNERABLE_NO_UPDATE) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerDisabled, ":-moz-handler-disabled", "", michael@0: NS_EVENT_STATE_HANDLER_DISABLED) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerBlocked, ":-moz-handler-blocked", "", michael@0: NS_EVENT_STATE_HANDLER_BLOCKED) michael@0: CSS_STATE_PSEUDO_CLASS(mozHandlerCrashed, ":-moz-handler-crashed", "", michael@0: NS_EVENT_STATE_HANDLER_CRASHED) michael@0: michael@0: CSS_STATE_PSEUDO_CLASS(mozMathIncrementScriptLevel, michael@0: ":-moz-math-increment-script-level", "", michael@0: NS_EVENT_STATE_INCREMENT_SCRIPT_LEVEL) michael@0: michael@0: // CSS 3 UI michael@0: // http://www.w3.org/TR/2004/CR-css3-ui-20040511/#pseudo-classes michael@0: CSS_STATE_PSEUDO_CLASS(required, ":required", "", NS_EVENT_STATE_REQUIRED) michael@0: CSS_STATE_PSEUDO_CLASS(optional, ":optional", "", NS_EVENT_STATE_OPTIONAL) michael@0: CSS_STATE_PSEUDO_CLASS(valid, ":valid", "", NS_EVENT_STATE_VALID) michael@0: CSS_STATE_PSEUDO_CLASS(invalid, ":invalid", "", NS_EVENT_STATE_INVALID) michael@0: CSS_STATE_PSEUDO_CLASS(inRange, ":in-range", "", NS_EVENT_STATE_INRANGE) michael@0: CSS_STATE_PSEUDO_CLASS(outOfRange, ":out-of-range", "", NS_EVENT_STATE_OUTOFRANGE) michael@0: CSS_STATE_PSEUDO_CLASS(defaultPseudo, ":default", "", NS_EVENT_STATE_DEFAULT) michael@0: CSS_STATE_PSEUDO_CLASS(mozReadOnly, ":-moz-read-only", "", michael@0: NS_EVENT_STATE_MOZ_READONLY) michael@0: CSS_STATE_PSEUDO_CLASS(mozReadWrite, ":-moz-read-write", "", michael@0: NS_EVENT_STATE_MOZ_READWRITE) michael@0: CSS_STATE_PSEUDO_CLASS(mozSubmitInvalid, ":-moz-submit-invalid", "", michael@0: NS_EVENT_STATE_MOZ_SUBMITINVALID) michael@0: CSS_STATE_PSEUDO_CLASS(mozUIInvalid, ":-moz-ui-invalid", "", michael@0: NS_EVENT_STATE_MOZ_UI_INVALID) michael@0: CSS_STATE_PSEUDO_CLASS(mozUIValid, ":-moz-ui-valid", "", michael@0: NS_EVENT_STATE_MOZ_UI_VALID) michael@0: CSS_STATE_PSEUDO_CLASS(mozMeterOptimum, ":-moz-meter-optimum", "", michael@0: NS_EVENT_STATE_OPTIMUM) michael@0: CSS_STATE_PSEUDO_CLASS(mozMeterSubOptimum, ":-moz-meter-sub-optimum", "", michael@0: NS_EVENT_STATE_SUB_OPTIMUM) michael@0: CSS_STATE_PSEUDO_CLASS(mozMeterSubSubOptimum, ":-moz-meter-sub-sub-optimum", "", michael@0: NS_EVENT_STATE_SUB_SUB_OPTIMUM) michael@0: michael@0: // Those values should be parsed but do nothing. michael@0: CSS_STATE_PSEUDO_CLASS(mozPlaceholder, ":-moz-placeholder", "", NS_EVENT_STATE_IGNORE) michael@0: michael@0: #ifdef DEFINED_CSS_STATE_PSEUDO_CLASS michael@0: #undef DEFINED_CSS_STATE_PSEUDO_CLASS michael@0: #undef CSS_STATE_PSEUDO_CLASS michael@0: #endif michael@0: michael@0: #ifdef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #undef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #undef CSS_STATE_DEPENDENT_PSEUDO_CLASS michael@0: #endif