summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2022-03-11LibWeb: Rename Painting::Box => PaintableAndreas Kling
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.
2022-03-11LibWeb: Make Painting::Box virtual and add Painting::BoxWithLinesAndreas Kling
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.
2022-03-11LibWeb: Hang StackingContext off of the paint boxesAndreas Kling
Stacking contexts have nothing to do with layout and everything with painting, so let's keep them in Painting::Box.
2022-03-11LibWeb: Make StackingContext paint functions constAndreas Kling
2022-03-11LibWeb: Move StackingContext and PaintPhase into the Painting namespaceAndreas Kling
2022-03-11LibWeb: Add Painting::Box and move things from Layout::Box into itAndreas Kling
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.)
2022-03-10Browser+LibWeb+WebContent: Show style for pseudo-elements :^)Sam Atkins
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.
2022-03-10LibWeb: Display pseudo-elements in the DOM inspectorSam Atkins
This patch only makes them appear in the tree - they are not yet inspectable themselves.
2022-03-10LibWeb: Move pseudo-element-from-string code into SelectorSam Atkins
2022-03-10LibWeb: Move pseudo-class/element names into the headerSam Atkins
These are constexpr, meaning that while the implementations were in the cpp file, nobody outside that file could actually call them.
2022-03-10LibWeb: Add window.sessionStoragePaul Wratt
2022-03-10Browser: Show currently loading host and remaining resource countBen Abraham
2022-03-09LibWeb: Only try parsing valid types of media-feature valuesSam Atkins
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.
2022-03-09LibWeb: Use ValueID for media-query identifiersSam Atkins
2022-03-09LibWeb+Meta: Stop discrete media-features from parsing as rangesSam Atkins
Only "range" type media-features are allowed to appear in range syntax, or have a `min-/max-` prefix.
2022-03-09LibWeb: Use MediaFeatureIDs instead of Strings :^)Sam Atkins
2022-03-09Meta: Generate CSS::MediaFeatureID enumSam Atkins
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. :^)
2022-03-09LibWeb: Add MediaFeatures.json file, and associated identifiersSam Atkins
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.
2022-03-09LibWeb: Invalidate style after CSSStyleSheet.{insert,remove}Rule()Andreas Kling
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. :^)
2022-03-09LibWeb: Add the StyleSheet.href attributeAndreas Kling
This is only ever null at the moment, as we only set it on <style> elements to begin with.
2022-03-09LibWeb: Respect inline-axis margins between line box fragments :^)Andreas Kling
This makes the buckets on ACID3 space out nicely.
2022-03-09LibWeb: Establish parent/child relationship between BrowsingContextsAndreas Kling
When an iframe is inserted or removed from a document, we now take it in and out of the BrowsingContext tree.
2022-03-09LibWeb: Always relayout document on element style changeAndreas Kling
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.
2022-03-09LibWeb: Always call update_style() in update_layout()Andreas Kling
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.
2022-03-09LibWeb: Invalidate document style when a node is removedAndreas Kling
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.
2022-03-09LibWeb: Flush pending layouts when accessing element resolved styleAndreas Kling
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.
2022-03-09LibWeb: Add StyleValue::equals() override for PositionStyleValueAndreas Kling
2022-03-09LibWeb: Use reverse iterator for reverse loop into NonnullRefPtrVectorFederico Guerinoni
2022-03-09LibWeb: Implement "NodeIterator pre-removing steps"Andreas Kling
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
2022-03-09LibWeb: Add support for DOM's TreeWalkerAndreas Kling
This patch adds TreeWalker (created via Document.createTreeWalker()) which allows you to traverse a filtered view of the DOM in all directions.
2022-03-09LibWeb: Add basic support for DOM's NodeIterator and NodeFilterAndreas Kling
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.
2022-03-09LibWeb: Allow returning JS::ThrowCompletionOr<T> from wrapped functionsAndreas Kling
In some cases, we need more nuance than what DOM::ExceptionOr<T> offers.
2022-03-09LibWeb: Fail resource loads on HTTP 4xx or 5xx errorAndreas Kling
This fixes an issue on ACID3 where failing image loads with body content would still get displayed.
2022-03-08LibWeb: Implement the WindowProxy exotic objectLinus Groh
A couple steps requiring working relationships between browsing contexts are currently FIXME'd - see #12917.
2022-03-08LibWeb: Stub out 'check if access between two BCs should be reported'Linus Groh
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more cross-origin related ground to cover. :^)
2022-03-08LibWeb: Implement 'cross-origin accessible window property name' conceptLinus Groh
2022-03-08Browser+LibWeb: Add an Element size preview widget to inspectorVrins
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.
2022-03-08LibWeb: Add explicit color to mark elementLady Gegga
2022-03-08LibWeb: Add default styling to abbr, acronym, mark, strike and ttLady Gegga
2022-03-08LibWeb: Remove outdated FIXME comment in Namespaces validate_and_extractnetworkException
As step "2. Validate qualifiedName" got implemented in bfa7aad0f6443249ae1a8f577b3150ac32add7a3, parts is known to have a length of 2.
2022-03-08LibWeb: Move Timer from DOM directory & namespace to HTMLLinus Groh
Timers are part of the HTML spec. :^) https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
2022-03-08LibWeb: Move Window from DOM directory & namespace to HTMLLinus Groh
The Window object is part of the HTML spec. :^) https://html.spec.whatwg.org/multipage/window-object.html
2022-03-08LibWeb: Make InlineLevelIterator emit absolutely positioned itemsAndreas Kling
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.
2022-03-07LibWeb: Make TextNode::ChunkIterator::try_commit_chunk() constMaciej
2022-03-07LibWeb: Add Ratio type to MediaFeatureValueSam Atkins
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. :^)
2022-03-07LibWeb: Introduce and parse CSS Ratio typeSam Atkins
This is only used by media-queries, so for now we can skip adding/parsing a StyleValue for these.
2022-03-07LibWeb: Correct "color" media-feature valueSam Atkins
This is bits per color channel, not bits per pixel, so 32 was a little over-optimistic. :^)
2022-03-07LibWeb: Support more CSS image-rendering valuesAndreas Kling
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.
2022-03-06LibWeb: Implement the remaining LocationObject internal methodsLinus Groh
2022-03-06LibWeb: Implement the CrossOriginOwnPropertyKeys AOLinus Groh