2016-02-03 01:34:11 +00:00
|
|
|
/* 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/. */
|
|
|
|
|
2016-06-27 22:14:55 +00:00
|
|
|
//! States elements can be in.
|
|
|
|
|
2016-12-31 23:34:51 +00:00
|
|
|
#![deny(missing_docs)]
|
|
|
|
|
2016-02-03 01:34:11 +00:00
|
|
|
bitflags! {
|
|
|
|
#[doc = "Event-based element states."]
|
2016-06-22 14:43:20 +00:00
|
|
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
2017-03-18 20:45:01 +00:00
|
|
|
pub flags ElementState: u32 {
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "The mouse is down on this element. \
|
|
|
|
https://html.spec.whatwg.org/multipage/#selector-active \
|
|
|
|
FIXME(#7333): set/unset this when appropriate"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_ACTIVE_STATE = 1 << 0,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "This element has focus. \
|
|
|
|
https://html.spec.whatwg.org/multipage/#selector-focus"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_FOCUS_STATE = 1 << 1,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "The mouse is hovering over this element. \
|
|
|
|
https://html.spec.whatwg.org/multipage/#selector-hover"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_HOVER_STATE = 1 << 2,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "Content is enabled (and can be disabled). \
|
|
|
|
http://www.whatwg.org/html/#selector-enabled"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_ENABLED_STATE = 1 << 3,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "Content is disabled. \
|
|
|
|
http://www.whatwg.org/html/#selector-disabled"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_DISABLED_STATE = 1 << 4,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "Content is checked. \
|
|
|
|
https://html.spec.whatwg.org/multipage/#selector-checked"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_CHECKED_STATE = 1 << 5,
|
2016-02-03 01:34:11 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-indeterminate"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_INDETERMINATE_STATE = 1 << 6,
|
2016-06-07 04:44:16 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-placeholder-shown"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_PLACEHOLDER_SHOWN_STATE = 1 << 7,
|
2016-08-03 19:53:30 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-target"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_TARGET_STATE = 1 << 8,
|
2016-12-09 17:52:34 +00:00
|
|
|
#[doc = "https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_FULLSCREEN_STATE = 1 << 9,
|
2017-03-16 12:21:29 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-valid"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_VALID_STATE = 1 << 10,
|
2017-03-16 12:21:29 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-invalid"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_INVALID_STATE = 1 << 11,
|
2017-03-16 12:21:29 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-valid"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_MOZ_UI_VALID_STATE = 1 << 12,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-broken"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_BROKEN_STATE = 1 << 13,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-user-disabled"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_USER_DISABLED_STATE = 1 << 14,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-suppressed"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_SUPPRESSED_STATE = 1 << 15,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-loading"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_LOADING_STATE = 1 << 16,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-blocked"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_HANDLER_BLOCKED_STATE = 1 << 17,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-disabled"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_HANDLER_DISABLED_STATE = 1 << 18,
|
2017-03-18 20:45:01 +00:00
|
|
|
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-crashed"]
|
2017-03-22 22:41:37 +00:00
|
|
|
const IN_HANDLER_CRASHED_STATE = 1 << 19,
|
2017-03-23 00:28:25 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-required"]
|
|
|
|
const IN_REQUIRED_STATE = 1 << 20,
|
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-optional"]
|
|
|
|
const IN_OPTIONAL_STATE = 1 << 21,
|
2017-01-06 08:09:32 +00:00
|
|
|
#[doc = "https://html.spec.whatwg.org/multipage/#selector-read-write"]
|
2017-03-23 00:28:25 +00:00
|
|
|
const IN_READ_WRITE_STATE = 1 << 22,
|
2016-02-03 01:34:11 +00:00
|
|
|
}
|
|
|
|
}
|