HTMLIFrameElement

Struct HTMLIFrameElement 

Source
#[repr(C)]
pub(crate) struct HTMLIFrameElement { htmlelement: HTMLElement, webview_id: Cell<Option<WebViewId>>, browsing_context_id: Cell<Option<BrowsingContextId>>, pipeline_id: Cell<Option<PipelineId>>, pending_pipeline_id: Cell<Option<PipelineId>>, about_blank_pipeline_id: Cell<Option<PipelineId>>, sandbox: MutNullableDom<DOMTokenList>, sandboxing_flag_set: Cell<Option<SandboxingFlagSet>>, load_blocker: DomRefCell<Option<LoadBlocker>>, throttled: Cell<bool>, script_window_proxies: Rc<ScriptWindowProxies>, pending_navigation: Cell<bool>, }

Fields§

§htmlelement: HTMLElement§webview_id: Cell<Option<WebViewId>>§browsing_context_id: Cell<Option<BrowsingContextId>>§pipeline_id: Cell<Option<PipelineId>>§pending_pipeline_id: Cell<Option<PipelineId>>§about_blank_pipeline_id: Cell<Option<PipelineId>>§sandbox: MutNullableDom<DOMTokenList>§sandboxing_flag_set: Cell<Option<SandboxingFlagSet>>§load_blocker: DomRefCell<Option<LoadBlocker>>§throttled: Cell<bool>§script_window_proxies: Rc<ScriptWindowProxies>§pending_navigation: Cell<bool>

Keeping track of whether the iframe will be navigated outside of the processing of it’s attribute(for example: form navigation). This is necessary to prevent the iframe load event steps from asynchronously running for the initial blank document while script at this point(when the flag is set) expects those to run only for the navigated documented.

Implementations§

Source§

impl HTMLIFrameElement

Source§

impl HTMLIFrameElement

Source

fn get_url(&self) -> ServoUrl

Source

pub(crate) fn navigate_or_reload_child_browsing_context( &self, load_data: LoadData, history_handling: NavigationHistoryBehavior, can_gc: CanGc, )

Source

fn start_new_pipeline( &self, load_data: LoadData, pipeline_type: PipelineType, history_handling: NavigationHistoryBehavior, can_gc: CanGc, )

Source

pub(crate) fn is_initial_blank_document(&self) -> bool

When an iframe is first inserted into the document, an “about:blank” document is created, and synchronously processed by the script thread. This initial synchronous load should have no noticeable effect in script. See the note in iframe_load_event_steps.

Source

fn process_the_iframe_attributes(&self, mode: ProcessingMode, can_gc: CanGc)

Source

fn create_nested_browsing_context(&self, can_gc: CanGc)

https://html.spec.whatwg.org/multipage/#create-a-new-child-navigable Synchronously create a new browsing context(This is not a navigation). The pipeline started here should remain unnoticeable to script, but this is not easy to refactor because it appears other features have come to rely on the current behavior. For now only the iframe load event steps are skipped in some cases for this initial document, and we still fire load and pageshow events as part of maybe_queue_document_completion. Also, some controversy spec-wise remains: https://github.com/whatwg/html/issues/4965

Source

fn destroy_nested_browsing_context(&self)

Source

pub(crate) fn update_pipeline_id( &self, new_pipeline_id: PipelineId, reason: UpdatePipelineIdReason, can_gc: CanGc, )

Source

fn new_inherited( local_name: LocalName, prefix: Option<Prefix>, document: &Document, ) -> HTMLIFrameElement

Source

pub(crate) fn new( local_name: LocalName, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> DomRoot<HTMLIFrameElement>

Source

pub(crate) fn pipeline_id(&self) -> Option<PipelineId>

Source

pub(crate) fn browsing_context_id(&self) -> Option<BrowsingContextId>

Source

pub(crate) fn webview_id(&self) -> Option<WebViewId>

Source

pub(crate) fn sandboxing_flag_set(&self) -> SandboxingFlagSet

Source

pub(crate) fn set_throttled(&self, throttled: bool)

Source

pub(crate) fn note_pending_navigation(&self)

Note a pending navigation. This is used to ignore the async load event steps for the initial blank document if those haven’t run yet.

Source

pub(crate) fn iframe_load_event_steps( &self, loaded_pipeline: PipelineId, can_gc: CanGc, )

Source

fn parse_sandbox_attribute(&self)

Parse the sandbox attribute value given the Attr. This sets the sandboxing_flag_set property or clears it is the value isn’t specified. Notably, an unspecified sandboxing attribute (no sandboxing) is different from an empty one (full sandboxing).

Trait Implementations§

§

impl Castable for HTMLIFrameElement

Source§

fn is<T>(&self) -> bool
where T: DerivedFrom<Self>,

Check whether a DOM object implements one of its deriving interfaces.
Source§

fn upcast<T>(&self) -> &T
where T: Castable, Self: DerivedFrom<T>,

Cast a DOM object upwards to one of the interfaces it derives from.
Source§

fn downcast<T>(&self) -> Option<&T>
where T: DerivedFrom<Self>,

Cast a DOM object downwards to one of the interfaces it might implement.
Source§

impl DomObject for HTMLIFrameElement

Source§

fn reflector(&self) -> &Reflector

Returns the receiver’s reflector.
Source§

impl DomObjectWrap<DomTypeHolder> for HTMLIFrameElement

Source§

const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::HTMLIFrameElementBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::html::htmliframeelement::HTMLIFrameElement>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::html::htmliframeelement::HTMLIFrameElement>>}

Function pointer to the general wrap function type
Source§

impl HTMLIFrameElementMethods<DomTypeHolder> for HTMLIFrameElement

Source§

fn Srcdoc(&self) -> TrustedHTMLOrString<DomTypeHolder>

Source§

fn SetSrcdoc( &self, value: TrustedHTMLOrString<DomTypeHolder>, can_gc: CanGc, ) -> Fallible<()>

Source§

fn Sandbox(&self, can_gc: CanGc) -> DomRoot<DOMTokenList>

https://html.spec.whatwg.org/multipage/#dom-iframe-sandbox

The supported tokens for sandbox’s DOMTokenList are the allowed values defined in the sandbox attribute and supported by the user agent. These range of possible values is defined here: https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox

Source§

fn GetContentWindow(&self) -> Option<DomRoot<WindowProxy>>

Source§

fn GetContentDocument(&self) -> Option<DomRoot<Document>>

Source§

fn ReferrerPolicy(&self) -> DOMString

Source§

fn Src(&self) -> USVString

Source§

fn SetSrc(&self, value: USVString)

Source§

fn SetReferrerPolicy(&self, value: DOMString)

Source§

fn AllowFullscreen(&self) -> bool

Source§

fn SetAllowFullscreen(&self, value: bool)

Source§

fn Width(&self) -> DOMString

Source§

fn SetWidth(&self, value: DOMString)

Source§

fn Height(&self) -> DOMString

Source§

fn SetHeight(&self, value: DOMString)

Source§

fn FrameBorder(&self) -> DOMString

Source§

fn SetFrameBorder(&self, value: DOMString)

Source§

fn SetName(&self, value: DOMString)

Source§

fn Name(&self) -> DOMString

Source§

impl HasParent for HTMLIFrameElement

Source§

fn as_parent(&self) -> &HTMLElement

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Source§

type Parent = HTMLElement

Source§

impl IDLInterface for HTMLIFrameElement

Source§

fn derives(class: &'static DOMClass) -> bool

Returns whether the given DOM class derives that interface.
Source§

impl MallocSizeOf for HTMLIFrameElement

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl MutDomObject for HTMLIFrameElement

Source§

unsafe fn init_reflector(&self, obj: *mut JSObject)

Initializes the Reflector Read more
Source§

impl PartialEq for HTMLIFrameElement

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToJSValConvertible for HTMLIFrameElement

Source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl Traceable for HTMLIFrameElement

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
Source§

impl VirtualMethods for HTMLIFrameElement

Source§

fn post_connection_steps(&self, can_gc: CanGc)

Source§

fn super_type(&self) -> Option<&dyn VirtualMethods>

Returns self as the superclass of the implementation for this trait, if any.
Source§

fn attribute_mutated( &self, attr: &Attr, mutation: AttributeMutation<'_>, can_gc: CanGc, )

Source§

fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool

Returns true if given attribute attr affects style of the given element.
Source§

fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue

Returns the right AttrValue variant for the attribute with name name on this element.
Source§

fn bind_to_tree(&self, context: &BindContext<'_>, can_gc: CanGc)

Called when a Node is appended to a tree.
Source§

fn unbind_from_tree(&self, context: &UnbindContext<'_>, can_gc: CanGc)

Called when a Node is removed from a tree. Implements removing steps: https://dom.spec.whatwg.org/#concept-node-remove-ext
Source§

fn children_changed(&self, mutation: &ChildrenMutation<'_>, can_gc: CanGc)

Called on the parent when its children are changed.
Source§

fn handle_event(&self, event: &Event, can_gc: CanGc)

Called during event dispatch after the bubbling phase completes.
Source§

fn adopting_steps(&self, old_doc: &Document, can_gc: CanGc)

Source§

fn cloning_steps( &self, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, can_gc: CanGc, )

Source§

fn pop(&self)

Called on an element when it is popped off the stack of open elements of a parser.
§

impl DerivedFrom<Element> for HTMLIFrameElement

§

impl DerivedFrom<EventTarget> for HTMLIFrameElement

§

impl DerivedFrom<HTMLElement> for HTMLIFrameElement

§

impl DerivedFrom<Node> for HTMLIFrameElement

Source§

impl Eq for HTMLIFrameElement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsVoidPtr for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<D, T> DomGlobalGeneric<D> for T
where D: DomTypes, T: DomObject,

Source§

fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>
where Self: Sized,

Returns the [GlobalScope] of the realm that the DomObject was created in. If this object is a Node, this will be different from it’s owning Document if adopted by. For Nodes it’s almost always better to use NodeTraits::owning_global.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SafeToJSValConvertible for T

Source§

fn safe_to_jsval( &self, cx: JSContext, rval: MutableHandle<'_, Value>, _can_gc: CanGc, )

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ThisReflector for T
where T: DomObject,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T