ladybird/Libraries/LibWeb/HTML/Parser
Andreas Kling 4f855286d7 LibWeb: Clamp layout content sizes to a max value instead of crashing
We've historically asserted that no "saturated" size values end up as
final metrics for boxes in layout. This always had a chance of producing
false positives, since you can trivially create extremely large boxes
with CSS.

The reason we had those assertions was to catch bugs in our own engine
code where we'd incorrectly end up with non-finite values in layout
algorithms. At this point, we've found and fixed all known bugs of that
nature, and what remains are a bunch of false positives on pages that
create very large scrollable areas, iframes etc.

So, let's change it! We now clamp content width and height of boxes to
17895700 pixels, apparently the same cap as Firefox uses.

There's also the issue of calc() being able to produce non-finite
values. Note that we don't clamp the result of calc() directly, but
instead just clamp values when assigning them to content sizes.

Fixes #645.
Fixes #1236.
Fixes #1249.
Fixes #1908.
Fixes #3057.
2025-02-05 18:28:55 +01:00
..
Entities.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Entities.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
HTMLEncodingDetection.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
HTMLEncodingDetection.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
HTMLParser.cpp LibWeb: Clamp layout content sizes to a max value instead of crashing 2025-02-05 18:28:55 +01:00
HTMLParser.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
HTMLToken.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
HTMLToken.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
HTMLToken.swift LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
HTMLTokenizer.cpp LibWeb: Emit comment token for unterminated bogus comments on EOF 2025-01-11 11:09:47 +01:00
HTMLTokenizer.h LibWeb: Teach more of HTMLTokenizer to stop at the insertion point 2024-11-24 11:45:23 +01:00
HTMLTokenizer.swift LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
HTMLTokenizerHelpers.cpp LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
HTMLTokenizerHelpers.h LibWeb: Add remaining states to the Swift tokenizer 2024-11-15 10:51:45 -07:00
ListOfActiveFormattingElements.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ListOfActiveFormattingElements.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
StackOfOpenElements.cpp LibWeb: Fix various typos 2025-01-30 15:00:16 +00:00
StackOfOpenElements.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00