mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make HTMLTableElementLayoutHelpers methods take self
This commit is contained in:
parent
09600301c5
commit
83045c7e68
1 changed files with 8 additions and 8 deletions
|
@ -406,15 +406,15 @@ impl HTMLTableElementMethods for HTMLTableElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait HTMLTableElementLayoutHelpers {
|
pub trait HTMLTableElementLayoutHelpers {
|
||||||
fn get_background_color(&self) -> Option<RGBA>;
|
fn get_background_color(self) -> Option<RGBA>;
|
||||||
fn get_border(&self) -> Option<u32>;
|
fn get_border(self) -> Option<u32>;
|
||||||
fn get_cellspacing(&self) -> Option<u32>;
|
fn get_cellspacing(self) -> Option<u32>;
|
||||||
fn get_width(&self) -> LengthOrPercentageOrAuto;
|
fn get_width(self) -> LengthOrPercentageOrAuto;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> {
|
impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn get_background_color(&self) -> Option<RGBA> {
|
fn get_background_color(self) -> Option<RGBA> {
|
||||||
unsafe {
|
unsafe {
|
||||||
(*self.upcast::<Element>().unsafe_get())
|
(*self.upcast::<Element>().unsafe_get())
|
||||||
.get_attr_for_layout(&ns!(), &local_name!("bgcolor"))
|
.get_attr_for_layout(&ns!(), &local_name!("bgcolor"))
|
||||||
|
@ -424,17 +424,17 @@ impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn get_border(&self) -> Option<u32> {
|
fn get_border(self) -> Option<u32> {
|
||||||
unsafe { (*self.unsafe_get()).border.get() }
|
unsafe { (*self.unsafe_get()).border.get() }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn get_cellspacing(&self) -> Option<u32> {
|
fn get_cellspacing(self) -> Option<u32> {
|
||||||
unsafe { (*self.unsafe_get()).cellspacing.get() }
|
unsafe { (*self.unsafe_get()).cellspacing.get() }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn get_width(&self) -> LengthOrPercentageOrAuto {
|
fn get_width(self) -> LengthOrPercentageOrAuto {
|
||||||
unsafe {
|
unsafe {
|
||||||
(*self.upcast::<Element>().unsafe_get())
|
(*self.upcast::<Element>().unsafe_get())
|
||||||
.get_attr_for_layout(&ns!(), &local_name!("width"))
|
.get_attr_for_layout(&ns!(), &local_name!("width"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue