Age | Commit message (Collapse) | Author |
|
Get rid of the dedicated Emoji class to make it easier to store a null
value signifying a failed lookup.
This allows us to remember failed lookups, making subsequent failures
for the same codepoint much faster. :^)
|
|
This helper invokes a callback for the node and each of its descendants
in pre-order.
|
|
Instead of trying again when asked repeatedly, just remember if it
didn't work out the first time.
|
|
|
|
|
|
It's now possible to set a page background image via <body background>.
Also, HtmlView now officially handles rendering the body element's
background (color, image or both.) LayoutBox is responsible for all
other background rendering.
Note that it's not yet possible to use CSS background-image properties
directly, since we can't parse them yet. :^)
|
|
Also change the API to take a destination rect instead of a source rect
since internally it was basically creating a destination rect from the
source rect anyway. It was a little confusing.
|
|
If the current line box already has zero width, there's no point in
inserting a line break to make space, since we'll just be at x=0 after
breaking as well.
This removes an ugly unnecessary line break before images wider than
their containing block. :^)
|
|
Capture a weak pointer to the element and pass that to the load finish
callback in HTMLImageElement::load_image(). This allows us to ignore
completed loads if the <img> element is no longer around.
|
|
This makes Node and LayoutNode weakable. Frame was already weakable.
|
|
When loading a URL that ends in ".png", we now construct a simple
DOM document to contain the image. It also shows the image dimensions
in the document title.
Because we use <img src> to load the image into the synthetic document,
we end up loading the image resource twice. This issue will go away
once we have a smarter, caching, loader mechanism.
|
|
The FontCache caches the result of font lookups. The cache key is a
simple object called FontSelector which consists of the font family
and font weight (both strings.)
This drastically reduces time spent in font lookup.
|
|
This is extremely awkward and I'm sure there are many better ways to
achieve this..
|
|
This makes sure that values like "auto !important" don't have a space
character after "auto".
|
|
|
|
Also add some special variants for the table classes, to make it a bit
more pleasant to write table code. :^)
|
|
Some inline stylesheets use HTML comments like "<!--blah blah-->".
The HTML parser currently generates a comment child node of the <style>
element whenever this happens, and we don't want the comment itself to
be interpreted as part of the stylesheet.
|
|
|
|
This is a total hack to get around the auto-detection mechanism for
whether a block has inline or block children. We'll say that tables
never have inline children for now, and then anything that actually
turns out to be an inline child will just be ignored by layout.
|
|
|
|
Instead of computing whether a block's children are inline based on the
first child, make it an imperatively-set flag.
This gives us some flexibility to ignore things like text nodes inside
a <table>, for example. I'm still unsure what the "correct" way to deal
with those will be. We'll find out sooner or later. :^)
|
|
This class introduces LayoutTable, LayoutTableRow and LayoutTableCell.
These are produced by "display" values table, table-row and table-cell
respectively.
Note that there's no layout happening yet, I'm just adding the classes.
|
|
|
|
|
|
|
|
|
|
Path from Anonymous.
|
|
Patch from Anonymous.
|
|
This is really just "center { display: block; text-align: center; }" in
the default stylesheet, but it totally works!
|
|
This was easier than I imagined; we just shift each line box to the
left based on the alignment and the remaining space on each line. :^)
|
|
|
|
When playing an ABuffer, the count of samples were determined by the
size of the SharedBuffer. This caused small pauses of up to 512
samples during the playback, when the size of the shared buffer was
rounded up to a multiple of 4096. This problem was amplified by the
fact that the AResampleHelper was created every time a new chunk of
audio was to be processed, causing inconsistencies in the playback of
wav files.
|
|
|
|
Oops, we now need to call LayoutBox instead of LayoutNode for blocks
with non-inline children.
|
|
We now wait until the pixels are actually needed before fully decoding
images in <img> elements.
This needs some more work and is currently a bit memory-wasteful since
we'll hang on to the raw image data forever.
|
|
This will allow rendering code to skip various things sometimes. :^)
|
|
An ImageLoader is a generic interface for loading encoded image data of
any supported format. It has an ImageLoaderPlugin internally that does
all the work.
This patch adds an initial PNGImageLoaderPlugin that knows how to
retrieve the size of a PNG, and the bitmap. The API is divided into
size() and bitmap() to facilitate geometry-only decoding.
This will be useful in places like LibHTML where we need dimensions for
layout purposes but can wait with the bitmap until later.
|
|
If a LayoutNode is split into line box fragments, we need to walk our
fragments and invalidate them. It was not enough to do this only for
LayoutBox nodes.
|
|
|
|
The render() implementation in both LayoutBlock and LayoutBox need to
be calling the immediate parent class. :^)
|
|
To streamline the layout tree and remove irrelevant data from classes
that don't need it, this patch adds two new LayoutNode subclasses.
LayoutNodeWithStyleAndBoxModelMetrics should be inherited by any layout
node that cares about box model metrics (margin, border, and padding.)
LayoutBox should be inherited by any layout node that can have a rect.
This makes LayoutText significantly smaller (from 140 to 40 bytes) and
clarifies a lot of things about the layout tree.
I'm also adding next_sibling() and previous_sibling() overloads to
LayoutBlock that return a LayoutBlock*. This is okay since blocks only
ever have block siblings.
Do also note that the semantics of is<T> slightly change in this patch:
is<T>(nullptr) now returns true, to facilitate allowing to<T>(nullptr).
|
|
There's no need to pass the StyleResolver to this function. Nodes that
need it can just get it from the document.
|
|
Building a whole layout tree shouldn't be a concern of Node, so this
patch moves it to a separate class.
|
|
|
|
This is an implementation of syslog with some OpenBSD extensions.
There is no syslogd support (so it only logs to dbgprintf/stderr),
but otherwise is functional.
Many weird defines are always present, because some syslog users in
the wild check for their existence.
|
|
Instead, just sched_yield() and try again. This makes the WindowServer
not fall apart whenever clients take a bit too long to respond.
Fixes #656.
|
|
This patch makes it possible to call Node::invalidate_style() and have
that node and all of its ancestors recompute their style.
We then figure out if the new style is visually different from the old
style, and if so do a paint invalidation with set_needs_display().
Note that the "are they visually different" code is very incomplete!
Use this to make hover effects a lot more efficient. They no longer
cause a full relayout+repaint, but only a style invalidation.
Style invalidations are still quite heavy though, and there's a lot of
room for improvement there. :^)
|
|
|
|
This is currently very aggressive. Whenever the Document's hovered node
changes, we invalidate all style and do a full relayout.
It does look cool though. So cool that I'm adding it to the default
stylesheet. :^)
|
|
We don't actually do anything with these yet, but now the values will
be there for the selector engine to look at when it feels ready. :^)
|