Age | Commit message (Collapse) | Author |
|
|
|
These two show up in profiles, so let's add specializations for them.
|
|
|
|
This is useful in all tree types.
|
|
The StyleResolver can find the specified CSS values for the parent
element via the DOM. Forcing everyone to locate specified values for
their parent was completely unnecessary.
|
|
Layout nodes now only carry CSS computer values with them. The main
idea here is to give them only what they need to perform layout, and
leave the rest back in the DOM.
|
|
Instead of using the specified style stored on Layout::Node, use the
specified CSS values kept by the DOM::Element in more places.
|
|
This object represents the specified CSS values, so let's call it that.
|
|
Another step towards not having to carry the full specified style with
us everywhere. This isn't the ideal final layout, since we're mixing
computed and used values a bit randomly here, but one step at a time.
|
|
This object represents the CSS "computed values" so let's call it that.
|
|
|
|
Hoo boy, we've really accumulated a lot of this stuff.
|
|
Now that we have RTTI in userspace, we can do away with all this manual
hackery and use dynamic_cast.
We keep the is<T> and downcast<T> helpers since they still provide good
readability improvements. Note that unlike dynamic_cast<T>, downcast<T>
does not fail in a recoverable way, but will assert if the object being
casted is not a T.
|
|
This patchset makes ProtocolServer stream the downloads to its client
(LibProtocol), and as such changes the download API; a possible
download lifecycle could be as such:
notation = client->server:'>', server->client:'<', pipe activity:'*'
```
> StartDownload(GET, url, headers, {})
< Response(0, fd 8)
* {data, 1024b}
< HeadersBecameAvailable(0, response_headers, 200)
< DownloadProgress(0, 4K, 1024)
* {data, 1024b}
* {data, 1024b}
< DownloadProgress(0, 4K, 2048)
* {data, 1024b}
< DownloadProgress(0, 4K, 1024)
< DownloadFinished(0, true, 4K)
```
Since managing the received file descriptor is a pain, LibProtocol
implements `Download::stream_into(OutputStream)`, which can be used to
stream the download into any given output stream (be it a file, or
memory, or writing stuff with a delay, etc.).
Also, as some of the users of this API require all the downloaded data
upfront, LibProtocol also implements `set_should_buffer_all_input()`,
which causes the download instance to buffer all the data until the
download is complete, and to call the `on_buffered_download_finish`
hook.
|
|
Exposes removeAttribute, hasAttribute and hasAttributes.
|
|
Problem:
- `(void)` simply casts the expression to void. This is understood to
indicate that it is ignored, but this is really a compiler trick to
get the compiler to not generate a warning.
Solution:
- Use the `[[maybe_unused]]` attribute to indicate the value is unused.
Note:
- Functions taking a `(void)` argument list have also been changed to
`()` because this is not needed and shows up in the same grep
command.
|
|
|
|
|
|
Otherwise fetching stuff via LayoutNode::style() will have stale values
since we were only updating the specified_style() here.
LayoutNode::specified_style() should eventually go away since there's
no need to carry those uncooked values around with the layout tree.
|
|
Running a StyleInvalidator for every attribute set in a new document
was making it impossible to load larger sites. :^)
|
|
|
|
This way we don't have to look them up in the CSS::StyleProperties
every time we want to paint with them.
|
|
This patch adds a simple, naive & inefficient class for document-wide
style invalidation, e.g. after element attribute updates. During
construction it collects a HashMap of a document's elements and their
matching rules, during destruction it does the same and then compares
the results; dirtying all elements that have a different number or order
of matching rules afterwards.
Much room for improvement, but it solves the problem of stale element
styling after attribute updates for now :^)
Fixes #4404.
|
|
Let's just assert that we're detaching from the frame we thought we
were in.. just in case.
|
|
Now that documents are attached to their frame *before* parsing, we can
create the content frame of <iframe> elements right away, instead of
waiting for the host frame attachment.
Fixes #4408.
|
|
This patch adds a second style dirty bit that tracks whether a DOM node
has one or more children with dirty style. This allows the style update
to skip over entire subtrees where all nodes are clean.
|
|
There is now only Document::update_layout().
|
|
|
|
|
|
|
|
Fixes #4403.
|
|
After you mark a node as needing new style, there's no situation in
which we don't want a style update to happen, so just take care of
scheduling it automatically.
|
|
From the Web IDL spec: https://heycam.github.io/webidl/#idl-undefined
[...]
undefined constant values in IDL are represented with the `undefined`
token.
[...]
Note: This value was previously spelled `void`, and more limited in how
it was allowed to be used.
|
|
From the Web IDL spec: https://heycam.github.io/webidl/#prod-Namespace
Namespace ::
namespace identifier { NamespaceMembers } ;
|
|
|
|
|
|
|
|
|
|
Instead of invoking the CSS parser every time we compute the style for
an element that has a "style" attribute, we now cache the result of
parsing the inline style whenever the "style" attribute is set.
This is a nice boost to relayout performance since we no longer hit the
CSS parser at all.
|
|
|
|
I didn't generalize this into a helper since the HTML spec doesn't
seem to use this particular algorithm for anything else.
This makes the ACID1 test title show up correctly. :^)
|
|
The BFC "context box" is now the outer box of the block formatting
context. Previously the context box was always the current target box,
which made it hard to reason about who was really the containing block
of whom in various places.
Note that IFC still has the containing block as its context box, this
change only affects BFC. However, to clarify the situation in IFC,
I've added a containing_block() getter than returns the context_box().
|
|
|
|
Also note that setting an invalid URL here should raise a JS exception
(and not navigate away).
Fixes #4301.
|
|
Note that we're taking a shortcut here and returning the elements as an
Array instead of HTMLCollection. One day we'll have to bite the bullet
and deal with HTMLCollection, but not today.
|
|
I left a page open overnight and it had run out of timer ID's. :^)
|
|
Instead of hiding JS exceptions raised on the web, we now print them to
the debug log. This will make it a bit easier to work out why some web
pages aren't working right. :^)
|
|
|
|
This will allow us to find the containing block formatting context
when needed later on.
|
|
|