Age | Commit message (Collapse) | Author |
|
Calling this "Box" made it very confusing to look at code that used both
Layout::Box and Painting::Box. Let's try calling it Paintable instead.
|
|
BlockContainer paint boxes are the only ones that have line boxes
associated, so let's not waste memory on line boxes in all the other
types of boxes.
This also adds Layout::Box::paint_box() and the more tightly typed
Layout::BlockContainer::paint_box() to get at the paint box from the
corresponding layout box.
|
|
Stacking contexts have nothing to do with layout and everything with
painting, so let's keep them in Painting::Box.
|
|
|
|
|
|
The "paintable" state in Layout::Box was actually not safe to access
until after layout had been performed.
As a first step towards making this harder to mess up accidentally,
this patch moves painting information from Layout::Box to a new class:
Painting::Box. Every layout can have a corresponding paint box, and
it holds the final used metrics determined by layout.
The paint box is created and populated by FormattingState::commit().
I've also added DOM::Node::paint_box() as a convenient way to access
the paint box (if available) of a given DOM node.
Going forward, I believe this will allow us to better separate data
that belongs to layout vs painting, and also open up opportunities
for naturally invalidating caches in the paint box (since it's
reconstituted by every layout.)
|
|
This expands the InspectorWidget::Selection to include an optional
PseudoElement, which is then passed over IPC to request style
information for it.
As noted, this has some pretty big limitations because pseudo-elements
don't have DOM nodes:
- Declared style has to be recalculated when it's requested.
- We don't display the computed style.
- We don't display custom properties.
|
|
This patch only makes them appear in the tree - they are not yet
inspectable themselves.
|
|
|
|
These are constexpr, meaning that while the implementations were in the
cpp file, nobody outside that file could actually call them.
|
|
|
|
|
|
This resolves the ambiguity between whether a single number is a number
or a ratio. :^)
Also removed the "no more tokens" checks from
deea129b8c730e717dc1a83c2eafa81b0e2b34ec - that logic was completely
wrong, since there are always tokens after a value in the `(123 < foo <
456)` syntax.
|
|
|
|
Only "range" type media-features are allowed to appear in range syntax,
or have a `min-/max-` prefix.
|
|
|
|
This works largely the same as the PropertyID and ValueID generators,
but using LibMain, Core::Stream, and TRY().
Rather than have a MediaFeatureID::Invalid, I decided to return an
Optional. We'll see if that turns out better or not. :^)
|
|
This data will be used to generate code for parsing media-queries. So
far, it includes all MEDIAQUERIES-4 features, and
`prefers-color-scheme` from MEDIAQUERIES-5 since we support that.
|
|
When rules are inserted or removed via the CSSOM API, we now invalidate
document style to ensure that any changes made are reflected.
1% progression on ACID3. :^)
|
|
This is only ever null at the moment, as we only set it on <style>
elements to begin with.
|
|
This makes the buckets on ACID3 space out nicely.
|
|
When an iframe is inserted or removed from a document, we now take it in
and out of the BrowsingContext tree.
|
|
Let's get this right before trying to make it fast. This patch removes
the code that tried to do less work when an element's style changes,
and instead simply invalidates the entire document.
Note that invalidations are still coalesced, and will not be
synchronized until update_style() and/or update_layout() is used.
|
|
If the style is dirty, update_style() may cause layout to become dirty.
Therefore we must always update style when updating layout, to ensure
up-to-date results.
|
|
This forces us to recompute style everywhere, since all kinds of
selectors may produce different results now.
In the future, we should look at narrowing down the invalidation that
occurs here, but for now let's just invalidate everything and make the
results correct before worrying about performance.
|
|
We were handing out stale values from window.getComputedStyle() objects
after the first layout.
Fix this by always updating layout on property access. This is not
necessary for all properties, but for now let's go with the simplest
approach to make it work correctly.
|
|
|
|
|
|
These steps run when a node is about to be removed from its parent,
and adjust the position of any live NodeIterators so that they don't
point at a now-removed node.
Note that while this commit implements what's in the DOM specification,
the specification doesn't fully match what other browsers do.
Spec bug: https://github.com/whatwg/dom/issues/907
|
|
This patch adds TreeWalker (created via Document.createTreeWalker())
which allows you to traverse a filtered view of the DOM in all
directions.
|
|
This patch adds NodeIterator (created via Document.createNodeIterator())
which allows you to iterate through all the nodes in a subtree while
filtering with a provided NodeFilter callback along the way.
This first cut implements the full API, but does not yet handle nodes
being removed from the document while referenced by the iterator. That
will be done in a subsequent patch.
|
|
In some cases, we need more nuance than what DOM::ExceptionOr<T> offers.
|
|
This fixes an issue on ACID3 where failing image loads with body content
would still get displayed.
|
|
A couple steps requiring working relationships between browsing contexts
are currently FIXME'd - see #12917.
|
|
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more
cross-origin related ground to cover. :^)
|
|
|
|
This Adds an element size preview widget to the inspector widget
in a new tab. This functions similar to chrome and firefox and
shows the margin, border, padding, and content size of the selected
element in the inspector.
The colors for the size preview widget are taken from the chrome
browser.
|
|
|
|
|
|
As step "2. Validate qualifiedName" got implemented in
bfa7aad0f6443249ae1a8f577b3150ac32add7a3, parts is known to have a
length of 2.
|
|
Timers are part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
|
|
The Window object is part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/window-object.html
|
|
Note that we don't put absolutely positioned items on a line! This is
just so that IFC can discover boxes and pass them along to BFC.
This fixes an issue where only direct children of the IFC containing
block were considered for absolute positioning. Now we pick up
absolutely positioned children of nested inline nodes as well.
|
|
|
|
As noted, the Parser can't handle the `<number>` syntax for this - it
gets parsed instead by the `<number>` branch. We can't actually resolve
the ambiguity without making the Parser aware of what type each
media-feature is, but I will get to that soon. :^)
|
|
This is only used by media-queries, so for now we can skip
adding/parsing a StyleValue for these.
|
|
This is bits per color channel, not bits per pixel, so 32 was a little
over-optimistic. :^)
|
|
This patch adds support for "crisp-edges", "high-quality" and "smooth"
for the CSS image-rendering property.
"crisp-edges" maps to nearest-neighbor scaling for <canvas> and <img>
elements, while "high-quality" and "smooth" both use bilinear blending.
|
|
|
|
|