From 381651fd106462b38a8f258a9e97e4c515526aa3 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 6 Jan 2017 10:04:49 +1100 Subject: [PATCH 1/2] Change order of element state bits --- components/style/element_state.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/style/element_state.rs b/components/style/element_state.rs index 9ccd08334cc..3bfa55242ad 100644 --- a/components/style/element_state.rs +++ b/components/style/element_state.rs @@ -31,13 +31,13 @@ bitflags! { const IN_CHECKED_STATE = 0x20, #[doc = "https://html.spec.whatwg.org/multipage/#selector-indeterminate"] const IN_INDETERMINATE_STATE = 0x40, - #[doc = "https://html.spec.whatwg.org/multipage/#selector-read-write"] - const IN_READ_WRITE_STATE = 0x80, #[doc = "https://html.spec.whatwg.org/multipage/#selector-placeholder-shown"] - const IN_PLACEHOLDER_SHOWN_STATE = 0x0100, + const IN_PLACEHOLDER_SHOWN_STATE = 0x80, #[doc = "https://html.spec.whatwg.org/multipage/#selector-target"] - const IN_TARGET_STATE = 0x0200, + const IN_TARGET_STATE = 0x100, #[doc = "https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class"] - const IN_FULLSCREEN_STATE = 0x0400, + const IN_FULLSCREEN_STATE = 0x200, + #[doc = "https://html.spec.whatwg.org/multipage/#selector-read-write"] + const IN_READ_WRITE_STATE = 0x400, } } From 0c913d59180e5e70857d3e0126c8b090b8e5f9c4 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 6 Jan 2017 10:05:10 +1100 Subject: [PATCH 2/2] Make Gecko_ElementState return u16 --- components/style/gecko/wrapper.rs | 2 +- components/style/gecko_bindings/bindings.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 6764269c282..f5890e2b95f 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -337,7 +337,7 @@ impl<'le> TElement for GeckoElement<'le> { fn get_state(&self) -> ElementState { unsafe { - ElementState::from_bits_truncate(Gecko_ElementState(self.0) as u16) + ElementState::from_bits_truncate(Gecko_ElementState(self.0)) } } diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 1b560cd4518..d9106d9ace2 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -349,7 +349,7 @@ extern "C" { -> RawGeckoNodeBorrowedOrNull; } extern "C" { - pub fn Gecko_ElementState(element: RawGeckoElementBorrowed) -> u8; + pub fn Gecko_ElementState(element: RawGeckoElementBorrowed) -> u16; } extern "C" { pub fn Gecko_IsHTMLElementInHTMLDocument(element: RawGeckoElementBorrowed)