diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 0ddb083c1c0..254ed8d4177 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -1644,7 +1644,7 @@ impl Fragment { _ => return None, }; - let mut remaining_inline_size = max_inline_size; + let mut remaining_inline_size = max_inline_size - self.border_padding.inline_start_end(); let mut inline_start_range = Range::new(text_fragment_info.range.begin(), ByteIndex(0)); let mut inline_end_range = None; let mut overflowing = false; diff --git a/components/layout/inline.rs b/components/layout/inline.rs index f734e66eb6a..0bc24d76276 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -636,7 +636,23 @@ impl LineBreaker { // Push the first fragment onto the line we're working on and start off the next line with // the second fragment. If there's no second fragment, the next line will start off empty. match (inline_start_fragment, inline_end_fragment) { - (Some(inline_start_fragment), Some(inline_end_fragment)) => { + (Some(mut inline_start_fragment), Some(mut inline_end_fragment)) => { + inline_start_fragment.border_padding.inline_end = Au(0); + if let Some(ref mut inline_context) = inline_start_fragment.inline_context { + for node in &mut inline_context.nodes { + node.flags.remove(LAST_FRAGMENT_OF_ELEMENT); + } + } + inline_start_fragment.border_box.size.inline += inline_start_fragment.border_padding.inline_start; + + inline_end_fragment.border_padding.inline_start = Au(0); + if let Some(ref mut inline_context) = inline_end_fragment.inline_context { + for node in &mut inline_context.nodes { + node.flags.remove(FIRST_FRAGMENT_OF_ELEMENT); + } + } + inline_end_fragment.border_box.size.inline += inline_end_fragment.border_padding.inline_end; + self.push_fragment_to_line(layout_context, inline_start_fragment, LineFlushMode::Flush); diff --git a/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-001.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-001.htm.ini deleted file mode 100644 index a804c570c98..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-001.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[c5509-ipadn-l-001.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-003.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-003.htm.ini index 6d242c822ca..11101467644 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-003.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/c5509-ipadn-l-003.htm.ini @@ -1,3 +1,4 @@ [c5509-ipadn-l-003.htm] type: reftest - expected: FAIL + expected: + if os == "mac": FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/inlines-017.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/inlines-017.htm.ini deleted file mode 100644 index 9f87e4c3ae1..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/inlines-017.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[inlines-017.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index ee63e759d12..4291bf726aa 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -816,6 +816,18 @@ "url": "/_mozilla/css/border_collapse_simple_a.html" } ], + "css/border_inline_split.html": [ + { + "path": "css/border_inline_split.html", + "references": [ + [ + "/_mozilla/css/border_inline_split_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/border_inline_split.html" + } + ], "css/border_radius_asymmetric_sizes_a.html": [ { "path": "css/border_radius_asymmetric_sizes_a.html", @@ -9970,6 +9982,18 @@ "url": "/_mozilla/css/border_collapse_simple_a.html" } ], + "css/border_inline_split.html": [ + { + "path": "css/border_inline_split.html", + "references": [ + [ + "/_mozilla/css/border_inline_split_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/border_inline_split.html" + } + ], "css/border_radius_asymmetric_sizes_a.html": [ { "path": "css/border_radius_asymmetric_sizes_a.html", diff --git a/tests/wpt/mozilla/tests/css/border_inline_split.html b/tests/wpt/mozilla/tests/css/border_inline_split.html new file mode 100644 index 00000000000..4cf2aaacc11 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/border_inline_split.html @@ -0,0 +1,20 @@ + +
+ + + + + +