summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/TextNode.h
AgeCommit message (Collapse)Author
2022-03-16LibWeb: Move text fragment painting to PaintableWithLinesAndreas Kling
All the other painting code has moved to paintables already.
2022-03-11LibWeb: Move mouse event and label logic from layout to painting treeAndreas Kling
Input events have nothing to do with layout, so let's not send them to layout nodes. The job of Paintable starts to become clear. It represents a paintable item that can be rendered into the viewport, which means it can also be targeted by the mouse cursor.
2022-03-11LibWeb: Make Paintable ref-countedAndreas Kling
This will allow us to use a protective NonnullRefPtr to keep paintables alive while running arbitrary JavaScript in response to events.
2022-03-11LibWeb: Generate a TextPaintable for every Layout::TextNodeAndreas Kling
This is prep work for moving event handling over to the painting tree.
2022-03-11LibWeb: Let Paintable perform the paintingAndreas Kling
This patch adds a bunch of Paintable subclasses, each corresponding to the Layout::Node subclasses that had a paint() override. All painting logic is moved from layout nodes into their corresponding paintables. Paintables are now created by asking a Layout::Box to produce one: static NonnullOwnPtr<Paintable> Layout::Box::create_paintable() Note that inline nodes still have their painting logic. Since they are not boxes, and all paintables have a corresponding box, we'll need to come up with some other solution for them.
2022-03-11LibWeb: Move StackingContext and PaintPhase into the Painting namespaceAndreas Kling
2022-03-07LibWeb: Make TextNode::ChunkIterator::try_commit_chunk() constMaciej
2022-01-23LibWeb: Remove old Layout::Node::split_into_lines() APIAndreas Kling
Now that we build lines incrementally, we no longer need the atomic line splitting API. The new InlineLevelIterator and LineBuilder setup does have some regressions from the old behavior, but we can deal with them as we go.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-09-15LibWeb: Make Layout::Node::paint() pure virtualAndreas Kling
In the past, the base class implementation of this was used to descend into subtrees and paint children. That is now taken care of by StackingContext::paint_descendants() instead, and nothing used this.
2021-08-29LibWeb: Rename wrap_breaks to respect_linebreakssin-ack
This more clearly expresses the purpose of this flag. Since only CSS::WhiteSpace::Nowrap sets this value to false and it does not respect linebreaks, this made the most sense as a flag name.
2021-08-29LibWeb: Refactor TextNode::ChunkIteratorsin-ack
This commit refactors the text chunking algorithm used in TextNode::ChunkIterator. The m_start_of_chunk member parameter has been replaced with a local variable that's anchored to the current iterator at the start of every next() call, and the algorithm is made a little more clear by explicitly separating what can and cannot peek into the next character during iteration.
2021-07-29LibWeb: Add proper support for text-decoration-line property valuesTobias Christiansen
The code handling the rendering of the text-decoration-line got moved into its own function to reduce clutter. The CSS property text-decoration-line now supports underline, overline and line-through.
2021-04-29LibWeb: Move Layout::TextNode whitespace collapse to separate functionAndreas Kling
2021-04-27LibWeb: Refactor Layout::TextNode splitting into a chunk iteratorAndreas Kling
Creating a ChunkIterator allows you to iterate over the text in a Layout::TextNode at your leisure by calling next() when you want another chunk. This is one of many steps towards improving inline layout.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-04LibWeb: Defer mouse events from TextNode to LabelTimothy Flynn
A label's format is: <label>Label text</label> So, a TextNode is created as a child of the Label node, and EventHandler will send events to the TextNode. This changes TextNode to accept mouse events if its parent is a Label, and to forward those events upward.
2021-01-17LibWeb: Add fast_is<T>() for some DOM and layout node subclassesAndreas Kling
The generic is<T>() uses dynamic_cast which is fine in the majority of cases, but when one of them shows up in profiles, we can make it faster by answering the is-a question manually.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling