mirror of
https://github.com/servo/servo.git
synced 2025-09-01 10:38:25 +01:00
Start supporting images in layout 2020
This commit is contained in:
parent
f24e8d0557
commit
5a360ac63d
11 changed files with 254 additions and 47 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue