SipHash is highly HashDoS-resistent, initialized with a random seed at
startup (i.e. non-deterministic) and usable for security-critical use
cases with large enough parameters. We just use it because it's
reasonably secure with parameters 1-3 while having excellent properties
and not being significantly slower than before.
Print out the value of each property in the computed-style of the body
element. This is by no means a thorough test that we're serializing
every property's value correctly in every configuration, (and in fact,
some are definitely wrong,) but it does give us a nice baseline.
This makes multiple levels of quote actually use different quotation
marks, instead of always the first available pair of them.
Each Layout::Node remembers what the quote-nesting level was before its
content was evaluated, so that we can re-use this number in
`apply_style()`. This is a bit hacky, since we end up converting the
`content` value into a string twice.
`StyleProperties::content()` now takes an initial quote-nesting level,
and returns the final level after that content.
The internal reuse of FixedMemoryStream makes this straightforward.
There alread is one user of the new API, demonstrating the need for this
change beyond what I said out to use it for :^)
DOMMatrix fromMatrix was using create_from_dom_matrix_2d_init to make
a DOMMatrix for it's init struct this is wrong because only the 2D
params of the DOMMatrix are put into the new matrix. I have added
a non 2D version of that function that takes the full DOMMatrixInit
so now fromMatrix works correctly again. I also have added some
text tests to test if it works correctly.
I split the dommatrix.html text tests into multiple files because that
file was becoming to big so now every sub function is a seperate file.
For now, part of this is commented-out. Our current implementations of
`<mask>` and `<symbol>` rely on creating layout nodes, so they can't be
`display: none`.
It does not currently handle any of the actual scripting, but this
should at least allow us to create an instance of the element.
The test being added here isn't actually testing much, but before the
previous commit we used to crash parsing the page due to a TODO().
These allow accessing embeds, forms, images and objects with a given
name attribute, and any element with a given id attribute, as top level
properties on the global object.
It also allows accessing NavigableContainers by target name as top level
properties on the global object.
The current implementation feels very expensive. It's likely that
these values will need smarter caching in the future.
And implement WindowProperties, the "named properties object" for Window
according to the spec.
This involves moving an AO out of LegacyPlatformObject and into a common
place that the WindowProperties class can access.
This doesn't implement the AOs on Window that actually name lookup for
the unenumerable named properties on the window yet, just the
scaffolding.
Before, we only ensured that boxes establishing BFC did not overlap
with floats because that is what CSS 2.2 specification says. However,
we should also apply the same for boxes establishing FFC or GFC as this
aligns with the behavior of other browsers.
Fixes https://github.com/SerenityOS/serenity/issues/21095
Otherwise `attr(|name, "fallback")` becomes `attr(| name , "fallback")`
The test here is slightly aspirational. There are other rules for
serialization we don't follow (like stripping whitespace entirely from
many places) so these are marked with FIXMEs.
This allows SVG mask elements to have layout computed, but not connected
to the main paint tree. They should only be reachable if (and painted)
if referenced by the "mask" attribute of another element.
This is controlled by the forms_unconnected_subtree() function on the
paintable, which (if it returns true) prevents the paintable from being
added as a child to what would be its parent.
This fixes an issue where the value would be out of sync with reality
in anonymous wrapper block boxes, since we forgot to compute m_visible
after assigning the computed values to them.
Fixes#21106
Some steps are still to be implemented, namely:
* Properly aborting the read algorithm
* Handling BinaryString type properly
* Setting error on any error
But as it stands, this is enough functionality for the basic case of
reading the contents of a blob using the FileReader API.
This adds initial support for `open-quote`, `close-quote`,
`no-open-quote` and `no-close-quote`. We don't yet track the "nesting
level" so we always use the first pair of quotes from the `quotes`
property.
https://unicode.org/versions/Unicode15.1.0/
This update includes a new set of code point properties, Indic Conjunct
Break. These may have the values Consonant, Linker, or Extend. These are
used in text segmentation to prevent breaking on some extended grapheme
cluster sequences.
Previously, we used `on_load_finish` to determine when the text test
was completed. This method did not allow testing of async functions
because there was no way to indicate that the runner should wait for
the async call to end.
This change introduces a function in the `internals` object that is
intended to be called when the text test execution is completed. The
text test runner will now ignore `on_load_finish` which means a test
will timeout if this new function is never called.
`test(f)` function in `include.js` has been modified to automatically
terminate a test once `load` event is fired on `window`.
new `asyncTest(f)` function has been introduces. `f` receives function
that will terminate a test as a first argument.
Every test is expected to call either `test()` or `asyncTest()` to
complete. If not, it will remain hanging until a timeout occurs.
This fixes the sizing of the arrow icons displayed to the left of
parent sections on a table of contents on Wikipedia articles, which
are sized using the equation `calc(max(0.75em, 12px))`. Now, the icon
will not expand past the edges of the box they are within, avoiding
clipping the edges of the arrows.
We shouldn't be putting generated pseudo elements inside elements that
can't have children in the first place.
This patch fixes two issues:
- We stop generating pseudo elements for layout nodes that can't have
children anyway.
- We mark Layout::BreakNode as not being able to have children.
These apply to any elements that have some kind of open/closed state.
The spec suggests `<details>`, `<dialog>`, and `<select>`, so that's
what I've supported here. Only `<details>` is fleshed out right now,
but once the others are, these pseudo-classes should work
automatically. :^)
The spec requires that details elements be assigned a shadow tree with
two slots. The first slot is assigned the first summary child element of
the details element. The second slot is assigned all other children.
Each ref test now links to its reference page with a link tag, in the
same format as WPT:
`<link rel="match" href="reference-page.html" />`
The reference pages have all been moved into a separate `reference/` dir
so that we can just treat every file in `ref/` as a test. There's no
filter to only look at .html files, because we also have a .svg file in
there, and there may be other formats we want to use too. But it's not
too hard to add one if we need it.
We skip serializing any of the internal state of the Regex<ECMA262>
object, because that state is all computable from the input pattern
and flags. If it turns out that this is really, really slow, we can add
some optimizations to serialize more of the regex parse result.