Alexis Menard

@darktears
5 Followers
28 Following
13 Posts
I work on Blink/Chromium web engine.
@claviska the original dev didn't know about CMake. ChatGPT is cool and everything but at the end the original dev still doesn't know about CMake. Does he need to? Debatable. But who will maintain that going forward? ChatGPT making not so great suggestions?
@claviska It took me couple of days to cleanup a CMakeList.txt (build system file) to work on more than one setup and be a lot better. The original file was generated by ChatGPT. Got rid of 400 lines of code.

@MaxArt2501 @bramus The goal of the API is to be able to lay content on each side of the fold area (whether that's an opaque or transparent area) or avoiding laying out content on the fold area when it requires interactions (e.g. buttons). Basically, what you said making apps aware where the fold is so they can optimize or create new layouts.

Discussing with a few more folks I got convinced about the 1. I'll update the spec.

@MaxArt2501 @bramus I'm not sure I understand the "can't be reduced anymore". When the device is folded segment 1 + fold area + segment 2 = viewport size. If the window is a floating window, then neither on Android, nor Windows we support trying to intersect the browser window with the fold area to give you some partial segments. Segments are subdivisions of the total viewport.

The spec currently has `null` when the device isn't folded or it's a regular device.

@MaxArt2501 @bramus If we return 1 segment for regular devices or a foldable device used flat then the segment will be the exact value of the viewport bringing no additional information you've already have through innerHeight/Width. Then why would you care of the use case where the segment is 1? I'm doing the implementation; I'm just trying to understand why it would ever be useful.
@AliveDevil @bramus Please expand on the closed state. Do you mean it renders on the front screen?
@MaxArt2501 @bramus And in regards to your question about the number of segments > 2. The API is dynamic, it will return the current number of active segments.
@MaxArt2501 @bramus when the device is opened/flat or closed (meaning front screen) why 1 segment though? Semantically a segment is a part of something that is divided. If the viewport is not divided, then there are no segments. When the device is not folded there are no divisions therefore no segments. Why do you need to treat the opened case differently than any other device? What would the 1 segment information would help you with? Especially if it contains the same info as `viewport`?
@nhoizey that's why I beefed up DevTools 😀 . You now can emulate two new devices. A foldable PC and a foldable Android which will set the segments. You can also change the posture in the devtools for both of them. And you can see where the hinge/fold would land in your page.
@nhoizey now I hope you'll try them :)