summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/CSS
AgeCommit message (Collapse)Author
2020-06-07LibWeb: Start fleshing out support for relative CSS unitsAndreas Kling
This patch introduces support for more than just "absolute px" units in our Length class. It now also supports "em" and "rem", which are units relative to the font-size of the current layout node and the <html> element's layout node respectively.
2020-06-07LibWeb: Move Frame.{cpp,h} into a new Frame/ directoryAndreas Kling
2020-06-05LibWeb: Fix mismatching Resource subclass typesAndreas Kling
This was a confusing bug: ImageStyleValue loaded its image resource as a Generic resource, while HTMLImageElement loaded as Image. This patch fixes the issue and adds an assertion to verify that we only share resources that have the same C++ client class type.
2020-06-04LibWeb: Process style sheets in document orderAndreas Kling
Until now we would simply apply stylesheets in the order they finished loading. This patch adds a StyleSheetList object that hangs off of each Document and contains all the style sheets in document order. There's still a lot of work to do for a proper cascade, but at least this makes us consistently wrong every time. :^)
2020-06-02LibWeb: Share decoded images at the Resource level :^)Andreas Kling
This patch adds ImageResource as a subclass of Resource. This new class also keeps a Gfx::ImageDecoder so that we can share decoded bitmaps between all clients of an image resource inside LibWeb. With this, we now share both encoded and decoded data for images. :^) I had to change how the purgeable-volatile flag is updated to keep the volatile-images-outside-the-visible-viewport optimization working. HTMLImageElement now inherits from ImageResourceClient (a subclass of ResourceClient with additional image-specific stuff) and informs its ImageResource about whether it's inside the viewport or outside. This is pretty awesome! :^)
2020-06-02LibWeb: Port ImageStyleValue to the ResourceClient interfaceAndreas Kling
2020-06-01LibWeb: Move ResourceLoader into a new Loader/ directoryAndreas Kling
2020-05-30LibWeb: Use the globals from HTML::AttributeNames in style resolutionAndreas Kling
Using these avoids the FlyString lookups, so we should basically always prefer them over string literal attribute names.
2020-05-30LibWeb: Add default UA style for <hgroup> elementAndreas Kling
2020-05-30LibWeb: Don't render list item markers for "list-style-type: none"Andreas Kling
2020-05-30LibWeb: Naive support for CSS "background" shorthandAndreas Kling
Many sites simply use "background" as an alias for "background-color" so let's at least support that.
2020-05-28LibWeb: Rename Web::HtmlView => Web::PageViewAndreas Kling
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28LibWeb: Add default UA style for some table-related elementsAndreas Kling
2020-05-26LibWeb: Add cached global attribute name FlyStringsAndreas Kling
Instead of creating extremely common FlyStrings like "id" and "class" on demand every time they are needed, we now have AttributeNames.h, which provides Web::HTML::AttributeNames::{id,class_} This avoids a bunch of string allocations during selector matching.
2020-05-26LibWeb: The line-height should not be multiplied by the glyph heightAndreas Kling
This was causing very tall lines on many websites. We can now see the section header thingy on google.com (although it's broken into lines where it should not be..) :^)
2020-05-26LibWeb: Implement vendor specific CSS color style for System PaletteFalseHonesty
Add "-libweb-palette-foo-bar" CSS color properties to allow CSS to style itself using the currently selected System Theme.
2020-05-21LibWeb: Update the CSS prefix to -libwebSergey Bugaev
2020-05-19LibWeb: Fix duplicated public access modifier in StyleDeclarationLinus Groh
2020-05-14LibWeb: Support the :root pseudo classLinus Groh
2020-05-13AK: Replace String::trim_spaces() with String::trim_whitespace()Linus Groh
As suggested by @awesomekling in a code review and (initially) ignored by me :^) Implementation is roughly based on LibJS's trim_string(), but with a fix for trimming all-whitespace strings.
2020-05-11LibWeb: Add basic support for CSS percentagesAndreas Kling
Many properties can now have percentage values that get resolved in layout. The reference value (what is this a percentage *of*?) differs per property, so I've added a helper where you provide a reference value as an added parameter to the existing length_or_fallback().
2020-05-11LibWeb: Add very basic handling of "font-family" font stacksLinus Groh
2020-05-11LibWeb: Set nav, main, article, aside, section to "display: block"Linus Groh
This makes the blog posts on awesomekling.github.io show up :^)
2020-05-05LibWeb: Recognise :focus pseudo-classLinus Groh
It's still only a dummy as LibWeb doesn't have focused elements yet, but at least now we don't treat "selector:focus" as just "selector". This fixes an issue on google.com which was mostly grey - coming from some menu item focus styles :^)
2020-05-03ProtocolServer: Pass HTTP response headers to the clientAndreas Kling
We now store the response headers in a download object on the protocol server side and pass it to the client when finishing up a download. Response headers are passed as an IPC::Dictionary. :^)
2020-04-08LibWeb: Remove bizarre HashMap leak in StyleProperties copy ctorAndreas Kling
2020-03-23 LibWeb: CSS: Add "position: absolute" with top and leftmyphs
This momentarily handles the CSS property "position: absolute;" in combination with the properties "top" and "left", so that elements can be placed anywhere on the page independently from their parents. Statically positioned elements ignore absolute positioned elements when calculating their position as they don't take up space.
2020-03-22LibWeb: Use FlyString for Element tag namesAndreas Kling
This makes selector matching a lot more efficient, and also reduces the number of strings on the heap.
2020-03-20LibWeb: Add CSS property 'border'myphs
This makes it possible to write shorter CSS. Instead of writing .foo { border-width: 3px; border-style: solid; border-color: blue; } it is now possible to write .foo { border: 3px solid blue; } while the order of values is irrelevant. Currently only the basic values are supported. More values should be added in the future. Three more value specific parse functions were added: parse_line_width, parse_color, and parse_line_style Additionally a few test cases were added to borders.html.
2020-03-18LibWeb: Don't try to repaint frameless documents in CSSStyleValueAndreas Kling
2020-03-11LibWeb: Skip non-font files when looking for fonts instead of assertingTibor Nagy
2020-03-07LibWeb: Rename directory LibHTML => LibWebAndreas Kling
Let's rename this to LibWeb since it aims to provide more parts of the web platform than just HTML. :^)