This property was removed from the CSS specs, and efforts to correct the
HTML spec have stalled. For now, let's comment them out so that I don't
get spammed with the meaningless log warnings that they didn't parse,
every time I launch Ladybird. :^)
`DeprecatedString::to_int` calls `StringUtils::convert_to_int`
internally. However, the integer parsing is not done in an HTML
spec-compliant way. For example, `colspan="2;"` is valid according to
the spec. But, with the current implementation, we will fail to parse
"2;", and instead fall back to using 1 as the colspan value.
This patch changes the `HTMLTableCellElement::col_span` and
`HTMLTableCellElement::row_span` methods to use the
`Web::HTML::parse_non_negative_integer` function that will parse the
attribute value in an HTML spec-compliant way.
We have code inside LibWeb that uses the
`AK::StringUtils::convert_to_uint`and `AK::StringUtils::convert_to_int`
methods for parsing integers. This works well for the most part, but
according to the spec, trailing characters are allowed and should be
ignored, but this is not how the `StringUtil` methods are implemented.
This patch adds two new methods named `parse_integer` and
`parse_non_negative_integer` inside the `Web::HTML` namespace that uses
`StringUtils` under the hood but adds a bit more logic to make it spec
compliant.
In case we've looked up the family name before and cached the result of
font fallback, we now invalidate any cached entries with the same family
name so that the next lookup may consider the newly downloaded font.
This giant grid test has been a source of problems while iterating on
GFC for a long time. Let's split it into smaller tests to make it
easier to identify issues without needing further reductions on the
test.
This function is used to calculate a matching radius that goes inside or
outside of the border. For example, if the border-radius is 10px and we
are 5px further out, the radius needs to be 15px to look right.
However, if the radius is 0 it isn't rounded, and we want to keep the
same sharp corner no matter how far we go.
This makes our outline rendering better match Chrome and Firefox.
This event is the star of the show, and the main way that web content
can react to either programmatic or user-initiated navigation.
All of the fun algorithms will have to come later though.
This API is how JavaScript can manipulate the new Navigable concepts
directly. We are still missing most of the interesting algorithms on
Navigation that do the actual navigation steps, and call into the
currently WIP navigable AOs.
This enum is used in many Navigation API classes, so stick it in its own
IDL file. However, we have no way to ask the BindingsGenerator to create
just an enum class that's not defined in an IDL file without an
``interface`` class at the top level, so implement the expected enum
and stringification method manually.
Add some checks to the statement wrapping code to make sure we properly
handle the expected pattern of returning ``Optional<Enum>`` from
nullable enum properties.
We never implemented this for History::pushState/popState, and now that
we're working on the Navigable changes, we don't need this legacy entry
with its legacy name.
Add the seralization and URL validation steps, but skip the actual
navigation for now. This might cause more pages to throw exceptions
when trying to push state that contains objects that we don't know how
to serialize.
This avoids looking at every single installed typeface to see if there's
a family name match.
Fixes a large performance regression introduced when making
StyleComputer consider system fonts in CSS font fallback.
Regressed with 69a81243f5.
Some clients (e.g LibWeb) want to look up typefaces by name. Since we
already store typefaces in a HashMap keyed by family name, let's also
have a nice & fast API that takes advantage of this.
These two ref-tests involve two boxes positioned in the same place, with
outlines. Outlines always have a border-radius, meaning that the corner
pixels are not 100% opaque. (It seems to be 254 instead of 255.) With
the test files painting two outlines, and the ref test only painting
one, slight changes in the background color of the page would make that
slight variation visible sometimes. So, let's avoid that inconsistency
by always painting one outline instead of two.
Previously, this would only be enabled if the `sqlite` port was
already installed. This change explicitly disables the feature, as it
isn't that useful on SerenityOS. This ensures a consistent build
regardless of whether the `sqlite` port is installed or not.
Previously,`openssl` would be used as the crypto backend for `libssh2`
if the `openssl` port was installed and the `libgcrypt` dependency
would be ignored.
With this change we install `openssl` as a dependency and explicitly
specify that it should be used as the crypto backend. We also add
`zlib` as an explicit dependency and specify that `zlib` compression
should be used.
As it turns out, there are popular User-Agent blacklists out there with
the string "LibWeb" in them. Such entries have been added long before
our LibWeb existed, so "LibWeb" has presumably been used by some bot
that people got tired of.
Trying to chase down everyone who has installed these blacklists is
obviously a losing battle, so this patch simply removes the engine part
of our default UA string.
We were relying on the table fixup algorithm to insert the missing table
row, which fails to do so when we only have an image in the button.
While that might be a problem with the table fixup algorithm, we should
build a correct layout tree explicitly anyway.
Fixes crashes on GitHub.
There was a small mishmash of argument order, as seen on the table:
| Traits<T>::equals(U, T) | Traits<T>::equals(T, U)
============= | ======================= | =======================
uses equals() | HashMap | Vector, HashTable
defines equals() | *String[^1] | ByteBuffer
[^1]: String, DeprecatedString, their Fly-type equivalents and KString.
This mostly meant that you couldn't use a StringView for finding a value
in Vector<String>.
I'm changing the order of arguments to make the trait type itself first
(`Traits<T>::equals(T, U)`), as I think it's more expected and makes us
more consistent with the rest of the functions that put the stored type
first (like StringUtils functions and binary_serach). I've also renamed
the variable name "other" in find functions to "entry" to give more
importance to the value.
With this change, each of the following lines will now compile
successfully:
Vector<String>().contains_slow("WHF!"sv);
HashTable<String>().contains("WHF!"sv);
HashMap<ByteBuffer, int>().contains("WHF!"sv.bytes());
With this change, elements that want to receive viewport rect updates
will need to register on document instead of the browsing context.
This change solves the problem where a browsing context for a document
is guaranteed to exist only while the document is active so browsing
context might not exit by the time DOM node that want to register is
constructed.
This is a part of preparation work before switching to navigables where
this issue becomes more visible.