Removing u8 from HTMLIframeElement

Remove u8 in HTMLIframeElement.rs

Remove u8 from IframeElement.rs

u8 removal

trying to pass test - uri

Update htmliframeelement.rs

u8 removal

removing u8 from Rust HTMLIFrameElement
This commit is contained in:
Patrick Trottier 2016-07-01 14:45:37 -04:00
parent b2a32ec028
commit 7be78a3e54

View file

@ -50,15 +50,17 @@ use style::context::ReflowGoal;
use url::Url;
use util::prefs::mozbrowser_enabled;
#[derive(HeapSizeOf)]
enum SandboxAllowance {
AllowNothing = 0x00,
AllowSameOrigin = 0x01,
AllowTopNavigation = 0x02,
AllowForms = 0x04,
AllowScripts = 0x08,
AllowPointerLock = 0x10,
AllowPopups = 0x20
bitflags! {
#[derive(JSTraceable, HeapSizeOf)]
flags SandboxAllowance: u8 {
const ALLOW_NOTHING = 0x00,
const ALLOW_SAME_ORIGIN = 0x01,
const ALLOW_TOP_NAVIGATION = 0x02,
const ALLOW_FORMS = 0x04,
const ALLOW_SCRIPTS = 0x08,
const ALLOW_POINTER_LOCK = 0x10,
const ALLOW_POPUPS = 0x20
}
}
#[dom_struct]
@ -67,7 +69,7 @@ pub struct HTMLIFrameElement {
pipeline_id: Cell<Option<PipelineId>>,
subpage_id: Cell<Option<SubpageId>>,
sandbox: MutNullableHeap<JS<DOMTokenList>>,
sandbox_allowance: Cell<Option<u8>>,
sandbox_allowance: Cell<Option<SandboxAllowance>>,
load_blocker: DOMRefCell<Option<LoadBlocker>>,
visibility: Cell<bool>,
}
@ -589,17 +591,17 @@ impl VirtualMethods for HTMLIFrameElement {
match attr.local_name() {
&atom!("sandbox") => {
self.sandbox_allowance.set(mutation.new_value(attr).map(|value| {
let mut modes = SandboxAllowance::AllowNothing as u8;
let mut modes = ALLOW_NOTHING;
for token in value.as_tokens() {
modes |= match &*token.to_ascii_lowercase() {
"allow-same-origin" => SandboxAllowance::AllowSameOrigin,
"allow-forms" => SandboxAllowance::AllowForms,
"allow-pointer-lock" => SandboxAllowance::AllowPointerLock,
"allow-popups" => SandboxAllowance::AllowPopups,
"allow-scripts" => SandboxAllowance::AllowScripts,
"allow-top-navigation" => SandboxAllowance::AllowTopNavigation,
_ => SandboxAllowance::AllowNothing
} as u8;
"allow-same-origin" => ALLOW_SAME_ORIGIN,
"allow-forms" => ALLOW_FORMS,
"allow-pointer-lock" => ALLOW_POINTER_LOCK,
"allow-popups" => ALLOW_POPUPS,
"allow-scripts" => ALLOW_SCRIPTS,
"allow-top-navigation" => ALLOW_TOP_NAVIGATION,
_ => ALLOW_NOTHING
};
}
modes
}));