aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/fragments.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2019-11-29 09:28:44 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-12-01 10:56:33 +0100
commit5a360ac63d374023884289ca86b7c2390394c533 (patch)
treeddd0f62d6628b36f44d857be64bfa14e8ea1564d /components/layout_2020/fragments.rs
parentf24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3 (diff)
downloadservo-5a360ac63d374023884289ca86b7c2390394c533.tar.gz
servo-5a360ac63d374023884289ca86b7c2390394c533.zip
Start supporting images in layout 2020
Diffstat (limited to 'components/layout_2020/fragments.rs')
-rw-r--r--components/layout_2020/fragments.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/layout_2020/fragments.rs b/components/layout_2020/fragments.rs
index a0ea097abb6..e0c335eb3c9 100644
--- a/components/layout_2020/fragments.rs
+++ b/components/layout_2020/fragments.rs
@@ -10,12 +10,13 @@ use std::sync::Arc;
use style::properties::ComputedValues;
use style::values::computed::Length;
use style::Zero;
-use webrender_api::FontInstanceKey;
+use webrender_api::{FontInstanceKey, ImageKey};
pub(crate) enum Fragment {
Box(BoxFragment),
Anonymous(AnonymousFragment),
Text(TextFragment),
+ Image(ImageFragment),
}
pub(crate) struct BoxFragment {
@@ -61,6 +62,12 @@ pub(crate) struct TextFragment {
pub glyphs: Vec<Arc<GlyphStore>>,
}
+pub(crate) struct ImageFragment {
+ pub style: ServoArc<ComputedValues>,
+ pub content_rect: Rect<Length>,
+ pub image_key: ImageKey,
+}
+
impl AnonymousFragment {
pub fn no_op(mode: (WritingMode, Direction)) -> Self {
Self {