summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/CSS
AgeCommit message (Collapse)Author
2020-09-08LibWeb: Add support for viewport-relative length units (#3433)Jakob-Niklas See
We can now use vh, vw, vmax and vmin as length units in CSS.
2020-08-17LibWeb: Add Comment and DocumentFragment bindings, move querySelector...Luke
...{All} to ParentNode. Exposes createDocumentFragment and createComment on Document. Stubs out the document.body setter. Also adds ParentNode back :^).
2020-08-17LibWeb: Rename PageView => InProcessWebViewAndreas Kling
2020-08-12LibWeb: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code. Also, in the case of {Event,Node}WrapperFactory.cpp, the corresponding header was forgotten. This would cause an issue later when we enable -Wmissing-declarations. Is my clang-format misconfigured? Why is the diff for NodeWrapperFactory.cpp so large?
2020-08-12LibWeb: Fix #include <LibWeb/{DOM => HTML}/AttributeNames.h>Linus Groh
This file has been moved from DOM/ to HTML/ in a784090b91139776b26fbac2a8426de3abdea308.
2020-08-07LibWeb: Remove some unnecessary throwaway strings in the CSS parserAndreas Kling
We've had StringView::ends_with(..., CaseSensitivity) for a while, so let's use it to avoid creating a bunch of unnecessary strings here.
2020-08-07LibWeb: Handle CSS "ex" lengths (relative to font x-height)Andreas Kling
These are pretty rare, but they do come up in some places and it's not hard to support. The Gfx::Font information is approximate (and bad) but we can fix that separately.
2020-07-28LibWeb: Move the Page/Frame/EventHandler classes into Page/Andreas Kling
2020-07-28LibWeb: Fix bad #include in CSSParser.cppAndreas Kling
2020-07-28LibWeb: Move the CSS parser into CSS/Parser/Andreas Kling
2020-07-26LibWeb: Move CSS classes into the Web::CSS namespaceAndreas Kling
2020-07-26LibWeb: Move DOM classes into the Web::DOM namespaceAndreas Kling
LibWeb keeps growing and the Web namespace is filling up fast. Let's put DOM stuff into Web::DOM, just like we already started doing with SVG stuff in Web::SVG.
2020-07-26LibWeb: Switch to using AK::is and AK::downcastAndreas Kling
2020-07-26LibWeb: Move HTML object model stuff into LibWeb/HTML/Andreas Kling
Take a hint from SVG and more all the HTML classes into HTML instead of mixing them with the DOM classes.
2020-07-23LibWeb: Rename Element::tag_name() => local_name()Andreas Kling
To prepare for fully qualified tag names, let's call this local_name. Note that we still keep an Element::tag_name() around since that's what the JS bindings end up calling into for the Element.tagName property.
2020-07-21LibWeb: Use "namespace Web::Foo {" since C++20 allows it :^)Andreas Kling
Thanks @nico for teaching me about this!
2020-07-05LibWeb: Use LayoutTableRowGroup for display:table-{header,footer}-groupAndreas Kling
2020-06-28LibWeb: Give the <blockquote> element some margins in the UA styleAndreas Kling
2020-06-28LibWeb: Support "pt" length units :^)Andreas Kling
2020-06-28LibWeb: Add Length::is_undefined_or_auto()Andreas Kling
Quite often, we want the same behavior in both cases. This allows us to express that with a single method.
2020-06-28LibWeb: Tweak default style for <hr> to use em units for margin valuesAndreas Kling
2020-06-28LibWeb: Don't tolerate unit-less lengths (except 0) in standards modeAndreas Kling
"width: 500" is not a valid CSS property in standards mode and should be ignored. To plumb the quirks-mode flag into CSS parsing, this patch adds a new CSS::ParsingContext object that must be passed to the CSS parser. Currently it only allows you to check the quirks-mode flag. In the future it will be a good place to put additional information needed for things like relative URL resolution, etc. This narrows <div class=parser> on ACID2 to the correct width. :^)
2020-06-28LibWeb: Use length units and shorthands in the default UA style sheetAndreas Kling
2020-06-26LibWeb: Add the 'float' CSS property to LayoutStyleAndreas Kling
Note that we don't use the property for anything yet, as I'm still wrapping my head around how to implement floats.
2020-06-25LibWeb: Fix build after Specificity.h removalAndreas Kling
2020-06-25LibWeb: Don't allow more than one color sub-value in CSS 'background'Andreas Kling
2020-06-25LibWeb: Compress specificity into a 32-bit unsigned intAndreas Kling
Instead of storing the three-part specificy for every selector, just mash them together into a 32-bit value instead. This saves both space and time, and matches the behavior of other browser engines.
2020-06-25LibWeb: Serialize Length::Type::Percentage with a "%" suffixAndreas Kling
"10 percentage" looked rather silly. :^)
2020-06-24LibWeb: Move the offset, margin and padding boxes into LayoutStyleAndreas Kling
2020-06-24LibWeb: Move white-space into LayoutStyleAndreas Kling
2020-06-24LibWeb: Add CSS::Display enum and StyleProperties::display()Andreas Kling
The display property is not interesting after we've built the layout tree, so we don't have to move it into LayoutStyle.
2020-06-24LibWeb: Move width into LayoutStyleAndreas Kling
This patch also adds the ability for Length to contain percentage values. This is a little off-spec, but will make storing and dealing with lengths a lot easier. To resolve a Length to a px-or-auto Length, there are now helpers for that. After calling them, you no longer have to think about em, rem, %, and such things.
2020-06-24LibWeb: Add an "undefined" state to LengthAndreas Kling
A default-constructed Length now gives you an undefined length value, which can be used to signify the absence of a value.
2020-06-24LibWeb: Remove default Length constructor and add make_auto()/make_px()Andreas Kling
To prepare for adding an undefined/empty state for Length, let's first move away from Length() creating an auto value.
2020-06-23LibWeb: Cache the used CSS text-align property on LayoutNodeWithStyleAndreas Kling
2020-06-23LibWeb: Always inline absolute Length to_px() conversionAndreas Kling
Only do the relative Length units out of line.
2020-06-23LibWeb: Decode CSS image values out-of-process as wellAndreas Kling
2020-06-15LibWeb: Respect CSS z-index property while paintingAndreas Kling
To support z-ordering when painting, the layout tree now has a parallel sparse tree of stacking contexts. The rules for which layout boxes establish a stacking context are a bit complex, but the intent is to encapsulate the decision making into establishes_stacking_context(). When we paint, we start from the ICB (LayoutDocument) who always has a StackingContext and then paint the tree of StackingContexts where each node has its children sorted by z-index. This is pretty crude, but gets the basic job done. Note that this does not yet support hit testing; hit testing is still done using a naive treewalk from the root.
2020-06-14LibWeb: Make the specificity sort comparator a bit more readableAndreas Kling
2020-06-13LibWeb: Expand background:none into background-color:transparentAndreas Kling
2020-06-13LibWeb: Turn <td align> into CSS text-alignAndreas Kling
Note that align=center and align=middle both behave like the <center> element, and not like text-align:center.
2020-06-13LibWeb: Implement <center> as -libweb-centerAndreas Kling
To get the expected behavior for <center>, we needed a special text alignment mode that centers block-level elements (and not just line box fragments.)
2020-06-13LibWeb: Tweak UA style to reset text-align on table elementsAndreas Kling
I think maybe this is only supposed to happen in quirks mode but I'm not entirely sure. This makes "<center><table>..." behave as expected.
2020-06-13LibWeb: Sort matched style rules by specificity, document orderAndreas Kling
If two rules have equal specificity, they should be applied in the order in which we encountered them.
2020-06-13LibWeb: Fix broken Specificity::operator==Andreas Kling
2020-06-13LibWeb: Parse and match the :visited pseudo-class (always fails)Andreas Kling
If we don't do this, something like "a:visited" is parsed as "a" which may then take precedence over a previous "a:link" etc.
2020-06-13LibWeb: Allow url("foo") and url('foo') in CSS background-image valuesAndreas Kling
This is very hackish and will be fixed by writing a proper CSS parser.
2020-06-10LibWeb: Don't try to expand shorthands from non-string CSS valuesAndreas Kling
If something is already e.g a length or a color value, we don't need to try to expand it by stringifying and looking at the parts.
2020-06-10LibWeb: Expand "background: url()" into "background-image: url()"Andreas Kling
This gives us a yellow forehead on ACID2! :^)
2020-06-10LibWeb: Expand 2-part border-width shorthand CSS propertiesAndreas Kling