aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlhrelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlhrelement.rs')
-rw-r--r--components/script/dom/htmlhrelement.rs24
1 files changed, 9 insertions, 15 deletions
diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs
index 9be680b9043..69fa8887bb1 100644
--- a/components/script/dom/htmlhrelement.rs
+++ b/components/script/dom/htmlhrelement.rs
@@ -71,25 +71,19 @@ pub trait HTMLHRLayoutHelpers {
}
impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement> {
- #[allow(unsafe_code)]
fn get_color(self) -> Option<RGBA> {
- unsafe {
- self.upcast::<Element>()
- .get_attr_for_layout(&ns!(), &local_name!("color"))
- .and_then(AttrValue::as_color)
- .cloned()
- }
+ self.upcast::<Element>()
+ .get_attr_for_layout(&ns!(), &local_name!("color"))
+ .and_then(AttrValue::as_color)
+ .cloned()
}
- #[allow(unsafe_code)]
fn get_width(self) -> LengthOrPercentageOrAuto {
- unsafe {
- self.upcast::<Element>()
- .get_attr_for_layout(&ns!(), &local_name!("width"))
- .map(AttrValue::as_dimension)
- .cloned()
- .unwrap_or(LengthOrPercentageOrAuto::Auto)
- }
+ self.upcast::<Element>()
+ .get_attr_for_layout(&ns!(), &local_name!("width"))
+ .map(AttrValue::as_dimension)
+ .cloned()
+ .unwrap_or(LengthOrPercentageOrAuto::Auto)
}
}