Age | Commit message (Collapse) | Author |
|
This also required converting URLSearchParams::for_each and the callback
function it invokes to ThrowCompletionOr. With this, the ReturnType enum
used by WrapperGenerator is removed as all callers would be using
ReturnType::Completion.
|
|
|
|
|
|
|
|
|
|
|
|
For now, data URLs are explicitly limited to expected MIME types. For
example, image-related styles accept image MIME types.
|
|
|
|
This is an alias of Element.matches for web compatibility.
https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector
Used by particularly old versions of Sizzle, such as 1.10.2:
https://github.com/jquery/jquery/blob/16b079b164d62bd807c612806842a13bf9b04d17/jquery.js#L1644
This particular version is used by DuckDuckGo.
|
|
Marker boxes are laid out by the corresponding ListItemBox. BFC should
just leave them alone. This fixes a jiggling issue on welcome.html :^)
|
|
This helper returns the border box (content+padding+border) of a given
box. Margin not included.
|
|
We now compute the used height of height:auto by measuring from the top
content edge (y=0) to the bottom of the bottommost line box within the
block container.
This fixes an issue where we'd fail to account for the topmost line box
being taller than any of its fragments (which can happen if the
line-height is greater than the height of all fragments on the line.)
|
|
|
|
|
|
I don't remember why we did things this way, but it's clearly not right
to stretch fragments vertically. Instead, we should just align their
bottom to the appropriate line (as we already do.)
|
|
When using bitmap fonts, the computed *font* that we're using may be
smaller than the font-size property asked for. We can still honor the
font-size value in layout calculations.
|
|
This is a very limited implementation of overflow:hidden, but since it's
easy to cover this common scenario, let's do it.
|
|
Tables, unlike other block-level elements, should not stretch to fit
their containing block by default.
|
|
This accounts for cases like:
```css
.foo {
color: blue ! important ;
}
```
That's rare now that minifying is so popular, but does appear on some
websites.
I've added spec comments to `consume_a_declaration()` while I was at it.
|
|
Noticed this while checking some MediaWiki-based sites. It's not
obvious, but the spec does allow this, by not mentioning it in this list
of places whitespace is forbidden:
https://www.w3.org/TR/selectors-4/#white-space
|
|
|
|
Rather than following the spec exactly and creating lowercase strings,
we can simply do a case-insensitive string comparison. The caveat is
that creating attributes must follow the spec by creating the attribute
name with a lowercase string.
|
|
Note that these two implementation differ, but the one in
FormattingContext.cpp seems to be more complete. It is also more recent.
|
|
This API has no more clients (and the last client that I just removed
wasn't even using it right) so let's get rid of it.
|
|
When valid, this attribute needs to result in an IdentifierStyleValue.
Before this change we were turning it into a StringStyleValue, which
then defaulted to left alignment for all values.
For "center" and "middle", we turn it into -libweb-center. All other
values are passed verbatim to the CSS parser.
|
|
This resolves #10641.
|
|
This was confusing table layout by adding empty whitspace table boxes
that wound up stealing a bunch of horizontal space.
|
|
This was a hack to percentages within tables relative to the nearest
table-row ancestor instead of the nearest table container.
That didn't actually make sense, so this patch simply removes the hack
in favor of containing_block()->width().
|
|
Another one spotted in a scroll-up-and-down profile.
|
|
Spotted this in a profile while wheel scrolling up & down.
|
|
|
|
In #10434 an issue with leading whitespace in new lines after
a <br> element was fixed by checking whether the last fragment
of LineBox is empty.
However, this introduced a regression by which whitespace following
inline elements was swallowed, so `<b>Test</b> 123` would appear
like `Test123`.
By asking specifically if we are handling a forced linebreak
instead of implicity asking for a property that may be shared by
other Node types, we can maintain the correct behavior in regards
to leading whitespace on new lines, as well as trailing whitespace
of inline elements.
|
|
Color::from_string() now does a case-insensitive comparison of color
names, so we don't need this copy. :^)
|
|
Let's use the same name as the spec. :^)
|
|
|
|
|
|
This works at the Token level, which is quick and easy but has
drawbacks: We don't know when something is a property name or a value,
or if something is part of a selector. But, this works for now.
|
|
This is a requirement to be able to use the Tokens for syntax
highlighting.
|
|
This is a step in the spec in 3 places, and we had it implemented
differently in each one. This unifies them and makes it clearer what
we're doing.
|
|
Also renamed `starts_with_a_number()` -> `would_start_a_number()` to
better match spec terminology.
|
|
https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
The CSS parser should now be completely quirky! :^)
The code is a bit awkward, especially the prepending-0s step, but at
least it won't be running too often.
|
|
CLion was giving me the angry red underlines about this.
|
|
It seemed odd to have this one color handled separately, when
`Color::from_string()` implements all other CSS colors.
|
|
We're using the outermost right and bottom child edges to determine the
width and height of the ICB. However, since these edges are *within* the
respective child's rectangle, we have to add 1 when turning them into
width and height values.
This fixes an issue where scrolling a document would shrink its viewport
rect by 1 pixel (on both axes) on every scroll step.
|
|
The only reason it wasn't const before (and why we had a const_cast
hack) was to support ImageStyleValue's constructor taking it, which no
longer applies. `hack_count--;` :^)
|
|
This always felt awkward to me, and required a few other hacks to make
it work. Now, the request is only started when `load_bitmap()` is
called, which we do inside `NodeWithStyle::apply_style()`.
|
|
|
|
|
|
|
|
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
|