mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Apply shadow root style sheets in StyleComputer
Now, if an element belongs to a shadow tree, we use only the style sheets from the corresponding shadow root during style computation, instead of using all available style sheets as was the case previously. The only exception is the user agent style sheets, which are still taken into account for all elements. Tests/LibWeb/Layout/input/input-element-with-display-inline.html is affected because style of document no longer affects shadow tree of input element, like it is supposed to be. Co-authored-by: Simon Wanner <simon+git@skyrising.xyz>
This commit is contained in:
parent
91ec1d6f95
commit
33294aea86
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 33294aea86
Pull-request: https://github.com/SerenityOS/serenity/pull/23533
Issue: https://github.com/SerenityOS/serenity/issues/23410
Reviewed-by: https://github.com/awesomekling
7 changed files with 99 additions and 27 deletions
|
@ -105,4 +105,16 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_adopted_style_sheets(JS::Value new_val
|
|||
return {};
|
||||
}
|
||||
|
||||
void ShadowRoot::for_each_css_style_sheet(Function<void(CSS::CSSStyleSheet&)>&& callback) const
|
||||
{
|
||||
for (auto& style_sheet : style_sheets().sheets())
|
||||
callback(*style_sheet);
|
||||
|
||||
if (m_adopted_style_sheets) {
|
||||
m_adopted_style_sheets->for_each<CSS::CSSStyleSheet>([&](auto& style_sheet) {
|
||||
callback(style_sheet);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue