Repository navigation
script: Implement console.table - #49314
Conversation
Adds support for console.table, rendering tabular data as a text-based table sent to the embedder, with raw data forwarded to devtools under a new ConsoleLogLevel::Table. Falls back to a plain log call when the argument can't be parsed as tabular data. devtools: Send proper table data for console.table messages (servo#27212) Mirrors Firefox's console-messages.js handling of `level === "table"`: only the first two arguments (data, columns) are forwarded, with the data's `ownProperties`/`preview` rebuilt from its grip so the devtools frontend can render the table. Falls back to `ConsoleLogLevel::Log` when the argument can't be previewed as an object. devtools: Add tests for console.table message handling (servo#27212) Covers arrays, objects, Maps, nested rows, the columns argument, argument truncation, and the fallback to `ConsoleLogLevel::Log` for non-tabular data, matching Firefox's `console-messages.js` behavior. Signed-off-by: Domenico Rizzo <[email protected]>
|
@servo-highfive: assign me |
|
Hey @willypuzzle! Thanks for your interest in working on this issue. It's now assigned to you! |
|
@mrobinson please, would you review this PR? |
|
I will finish reviewing this tonight. |
…ervo#27212) `console.table` calls were mistakenly sent with `ConsoleLogLevel::Log` instead of `ConsoleLogLevel::Table`, so devtools never applied the table-specific handling added earlier. Also moves `console_table_arguments` next to its only caller in the console actor, and switches `console_table_items`/`table_descriptor` to build their JSON through `ObjectPropertyDescriptor` instead of a bespoke `property_descriptor_json` helper, keeping descriptor shape consistent with the rest of the object actor code. Signed-off-by: Domenico Rizzo <[email protected]>
|
@jdm I resolved all your observations :) |
You can run |
@jdm It says me |
|
If that doesn't work you can just run |
|
@jdm done! |
|
Just missing the --signoff from the last commit! |
…#27212) console.table is now implemented, so the previously failing idlharness subtests for the table operation pass and no longer need to be listed as expected failures. Signed-off-by: Domenico Rizzo <[email protected]>
e391d02 to
cb5645e
Compare
@jdm done |
Wire the remaining MVP NWebHandler callbacks from the WebViewDelegate: - show_console_message -> OnConsoleLog (with a concrete NWebConsoleLog), mapping the servo ConsoleLogLevel to NWebConsoleLogLevel. - notify_load_status_changed -> OnLoadingProgress, approximating the 0-100 progress ArkWeb expects from servo's discrete load stages. - notify_crashed -> OnPageLoadError; servo has no per-load network-error callback, so a webview crash is the failure it does surface. Validation: Test by running uv run ports/arkweb/tools/test_navigation.py and checking hilog for console/progress callback lines while it runs. 2026-11-09 sync: `./mach check --ohos -p arkweb`, and the arkweb-test suite on a DAYU200 as for the backend commit. AI-assisted: Yes (agent session; implementation and on-device testing) AI-assisted: Yes (agent session; 2026-11-09 sync -- upstream added `LoadStatus::Stopped` (servo#49427) and `ConsoleLogLevel::Table` (servo#49314): a stopped load reaches full progress, and `console.table()` is logged at the INFO level, as `console.log()` is; found by the drift review) Signed-off-by: Jonathan Schwender <[email protected]>
Wire the remaining MVP NWebHandler callbacks from the WebViewDelegate: - show_console_message -> OnConsoleLog (with a concrete NWebConsoleLog), mapping the servo ConsoleLogLevel to NWebConsoleLogLevel. - notify_load_status_changed -> OnLoadingProgress, approximating the 0-100 progress ArkWeb expects from servo's discrete load stages. - notify_crashed -> OnPageLoadError; servo has no per-load network-error callback, so a webview crash is the failure it does surface. Validation: Test by running uv run ports/arkweb/tools/test_navigation.py and checking hilog for console/progress callback lines while it runs. 2026-11-09 sync: `./mach check --ohos -p arkweb`, and the arkweb-test suite on a DAYU200 as for the backend commit. AI-assisted: Yes (agent session; implementation and on-device testing) AI-assisted: Yes (agent session; 2026-11-09 sync -- upstream added `LoadStatus::Stopped` (servo#49427) and `ConsoleLogLevel::Table` (servo#49314): a stopped load reaches full progress, and `console.table()` is logged at the INFO level, as `console.log()` is; found by the drift review) Signed-off-by: Jonathan Schwender <[email protected]>
Adds support for console.table, rendering tabular data as a text-based table sent to the embedder, with raw data forwarded to devtools under a new ConsoleLogLevel::Table. Falls back to a plain log call when the argument can't be parsed as tabular data.
Mirrors Firefox's console-messages.js handling of
level === "table": only the first two arguments (data, columns) are forwarded, with the data'sownProperties/previewrebuilt from its grip so the devtools frontend can render the table. Falls back toConsoleLogLevel::Logwhen the argument can't be previewed as an object.Testing: Covers arrays, objects, Maps, nested rows, the columns argument, argument truncation, and the fallback to
ConsoleLogLevel::Logfor non-tabular data, matching Firefox'sconsole-messages.jsbehavior.Fixes: #27212