aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock26
-rw-r--r--components/layout_2020/flow/inline.rs18
-rw-r--r--tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-computed.html.ini9
-rw-r--r--tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini87
-rw-r--r--tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-valid.html.ini9
-rw-r--r--tests/wpt/meta/css/css-inline/baseline-source/baseline-source-computed.html.ini9
-rw-r--r--tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-001.html.ini12
-rw-r--r--tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-textarea-001.tentative.html.ini3
-rw-r--r--tests/wpt/meta/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini87
-rw-r--r--tests/wpt/meta/css/css-inline/baseline-source/baseline-source-valid.html.ini9
10 files changed, 25 insertions, 244 deletions
diff --git a/Cargo.lock b/Cargo.lock
index bc05f2a35c9..ded52c4175f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1198,7 +1198,7 @@ dependencies = [
[[package]]
name = "derive_common"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"darling",
"proc-macro2",
@@ -3448,7 +3448,7 @@ dependencies = [
[[package]]
name = "malloc_size_of"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"accountable-refcell",
"app_units",
@@ -5061,7 +5061,7 @@ dependencies = [
[[package]]
name = "selectors"
version = "0.24.0"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"bitflags 2.5.0",
"cssparser",
@@ -5349,7 +5349,7 @@ dependencies = [
[[package]]
name = "servo_arc"
version = "0.2.0"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"nodrop",
"serde",
@@ -5359,7 +5359,7 @@ dependencies = [
[[package]]
name = "servo_atoms"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"string_cache",
"string_cache_codegen",
@@ -5557,7 +5557,7 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
[[package]]
name = "size_of_test"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"static_assertions",
]
@@ -5683,7 +5683,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "static_prefs"
version = "0.1.0"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
[[package]]
name = "strict-num"
@@ -5720,7 +5720,7 @@ dependencies = [
[[package]]
name = "style"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"app_units",
"arrayvec",
@@ -5779,7 +5779,7 @@ dependencies = [
[[package]]
name = "style_config"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"lazy_static",
]
@@ -5787,7 +5787,7 @@ dependencies = [
[[package]]
name = "style_derive"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"darling",
"derive_common",
@@ -5818,7 +5818,7 @@ dependencies = [
[[package]]
name = "style_traits"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"app_units",
"bitflags 2.5.0",
@@ -6172,7 +6172,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "to_shmem"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"cssparser",
"servo_arc",
@@ -6185,7 +6185,7 @@ dependencies = [
[[package]]
name = "to_shmem_derive"
version = "0.0.1"
-source = "git+https://github.com/servo/stylo?branch=2023-10-16#bab07f5fa1d0101d6b3c274e3715d1c1ef77e33c"
+source = "git+https://github.com/servo/stylo?branch=2023-10-16#c22dd97c7a826c04a8fb18f99fde5921ec2eea82"
dependencies = [
"darling",
"derive_common",
diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs
index 8ea53e6017c..bf90a9532f6 100644
--- a/components/layout_2020/flow/inline.rs
+++ b/components/layout_2020/flow/inline.rs
@@ -85,6 +85,7 @@ use style::properties::ComputedValues;
use style::values::computed::Length;
use style::values::generics::box_::VerticalAlignKeyword;
use style::values::generics::font::LineHeight;
+use style::values::specified::box_::BaselineSource;
use style::values::specified::text::{TextAlignKeyword, TextDecorationLine};
use style::values::specified::{TextAlignLast, TextJustify};
use style::Zero;
@@ -2143,13 +2144,18 @@ impl IndependentFormattingContext {
/// Picks either the first or the last baseline, depending on `baseline-source`.
/// <https://drafts.csswg.org/css-inline/#baseline-source>
fn pick_baseline(&self, baselines: &Baselines) -> Option<Au> {
- // TODO: Currently this only supports the initial `baseline-source: auto`.
- if let Self::NonReplaced(non_replaced) = self {
- if let NonReplacedFormattingContextContents::Flow(_) = non_replaced.contents {
- return baselines.last;
- }
+ match self.style().clone_baseline_source() {
+ BaselineSource::First => baselines.first,
+ BaselineSource::Last => baselines.last,
+ BaselineSource::Auto => {
+ if let Self::NonReplaced(non_replaced) = self {
+ if let NonReplacedFormattingContextContents::Flow(_) = non_replaced.contents {
+ return baselines.last;
+ }
+ }
+ baselines.first
+ },
}
- baselines.first
}
fn get_block_sizes_and_baseline_offset(
diff --git a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-computed.html.ini
deleted file mode 100644
index 6c85167ba57..00000000000
--- a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-computed.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[baseline-source-computed.html]
- [Property baseline-source value 'auto']
- expected: FAIL
-
- [Property baseline-source value 'first']
- expected: FAIL
-
- [Property baseline-source value 'last']
- expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini b/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
index 1b550175cb7..42d336c2cc1 100644
--- a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
+++ b/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
@@ -37,90 +37,3 @@
[Web Animations: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.3) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-valid.html.ini
deleted file mode 100644
index 000b6d6c757..00000000000
--- a/tests/wpt/meta-legacy-layout/css/css-inline/baseline-source/baseline-source-valid.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[baseline-source-valid.html]
- [e.style['baseline-source'\] = "auto" should set the property value]
- expected: FAIL
-
- [e.style['baseline-source'\] = "first" should set the property value]
- expected: FAIL
-
- [e.style['baseline-source'\] = "last" should set the property value]
- expected: FAIL
diff --git a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-computed.html.ini b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-computed.html.ini
deleted file mode 100644
index 6c85167ba57..00000000000
--- a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-computed.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[baseline-source-computed.html]
- [Property baseline-source value 'auto']
- expected: FAIL
-
- [Property baseline-source value 'first']
- expected: FAIL
-
- [Property baseline-source value 'last']
- expected: FAIL
diff --git a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-001.html.ini b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-001.html.ini
index f2ce445f9dc..acacc2c3829 100644
--- a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-001.html.ini
+++ b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-001.html.ini
@@ -1,16 +1,4 @@
[baseline-source-first-001.html]
- [.target > * 1]
- expected: FAIL
-
- [.target > * 3]
- expected: FAIL
-
- [.target > * 5]
- expected: FAIL
-
- [.target > * 7]
- expected: FAIL
-
[.target > * 9]
expected: FAIL
diff --git a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-textarea-001.tentative.html.ini b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-textarea-001.tentative.html.ini
index 431bd9eae41..3f4450cd8ac 100644
--- a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-textarea-001.tentative.html.ini
+++ b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-first-textarea-001.tentative.html.ini
@@ -2,9 +2,6 @@
[.target > * 1]
expected: FAIL
- [.target > * 3]
- expected: FAIL
-
[.target > * 5]
expected: FAIL
diff --git a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
index 1b550175cb7..42d336c2cc1 100644
--- a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
+++ b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-no-interpolation.html.ini
@@ -37,90 +37,3 @@
[Web Animations: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-behavior:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.3) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Transitions with transition: all: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (-0.3) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.3) should be [initial\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.5) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (0.6) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (1) should be [last\]]
- expected: FAIL
-
- [CSS Animations: property <baseline-source> from [initial\] to [last\] at (1.5) should be [last\]]
- expected: FAIL
diff --git a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-valid.html.ini b/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-valid.html.ini
deleted file mode 100644
index 000b6d6c757..00000000000
--- a/tests/wpt/meta/css/css-inline/baseline-source/baseline-source-valid.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[baseline-source-valid.html]
- [e.style['baseline-source'\] = "auto" should set the property value]
- expected: FAIL
-
- [e.style['baseline-source'\] = "first" should set the property value]
- expected: FAIL
-
- [e.style['baseline-source'\] = "last" should set the property value]
- expected: FAIL