This is called by https://athenacrisis.com/ and passed through to
AudioNode.connect, which expects an AudioNode.
Implement this function enough so that we return an AudioNode so that
AudioNode.connect does not throw a TypeError.
(cherry picked from commit a51095f705c5a6bce2c291e8b51ac90182c63419)
This is an AudioNode representing the final audio destination and is
what the user will ultimately hear.
This node is used as one of the connecting nodes in athenacrisis.com
Add a placeholder for the interface without anything backing it for now.
(cherry picked from commit 5eb80b8697d458ea2b70112a995e066f64b37ca6)
Ultimately it's RequestServer who knows which kind of encodings it can
handle and decompress, so let's have it set the Accept-Encoding.
(cherry picked from commit 2c918b540db2efcef4751084592ae1cf3be0999f)
Fetch requests from web workers fail CORS checks because the origin is
not inherited from the outside settings. Ensure web worker origin is
correctly inherited from outside settings
(cherry picked from commit 24adb1c4526fe29bbc332780272251be1635cf05)
Now that `Tokenizer::tokenize()` just returns a String, there are no
errors to propagate, and we can simplify the user code a bit.
(cherry picked from commit 59778d2b365476ecb5b50218dae4457493ee7bf7)
This ensures that calling `element.classList.toString()` always
produces the correct value.
(cherry picked from commit ec1f7779cb16223dab0ef9f7bf875c3f7b5724a9)
Previously, when creating a HTML element with
`document.createElementNS()` we would convert the given local name to
lowercase before deciding which element type to return. We now no
longer perform this lower case conversion, so if an uppercase local
name is provided, an element of type `HTMLUnknownElement` will be
returned. This aligns our implementation with the specification.
(cherry picked from commit 5a796629c61221261c1856e19dd829973e6158f0)
While conceptually is_supported_property_index is a cheap index lookup,
it is not currently cheap for an container such as HTMLAllCollection
that is operating on an uncached collection. Instead - just do the
lookup once. It also happens to look a little nicer to not blindly
dereference an optional.
(cherry picked from commit 22969a8e929eae00a45989acae99eb5a97269358)
This uses a faster hashtable lookup in the case of HTMLCollection.
Also port invoke_named_property_setter to FlyString to avoid a
FlyString->String->FlyString conversion that surfaces from this change.
(cherry picked from commit 8a5985b87f618120ce891bfbe87786381654af25)
This removes some ambiguity about what the return value should be if
the index is out of range.
Previously, we would sometimes return a JS null, and other times a JS
undefined.
It will also let us fold together the checks for whether an index is a
supported property index, followed by getting the value just afterwards.
(cherry picked from commit c5c1a8fcc78af986e5dd1a1f0bef1223e458ed37)
We don't need this for any case, so just remove it to simplify handling
in PlatformObject.
(cherry picked from commit 081c92bf3dc66773887243718cf41011289ac55e)
These let you format counters' current values as strings for use in
generated content.
(cherry picked from commit 898e3bd89878ddb87df06e056031673dc770be2b)
This is `counter(name, style?)` or `counters(name, link, style?)`. The
difference being, `counter()` matches only the nearest level (eg, "1"),
and `counters()` combines all the levels in the tree (eg, "3.4.1").
(cherry picked from commit 576a4314084e5c3b839006da00dddb16e58b3503)
These control the state of CSS counters.
Parsing code for `reversed(counter-name)` is implemented, but disabled
for now until we are able to resolve values for those.
(cherry picked from commit 017d6c3314d57d4e351764f328c1d25dbc9d033a)
The new method is Parser::parse_all_as_single_none_value(), which has a
few advantages:
1. There's no need for user code to manually create a StyleValue.
2. It consumes tokens so that doesn't have to be done manually.
3. Whitespace before or after the `none` is consumed correctly.
It does mean we create and then discard a `none` StyleValue in a couple
of places, namely parsing for `grid-*` properties. We may or may not
want to migrate those to returning the IdentifierStyleValue instead.
(cherry picked from commit ca10fb412947f6b6080326573418bfa8a3759c12)
This seems to have been required when pseudo-elements were first
implemented, but has since become unused. It's also awkward because we
don't have access to the DOM Element and its CountersSet at this point.
So, let's remove it.
For reference, Chrome&Firefox both return the computed value for
`content: counter(foo)` as `counter(foo)`, not as the computed string.
So not computing it here seems like the intended behaviour.
(cherry picked from commit 6f2f91d1f50130b6060ccfb1af1faaa890e81618)
This represents each element's set of CSS counters.
https://drafts.csswg.org/css-lists-3/#css-counters-set
Counters are resolved while building the tree. Most elements will not
have any counters to keep track of, so as an optimization, we don't
create a CountersSet object until the element actually needs one.
In order to properly support counters on pseudo-elements, the
CountersSet needs to go somewhere else. However, my experiments with
placing it on the Layout::Node kept hitting a wall. For now, this is
fairly simple at least.
(cherry picked from commit 708f49d906389f8875f006894e2aacf2305834bf)
This code previously only allocated enough space in
m_col_elements_by_index for 1 slot per column, meaning that columns
with a span > 1 would write off the end of it.
(cherry picked from commit 9e32c9329acd89d73eeff3494a5e728077962513)
...for images that don't use a color indexing transform.
For now, write the predictor transform unconditionally, and predict
every pixel as its left neighbor (that is, use predictor 1 everywhere).
This will grow a better heuristic in time, and eventually we might want
to use more than 1 of the 13 different predictor modes. But on average,
doing this unconditionally is better than not doing it unconditionally.
(Also, it's possible to disable this transform using `image`'s
`--webp-allowed-transforms` flag.)
Using the same benchmark as in #24819, this reduces the total size
of the test images further, from 88M to 69M (21.6%). It does increase
runtime for compressing all these images from about 4.4s to 4.7s,
a 6.8% slowdown.
For the usual test image (no effect on the two animations, which use
the color indexing transform):
sunset_retro.png (876K):
1.2M -> 730K, 31.4 ms ± 0.8 ms -> 31.4 ms ± 0.7 ms
From 37% larger than the input to 16% _smaller_ than the input :^)
(A 39% size reduction for this image.)
Compressing sunset_retro.png with zopflipng produces a 820K image,
so we're smaller even than what the best PNG encoder can do with
this image.
It's not a win for all images: For example, the size of
qoi_benchmark_suite/screenshot_web/sublime.png goes from 1.0M to 1.5M,
a fairly dramatic size increase. Hopefully we can get that back in
the future with better heuristics. (The input sublime.png is 1.3M,
and sublime.png encoded using our QOI encoder creates a 1.6M file,
so the 1.5M isn't atrocious, even though it's much bigger than the
size without the predictor transform.)
Our WebP Lossless writer currently now has a similar feature set
to our QOI writer: RLE, color cache, left prediction, and
subtract green is somewhat similar to QOI's luma chunk. The WebP
writer also writes huffman trees, which QOI doesn't do. For most
images, the WebP writer creates smaller files than the QOI writer,
while being about 50% slower. The WebP writer also writes smaller
files than Serenity OS's png writer, while being ~40x as fast
(for sunset_retro, ~30ms instead of ~1.3s; 730K output instead of
999K).
Only doing RLE and using a single predictor for the entire image is
similar to what fpng is doing (...but fpng uses the T predictor always).
We still don't write a meta prefix image to keep the huffman trees
flatter, we still don't do full LZ77 backward matches, and we still
don't write color transforms. But the writer has now enough features
to be in usable shape. It's now Serenity OS's best-compressing lossless
image writer.
The test_webp_color_indexing_transform_single_channel test uses a
linear horizontal gradient, which the predictor transform compresses
so well that encoded_data_without_color_indexing ends up being
smaller than the color indexed file. Just disable the predictor
transform in that test for now.
Removes some noise from the console when browsing bbc.co.uk :^)
(cherry picked from commit 793248aec977d4b15006d6e55a960da2e115a734,
amended to s/UIEvents::KeyCode/KeyCode/ to resolve cherry-pick conflict)
We now ensure that `Node::is_character_data()` returns true for all
nodes of type character data.
Previously, calling `Node::length()` on `CDataSection` or
`ProcessingInstruction` nodes would return an incorrect value.
(cherry picked from commit 3802d9ccc4ea4428b82c6d584c3667c040cb46c7)