mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Align StyleSheet title getter with the specification
The CSSOM specification says that StyleSheet.title should return null if the title field is empty.
This commit is contained in:
parent
b9df8deba2
commit
84193f2746
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/tcl3
Commit: 84193f2746
Pull-request: https://github.com/SerenityOS/serenity/pull/24150
6 changed files with 22 additions and 13 deletions
|
@ -36,4 +36,14 @@ void StyleSheet::set_parent_css_style_sheet(CSSStyleSheet* parent)
|
|||
m_parent_style_sheet = parent;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-stylesheet-title
|
||||
Optional<String> StyleSheet::title_for_bindings() const
|
||||
{
|
||||
// The title attribute must return the title or null if title is the empty string.
|
||||
if (m_title.is_empty())
|
||||
return {};
|
||||
|
||||
return m_title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue