Make synthesize_presentational_hints_for_legacy_attributes be safe

This commit is contained in:
Anthony Ramine 2020-04-01 00:25:49 +02:00
parent 0c0027ecfd
commit ebd2892158
3 changed files with 6 additions and 12 deletions

View file

@ -639,10 +639,8 @@ impl<'le> TElement for ServoLayoutElement<'le> {
) where ) where
V: Push<ApplicableDeclarationBlock>, V: Push<ApplicableDeclarationBlock>,
{ {
unsafe { self.element
self.element .synthesize_presentational_hints_for_legacy_attributes(hints);
.synthesize_presentational_hints_for_legacy_attributes(hints);
}
} }
/// The shadow root this element is a host of. /// The shadow root this element is a host of.

View file

@ -646,10 +646,8 @@ impl<'le> TElement for ServoLayoutElement<'le> {
) where ) where
V: Push<ApplicableDeclarationBlock>, V: Push<ApplicableDeclarationBlock>,
{ {
unsafe { self.element
self.element .synthesize_presentational_hints_for_legacy_attributes(hints);
.synthesize_presentational_hints_for_legacy_attributes(hints);
}
} }
/// The shadow root this element is a host of. /// The shadow root this element is a host of.

View file

@ -567,8 +567,7 @@ pub trait LayoutElementHelpers<'dom> {
fn has_class_for_layout(self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool; fn has_class_for_layout(self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool;
fn get_classes_for_layout(self) -> Option<&'dom [Atom]>; fn get_classes_for_layout(self) -> Option<&'dom [Atom]>;
#[allow(unsafe_code)] fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(self, _: &mut V)
where where
V: Push<ApplicableDeclarationBlock>; V: Push<ApplicableDeclarationBlock>;
fn get_colspan(self) -> u32; fn get_colspan(self) -> u32;
@ -616,8 +615,7 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
.map(|attr| attr.as_tokens().unwrap()) .map(|attr| attr.as_tokens().unwrap())
} }
#[allow(unsafe_code)] fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
unsafe fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
where where
V: Push<ApplicableDeclarationBlock>, V: Push<ApplicableDeclarationBlock>,
{ {