mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Whitespace stripping should not result in a dangling, open border.
This commit is contained in:
parent
2477cfc9b4
commit
2b75ef09f7
5 changed files with 42 additions and 7 deletions
|
@ -1782,20 +1782,20 @@ pub fn strip_ignorable_whitespace_from_start(this: &mut LinkedList<Fragment>) {
|
|||
remaining_fragment.inline_context {
|
||||
if let Some(ref inline_context_of_removed_fragment) =
|
||||
removed_fragment.inline_context {
|
||||
for (i, inline_context_node_from_removed_fragment) in
|
||||
inline_context_of_removed_fragment.nodes.iter().enumerate() {
|
||||
if i >= inline_context_of_remaining_fragment.nodes.len() {
|
||||
break
|
||||
}
|
||||
for (inline_context_node_from_removed_fragment,
|
||||
inline_context_node_from_remaining_fragment) in
|
||||
inline_context_of_removed_fragment.nodes.iter().rev().zip(
|
||||
inline_context_of_remaining_fragment.nodes.iter_mut().rev()
|
||||
) {
|
||||
if !inline_context_node_from_removed_fragment.flags.contains(
|
||||
FIRST_FRAGMENT_OF_ELEMENT) {
|
||||
continue
|
||||
}
|
||||
if inline_context_node_from_removed_fragment.address !=
|
||||
inline_context_of_remaining_fragment.nodes[i].address {
|
||||
inline_context_node_from_remaining_fragment.address {
|
||||
continue
|
||||
}
|
||||
inline_context_of_remaining_fragment.nodes[i].flags.insert(
|
||||
inline_context_node_from_remaining_fragment.flags.insert(
|
||||
FIRST_FRAGMENT_OF_ELEMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1874,6 +1874,8 @@ impl fmt::Debug for InlineFragmentNodeInfo {
|
|||
|
||||
#[derive(Clone)]
|
||||
pub struct InlineFragmentContext {
|
||||
/// The list of nodes that this fragment will be inheriting styles from,
|
||||
/// from the most deeply-nested node out.
|
||||
pub nodes: Vec<InlineFragmentNodeInfo>,
|
||||
}
|
||||
|
||||
|
|
|
@ -5323,6 +5323,18 @@
|
|||
"url": "/_mozilla/css/white_space_intrinsic_sizes_a.html"
|
||||
}
|
||||
],
|
||||
"css/whitespace_no_affect_border.html": [
|
||||
{
|
||||
"path": "css/whitespace_no_affect_border.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/whitespace_no_affect_border_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/whitespace_no_affect_border.html"
|
||||
}
|
||||
],
|
||||
"css/whitespace_nowrap_a.html": [
|
||||
{
|
||||
"path": "css/whitespace_nowrap_a.html",
|
||||
|
@ -11781,6 +11793,18 @@
|
|||
"url": "/_mozilla/css/white_space_intrinsic_sizes_a.html"
|
||||
}
|
||||
],
|
||||
"css/whitespace_no_affect_border.html": [
|
||||
{
|
||||
"path": "css/whitespace_no_affect_border.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/whitespace_no_affect_border_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/whitespace_no_affect_border.html"
|
||||
}
|
||||
],
|
||||
"css/whitespace_nowrap_a.html": [
|
||||
{
|
||||
"path": "css/whitespace_nowrap_a.html",
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Whitespace stripping should not affect the border</title>
|
||||
<link rel="match" href="whitespace_no_affect_border_ref.html">
|
||||
<span style="border: solid 1px #000"> <span>text</span> next</span>
|
|
@ -0,0 +1,4 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Whitespace stripping should not affect the border</title>
|
||||
<span style="border: solid 1px #000"><span>text</span> next</span>
|
Loading…
Add table
Add a link
Reference in a new issue