Currently, all handling of pending dialogs occurs in PageHost. In order
to re-use this functionality to run WebDriver in a headless move, move
it to Page.
This will merge the following two git identities so they are considered
the same:
Matthew Olsson <matthewcolsson@gmail.com>
mattco98 <matthewcolsson@gmail.com>
This change makes out-of-flow blocks to be considered for joining
only to anonymous blocks that have inline children. It finally
solved the problem that out-of-flow break anonymous blocks into
chunks causing wrong layout without regressing Acid2.
This patch does two things:
- We now use u32 instead of size_t for the hops and index fields
in EnvironmentCoordinate. This means we're limited to an environment
nesting level and variable count of 4Gs respectively.
- Instead of wrapping it in an Optional, EnvironmentCoordinate now has
a custom valid/invalid state using a magic marker value.
These two changes reduce the size of Identifier by 16 bytes. :^)
Before this change, each AST node had a 64-byte SourceRange member.
This SourceRange had the following layout:
filename: StringView (16 bytes)
start: Position (24 bytes)
end: Position (24 bytes)
The Position structs have { line, column, offset }, all members size_t.
To reduce memory consumption, AST nodes now only store the following:
source_code: NonnullRefPtr<SourceCode> (8 bytes)
start_offset: u32 (4 bytes)
end_offset: u32 (4 bytes)
SourceCode is a new ref-counted data structure that keeps the filename
and original parsed source code in a single location, and all AST nodes
have a pointer to it.
The start_offset and end_offset can be turned into (line, column) when
necessary by calling SourceCode::range_from_offsets(). This will walk
the source code string and compute line/column numbers on the fly, so
it's not necessarily fast, but it should be rare since this information
is primarily used for diagnostics and exception stack traces.
With this, ASTNode shrinks from 80 bytes to 32 bytes. This gives us a
~23% reduction in memory usage when loading twitter.com/awesomekling
(330 MiB before, 253 MiB after!) :^)
Making floats to join anonymous block caused regressions in
Acid2 Test so let's leave it to be only absolute blocks who
might be joined into anonymous block when possible.
We can't be nuking the ESO while its owned execution context is still on
the VM's execution context stack, as that may lead to a use-after-free.
This patch solves this by adding a `context_owner` field to each context
and treating it as a GC root.
When timeouts are implemented, the start node used to find elements may
not remain valid for the entire duration of the timeout. For example,
the active document element may change, or the start node may be removed
from the DOM.
To handle this, we will need to re-evaluate the start node on each
iteration of the find() operation. This patch wraps the steps to do so
in a lambda to be executed on each iteration.
This getter and setter were previously labelled as a "hack" and used to
disable style invalidation on attribute changes during the HTML parsing
phase (as it caused big sites's loading to be slow). These functions
are currently not used, so they can be removed:^)
This commit adds inline spec comments to the part of the parser that
ends up calling HTMLScriptElement::prepare().
The code is tweaked to match the spec more closely.