Age | Commit message (Collapse) | Author |
|
|
|
|
|
Hoo boy, we've really accumulated a lot of this stuff.
|
|
|
|
This replaces the hand-rolled string-based inheritance check tech.
|
|
Note that these are only used in debugging/test output so it's not
performance sensitive.
|
|
|
|
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.
|
|
|
|
Compared to version 10 this fixes a bunch of formatting issues, mostly
around structs/classes with attributes like [[gnu::packed]], and
incorrect insertion of spaces in parameter types ("T &"/"T &&").
I also removed a bunch of // clang-format off/on and FIXME comments that
are no longer relevant - on the other hand it tried to destroy a couple of
neatly formatted comments, so I had to add some as well.
|
|
Fixes* 4668
|
|
When we have an abstract font class it makes no sense to keep
these methods in the Font class.
|
|
|
|
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.
|
|
This fixes 4 issues:
- RECONSUME_IN_RETURN_STATE was functionally equivalent to
SWITCH_TO_RETURN_STATE, which caused us to lose characters.
For example, &test= would lose the =
- & characters by themselves would be lost. For example, 1 & 2
would become 1 2. This is because we forgot to flush
characters in the the ANYTHING_ELSE path in CharacterReference
- Named character references didn't work at all in attributes.
This is because there was a path that was checking the entity
code points instead of the entity itself. Plus, the path that
was checking the entity itself wasn't quite spec compliant.
- If we fail to match a named character reference, the first
character is lost. For example &test would become &est.
However, this relies on a little hack since I can't wrap my
head around on how to change the code to do as the spec says.
The hack is to reconsume in AmbigiousAmpersand instead of
just switching to it.
Fixes #3957
|
|
We were painting unfinished pixels while waiting for the WebContent
process to render the page. This caused OOPWV to flicker black
sometimes, which looked pretty bad.
This way we still flicker, but at least we flicker with the correct
palette color. :^)
|
|
It always felt a bit jarring that tooltips would pop in right away when
you hover over a toolbar button. This patch adds a 700ms delay before
they appear, and a 50ms delay before they disappear.
Once a tooltip is up, moving the cursor between two widgets that both
have tooltips will leave the tooltip on screen without delays.
|
|
Also use "// prettier-ignore" comments where necessary rather than
excluding whole files (via .prettierignore).
|
|
|
|
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.
|
|
The "border" property is a shorthand that expands into multiple
longhand properties. We shouldn't leave it set in a StyleProperties
after expanding it.
|
|
Let's just copy an empty string here to make ourselves a ByteBuffer.
|
|
|
|
|
|
This gets way too noisy on some pages, and isn't even interesting.
|
|
We were only pruning trailing whitespace on lines. This patch makes it
so we also don't add whitespace as the leading line box fragment on new
lines.
This logic is pretty crufty and I think we can do better, but for now
I've just made it handle this extra case so we can stop having lines
that start with a space character. :^)
|
|
|
|
|
|
|
|
We were following the spec incorrectly. The comment was right, but the
code was wrong.
|
|
|
|
|
|
This is a hack until we implement a proper overflow mechanism. For now,
this allows us to right-click below the lowest content on the page.
|
|
Fixes #4425.
|
|
|
|
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.
|
|
We have a hack that propagates text-decoration-line through inheritance
even though it's not an inherited property. Once we implement the CSS
cascade properly we can stop doing this.
|
|
|
|
Only the offset box (left/top/right/bottom) box defaults to 'auto'.
Both the padding and margin boxes default to '0' for all values.
|
|
The default equals() does to_string() on both sides which is pretty
silly when they are of the same type.
|
|
Running a StyleInvalidator for every attribute set in a new document
was making it impossible to load larger sites. :^)
|
|
Don't wait until fragment layout to compute width/height of boxes on
the line, just do it while we're splitting into lines.
|
|
|
|
|
|
This way we don't have to look them up in the CSS::StyleProperties
every time we want to paint with them.
|
|
|
|
Also 'text-decoration' is actually a shorthand, so treat it that way.
|
|
This broke since "none" is now always going to be an identifier value.
|
|
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.
|