ns_compatibility.rs (733B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 //! Little helper for `nsCompatibility`. 6 7 use crate::context::QuirksMode; 8 use crate::gecko_bindings::structs::nsCompatibility; 9 10 impl From<nsCompatibility> for QuirksMode { 11 #[inline] 12 fn from(mode: nsCompatibility) -> QuirksMode { 13 match mode { 14 nsCompatibility::eCompatibility_FullStandards => QuirksMode::NoQuirks, 15 nsCompatibility::eCompatibility_AlmostStandards => QuirksMode::LimitedQuirks, 16 nsCompatibility::eCompatibility_NavQuirks => QuirksMode::Quirks, 17 } 18 } 19 }