Skip to content
Permalink
Browse files

Import victor's layout system 🍷

  • Loading branch information...
nox committed Sep 9, 2019
1 parent 8690475 commit 4444c5a2adfec909e165497ca331c09e02ee54cc
@@ -6,6 +6,7 @@ Agoston Szepessy <agszepp@gmail.com>
Alexander Popiak <alex@zenguard.org> <alexander.popiak@gmail.com>
Alexandrov Sergey <splavgm@gmail.com>
Antonio de Luna <tonydelun@gmail.com>
Anthony Ramine <nox@nox.paris> <n.oxyde@gmail.com>
Askeing Yen (fyen) <askeing@gmail.com>
Attila Dusnoki <dati91@gmail.com> <dati91@users.noreply.github.com>
bd339 <bd339@tuta.io> <bd339@localhost.localdomain>

Some generated files are not rendered by default. Learn more.

@@ -502,7 +502,7 @@ pub fn style_length(style_length: Size, container_size: Option<Au>) -> MaybeAuto
match style_length {
Size::Auto => MaybeAuto::Auto,
Size::LengthPercentage(ref lp) => {
MaybeAuto::from_option(lp.0.maybe_to_used_value(container_size))
MaybeAuto::from_option(lp.0.maybe_to_used_value(container_size.map(|l| l.into())))
},
}
}
@@ -14,19 +14,24 @@ doctest = false

[dependencies]
app_units = "0.7"
atomic_refcell = "0.1"
cssparser = "0.25"
euclid = "0.20"
fnv = "1.0"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
ipc-channel = "0.12"
libc = "0.2"
malloc_size_of = { path = "../malloc_size_of" }
matches = "0.1"
msg = {path = "../msg"}
range = {path = "../range"}
rayon = "1"
rayon_croissant = "0.1.1"
script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
serde = "1.0"
servo_arc = { path = "../servo_arc" }
servo_url = {path = "../url"}
style = {path = "../style", features = ["servo", "servo-layout-2020"]}
style_traits = {path = "../style_traits"}
@@ -2,12 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use gfx::font_cache_thread::FontCacheThread;
use msg::constellation_msg::PipelineId;
use std::sync::Mutex;
use style::context::SharedStyleContext;

pub struct LayoutContext<'a> {
pub id: PipelineId,
pub style_context: SharedStyleContext<'a>,
pub font_cache_thread: Mutex<FontCacheThread>,
}

impl<'a> LayoutContext<'a> {
@@ -2,17 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use crate::element_data::LayoutDataForElement;
use atomic_refcell::AtomicRefCell;
use script_layout_interface::StyleData;

#[repr(C)]
pub struct StyleAndLayoutData {
pub style_data: StyleData,
pub(super) layout_data: AtomicRefCell<LayoutDataForElement>,
}

impl StyleAndLayoutData {
pub fn new() -> Self {
Self {
style_data: StyleData::new(),
layout_data: Default::default(),
}
}
}

0 comments on commit 4444c5a

Please sign in to comment.
You can’t perform that action at this time.