Make HTMLHRLayoutHelpers methods take self

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

View file

@ -66,13 +66,13 @@ impl HTMLHRElementMethods for HTMLHRElement {
}
pub trait HTMLHRLayoutHelpers {
fn get_color(&self) -> Option<RGBA>;
fn get_width(&self) -> LengthOrPercentageOrAuto;
fn get_color(self) -> Option<RGBA>;
fn get_width(self) -> LengthOrPercentageOrAuto;
}
impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement> {
#[allow(unsafe_code)]
fn get_color(&self) -> Option<RGBA> {
fn get_color(self) -> Option<RGBA> {
unsafe {
(&*self.upcast::<Element>().unsafe_get())
.get_attr_for_layout(&ns!(), &local_name!("color"))
@ -82,7 +82,7 @@ impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement> {
}
#[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"))