summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2023-06-05LibWeb: Ensure that contentType in Blob::slice is basic latinShannon Booth
2023-06-04LibWeb: Account for negative margins when calculating float intrusionAndreas Kling
If a box has a negative margin-left, it may have a negative effective offset within its parent BFC root coordinate system. We can account for this when calculating the amount of left-side float intrusion by flooring the X offset at 0.
2023-06-03LibWeb: Rewind TokenStream if we reject a parsed value as out-of-boundsSam Atkins
Wrap the parsing of numbers, integers, and dimensions in a transaction, which we only commit if that parsed value was actually accepted by the property. This fixes `font: 0/0 a;` failing to parse.
2023-06-03LibWeb: Exit `parse_font_family_value()` when hitting an illegal tokenSam Atkins
...instead of looping forever. Oops! :^)
2023-06-03LibWeb: Don't crash when document.write a script with src attrZhiyuan Guo
To abort the processing of any nested invocations of the tokenizer, just return is enough in this case. During the process of pending parsing blocking script, the is_ready_to_be_parser_executed() check should be applied on the blocking script, not the original script.
2023-06-03LibWeb: Detect and reject math functions with no resolved typeSam Atkins
... instead of crashing :^)
2023-06-03LibWeb: Resolve the `transition-delay` propertystelar7
2023-06-03LibWeb: Implement the `<symbol>` SVG elementPrestonLTaylor
2023-06-03LibWeb: Implement the `<use>` SVG elementPrestonLTaylor
The SVG <use> element is used to be able to reuse other SVG graphics without having to re-write the svg element. We now support this feature! :^)
2023-06-03LibWeb: Add document_fully_loaded event to DocumentObserverPrestonLTaylor
SVGUseElement needs to be able to query the fully loaded document for its referenced element.
2023-06-03LibWeb: Allow SVG painting to escape out of a shadow treePrestonLTaylor
The spec for the `<use>` element requires a shadow tree for the rendered content, so we need to be able to escape shadow trees when rendering svg content.
2023-06-03LibWeb: Implement `details_notification_task_steps` for <details>stelar7
2023-06-03LibWeb: Implement the <summary> elementstelar7
2023-06-03LibWeb: Make disclosure marker bounds squareSimon Wanner
This makes sure we actually render an equilateral triangle inside a square.
2023-06-03LibWeb: Support list-style-positionSimon Wanner
This moves the ::marker inside of <summary> actually inside. :^)
2023-06-03LibWeb: Make pseudo-elements inspectableSimon Wanner
This makes it possible to set a pseudo-element as the inspected node using Document::set_inspected_node(), Document then provides inspected_layout_node() for the painting related functions.
2023-06-03LibWeb: Add list-style-type: disclosure-{closed,open}Simon Wanner
These markers are rendered as equilateral triangles pointing right and down respectively. As we currently don't implement writing-mode the closed marker does not respect it.
2023-06-02LibWeb: Fix order/formatting of Properties.jsonSam Atkins
2023-06-02LibWeb: Add missing value ranges to CSS propertiesSam Atkins
...except those related to `grid`, because I can't figure out how the 17 different properties interact with each other, and what values apply to which ones. 😅 All but 1 of these are the infinite range `[-∞,∞]`. As such, specifying that range does not change anything, but it does make it explicit that we've looked at what the range should be, instead of just not having added it.
2023-06-02LibWeb: Support font-size: calc()Andreas Kling
Now that we have a way to resolve calc() lengths without a layout node, we can finally support calc() values in font-size. This wasn't possible before because font-related properties have to be resolved eagerly in StyleComputer due to font-relative CSS length units depending on the computed font being known.
2023-06-02LibWeb: Add a way to resolve calc() values without a layout nodeAndreas Kling
Instead of a layout node, you can pass a new Length::ResolutionContext struct which contains everything needed to resolve calc() lengths.
2023-06-02LibWeb: Fix crashing when grid track size is calc() with percentageAliaksandr Kalenik
Use contains_percentage() that works for calc() values instead of is_percentage(). This fixes issue when tracks with calc() that has percentages where considered as "fixed" tracks with resolvable size which led to incorrectly resolved infinite final track sizes.
2023-06-02LibWeb: Bounds-check parsed CSS typesSam Atkins
This reintroduces bounds-checking for the CSS `<angle>`, `<frequency>`, `<integer>`, `<length>`, `<number>`, `<percentage>`, `<resolution>`, and `<time>` types. I regressed this around 6b8f4841145a53553c0007a6ff4feefec98a426a when changing how we parsed StyleValues. This is an improvement from before though, since we now allow the bounds of a dimension type to have units. Added a test to make sure we don't regress this again. :^)
2023-06-02LibWeb: Add comparison operators to CSS numeric types (except Length)Sam Atkins
This is to make it easier to bounds-check their values during parsing. Length is left out because many length units are relative to the context in which they are used, and so we cannot easily compare `10px` and `1em`, for example.
2023-06-02LibWeb: Support flex items with calc() main size containing percentagesAndreas Kling
If a flex item's main size is a CSS calc() value that resolves to a length and contains a percentage, we can only resolve it when we have the corresponding reference size for the containing block.
2023-06-02LibWeb: Make StackingContext sorting a lot fasterAndreas Kling
Stacking contexts are sorted after building a tree of them. They are sorted by z-index first, DOM tree order second. Sorting was previously *very* slow on pages with many stacking contexts. That was because the sort() function used Node::is_before() in the quick_sort comparator to see if one StackingContext was before another. is_before() does tree traversal and can take quite a long time per call. This patch avoids all that by letting StackingContext know its index among all StackingContexts within the same document in tree order. There's a noticeable snappiness increase on the CSS-FLEXBOX-1 spec page, for instance. :^)
2023-06-02LibWeb: Parse `clamp()` css math functionstelar7
2023-06-02LibWeb: Parse `max()` css math functionstelar7
2023-06-02LibWeb: Parse `min()` css math functionstelar7
2023-06-02LibWeb: Move function parsing to separate methodstelar7
2023-06-02LibWeb: Remove per path clipping for SVGGeometryPaintableMacDue
Somewhere the path bounding box in the layout and the actual draw path are getting slightly mismatched. This results in partly clipped bits of SVGs. The paths are already clipped to the containing SVG, and the size of the path in the layout is computed from the bounding box, so it is probably safe just to remove this clipping for now.
2023-06-02LibWeb: Avoid text-aligning content that is too long for its line boxFalseHonesty
Previously, we would always respect the `text-align` property, even if the text being aligned was too long for its line box and would be clipped. This led to seeing the clipped middle/end of strings when we should instead always see the beginning of the text.
2023-06-01LibWeb: Convert NumberStyleValue from float to doubleSam Atkins
We have double precision in the parser, and currently use doubles for most of layout, so we might as well keep that extra precision inside NumberStyleValue too.
2023-06-01LibWeb: Remove int usage of NumberStyleValuesSam Atkins
Use IntegerStyleValue where we should; remove the ability of NumberStyleValue to hold integers, and add integer interpolation for animations.
2023-06-01LibWeb: Implement IntegerStyleValue, for holding `<integer>`Sam Atkins
Having one StyleValue for `<number>` and `<integer>` is making user code more complicated than it needs to be. We know based on the property being parsed, whether it wants a `<number>` or an `<integer>`, so we can use separate StyleValue types for these.
2023-06-01LibWeb: Rename NumericStyleValue -> NumberStyleValueSam Atkins
This is in preparation of splitting off a separate IntegerStyleValue.
2023-06-01LibWeb: Round lengths to 3 decimals after resolving from percentageAndreas Kling
This is a hack to emulate the behavior of other engines that use fixed-point math. By rounding to 3 decimals, we retain a fair amount of detail, while still allowing overshooting 100% without breaking lines. This is both gross and slow, but it fixes real sites. Notably, the popular Bootstrap library uses overshooting percentages in their 12-column grid system. This hack can be removed when CSSPixels is made a fixed-point type.
2023-06-01LibWeb: Allow infinitely long flex lines when sizing under max-contentAndreas Kling
If the flex container is being sized under a max-content main size constraint, there is effectively infinite space available for flex items. Thus, flex lines should be allowed to be infinitely long. This is a little awkward, because the spec doesn't mention specifics about how to resolve flexible lengths during intrninsic sizing. I've marked the spec deviations with big "AD-HOC" comments.
2023-06-01LibWeb: Implement `has_transient_activation`stelar7
2023-06-01LibWeb: Set `last activation timestamp` on the windowstelar7
2023-06-01LibWeb: Implement step 7 of `choose_a_browsing_context`stelar7
2023-06-01LibWeb: Measure the overflow for all scroll containersAndreas Kling
Instead of just measuring the layout viewport, we now measure overflow in every box that is a scroll container. This has the side effect of no longer creating paintables for layout boxes that didn't participate in layout. (For example, empty/anonymous boxes that were ignored by flex itemization.) Such boxes are now marked as "(not painted)" in the layout tree dumps, as they have no paintable to dump geometry from.
2023-06-01LibWeb: Clip overflow in descendant boxes for non-visible CSS overflowAndreas Kling
We were only clipping for hidden, when we should be clipping for hidden, clip, scroll and auto. Basically everything but visible. :^)
2023-06-01LibWeb: Let's say that layout viewports are always scroll containersAndreas Kling
This will allow us to have a shared code path for overflow calculation.
2023-06-01LibWeb: Include scrollable overflow in paint tree dumpsAndreas Kling
2023-06-01LibWeb: Support `line-height: calc(...)` values that resolve to numberAndreas Kling
This is used on GitHub and many other websites.
2023-06-01LibWeb: Add support for parsing place-content shorthand CSS propertyFalseHonesty
2023-06-01LibWeb: Put debug spam about indefinitely sized SVGs behind a flagAndreas Kling
2023-06-01LibWeb: Put debug spam about negative content sizes behind a flagAndreas Kling
We already clamp these values to zero, so it's actually pretty harmless when this happens. If someone wants to investigate these issues deeper and see if they can be fixed earlier in the layout pipeline, they can enable the spam locally.
2023-06-01LibWeb: Invalidate layout tree in textContent setterAndi Gallo
The textContent setter changes the structure of the DOM, therefore the layout tree becomes invalid.