Merge RawLayoutElementHelpers into LayoutElementHelpers

This commit is contained in:
Anthony Ramine 2020-03-31 18:30:42 +02:00
parent 3b504148d5
commit 0bda174823
17 changed files with 86 additions and 97 deletions

View file

@ -22,7 +22,7 @@ use crate::dom::document::Document;
use crate::dom::element::{cors_setting_for_element, referrer_policy_for_element};
use crate::dom::element::{reflect_cross_origin_attribute, set_cross_origin_attribute};
use crate::dom::element::{
AttributeMutation, CustomElementCreationMode, Element, ElementCreator, RawLayoutElementHelpers,
AttributeMutation, CustomElementCreationMode, Element, ElementCreator, LayoutElementHelpers,
};
use crate::dom::event::Event;
use crate::dom::eventtarget::EventTarget;
@ -1418,7 +1418,7 @@ impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement> {
#[allow(unsafe_code)]
fn get_width(self) -> LengthOrPercentageOrAuto {
unsafe {
(*self.upcast::<Element>().unsafe_get())
self.upcast::<Element>()
.get_attr_for_layout(&ns!(), &local_name!("width"))
.map(AttrValue::as_dimension)
.cloned()
@ -1429,7 +1429,7 @@ impl LayoutHTMLImageElementHelpers for LayoutDom<'_, HTMLImageElement> {
#[allow(unsafe_code)]
fn get_height(self) -> LengthOrPercentageOrAuto {
unsafe {
(*self.upcast::<Element>().unsafe_get())
self.upcast::<Element>()
.get_attr_for_layout(&ns!(), &local_name!("height"))
.map(AttrValue::as_dimension)
.cloned()