Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boxdump debug command #2286

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Add boxdump debug command #2286

merged 1 commit into from
Feb 1, 2024

Conversation

jellefoks
Copy link
Member

@jellefoks jellefoks commented Jan 24, 2024

This adds a "boxdump()" to the debug console commands, that prints the tree of LayoutBoxes with references to the generating element, enabled for qa/devel/debug builds. This also improves the Cobalt tab for debug console commands to use a textarea instead of pre, with a download button, and execute the debug command on "enter" instead of requiring a separate button press.

To make this possible, the |ConsoleCommandManager| is expanded to support a |CommandHandler| that returns a string.

The "dump_render_tree" is also changed to return the tree as a string for devtools.

Ths boxdump is slightly expanded to also print the computed style non-inherited property values for each box, and some internal state for the flex containers.

b/0nobug

@jellefoks jellefoks force-pushed the boxdump branch 2 times, most recently from eed136a to 7295868 Compare January 24, 2024 23:24
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 81 lines in your changes are missing coverage. Please review.

Comparison is base (bb9e01b) 58.45% compared to head (cd13cf6) 58.44%.

Files Patch % Lines
cobalt/browser/web_module.cc 0.00% 28 Missing ⚠️
cobalt/renderer/pipeline.cc 0.00% 21 Missing ⚠️
cobalt/debug/console/command_manager.cc 26.66% 11 Missing ⚠️
cobalt/debug/backend/cobalt_agent.cc 0.00% 5 Missing ⚠️
cobalt/dom/document.cc 72.22% 5 Missing ⚠️
cobalt/cssom/css_computed_style_data.cc 0.00% 3 Missing ⚠️
cobalt/cssom/css_computed_style_data.h 0.00% 3 Missing ⚠️
cobalt/debug/console/command_manager.h 0.00% 3 Missing ⚠️
cobalt/debug/console/debug_hub.cc 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2286      +/-   ##
==========================================
- Coverage   58.45%   58.44%   -0.01%     
==========================================
  Files        1901     1901              
  Lines       94607    94669      +62     
==========================================
+ Hits        55299    55326      +27     
- Misses      39308    39343      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sherryzy
Copy link
Contributor

sherryzy commented Jan 31, 2024

What will be the output look like? Can you share an example here?

@jellefoks
Copy link
Member Author

What will be the output look like? Can you share an example here?

image

@jellefoks jellefoks merged commit eaeaf5e into youtube:main Feb 1, 2024
339 of 341 checks passed
@jellefoks jellefoks deleted the boxdump branch February 1, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants