for_each_cell_among_possible_pointers() was taking HashTable by value
instead of by const reference for no reason.
The copying was soaking up ~4% of CPU time while loading https://x.com/
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.
Instead of running a big switch statement on the opcode when checking
how long an instruction is, we now simply store that in a member
variable at construction time for instant access.
This yields a 10.2% speed-up on Kraken/ai-astar :^)
Timers run in their own thread, to take advantage of existing Java
Executor features. By hooking into ALooper, we can spin the main
Activity's UI thread event loop without causing a fuss, or spinning the
CPU by just polling our event loop constantly.
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 CSS Selectors-4 spec suggests that `:open` and `:closed` should
apply to `<select>` elements, so let's add a way of storing and
exposing that state. We don't yet actually generate any layout for
`<select>` elements, so they will always report that they are closed.
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.
Most events on a slottable are composed, meaning they propagate from the
slottable and through its shadow tree before bubbling up to the parent
of the slottable.
This implements looking up a slottable's assigned slot, and a slot's
list of assigned slottables. For the latter, only unflattened lookups
are implemented so far.
This implements automatic slottable assignment by way of hooking into
the element attribute change steps. When the `name` attribute of a slot
or the `slot` attribute of a slottable changes, assignment is performed.
This implements manual slottable assignment by way of HTMLSlotElement's
`assign` API. This includes all of the slottable-related AOs needed to
perform the assignment.
A slottable is either a DOM element or a DOM text node. They may be
assigned to slots (HTMLSlotElement) either automatically or manually.
Automatic assignment occurs by matching a slot's `name` attribute to
a slottable's `slot` attribute. Manual assignment occurs by using the
slot's (not yet implemented) `assign` API.
This commit does not perform the above assignments. It just sets up the
slottable concept via IDL and hooks the slottable mixin into the element
and text nodes.
This is similar to the run activation behavior in that elements may
define these steps themselves. HTMLSlotElement is one such element. The
existing (ad-hoc) Element::attribute_changed() method is not sufficient
there as the steps require knowledge of the attribute's old value and
its namespace, which this extension provides.
Unlike the run activation behavior, we store these steps in a list. An
element may end up defining multiple attribute change steps. For example
all DOM elements must define steps to handle the "slot" attribute, and
HTMLSlotElement must define steps to handle the "name" attribute.
The spec now has a "toggle task tracker" to coalesce rapid changes to
this attribute. It also now has an explicit ToggleEvent to encapsulate
the old and new state of the element.
This further handles the attribute being added/removed using a override
of Element::attribute_changed(), rather than being the only element to
instead override Element::set/remove__attribute().
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.
This attempts to load the URL of the first `<link rel="match" href=""/>`
it finds. If that tag is missing, we load an error page to make sure
the ref-test fails. (And to provide some feedback if someone looks at
the screenshot somehow.) Wrong URLs will instead end up loading the
default 404 error page.
Previously, when there were more rows or columns than the BoardWidget
could contain, nothing was displayed. The BoardWidget minimum size is
now set whenever the number of rows or columns changes.
This change also ensures that the redo stack is cleared when a move is
made, so that it isn't possible to redo a previous move after having
made a new one.