mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibWeb: Make Frame point weakly to Page
This patch makes Page weakable and allows page-less frames to exist. Page is single-owner, and Frame is multiple-owner, so it's not sound for Frame to assume its containing Page will stick around for its own entire lifetime. Fixes #3976.
This commit is contained in:
parent
e445ff670d
commit
81add73955
12 changed files with 87 additions and 56 deletions
|
@ -172,7 +172,8 @@ Color IdentifierStyleValue::to_color(const DOM::Document& document) const
|
|||
if (id() == CSS::ValueID::VendorSpecificLink)
|
||||
return document.link_color();
|
||||
|
||||
auto palette = document.frame()->page().palette();
|
||||
ASSERT(document.page());
|
||||
auto palette = document.page()->palette();
|
||||
switch (id()) {
|
||||
case CSS::ValueID::VendorSpecificPaletteDesktopBackground:
|
||||
return palette.color(ColorRole::DesktopBackground);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue