LibDevTools: Don't assume computed layout values are strings
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

Width and height are doubles, so get_string() will return nothing and
fail. We just want a JsonValue here without caring what type it is, so
let's just use get() instead.
This commit is contained in:
Sam Atkins 2025-09-26 15:16:49 +01:00 committed by Andreas Kling
commit 11a6b6f38f
Notes: github-actions[bot] 2025-09-26 20:32:58 +00:00

View file

@ -30,7 +30,7 @@ static void received_layout(JsonObject& response, JsonValue const& node_box_sizi
response.set(key, MUST(String::formatted("{}px", pixel_value(key))));
};
auto set_computed_value = [&](auto key) {
response.set(key, node_box_sizing.as_object().get_string(key).value_or(String {}));
response.set(key, node_box_sizing.as_object().get(key).value_or(String {}));
};
// FIXME: This response should also contain "top", "right", "bottom", and "left", but our box model metrics in