mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 16:10:20 +00:00
LibWeb: Don't crash on content with SVG elements outside of <svg>
We'll have to do something more proper to support this scenario eventually, but for now let's at least not crash just because somebody put an SVG <path> inside an HTML element.
This commit is contained in:
parent
ed089586ea
commit
0a533da22f
Notes:
sideshowbarker
2024-07-17 18:07:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0a533da22f
1 changed files with 3 additions and 0 deletions
|
@ -17,6 +17,9 @@ PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::I
|
|||
|
||||
SVGContext& PaintContext::svg_context()
|
||||
{
|
||||
// FIXME: This is a total hack to avoid crashing on content that has SVG elements embedded directly in HTML without an <svg> element.
|
||||
if (!m_svg_context.has_value())
|
||||
m_svg_context = SVGContext { {} };
|
||||
return m_svg_context.value();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue