aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock12
-rw-r--r--components/layout/construct.rs22
-rw-r--r--components/util/Cargo.toml1
-rw-r--r--ports/cef/Cargo.lock13
-rw-r--r--tests/ref/basic.list1
-rw-r--r--tests/ref/float_table_a.html35
-rw-r--r--tests/ref/float_table_ref.html22
7 files changed, 89 insertions, 17 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a9293f5921f..b79a663c2f8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -162,7 +162,7 @@ dependencies = [
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig#6e02b6df7815dc4bf1f8ef20b926e717891f8544)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype#fb15dd309750c8ec664b2c9f245cfcb06731872e)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#2982b770db6e5e3270305e0fd6b8068f6f80a489)",
- "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz#f07c6ae3111a94945f0f04b5f0d7c4e7c20958e9)",
+ "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz#a502be3df659cd13bac0e62638f4dac3dfb2f52d)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers#c04029907be1f2242d48235d3b03608b905bbd9f)",
"macros 0.0.1",
"msg 0.0.1",
@@ -194,7 +194,7 @@ dependencies = [
[[package]]
name = "harfbuzz"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-harfbuzz#f07c6ae3111a94945f0f04b5f0d7c4e7c20958e9"
+source = "git+https://github.com/servo/rust-harfbuzz#a502be3df659cd13bac0e62638f4dac3dfb2f52d"
[[package]]
name = "http"
@@ -409,17 +409,17 @@ source = "git+https://github.com/servo/rust-stb-image#f5022de4ad6bb474a03493d1f2
[[package]]
name = "string_cache"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1"
+source = "git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a"
dependencies = [
"phf 0.0.0 (git+https://github.com/sfackler/rust-phf#fa5d803428dd760287330571c919c7c5e11b2e1b)",
"phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#fa5d803428dd760287330571c919c7c5e11b2e1b)",
- "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1)",
+ "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a)",
]
[[package]]
name = "string_cache_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1"
+source = "git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a"
[[package]]
name = "style"
@@ -451,7 +451,7 @@ version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure#9c5567b79d8b87e8ef3b48c5842f453978035d21)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#2982b770db6e5e3270305e0fd6b8068f6f80a489)",
- "string_cache 0.0.0 (git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1)",
+ "string_cache 0.0.0 (git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a)",
"task_info 0.0.1",
]
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index d48612375d4..466a254237d 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -684,7 +684,8 @@ impl<'a, 'b> FlowConstructor<'a, 'b> {
/// Builds a flow for a node with `display: table`. This yields a `TableWrapperFlow` with possibly
/// other `TableCaptionFlow`s or `TableFlow`s underneath it.
- fn build_flow_for_table_wrapper(&mut self, node: &ThreadSafeLayoutNode) -> ConstructionResult {
+ fn build_flow_for_table_wrapper(&mut self, node: &ThreadSafeLayoutNode,
+ float_value: float::T) -> ConstructionResult {
let fragment = Fragment::new_from_specific_info(node, TableWrapperFragment);
let wrapper_flow = box TableWrapperFlow::from_node_and_fragment(node, fragment);
let mut wrapper_flow = FlowRef::new(wrapper_flow as Box<Flow>);
@@ -734,7 +735,20 @@ impl<'a, 'b> FlowConstructor<'a, 'b> {
abs_descendants.push(wrapper_flow.clone());
}
}
- FlowConstructionResult(wrapper_flow, abs_descendants)
+
+ match float_value {
+ float::none => {
+ FlowConstructionResult(wrapper_flow, abs_descendants)
+ }
+ _ => {
+ let float_kind = FloatKind::from_property(float_value);
+ let float_flow = box BlockFlow::float_from_node(self, node, float_kind) as Box<Flow>;
+ let mut float_flow = FlowRef::new(float_flow);
+ float_flow.add_new_child(wrapper_flow);
+ float_flow.finish(self.layout_context);
+ FlowConstructionResult(float_flow, abs_descendants)
+ }
+ }
}
/// Builds a flow for a node with `display: table-caption`. This yields a `TableCaptionFlow`
@@ -858,8 +872,8 @@ impl<'a, 'b> PostorderNodeMutTraversal for FlowConstructor<'a, 'b> {
}
// Table items contribute table flow construction results.
- (display::table, _, _) => {
- let construction_result = self.build_flow_for_table_wrapper(node);
+ (display::table, float_value, _) => {
+ let construction_result = self.build_flow_for_table_wrapper(node, float_value);
node.set_flow_construction_result(construction_result)
}
diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml
index be6662b76f6..6f4824fd65a 100644
--- a/components/util/Cargo.toml
+++ b/components/util/Cargo.toml
@@ -18,3 +18,4 @@ path = "../../support/rust-task_info"
[dependencies.string_cache]
git = "https://github.com/servo/string-cache"
+
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index a3ed1159df2..dad6d3e58d2 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -175,7 +175,7 @@ dependencies = [
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig#6e02b6df7815dc4bf1f8ef20b926e717891f8544)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype#fb15dd309750c8ec664b2c9f245cfcb06731872e)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#2982b770db6e5e3270305e0fd6b8068f6f80a489)",
- "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz#f07c6ae3111a94945f0f04b5f0d7c4e7c20958e9)",
+ "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz#a502be3df659cd13bac0e62638f4dac3dfb2f52d)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers#c04029907be1f2242d48235d3b03608b905bbd9f)",
"macros 0.0.1",
"msg 0.0.1",
@@ -207,7 +207,7 @@ dependencies = [
[[package]]
name = "harfbuzz"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-harfbuzz#f07c6ae3111a94945f0f04b5f0d7c4e7c20958e9"
+source = "git+https://github.com/servo/rust-harfbuzz#a502be3df659cd13bac0e62638f4dac3dfb2f52d"
[[package]]
name = "http"
@@ -414,7 +414,6 @@ dependencies = [
"layout 0.0.1",
"msg 0.0.1",
"net 0.0.1",
- "png 0.1.0 (git+https://github.com/servo/rust-png#f3640b37e71a02ee3e140e181cc9accb0a123e16)",
"script 0.0.1",
"util 0.0.1",
]
@@ -446,17 +445,17 @@ source = "git+https://github.com/servo/rust-stb-image#f5022de4ad6bb474a03493d1f2
[[package]]
name = "string_cache"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1"
+source = "git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a"
dependencies = [
"phf 0.0.0 (git+https://github.com/sfackler/rust-phf#fa5d803428dd760287330571c919c7c5e11b2e1b)",
"phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#fa5d803428dd760287330571c919c7c5e11b2e1b)",
- "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1)",
+ "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a)",
]
[[package]]
name = "string_cache_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1"
+source = "git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a"
[[package]]
name = "style"
@@ -488,7 +487,7 @@ version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure#9c5567b79d8b87e8ef3b48c5842f453978035d21)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#2982b770db6e5e3270305e0fd6b8068f6f80a489)",
- "string_cache 0.0.0 (git+https://github.com/servo/string-cache#aa4365ac8da8504a82c709f97b6bcace9b0af4a1)",
+ "string_cache 0.0.0 (git+https://github.com/servo/string-cache#6d5a6669d05fcc20fe0436a7f9a63310e2bc522a)",
"task_info 0.0.1",
]
diff --git a/tests/ref/basic.list b/tests/ref/basic.list
index 7c26bc7b2e1..dcacbaef88a 100644
--- a/tests/ref/basic.list
+++ b/tests/ref/basic.list
@@ -122,3 +122,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html
== inline_block_margin_a.html inline_block_margin_ref.html
== inline_block_img_a.html inline_block_img_ref.html
== inline_block_baseline_a.html inline_block_baseline_ref.html
+== float_table_a.html float_table_ref.html
diff --git a/tests/ref/float_table_a.html b/tests/ref/float_table_a.html
new file mode 100644
index 00000000000..7c3517563eb
--- /dev/null
+++ b/tests/ref/float_table_a.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: 'ahem';
+ src: url(fonts/ahem/ahem.ttf);
+ }
+ body {
+ margin: 0;
+ }
+ table {
+ font-family: 'ahem';
+ font-size: 100px;
+ color: red;
+ float: right;
+ line-height: 1;
+ }
+ td {
+ padding: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <table>
+ <tbody>
+ <tr>
+ <td>X</td>
+ </tr>
+ </tbody>
+ </table>
+ </body>
+</html>
diff --git a/tests/ref/float_table_ref.html b/tests/ref/float_table_ref.html
new file mode 100644
index 00000000000..78d1f44fddd
--- /dev/null
+++ b/tests/ref/float_table_ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="UTF-8">
+ <style type="text/css">
+ body {
+ margin: 0;
+ }
+ div {
+ background-color: red;
+ width: 100px;
+ height: 100px;
+ position: absolute;
+ right: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div></div>
+ </body>
+</html>