Make HTMLIFrameElementLayoutMethods methods take self

This commit is contained in:
Anthony Ramine 2020-03-29 17:19:59 +02:00
parent 668ef35612
commit 1504f35031

View file

@ -480,27 +480,27 @@ impl HTMLIFrameElement {
}
pub trait HTMLIFrameElementLayoutMethods {
fn pipeline_id(&self) -> Option<PipelineId>;
fn browsing_context_id(&self) -> Option<BrowsingContextId>;
fn get_width(&self) -> LengthOrPercentageOrAuto;
fn get_height(&self) -> LengthOrPercentageOrAuto;
fn pipeline_id(self) -> Option<PipelineId>;
fn browsing_context_id(self) -> Option<BrowsingContextId>;
fn get_width(self) -> LengthOrPercentageOrAuto;
fn get_height(self) -> LengthOrPercentageOrAuto;
}
impl HTMLIFrameElementLayoutMethods for LayoutDom<'_, HTMLIFrameElement> {
#[inline]
#[allow(unsafe_code)]
fn pipeline_id(&self) -> Option<PipelineId> {
fn pipeline_id(self) -> Option<PipelineId> {
unsafe { (*self.unsafe_get()).pipeline_id.get() }
}
#[inline]
#[allow(unsafe_code)]
fn browsing_context_id(&self) -> Option<BrowsingContextId> {
fn browsing_context_id(self) -> Option<BrowsingContextId> {
unsafe { (*self.unsafe_get()).browsing_context_id.get() }
}
#[allow(unsafe_code)]
fn get_width(&self) -> LengthOrPercentageOrAuto {
fn get_width(self) -> LengthOrPercentageOrAuto {
unsafe {
(*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("width"))
@ -511,7 +511,7 @@ impl HTMLIFrameElementLayoutMethods for LayoutDom<'_, HTMLIFrameElement> {
}
#[allow(unsafe_code)]
fn get_height(&self) -> LengthOrPercentageOrAuto {
fn get_height(self) -> LengthOrPercentageOrAuto {
unsafe {
(*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("height"))