LibWeb: Move border width and color into LayoutStyle

To make this possible, I also had to give each LayoutNode a Document&
so it can resolve document-specific colors correctly. There's probably
ways to avoid having this extra member by resolving colors later, but
this works for now.
This commit is contained in:
Andreas Kling 2020-06-24 19:41:12 +02:00
parent 4b2ac34725
commit 440b4ece22
Notes: sideshowbarker 2024-07-19 05:24:20 +09:00
57 changed files with 173 additions and 190 deletions

View file

@ -68,12 +68,12 @@ void HTMLImageElement::parse_attribute(const FlyString& name, const String& valu
m_image_loader.load(document().complete_url(value));
}
RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleProperties* parent_style) const
RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleProperties* parent_style)
{
auto style = document().style_resolver().resolve_style(*this, parent_style);
if (style->display() == CSS::Display::None)
return nullptr;
return adopt(*new LayoutImage(*this, move(style), m_image_loader));
return adopt(*new LayoutImage(document(), *this, move(style), m_image_loader));
}
const Gfx::Bitmap* HTMLImageElement::bitmap() const