Merge layout and layout_tests

This commit is contained in:
Anthony Ramine 2018-01-19 12:12:47 +01:00
parent c2ed7c9632
commit a311e0f569
8 changed files with 42 additions and 54 deletions

9
Cargo.lock generated
View file

@ -1483,6 +1483,7 @@ dependencies = [
"servo_config 0.0.1",
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"size_of_test 0.0.1",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
"style_traits 0.0.1",
@ -1491,14 +1492,6 @@ dependencies = [
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "layout_tests"
version = "0.0.1"
dependencies = [
"layout 0.0.1",
"size_of_test 0.0.1",
]
[[package]]
name = "layout_thread"
version = "0.0.1"

View file

@ -8,6 +8,8 @@ publish = false
[lib]
name = "layout"
path = "lib.rs"
test = false
doctest = false
[dependencies]
app_units = "0.6.1"
@ -46,3 +48,6 @@ style_traits = {path = "../style_traits"}
unicode-bidi = {version = "0.3", features = ["with_serde"]}
unicode-script = {version = "0.1", features = ["harfbuzz"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
[dev-dependencies]
size_of_test = {path = "../size_of_test"}

View file

@ -140,22 +140,22 @@ pub struct InlineFragmentsConstructionResult {
///
/// The resulting `ConstructionItem` for the outer `span` will be:
///
/// ```ignore
/// ```rust,ignore
/// ConstructionItem::InlineFragments(
/// InlineFragmentsConstructionResult{
/// InlineFragmentsConstructionResult {
/// splits: linked_list![
/// InlineBlockSplit{
/// predecessors: IntermediateInlineFragments{
/// InlineBlockSplit {
/// predecessors: IntermediateInlineFragments {
/// fragments: linked_list![A],
/// absolute_descendents: AbsoluteDescendents{
/// absolute_descendents: AbsoluteDescendents {
/// descendant_links: vec![]
/// }
/// },
/// },
/// flow: B
/// flow: B,
/// }
/// ],
/// fragments: linked_list![C],
/// }
/// },
/// )
/// ```
#[derive(Clone)]

View file

@ -552,11 +552,13 @@ pub trait MutableOwnedFlowUtils {
/// Sets the flow as the containing block for all absolute descendants that have been marked
/// as having reached their containing block. This is needed in order to handle cases like:
///
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```html
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```
fn take_applicable_absolute_descendants(&mut self,
absolute_descendants: &mut AbsoluteDescendants);
}
@ -742,12 +744,14 @@ pub struct AbsoluteDescendantInfo {
/// Whether the absolute descendant has reached its containing block. This exists so that we
/// can handle cases like the following:
///
/// <div>
/// <span id=a style="position: absolute; ...">foo</span>
/// <span style="position: relative">
/// <span id=b style="position: absolute; ...">bar</span>
/// </span>
/// </div>
/// ```html
/// <div>
/// <span id=a style="position: absolute; ...">foo</span>
/// <span style="position: relative">
/// <span id=b style="position: absolute; ...">bar</span>
/// </span>
/// </div>
/// ```
///
/// When we go to create the `InlineFlow` for the outer `div`, our absolute descendants will
/// be `a` and `b`. At this point, we need a way to distinguish between the two, because the
@ -1343,11 +1347,13 @@ impl MutableOwnedFlowUtils for FlowRef {
/// Sets the flow as the containing block for all absolute descendants that have been marked
/// as having reached their containing block. This is needed in order to handle cases like:
///
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```html
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```
fn take_applicable_absolute_descendants(&mut self,
absolute_descendants: &mut AbsoluteDescendants) {
let mut applicable_absolute_descendants = AbsoluteDescendants::new();

View file

@ -2,6 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg(target_pointer_width = "64")]
extern crate layout;
#[macro_use] extern crate size_of_test;
use layout::Fragment;
use layout::SpecificFragmentInfo;

View file

@ -231,7 +231,7 @@ class MachCommands(CommandBase):
else:
test_patterns.append(test)
self_contained_tests = ["gfx", "msg", "selectors"]
self_contained_tests = ["gfx", "layout", "msg", "selectors"]
if not packages:
packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store'])
packages |= set(self_contained_tests)

View file

@ -1,14 +0,0 @@
[package]
name = "layout_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
[lib]
name = "layout_tests"
path = "lib.rs"
doctest = false
[dependencies]
layout = {path = "../../../components/layout"}
size_of_test = {path = "../../../components/size_of_test"}

View file

@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#[cfg(all(test, target_pointer_width = "64"))] extern crate layout;
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;