Make HTMLTableCellElementLayoutHelpers methods take self

This commit is contained in:
Anthony Ramine 2020-03-29 17:22:11 +02:00
parent f794feb6f4
commit 09600301c5

View file

@ -98,15 +98,15 @@ impl HTMLTableCellElementMethods for HTMLTableCellElement {
}
pub trait HTMLTableCellElementLayoutHelpers {
fn get_background_color(&self) -> Option<RGBA>;
fn get_colspan(&self) -> Option<u32>;
fn get_rowspan(&self) -> Option<u32>;
fn get_width(&self) -> LengthOrPercentageOrAuto;
fn get_background_color(self) -> Option<RGBA>;
fn get_colspan(self) -> Option<u32>;
fn get_rowspan(self) -> Option<u32>;
fn get_width(self) -> LengthOrPercentageOrAuto;
}
#[allow(unsafe_code)]
impl HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement> {
fn get_background_color(&self) -> Option<RGBA> {
fn get_background_color(self) -> Option<RGBA> {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("bgcolor"))
@ -115,7 +115,7 @@ impl HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement> {
}
}
fn get_colspan(&self) -> Option<u32> {
fn get_colspan(self) -> Option<u32> {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("colspan"))
@ -123,7 +123,7 @@ impl HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement> {
}
}
fn get_rowspan(&self) -> Option<u32> {
fn get_rowspan(self) -> Option<u32> {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("rowspan"))
@ -131,7 +131,7 @@ impl HTMLTableCellElementLayoutHelpers for LayoutDom<'_, HTMLTableCellElement> {
}
}
fn get_width(&self) -> LengthOrPercentageOrAuto {
fn get_width(self) -> LengthOrPercentageOrAuto {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("width"))