cobalt icon indicating copy to clipboard operation
cobalt copied to clipboard

Improve Nested Flexboxes.

Open jellefoks opened this issue 1 year ago • 4 comments

This fixes calculation for the main direction length and position of flex items in horizontal flex containers that are themselves also flex containers in vertical direction.

Further related improvements and tests will be added in a separate commit.

b/197582262

jellefoks avatar Feb 05 '24 18:02 jellefoks

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 59.87%. Comparing base (6f1f96e) to head (4dca6db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2378      +/-   ##
==========================================
+ Coverage   59.84%   59.87%   +0.02%     
==========================================
  Files        1832     1832              
  Lines       88596    88596              
==========================================
+ Hits        53021    53046      +25     
+ Misses      35575    35550      -25     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 05 '24 21:02 codecov[bot]

May I ask about the status and progress of this PR?

This seems to be a good improvement. Now no word wrap in some applications, ie text will be on one line as it should. However we see problem with it.

  1. Changed space Here is a small html page with two texts that will get different space between them. FlexFixProblem1.html.zip FlexFixProblem1

  2. flexbox.help I found a webpage to test flex stuff: https://flexbox.help/ However it doesn't work in Cobalt. I redesign it so it works in Cobalt and using key press to do changes. flexbox.help.zip Five things can be changed and each have several settings. This will give a huge amount of combinations. I did a script stepping each second. Took 35 minutes. Seems it get problems if flex-direction is column or column-reverse (and the others is not zero). My page can also be run in Chromium for comparison. I found several differences. This PR make changes and some make Cobalt show like Chromium, but some not. I haven't taken screenshots, but please checkout these combinations: 20100, 20010, 31525 and 12434.

  3. Norigin Spatial Navigation An application that uses Norigin Spatial Navigation library gets big problem. In short cannot run at all. Need to kill the cobalt process to recover. Maybe something about getting stuck in a focus function. https://github.com/NoriginMedia/Norigin-Spatial-Navigation

[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    base::debug::StackTrace::StackTrace() [0x7fbe636272de]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    base::task_runner_util::PostBlockingTask() [0x7fbe6330ef96]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    cobalt::browser::WebModule::Focus() [0x7fbe633001f3]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    cobalt::browser::BrowserModule::Focus() [0x7fbe632e676d]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    cobalt::browser::Application::OnApplicationEvent() [0x7fbe632d7567]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    starboard::shared::starboard::Application::HandleEventAndUpdateState() [0x7fbe621229c3]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    starboard::shared::starboard::Application::RunLoop() [0x7fbe62121b99]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    starboard::shared::starboard::Application::Run() [0x7fbe62121e72]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    SbRunStarboardMain [0x7fbe620293bf]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    <unknown> [0x7fbe61887d90]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    __libc_start_main [0x7fbe61887e40]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    <unknown> [0x558c6620583a]
[PostBlockingTask deadlock from Focus@cobalt/browser/web_module.cc:1641]    <unknown> [0x558c6620583a]

MichaelSweden avatar Jun 11 '24 09:06 MichaelSweden

Here is information from the "d.boxdump()" debug command for the "1. Changed space" I wrote about above. I think it is a margin that disappear. FlexFixProblem1-boxdump.zip

MichaelSweden avatar Jun 25 '24 12:06 MichaelSweden

Here is a small application (web page) that recreate the problem I wrote about earlier, that occur with this PR and Norigin Spatial Navigation library. See README.txt file for information on how to use it. I also attach info from d.boxdump() command, with and without this PR. 20240710-flexbox-test.zip boxdump-flexboxtest-beforePR.txt boxdump-flexboxtest-afterPR.txt flexbox-test It is 6 items and it shall be possible to move up and down with the arrow keys, focus will change. However with this PR moving down will get stuck on item 4. The first with nested flex column.

MichaelSweden avatar Jul 10 '24 12:07 MichaelSweden