Skip to content

Commit 86ad841

Browse files
author
bors-servo
authored
Auto merge of servo#24165 - nox:victor, r=SimonSapin
Import victor's layout system 🍷 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24165) <!-- Reviewable:end -->
2 parents ec1da1d + 4444c5a commit 86ad841

File tree

26 files changed

+3327
-243
lines changed

26 files changed

+3327
-243
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Agoston Szepessy <agszepp@gmail.com>
66
Alexander Popiak <alex@zenguard.org> <alexander.popiak@gmail.com>
77
Alexandrov Sergey <splavgm@gmail.com>
88
Antonio de Luna <tonydelun@gmail.com>
9+
Anthony Ramine <nox@nox.paris> <n.oxyde@gmail.com>
910
Askeing Yen (fyen) <askeing@gmail.com>
1011
Attila Dusnoki <dati91@gmail.com> <dati91@users.noreply.github.com>
1112
bd339 <bd339@tuta.io> <bd339@localhost.localdomain>

Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/layout/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ pub fn style_length(style_length: Size, container_size: Option<Au>) -> MaybeAuto
502502
match style_length {
503503
Size::Auto => MaybeAuto::Auto,
504504
Size::LengthPercentage(ref lp) => {
505-
MaybeAuto::from_option(lp.0.maybe_to_used_value(container_size))
505+
MaybeAuto::from_option(lp.0.maybe_to_used_value(container_size.map(|l| l.into())))
506506
},
507507
}
508508
}

components/layout_2020/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ doctest = false
1414

1515
[dependencies]
1616
app_units = "0.7"
17+
atomic_refcell = "0.1"
18+
cssparser = "0.25"
1719
euclid = "0.20"
1820
fnv = "1.0"
1921
gfx = {path = "../gfx"}
2022
gfx_traits = {path = "../gfx_traits"}
2123
ipc-channel = "0.12"
2224
libc = "0.2"
2325
malloc_size_of = { path = "../malloc_size_of" }
26+
matches = "0.1"
2427
msg = {path = "../msg"}
2528
range = {path = "../range"}
2629
rayon = "1"
30+
rayon_croissant = "0.1.1"
2731
script_layout_interface = {path = "../script_layout_interface"}
2832
script_traits = {path = "../script_traits"}
2933
serde = "1.0"
30-
servo_arc = {path = "../servo_arc"}
34+
servo_arc = { path = "../servo_arc" }
3135
servo_url = {path = "../url"}
3236
style = {path = "../style", features = ["servo", "servo-layout-2020"]}
3337
style_traits = {path = "../style_traits"}

components/layout_2020/context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

5+
use gfx::font_cache_thread::FontCacheThread;
56
use msg::constellation_msg::PipelineId;
7+
use std::sync::Mutex;
68
use style::context::SharedStyleContext;
79

810
pub struct LayoutContext<'a> {
911
pub id: PipelineId,
1012
pub style_context: SharedStyleContext<'a>,
13+
pub font_cache_thread: Mutex<FontCacheThread>,
1114
}
1215

1316
impl<'a> LayoutContext<'a> {

components/layout_2020/data.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

5+
use crate::element_data::LayoutDataForElement;
6+
use atomic_refcell::AtomicRefCell;
57
use script_layout_interface::StyleData;
68

79
#[repr(C)]
810
pub struct StyleAndLayoutData {
911
pub style_data: StyleData,
12+
pub(super) layout_data: AtomicRefCell<LayoutDataForElement>,
1013
}
1114

1215
impl StyleAndLayoutData {
1316
pub fn new() -> Self {
1417
Self {
1518
style_data: StyleData::new(),
19+
layout_data: Default::default(),
1620
}
1721
}
1822
}

0 commit comments

Comments
 (0)