mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb/CSS: Implement CSSNumericType.equals()
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
d29084997e
commit
7be645a091
Notes:
github-actions[bot]
2025-08-29 09:58:23 +00:00
Author: https://github.com/AtkinsSJ
Commit: 7be645a091
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5955
Reviewed-by: https://github.com/trflynn89
22 changed files with 181 additions and 16 deletions
|
@ -54,6 +54,23 @@ void CSSNumericValue::initialize(JS::Realm& realm)
|
|||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-equals
|
||||
bool CSSNumericValue::equals_for_bindings(Vector<CSSNumberish> values) const
|
||||
{
|
||||
// The equals(...values) method, when called on a CSSNumericValue this, must perform the following steps:
|
||||
|
||||
// 1. Replace each item of values with the result of rectifying a numberish value for the item.
|
||||
// 2. For each item in values, if the item is not an equal numeric value to this, return false.
|
||||
for (auto const& value : values) {
|
||||
auto rectified_value = rectify_a_numberish_value(realm(), value);
|
||||
if (!is_equal_numeric_value(rectified_value))
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. Return true.
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-type
|
||||
CSSNumericType CSSNumericValue::type_for_bindings() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue