mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb: Avoid a weird reparse of style attributes for pseudo elements
For pseudo elements that represent a browser-generated shadow tree element, such as ::placeholder, we were reparsing their style attribute in StyleComputer for some reason. Instead of doing this, just access the already-parsed version via Element::inline_style().
This commit is contained in:
parent
04d16a1ee3
commit
d21c5631aa
Notes:
github-actions[bot]
2024-10-19 19:15:00 +00:00
Author: https://github.com/awesomekling
Commit: d21c5631aa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1865
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 1 additions and 2 deletions
|
@ -2310,8 +2310,7 @@ RefPtr<StyleProperties> StyleComputer::compute_style_impl(DOM::Element& element,
|
|||
auto style = compute_style(parent_element, *element.use_pseudo_element());
|
||||
|
||||
// Merge back inline styles
|
||||
if (element.has_attribute(HTML::AttributeNames::style)) {
|
||||
auto* inline_style = parse_css_style_attribute(CSS::Parser::ParsingContext(document()), *element.get_attribute(HTML::AttributeNames::style), element);
|
||||
if (auto inline_style = element.inline_style()) {
|
||||
for (auto const& property : inline_style->properties())
|
||||
style->set_property(property.property_id, property.value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue