mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb: Verify type before casting PaintableBox to PaintableWithLines
Previously, calling `BlockContainer::paintable_with_lines()` would cast a `PaintableBox` to a `PaintableWithLines` without verifying that the cast was valid, which isn't the cast for `FieldsetPaintable`, for example. This method now returns null if it isn't poossible to cast to `PaintableWithLines`.
This commit is contained in:
parent
4f9aca4302
commit
cd0074528e
Notes:
github-actions[bot]
2025-07-13 01:03:06 +00:00
Author: https://github.com/tcl3
Commit: cd0074528e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5420
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ BlockContainer::~BlockContainer() = default;
|
||||||
|
|
||||||
Painting::PaintableWithLines const* BlockContainer::paintable_with_lines() const
|
Painting::PaintableWithLines const* BlockContainer::paintable_with_lines() const
|
||||||
{
|
{
|
||||||
return static_cast<Painting::PaintableWithLines const*>(Box::paintable_box());
|
return as_if<Painting::PaintableWithLines>(Box::paintable_box());
|
||||||
}
|
}
|
||||||
|
|
||||||
GC::Ptr<Painting::Paintable> BlockContainer::create_paintable() const
|
GC::Ptr<Painting::Paintable> BlockContainer::create_paintable() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue