mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Add some comments and remove obsolete allow attributes
This commit is contained in:
parent
d9e4f7a0ba
commit
4e64a1c682
2 changed files with 9 additions and 3 deletions
|
@ -1414,6 +1414,10 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME(nox): get_flag/set_flag (especially the latter) are not safe because
|
||||||
|
// they mutate stuff while values of this type can be used from multiple
|
||||||
|
// threads at once, this should be revisited.
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe fn get_flag(self, flag: NodeFlags) -> bool {
|
unsafe fn get_flag(self, flag: NodeFlags) -> bool {
|
||||||
|
@ -1441,6 +1445,9 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> {
|
||||||
unsafe { self.unsafe_get().children_count.get() }
|
unsafe { self.unsafe_get().children_count.get() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME(nox): How we handle style and layout data needs to be completely
|
||||||
|
// revisited so we can do that more cleanly and safely in layout 2020.
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe fn get_style_and_layout_data(self) -> Option<OpaqueStyleAndLayoutData> {
|
unsafe fn get_style_and_layout_data(self) -> Option<OpaqueStyleAndLayoutData> {
|
||||||
|
@ -1490,19 +1497,16 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
|
||||||
fn image_url(self) -> Option<ServoUrl> {
|
fn image_url(self) -> Option<ServoUrl> {
|
||||||
self.downcast::<HTMLImageElement>()
|
self.downcast::<HTMLImageElement>()
|
||||||
.expect("not an image!")
|
.expect("not an image!")
|
||||||
.image_url()
|
.image_url()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
|
||||||
fn image_data(self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)> {
|
fn image_data(self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)> {
|
||||||
self.downcast::<HTMLImageElement>().map(|e| e.image_data())
|
self.downcast::<HTMLImageElement>().map(|e| e.image_data())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
|
||||||
fn image_density(self) -> Option<f64> {
|
fn image_density(self) -> Option<f64> {
|
||||||
self.downcast::<HTMLImageElement>()
|
self.downcast::<HTMLImageElement>()
|
||||||
.expect("not an image!")
|
.expect("not an image!")
|
||||||
|
|
|
@ -271,6 +271,8 @@ impl<'dom> LayoutShadowRootHelpers<'dom> for LayoutDom<'dom, ShadowRoot> {
|
||||||
unsafe { &self.unsafe_get().author_styles.borrow_for_layout().data }
|
unsafe { &self.unsafe_get().author_styles.borrow_for_layout().data }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME(nox): This uses the dreaded borrow_mut_for_layout so this should
|
||||||
|
// probably be revisited.
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe fn flush_stylesheets<E: TElement>(
|
unsafe fn flush_stylesheets<E: TElement>(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue