aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r--components/layout/fragment.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 13cf107227e..63fec117a8c 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -23,6 +23,7 @@ use inline::{InlineMetrics, LAST_FRAGMENT_OF_ELEMENT};
use ipc_channel::ipc::IpcSender;
use layout_debug;
use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
+use msg::compositor_msg::{LayerId, LayerType};
use msg::constellation_msg::{PipelineId, SubpageId};
use net_traits::image::base::Image;
use net_traits::image_cache_task::UsePlaceholder;
@@ -2424,6 +2425,19 @@ impl Fragment {
}
}
}
+
+ pub fn layer_id(&self) -> LayerId {
+ let layer_type = match self.pseudo {
+ PseudoElementType::Normal => LayerType::FragmentBody,
+ PseudoElementType::Before(_) => LayerType::BeforePseudoContent,
+ PseudoElementType::After(_) => LayerType::AfterPseudoContent
+ };
+ LayerId::new_of_type(layer_type, self.node.id() as usize)
+ }
+
+ pub fn layer_id_for_overflow_scroll(&self) -> LayerId {
+ LayerId::new_of_type(LayerType::OverflowScroll, self.node.id() as usize)
+ }
}
impl fmt::Debug for Fragment {