aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout/table.rs5
-rw-r--r--components/script/script_task.rs9
-rw-r--r--tests/ref/basic.list1
-rw-r--r--tests/ref/table_containing_block_a.html22
-rw-r--r--tests/ref/table_containing_block_ref.html14
5 files changed, 49 insertions, 2 deletions
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 98569d68c95..1708ceca23a 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -18,6 +18,7 @@ use wrapper::ThreadSafeLayoutNode;
use servo_util::geometry::Au;
use servo_util::geometry;
+use servo_util::logical_geometry::LogicalRect;
use std::fmt;
use style::computed_values::table_layout;
@@ -290,6 +291,10 @@ impl Flow for TableFlow {
fn compute_absolute_position(&mut self) {
self.block_flow.compute_absolute_position()
}
+
+ fn generated_containing_block_rect(&self) -> LogicalRect<Au> {
+ self.block_flow.generated_containing_block_rect()
+ }
}
impl fmt::Show for TableFlow {
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index e743b9a098e..88e2f42415a 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -419,6 +419,12 @@ impl ScriptTask {
loop {
match event {
+ // This has to be handled before the ResizeMsg below,
+ // otherwise the page may not have been added to the
+ // child list yet, causing the find() to fail.
+ FromConstellation(AttachLayoutMsg(new_layout_info)) => {
+ self.handle_new_layout(new_layout_info);
+ }
FromConstellation(ResizeMsg(id, size)) => {
let mut page = self.page.borrow_mut();
let page = page.find(id).expect("resize sent to nonexistent pipeline");
@@ -442,8 +448,7 @@ impl ScriptTask {
for msg in sequential.move_iter() {
match msg {
// TODO(tkuehn) need to handle auxiliary layouts for iframes
- FromConstellation(AttachLayoutMsg(new_layout_info)) =>
- self.handle_new_layout(new_layout_info),
+ FromConstellation(AttachLayoutMsg(_)) => fail!("should have handled AttachLayoutMsg already"),
FromConstellation(LoadMsg(id, url)) => self.load(id, url),
FromScript(TriggerLoadMsg(id, url)) => self.trigger_load(id, url),
FromScript(TriggerFragmentMsg(id, url)) => self.trigger_fragment(id, url),
diff --git a/tests/ref/basic.list b/tests/ref/basic.list
index dcacbaef88a..9cdcdb108fb 100644
--- a/tests/ref/basic.list
+++ b/tests/ref/basic.list
@@ -123,3 +123,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.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
+== table_containing_block_a.html table_containing_block_ref.html
diff --git a/tests/ref/table_containing_block_a.html b/tests/ref/table_containing_block_a.html
new file mode 100644
index 00000000000..1b33586f70c
--- /dev/null
+++ b/tests/ref/table_containing_block_a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style type="text/css">
+ .rel {
+ position: relative;
+ }
+ .abs {
+ position:absolute;
+ }
+ </style>
+ </head>
+ <body>
+ <table class="rel">
+ <tbody>
+ <tr class="abs">
+ <td>Don't crash!</td>
+ </tr>
+ </tbody>
+ </table>
+ </body>
+</html>
diff --git a/tests/ref/table_containing_block_ref.html b/tests/ref/table_containing_block_ref.html
new file mode 100644
index 00000000000..b4377f5e761
--- /dev/null
+++ b/tests/ref/table_containing_block_ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ </head>
+ <body>
+ <table>
+ <tbody>
+ <tr>
+ <td>Don't crash!</td>
+ </tr>
+ </tbody>
+ </table>
+ </body>
+</html>