Basically the implementation we have with JS onEnterFrame callbacks and friends
is not sufficiently performant, and is a real pain to work with on large
complex websites. This implementation instead serializes all of the necessary
information to a ring buffer hanging off of the JSContext and outputs a JS
object containing that information when prompted.
There may be some subtle oddities in the design here, or more indirection in
some areas than you might expect. It should be kept in mind that this evolved
from a prototype which used a shmem to allow visualizing this trace live in the
parent process, which is a model we eventually want to return to, but this felt
like the safest first patch.
Differential Revision: https://phabricator.services.mozilla.com/D215932
Determining if a node is selected is a super-hot code path,
which at times introduces jank both in Reflow and Painting.
This is due to each node comparing its position to the range's start and end point,
which even happens several times (`nsINode::IsSelected()` and `Selection::LookupSelection()`).
In worst cases, this can lead to reflow which takes several minutes.
This patch introduces a cache which contains all fully selected nodes,
and lives throughout one `PresShell::DoReflow()` call.
Collecting all selected nodes of a selection is very fast.
The selected nodes are then stored in a hash set.
During reflow the check if a node is selected first checks the cache
if the node is fully selected, and otherwise goes through the existing
code to check if the node is partially selected.
Differential Revision: https://phabricator.services.mozilla.com/D217794
In the given code, all selections of all common inclusive ancestors are collected.
Typically, this will be only one.
In this case, looking up if a Selection pointer is already in the array boils down to one pointer comparison, which is much faster than inserting the pointer into the hashtable.
Since this is very hot code, changing the hashtable to an array already has a relatively significant influence.
Differential Revision: https://phabricator.services.mozilla.com/D205681
The update function can be called a lot when scrolling/resizing the window.
The line where we were forcing the reflow were added in Bug 1312103, as a way
to fix a lag during scrolling.
Removing the reflow, I don't see any lag anymore (it might be because the
anonymous content implementation changed).
We take this as an opportunity to refactor things a bit, directly manipulating
the element we need to handle instead of going through the anonymous content API
(e.g. `setAttribute`, which was showing in profiles).
Differential Revision: https://phabricator.services.mozilla.com/D218395
This exposes `darkColorScheme` on rule entries as the color scheme depends on the
node to which the rule applies, and we might get inherited rules.
We also make sure to update the property editor if the color scheme changes,
for example if the user triggers color scheme simulation.
A test is added to ensure we cover the different cases.
Differential Revision: https://phabricator.services.mozilla.com/D211845
This patch adds a new `isDarkColorScheme` option to the OutputParser.
When passed, this will parse `light-dark` function to add an "unmatched" CSS
class to the param that isn't used: the first one when `isDarkColorsScheme` is
false, the second one when `isDarkColorScheme` is true.
Test cases are added in browser_outputparser.js to cover this.
Differential Revision: https://phabricator.services.mozilla.com/D217833
This patch introduce a new #stack property on the parser, which hold the parenthesis
stack so we can handle nested functions.
We switch the existing `colorFunctions` array to this new stack as it's doing
something similar, but a bit more generic.
When there's at least an entry in the stack, we want to put the parsed parts,
text or nodes, into the `parts` stack entry property so it can be used later
when we handle the function being closed.
This parts get put into the "parent" stack entry, or into the main #parsed array
when the stack becomes empty.
We could go further, migrating `parseMatchingParens`/`parseVariable` to use the
stack and the `onCloseParenthesis` method. This might be done as part of Bug 1630950,
where we want to handle nested css variables.
Differential Revision: https://phabricator.services.mozilla.com/D218218
Take the `dom::GlobalObject` that we get passed, convert it to
`nsCOMPtr<nsISupports>`, and pass that down through the call chain to
eventually store it in `UniFFIPointer::mGlobal`.
Differential Revision: https://phabricator.services.mozilla.com/D218357
Fixing text wrapping issues on multiple settings screens to handle large text sizes.
Images of what the screens looked like before can be found in attachments on the bugzilla ticket.
Here are images of the after:
{F7477613}
{F7477614}
{F7477615}
{F7477616}
{F7477617}
{F7477618}
{F7477619}
{F7477620}
Differential Revision: https://phabricator.services.mozilla.com/D218257
When we fallback from accelerated canvases to non-accelerated canvases, there may
be a stale PathRecording left around that DrawTargetSkia can't use. In this case,
we need to create a PathSkia with the PathRecording's contents.
Differential Revision: https://phabricator.services.mozilla.com/D218512
The test fails only on Android right now because it was testing the
cached image codepath elsewhere. Extend it so it fails everywhere
consistently, and so it also tests srcset.
Bug 1911605 tracks fixing this properly.
This test matches the spec to the letter, but chrome fails the last
assertion (they seem to have some delay in setting the current request
or something).
Differential Revision: https://phabricator.services.mozilla.com/D218421
This fixes src loads to be consistent with srcset/picture loads, modulo
the special synchronous case in the spec
(https://html.spec.whatwg.org/#update-the-image-data step 7), which
requires src loads to be sync if the image is available.
We now avoid triggering the load from the parser consistently for src /
srcset / picture, and unify the codepath with BindToTree. That should
avoid some useless task allocations.
Only the sync load code-path needs a script runner (mostly to deal with
anonymous content like the video poster <img> and such, but it also
helps not trigger sync loads at unexpected times like on adoption).
About the HTMLImageElement::Complete() getter change, we need to also
return false if there's an existing load task. That is the proposal in
https://github.com/whatwg/html/issues/4884, and prevents some failures
in the-img-element/{update-src-complete,img.complete}.html WPTs. It
technically changes our behavior on .srcset changes, but it makes it
consistent with .src changes and other browsers, so seems fine.
There are a couple regressions in CSP tests and the networkEvent stubs,
but these are really a pre-existing issue. What happens is that, since
the loads are now async, CSP can't figure out the script that triggered
the load anymore. I need to look if there's an easy way to propagate
that information in the image load tasks, but this is trivially
reproducible by changing these tests to use srcset rather than src.
The rest of the test changes are as expected: either new passes, or
expected test changes from this.
Differential Revision: https://phabricator.services.mozilla.com/D215519
* Make mXPos/mYPos work in terms of margin (mExtraMargin).
* When we have no anchor, explicitly upgrade them to anchored-to-point.
Differential Revision: https://phabricator.services.mozilla.com/D215444
As per comments in bug 1910411's patches and others, it's not a useful
metric, specially now that we have LCP and so on.
Actually there doesn't seem to be any consumer of it since bug 1892001.
Differential Revision: https://phabricator.services.mozilla.com/D218489
Automatic update from web-platform-tests
webnn: Throw TypeError if MLBuffer type is not supported by backend
Previously threw NotSupportedError. This now matches the errors thrown
by MLGraphBuilder operand builders methods and moves the checks to the
renderer
Bug: 333392274
Change-Id: Ic2b73ae6c95d9326fe034725076f8dc7f6e1d0b6
Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5753043
Reviewed-by: Phillis Tang <phillis@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1336357}
--
wpt-commits: 2505f1cb2f6d01d720a357957a7216b683ecb7db
wpt-pr: 47424
Automatic update from web-platform-tests
Deflake color-mix currentcolor tests
Add an extra rAF() to make sure the tests are painted before the
currentcolor change.
Bug: 354513209
Change-Id: Id856a4c66c1d0aebf17a5578f913d261625fdc50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756784
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1336305}
--
wpt-commits: 5bd8ccb7009cdba6adab2bcab84ddbb7cebf9043
wpt-pr: 47418