1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:28:12 +00:00
serenity/Userland/Libraries
Andreas Kling 64959a8504 LibWeb: Express intrinsic size layout via size constraints
Previously, we had three layout modes:

- Normal:
    - Everything uses the computed values from CSS.

- MinContent:
    - Containing blocks act as if they have 0 width.
    - All line breaking opportunities are taken.

- MaxContent:
    - Containing blocks act as if they have infinite width.
    - Only forced line breaks are accepted.

The above was based on a set of misunderstandings of CSS sizing.
A major problem with the above was that *all* containing blocks
behaved differently during intrinsic size layout, not just the
relevant one.

With this patch there are only two layout modes:

- Normal:
    - Everything uses the computed values from CSS.

- IntrinsicSizeDetermination:
    - One or more boxes have size constraints applied.

There are two size constraints per layout box, set here:

- FormattingState::NodeState::width_constraint
- FormattingState::NodeState::height_constraint

They are of type SizeConstraint and can be one of None, MinContent,
or MaxContent. The default is None.

When performing an IntrinsicSizeDetermination layout, we now assign
a size constraint to the box we're trying to determine the intrinsic
size of, which is then honored by using two new helpers to query
the dimensions of containing blocks:

- FormattingContext::containing_block_width_for(Box)
- FormattingContext::containing_block_height_for(Box)

If there's a relevant constraint in effect on the Box, the size of
its containing block is adjusted accordingly.

This is essentially an implementation of the "available space"
constraints from CSS-SIZING-3. I'm sure some things will break from
this, and we'll have to deal with that separately.

Spec: https://drafts.csswg.org/css-sizing-3/#available
2022-07-11 18:57:45 +02:00
..
LibArchive LibArchive: Guard against major() and minor() macros from old glibc 2022-07-05 01:27:37 +02:00
LibAudio LibAudio: Add spec comments to the FlacLoader 2022-06-23 23:16:34 +01:00
LibC Kernel+LibC+LibCore: Pass fcntl extra argument as pointer-sized variable 2022-07-10 20:09:11 +02:00
LibCards LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
LibChess LibChess: Change UCI::Command::Type to enum class 2022-04-03 17:36:48 +01:00
LibCodeComprehension LibCodeComprehension: Re-organize code comprehension related code 2022-05-21 18:15:58 +02:00
LibCompress LibCompress: Write Deflate window size in the Zlib header 2022-07-10 13:52:18 +03:00
LibConfig LibConfig+ConfigServer: Write config values synchronously 2022-04-26 22:51:49 +02:00
LibCore Kernel+LibC+LibCore: Pass fcntl extra argument as pointer-sized variable 2022-07-10 20:09:11 +02:00
LibCoredump Everywhere: Fix two inconsistent serenity_lib() output names 2022-07-03 22:59:13 +02:00
LibCpp LibCpp: Support "FIXME" for comments 2022-06-14 19:07:00 +01:00
LibCrypt Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibCrypto LibCrypto: Add the [[nodiscard]] qualifier in both BigInteger classes 2022-07-09 15:55:32 +00:00
LibDebug LibDebug: Make sure current_breakpoint has value before usage 2022-07-03 21:54:46 +00:00
LibDesktop LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawn 2022-05-25 23:14:22 +01:00
LibDeviceTree Libraries: Add LibDeviceTree for manipulating OpenFirmware Device Trees 2021-10-21 19:20:03 -07:00
LibDiff Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibDl Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibDNS LibDNS: Remove the 'DNS' prefix from the various type and class names 2022-04-15 16:34:26 +01:00
LibDSP LibDSP: Fix keyboard glitch in Classic 2022-05-26 10:24:43 +01:00
LibEDID LibEDID: Return "Unknown" string if failed to determine the manufacturer 2022-06-10 22:32:54 +01:00
LibELF DynamicLoader: Stop performing relative relocations on non-pie objects 2022-07-10 14:24:34 +02:00
LibFileSystemAccessClient FileSystemAccessServer: Call window stealing functions sync 2022-06-30 11:15:24 +01:00
LibGemini AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice() 2022-06-13 15:38:51 +01:00
LibGfx LibGfx: Default-initialize dummy scanline 2022-07-10 21:39:28 +03:00
LibGL LibGL: Add ability to retrieve current clear values from GLContext 2022-06-13 21:45:27 +01:00
LibGPU LibGPU: Do not load LibSoftGPU via symlink inside Serenity 2022-06-13 21:45:27 +01:00
LibGUI LibGUI: Disallow selection identation in readonly text editors 2022-07-10 16:23:40 +02:00
LibHTTP LibHTTP: Include JsonObject.h in Job.cpp 2022-07-04 21:46:02 +02:00
LibImageDecoderClient Userland: Rename IPC::ServerConnection=>IPC::ConnectionToServer 2022-02-25 22:35:12 +01:00
LibIMAP LibIMAP: Properly escape the whole string instead of the first character 2022-07-06 11:12:45 +02:00
LibIPC LibIPC: Make noise when shutting down because of an error 2022-06-10 16:35:05 +01:00
LibJS AK: Treat empty string as invalid JSON 2022-07-10 23:31:48 +02:00
LibKeyboard Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibLine LibLine: Use the real shown line count around in cleanup() 2022-06-22 15:45:27 +02:00
LibM LibM: Implement fma 2022-07-08 22:27:38 +00:00
LibMain LibMain: Statically link LibMain 2022-03-24 03:04:57 +01:00
LibMarkdown LibMarkdown: Add strike-through text support to markdown 2022-04-28 22:15:08 +02:00
LibPCIDB Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibPDF Everywhere: Fix a bunch of typos 2022-05-29 15:22:00 +02:00
LibProtocol LibCore+Everywhere: Make Core::Stream::read() return Bytes 2022-04-16 13:27:51 -04:00
LibPthread LibPthread: Set errno in sem_trywait() 2022-06-12 00:28:26 +01:00
LibRegex LibRegex: Treat inverted Compare entries as disjunctions 2022-07-10 14:26:03 +02:00
LibSanitizer Meta+Userland: Add ENABLE_USERSPACE_COVERAGE_COLLECTION CMake option 2022-05-02 01:46:18 +02:00
LibSoftGPU Everywhere: Fix a bunch of typos 2022-05-29 15:22:00 +02:00
LibSQL AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice() 2022-06-13 15:38:51 +01:00
LibSymbolication Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibSyntax Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibSystem Meta+Userland: Add ENABLE_USERSPACE_COVERAGE_COLLECTION CMake option 2022-05-02 01:46:18 +02:00
LibTest Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibTextCodec Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibThreading Libraries: Use default constructors/destructors in LibThreading 2022-03-13 22:34:38 +01:00
LibTimeZone LibTimeZone: Parse and generate a list of time zones used by region 2022-07-06 16:56:42 +02:00
LibTLS AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice() 2022-06-13 15:38:51 +01:00
LibUnicode LibUnicode: Remove now-unused Unicode::select_pattern_with_plurality 2022-07-08 20:33:52 +02:00
LibUSBDB Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibVideo Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LibVT LibVT+Kernel: Separate the caret shapes and its steadiness 2022-06-22 12:12:00 +01:00
LibWasm LibWasm: Simplify the return instruction execution code a bit 2022-04-22 21:12:47 +04:30
LibWeb LibWeb: Express intrinsic size layout via size constraints 2022-07-11 18:57:45 +02:00
LibWebSocket LibCore+Everywhere: Make Core::Stream read_line() return StringView 2022-04-16 13:27:51 -04:00
LibWebView Browser+LibWeb+WebContent: Allow Browser to load local files 2022-06-27 20:22:15 +01:00
LibX86 LibX86+disasm: Use an output format closer to objdump 2022-04-07 16:50:34 +02:00
LibXML LibXML: Fail gracefully on integer overflow in character references 2022-07-10 22:29:11 +03:00
CMakeLists.txt LibCodeComprehension: Re-organize code comprehension related code 2022-05-21 18:15:58 +02:00