Age | Commit message (Collapse) | Author |
|
While calculating the minimum size for main min/max size violations
we were flooring the min size to 0 if the item doesn't have a min
main size. Instead of that determine the intrinsic min main size
of that element.
This fixes the flex: 80% 0 4/1/0 test case in the flex.html
test page.
This case was missed in a previous commit that added the
determine_min_main_size_of_child function
|
|
This is now the source of truth for 'user enabled/disabled scripting',
but it has to ask the window's page, which actually stores the setting.
Also use this new functionality in two places where it was previously
marked as a FIXME.
|
|
There's no need to have a custom is_scripting_enabled() for the
Document class, as it (indirectly) inherits from Node.
Also, let's not hardcode false here :^)
|
|
|
|
|
|
|
|
|
|
This commit moves a couple more special cases in mouse event handling to
handle_mouseup. Additionally, it gets rid of the special casing with
should_dispatch_event and only fires a click event to the EventTarget
when the left mouse button is clicked. Finally it restores the link
context menu callback that was lost during 0fc8c65.
|
|
Before if an element didn't have a main min size we would clamp
it to a literal zero. If that element also had a flex-basis 0
it's width would end up being 0.
This patch adds a determine_min_main_size_of_child function that
will calculate the minimum main size for the box based on the
content of the box.
We use the result of that function now instead of clamping
the element main min size to 0.
This also adds one more box to the flex.html test page, which is
the same flex: 0 0 0 box but with flex-direction: column.
|
|
For computing height in FormattingContext::calculate_intrinsic_sizes
we were calling into BlockFormattingContext::compute_theoretical_height
which will check if the CSS height property was defined and calculate
the height based on that instead of calculating the intrinsic height
This patch adds a new function calculate_intrinsic_height, which will
call into compute_auto_height_for_block_level_element for a block
element, or into compute_height_for_replaced_element for a replaced
element.
|
|
|
|
Optional and smart-pointers are already `[[nodiscard]]` so functions
returning them do not need to be declared as such.
|
|
|
|
Constantly accessing private `m_foo` fields feels uncomfortable and
doesn't fit well with our code style.
|
|
|
|
|
|
We're calling this in a way that is incorrect, and so the algorithm's
assumption that the next token is an `<ident-token>` is wrong, and we
have to handle that failing. Ideally we would just stop calling this
incorrectly, but until then, let's actually document what is happening.
|
|
|
|
|
|
|
|
|
|
|
|
The code had to change a bit to match. Previously, we appended an empty
sub-list immediately, but now we append it at the end. The difference
is that if there are no tokens, we now correctly return an empty
list-of-lists, instead of a list containing an empty list.
|
|
|
|
|
|
The `parse_as_list_of_declarations()` public method is unused and will
not be used by any user code so has been removed.
|
|
User code now calls `parse_as_supports_condition()` which actually does
the conversion to a StyleProperty.
|
|
We now correctly call convert_to_rule() outside of this function.
As before, I've renamed `parse_as_rule()` -> `parse_as_css_rule()` to
match the free function that calls it.
|
|
From the spec:
> "Parse a list of rules" is intended for the content of at-rules such
> as @media. It differs from "Parse a stylesheet" in the handling of
> <CDO-token> and <CDC-token>.
- https://www.w3.org/TR/css-syntax-3/#ref-for-parse-a-list-of-rules
|
|
This is not actually used by anything currently, but it should be used
for `@media` and other at-rules.
Removed the public parse_as_list_of_rules() because public functions
should be things that outside classes actually need to use.
|
|
`parse_a_stylesheet()` should not do any conversion on its rules. This
change corrects that. There are other places where we get this wrong,
but one thing at a time. :^)
|
|
|
|
Also introduce a `location` parameter when parsing a CSSStyleSheet. This
is not provided by anyone yet.
|
|
|
|
|
|
|
|
CSS Values and Units Module Level 5 defines attr as:
`attr(<q-name> <attr-type>?, <declaration-value>?)`
This implementation does not contain support for the type argument,
effectively supporting `attr(<q-name>, <declaration-value>?)`
|
|
We now position inline-level boxes based on ascent and descent metrics
from the font in use. This makes our basic text layouts look a lot more
like those produced by other browsers. :^)
I've tried to match the terminology used by the CSS Inline Layout spec.
This will regress Acid2 a little bit, and probably various other sites,
but on the whole it's the direction we should be heading, so let's go.
|
|
|
|
We were marking block boxes as having non-inline children when inserting
any child box, even if the child was out-of-flow.
|
|
This avoids a bunch of unnecessary work in Painter which not only took
time, but sometimes also led to alignment issues. draw_text_run() will
draw the text where we tell it, and that's it.
|
|
Instead of multiplying the font-size with 1.4f because reasons, we now
ask the font for its preferred line spacing.
|
|
Let's make it clear in the type name that this contains pixel metrics.
Also rename Font::metrics() => Font::pixel_metrics().
|
|
CSS actually wants the advance of the ASCII '0' character for its "ch"
units, so let's include that instead of the arbitrarily chosen 'M'.
|
|
Everyone was asking for the glyph width of 'M' anyway. We can just make
that request implicit and simplify the API.
|
|
|
|
This fixes a regression on GitHub from
5da7ebb806cd3be5b126ec22bfda926c7319e4f7.
Thanks to Simon for reporting it! :^)
|
|
|
|
Unlike BFC root blocks with height:auto, when the block *isn't* a BFC
root, we don't have to look for the "bottommost" block-level child and
determine the width from that.
Instead, we should just look at the last in-flow block-level child.
This was already indicated in the spec comment next to the code, but
the code itself was wrong.
This makes the body element on Acid3 have the correct height. It also
introduces a small regression on Acid2 that we'll have to track down.
|
|
Preserve floating point precision and delay rounding until the last
moment when figuring out where to paint background layers. This fixes an
issue on Acid3 where a thin sliver of red was visible because the
background X position was incorrectly rounded by 1px.
|