mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-03 23:52:08 +00:00
LibWeb: Make element_reference
optional in create_resolved_style
This commit is contained in:
parent
610ad25555
commit
fc46abb83f
Notes:
github-actions[bot]
2025-06-09 11:29:50 +00:00
Author: https://github.com/Calme1709
Commit: fc46abb83f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5034
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 7 additions and 8 deletions
|
@ -44,7 +44,7 @@ GC::Ref<CSSStyleProperties> CSSStyleProperties::create(JS::Realm& realm, Vector<
|
|||
return realm.create<CSSStyleProperties>(realm, Computed::No, Readonly::No, convert_declarations_to_specified_order(properties), move(custom_properties), OptionalNone {});
|
||||
}
|
||||
|
||||
GC::Ref<CSSStyleProperties> CSSStyleProperties::create_resolved_style(DOM::ElementReference element_reference)
|
||||
GC::Ref<CSSStyleProperties> CSSStyleProperties::create_resolved_style(JS::Realm& realm, Optional<DOM::ElementReference> element_reference)
|
||||
{
|
||||
// https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle
|
||||
// 6. Return a live CSSStyleProperties object with the following properties:
|
||||
|
@ -54,7 +54,6 @@ GC::Ref<CSSStyleProperties> CSSStyleProperties::create_resolved_style(DOM::Eleme
|
|||
// parent CSS rule: Null.
|
||||
// owner node: obj.
|
||||
// AD-HOC: Rather than instantiate with a list of decls, they're generated on demand.
|
||||
auto& realm = element_reference.element().realm();
|
||||
return realm.create<CSSStyleProperties>(realm, Computed::Yes, Readonly::Yes, Vector<StyleProperty> {}, HashMap<FlyString, StyleProperty> {}, move(element_reference));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue