aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-04-01 11:36:25 +0200
committerAnthony Ramine <nox@nox.paris>2020-04-01 11:40:56 +0200
commit4e64a1c682183a5f982f9b6b9cbc6d99b4a3b6ba (patch)
tree285744114e721ad417a0878f2dd017a37ffda00e /components/script/dom/node.rs
parentd9e4f7a0ba3f5853174d1aa0185932de9cb5ae06 (diff)
downloadservo-4e64a1c682183a5f982f9b6b9cbc6d99b4a3b6ba.tar.gz
servo-4e64a1c682183a5f982f9b6b9cbc6d99b4a3b6ba.zip
Add some comments and remove obsolete allow attributes
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 1a889ae0ac1..f9007bcf9c6 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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]
#[allow(unsafe_code)]
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() }
}
+ // 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]
#[allow(unsafe_code)]
unsafe fn get_style_and_layout_data(self) -> Option<OpaqueStyleAndLayoutData> {
@@ -1490,19 +1497,16 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> {
None
}
- #[allow(unsafe_code)]
fn image_url(self) -> Option<ServoUrl> {
self.downcast::<HTMLImageElement>()
.expect("not an image!")
.image_url()
}
- #[allow(unsafe_code)]
fn image_data(self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)> {
self.downcast::<HTMLImageElement>().map(|e| e.image_data())
}
- #[allow(unsafe_code)]
fn image_density(self) -> Option<f64> {
self.downcast::<HTMLImageElement>()
.expect("not an image!")