diff --git a/components/layout/block.rs b/components/layout/block.rs index fa91b847b20..0b10ef39000 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1020,8 +1020,12 @@ impl BlockFlow { self.base.position.size.block = cur_b; } - // Store the current set of floats in the flow so that flows that come later in the + // Translate the current set of floats back into the parent coordinate system in the + // inline direction, and store them in the flow so that flows that come later in the // document can access them. + floats.translate(LogicalSize::new(writing_mode, + self.fragment.inline_start_offset(), + Au(0))); self.base.floats = floats.clone(); self.adjust_fragments_for_collapsed_margins_if_root(layout_context); } else { diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 4285757014f..be3c9a95e51 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -1608,6 +1608,18 @@ "url": "/_mozilla/css/floated_table_with_margin_a.html" } ], + "css/floats_inline_margins_a.html": [ + { + "path": "css/floats_inline_margins_a.html", + "references": [ + [ + "/_mozilla/css/floats_inline_margins_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/floats_inline_margins_a.html" + } + ], "css/floats_margin_collapse_a.html": [ { "path": "css/floats_margin_collapse_a.html", @@ -8336,6 +8348,18 @@ "url": "/_mozilla/css/floated_table_with_margin_a.html" } ], + "css/floats_inline_margins_a.html": [ + { + "path": "css/floats_inline_margins_a.html", + "references": [ + [ + "/_mozilla/css/floats_inline_margins_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/floats_inline_margins_a.html" + } + ], "css/floats_margin_collapse_a.html": [ { "path": "css/floats_margin_collapse_a.html", diff --git a/tests/wpt/mozilla/tests/css/floats_inline_margins_a.html b/tests/wpt/mozilla/tests/css/floats_inline_margins_a.html new file mode 100644 index 00000000000..19b4910e6e0 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/floats_inline_margins_a.html @@ -0,0 +1,27 @@ + + +
submitted
+x
+ +