mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 18:52:56 +00:00
LibWeb: Clear stylesheet pointer when disabling link element
This fixes a crash when enabling an already disabled link element. Fixes a crash when changing mdbook themes.
This commit is contained in:
parent
1bd73184da
commit
59ba2fb2ee
Notes:
github-actions[bot]
2025-02-01 08:12:45 +00:00
Author: https://github.com/Gingeh
Commit: 59ba2fb2ee
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3423
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 17 additions and 1 deletions
|
@ -166,8 +166,10 @@ void HTMLLinkElement::attribute_changed(FlyString const& name, Optional<String>
|
|||
m_explicitly_enabled = true;
|
||||
|
||||
if (m_relationship & Relationship::Stylesheet) {
|
||||
if (name == HTML::AttributeNames::disabled && m_loaded_style_sheet)
|
||||
if (name == HTML::AttributeNames::disabled && m_loaded_style_sheet) {
|
||||
document_or_shadow_root_style_sheets().remove_a_css_style_sheet(*m_loaded_style_sheet);
|
||||
m_loaded_style_sheet = nullptr;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet:fetch-and-process-the-linked-resource
|
||||
// The appropriate times to fetch and process this type of link are:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue