Age | Commit message (Collapse) | Author |
|
This patch adds parsing support as well as all the needed stuctures all
over LibWeb to pass Transformations around.
|
|
This patch patches ef22a1b to also check for is_auto() on the height
property when setting definite_height.
|
|
This now uses the values in `InitialValues`, which is not ideal, but
it's better to have our defaults defined in two places, than in 3.
The default for `border-colors` is `currentcolor`, so we shortcut that
here and just grab the value of the `color` property. As noted, this is
not perfect, but it's somewhat better.
|
|
This is in preparation for the `currentcolor` value, which needs to know
what Node it's on so it can check the `color`.
|
|
In the spec, `fill` and `stroke` are supposed to be a shorthands for
various properties. But since the spec is still a working draft, and
neither Firefox or Chrome support the `fill-color` or `stroke-color`
properties, we'll stick with `fill` and `stroke` as simple colors for
now.
Also, note that SVG expects things in "user units", and we are assuming
that 1px = 1 user unit for now.
|
|
Auto is not specified at all.
|
|
This teaches all the relevant places about 'align-items'.
|
|
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.
|
|
The "Box" suffix added nothing here.
|
|
The root of a node can never be null, as "the root of an object is
itself, if its parent is null, or else it is the root of its parent."
https://dom.spec.whatwg.org/#concept-tree-root
|
|
Previously, this made the same "everything is px" assumption as in
`StyleProperties::load_font()`, so I've replaced it with the calculation
from there.
|
|
The previous code assumed all font sizes were in px, but now we perform
the conversion. There is an existing bug with em sizes returning 0,
which seems to affect other places too - see
`NodeWithStyle::apply_style()`.
This also implements 'larger', 'smaller' and calc() font-sizes.
|
|
This parses the elliptical border-radius values, though currently we
only support circular ones. So, to_length() is overloaded to return the
horizontal-radius. This means the code in Layout/Node.cpp does not need
to change for now.
|
|
Not having this header only causes an issue on Clang builds, since in
libc++, `std::type_info` is only forward-declared in `cxxabi.h`.
|
|
|
|
This patch spreads box-shadows around:
- The Values important to box-shadows are stored in a BoxShadowData
struct
- StyleProperties knows how to construct such a struct from a
BoxShadowStyleValue and a Node knows how to ask for it
- CalculatedValues contain BoxShadowData and expose them
|
|
|
|
|
|
|
|
This code worked with GCC because libstdc++ pulls in `type_info`'s
definition through the `cxxabi` header included by `AK/Demangle.h`.
In contrast, `libc++` only forward-declares it, so this code failed to
compile with it.
|
|
This makes it much clearer what this cast actually does: it will
VERIFY that the thing we're casting is a T (using is<T>()).
|
|
They get parsed and are available to the programmer of Layouts :^)
|
|
Flex-basis accepts either 'content' or a Length.
|
|
This is pretty naive and there are more nuances in the spec but should
be enough for now.
|
|
|
|
There are a few other things to notice, but they don't seem to be
implemented yet.
|
|
Our "frame" concept very closely matches what the web specs call a
"browsing context", so let's rename it to that. :^)
The "main frame" becomes the "top-level browsing context",
and "sub-frames" are now "nested browsing contexts".
|
|
|
|
Now our painting order inside stacking contexts is closer to the
algorithm specified by CSS 2.1 (see section 9.9 and Appendix E)
|
|
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
|
|
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
|
|
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 *
|
|
|
|
The background-repeat value may be specified as either one- or two-value
identifiers (to be interpreted as horizontal and vertical repeat). This
adds two pseudo-properties, background-repeat-x and background-repeat-y,
to handle this. One-value identifiers are mapped to two-value in
accordance with the spec.
|
|
|
|
We try scrolling a Node with the handle_mousewheel event, but if it
isn't scrollable, the event should be passed back up to the page
host. This is the first step in that process.
|
|
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
We implement this by adding a BlockBox::is_scrollable() helper,
and then ignoring wheel events for non-scrollable boxes.
Thanks to FireFox317 for pointing this out! :^)
|
|
This is rather crude, but you can now use the mouse wheel to scroll up
and down in block-level boxes with clipped overflowing content.
There's no limit to how far you can scroll in either direction, since
we don't yet track how much overflow there is. But it's a start. :^)
|
|
We don't actually do anything with the values yet, but now they are
available for layout nodes once we are ready to implement them.
|
|
We'll want to remove the LibGUI dependency from the WebContent process.
This is the first basic step of removing unnecessary LibGUI includes
and swapping out GUI::Painter for Gfx::Painter.
|
|
|
|
|
|
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.
|
|
|