mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibWeb: Use W3C urls for CSSOM spec links
https://www.w3.org/TR/cssom/ is the more permanent home of the CSSOM specification's latest version, and is up to date with the draft spec. Also, https://drafts.csswg.org/ has been down multiple times recently which made looking things up a pain.
This commit is contained in:
parent
df85832f32
commit
e8d4236bbd
Notes:
sideshowbarker
2024-07-18 02:20:23 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/e8d4236bbd4 Pull-request: https://github.com/SerenityOS/serenity/pull/10492
|
@ -19,7 +19,7 @@ CSSImportRule::~CSSImportRule()
|
|||
{
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-css-rule
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-rule
|
||||
String CSSImportRule::serialized() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
|
|
@ -12,14 +12,14 @@ CSSRule::~CSSRule()
|
|||
{
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssrule-csstext
|
||||
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
|
||||
String CSSRule::css_text() const
|
||||
{
|
||||
// The cssText attribute must return a serialization of the CSS rule.
|
||||
return serialized();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssrule-csstext
|
||||
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
|
||||
void CSSRule::set_css_text(StringView)
|
||||
{
|
||||
// On setting the cssText attribute must do nothing.
|
||||
|
|
|
@ -29,7 +29,7 @@ bool CSSRuleList::is_supported_property_index(u32 index) const
|
|||
return index < m_rules.size();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#insert-a-css-rule
|
||||
// https://www.w3.org/TR/cssom/#insert-a-css-rule
|
||||
DOM::ExceptionOr<unsigned> CSSRuleList::insert_a_css_rule(NonnullRefPtr<CSSRule> rule, u32 index)
|
||||
{
|
||||
// 1. Set length to the number of items in list.
|
||||
|
@ -54,7 +54,7 @@ DOM::ExceptionOr<unsigned> CSSRuleList::insert_a_css_rule(NonnullRefPtr<CSSRule>
|
|||
return index;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#remove-a-css-rule
|
||||
// https://www.w3.org/TR/cssom/#remove-a-css-rule
|
||||
DOM::ExceptionOr<void> CSSRuleList::remove_a_css_rule(u32 index)
|
||||
{
|
||||
// 1. Set length to the number of items in list.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
// https://drafts.csswg.org/cssom/#the-cssrulelist-interface
|
||||
// https://www.w3.org/TR/cssom/#the-cssrulelist-interface
|
||||
class CSSRuleList
|
||||
: public RefCounted<CSSRuleList>
|
||||
, public Bindings::Wrappable {
|
||||
|
|
|
@ -124,7 +124,7 @@ void CSSStyleDeclaration::set_css_text(StringView)
|
|||
TODO();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-css-declaration
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-declaration
|
||||
static String serialize_a_css_declaration(CSS::PropertyID property, String value, bool important)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -150,7 +150,7 @@ static String serialize_a_css_declaration(CSS::PropertyID property, String value
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-declaration-block
|
||||
String PropertyOwningCSSStyleDeclaration::serialized() const
|
||||
{
|
||||
// 1. Let list be an empty array.
|
||||
|
|
|
@ -19,7 +19,7 @@ CSSStyleRule::~CSSStyleRule()
|
|||
{
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylerule-style
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylerule-style
|
||||
CSSStyleDeclaration* CSSStyleRule::style()
|
||||
{
|
||||
return m_declaration;
|
||||
|
@ -89,7 +89,7 @@ static StringView to_string(Selector::SimpleSelector::PseudoClass::Type pseudo_c
|
|||
|
||||
static String serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const&);
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-simple-selector
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-simple-selector
|
||||
static String serialize_a_simple_selector(Selector::SimpleSelector const& simple_selector)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -213,7 +213,7 @@ static String serialize_a_simple_selector(Selector::SimpleSelector const& simple
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-selector
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-selector
|
||||
static String serialize_a_selector(Selector const& selector)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -270,7 +270,7 @@ static String serialize_a_selector(Selector const& selector)
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-group-of-selectors
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-group-of-selectors
|
||||
static String serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const& selectors)
|
||||
{
|
||||
// To serialize a group of selectors serialize each selector in the group of selectors and then serialize a comma-separated list of these serializations.
|
||||
|
@ -280,7 +280,7 @@ static String serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#serialize-a-css-rule
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-rule
|
||||
String CSSStyleRule::serialized() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -324,14 +324,14 @@ String CSSStyleRule::serialized() const
|
|||
TODO();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylerule-selectortext
|
||||
String CSSStyleRule::selector_text() const
|
||||
{
|
||||
// The selectorText attribute, on getting, must return the result of serializing the associated group of selectors.
|
||||
return serialized();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylerule-selectortext
|
||||
void CSSStyleRule::set_selector_text(StringView selector_text)
|
||||
{
|
||||
// 1. Run the parse a group of selectors algorithm on the given value.
|
||||
|
|
|
@ -19,7 +19,7 @@ CSSStyleSheet::~CSSStyleSheet()
|
|||
{
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylesheet-insertrule
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylesheet-insertrule
|
||||
DOM::ExceptionOr<unsigned> CSSStyleSheet::insert_rule(StringView rule, unsigned index)
|
||||
{
|
||||
// FIXME: 1. If the origin-clean flag is unset, throw a SecurityError exception.
|
||||
|
@ -39,7 +39,7 @@ DOM::ExceptionOr<unsigned> CSSStyleSheet::insert_rule(StringView rule, unsigned
|
|||
return m_rules->insert_a_css_rule(parsed_rule.release_nonnull(), index);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylesheet-deleterule
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylesheet-deleterule
|
||||
DOM::ExceptionOr<void> CSSStyleSheet::delete_rule(unsigned index)
|
||||
{
|
||||
// FIXME: 1. If the origin-clean flag is unset, throw a SecurityError exception.
|
||||
|
@ -50,7 +50,7 @@ DOM::ExceptionOr<void> CSSStyleSheet::delete_rule(unsigned index)
|
|||
return m_rules->remove_a_css_rule(index);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstylesheet-removerule
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstylesheet-removerule
|
||||
DOM::ExceptionOr<void> CSSStyleSheet::remove_rule(unsigned index)
|
||||
{
|
||||
// The removeRule(index) method must run the same steps as deleteRule().
|
||||
|
|
|
@ -737,7 +737,7 @@ bool ResolvedCSSStyleDeclaration::set_property(PropertyID, StringView)
|
|||
|
||||
String ResolvedCSSStyleDeclaration::serialized() const
|
||||
{
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-csstext
|
||||
// https://www.w3.org/TR/cssom/#dom-cssstyledeclaration-csstext
|
||||
// If the computed flag is set, then return the empty string.
|
||||
|
||||
// NOTE: ResolvedCSSStyleDeclaration is something you would only get from window.getComputedStyle(),
|
||||
|
|
|
@ -24,7 +24,7 @@ StyleSheetList::StyleSheetList(DOM::Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#ref-for-dfn-supported-property-indices%E2%91%A1
|
||||
// https://www.w3.org/TR/cssom/#ref-for-dfn-supported-property-indices%E2%91%A1
|
||||
bool StyleSheetList::is_supported_property_index(u32 index) const
|
||||
{
|
||||
// The object’s supported property indices are the numbers in the range zero to one less than the number of CSS style sheets represented by the collection.
|
||||
|
|
|
@ -33,7 +33,7 @@ void HTMLStyleElement::removed_from(Node* old_parent)
|
|||
return HTMLElement::removed_from(old_parent);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#remove-a-css-style-sheet
|
||||
// https://www.w3.org/TR/cssom/#remove-a-css-style-sheet
|
||||
static void remove_a_css_style_sheet(DOM::Document& document, NonnullRefPtr<CSS::CSSStyleSheet> sheet)
|
||||
{
|
||||
VERIFY(sheet.ptr());
|
||||
|
@ -47,7 +47,7 @@ static void remove_a_css_style_sheet(DOM::Document& document, NonnullRefPtr<CSS:
|
|||
sheet->set_owner_css_rule(nullptr);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#add-a-css-style-sheet
|
||||
// https://www.w3.org/TR/cssom/#add-a-css-style-sheet
|
||||
static void add_a_css_style_sheet(DOM::Document& document, NonnullRefPtr<CSS::CSSStyleSheet> sheet)
|
||||
{
|
||||
// 1. Add the CSS style sheet to the list of document or shadow root CSS style sheets at the appropriate location. The remainder of these steps deal with the disabled flag.
|
||||
|
@ -67,7 +67,7 @@ static void add_a_css_style_sheet(DOM::Document& document, NonnullRefPtr<CSS::CS
|
|||
// FIXME: 5. Set the disabled flag.
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#create-a-css-style-sheet
|
||||
// https://www.w3.org/TR/cssom/#create-a-css-style-sheet
|
||||
static void create_a_css_style_sheet(DOM::Document& document, String type, DOM::Element* owner_node, String media, String title, bool alternate, bool origin_clean, void* location, CSS::CSSStyleSheet* parent_style_sheet, CSS::CSSRule* owner_rule, NonnullRefPtr<CSS::CSSStyleSheet> sheet)
|
||||
{
|
||||
// 1. Create a new CSS style sheet object and set its properties as specified.
|
||||
|
@ -144,7 +144,7 @@ void HTMLStyleElement::update_a_style_block()
|
|||
sheet.release_nonnull());
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
|
||||
// https://www.w3.org/TR/cssom/#dom-linkstyle-sheet
|
||||
RefPtr<CSS::CSSStyleSheet> HTMLStyleElement::sheet() const
|
||||
{
|
||||
// The sheet attribute must return the associated CSS style sheet for the node or null if there is no associated CSS style sheet.
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
RefPtr<CSS::CSSStyleSheet> sheet() const;
|
||||
|
||||
private:
|
||||
// https://drafts.csswg.org/cssom/#associated-css-style-sheet
|
||||
// https://www.w3.org/TR/cssom/#associated-css-style-sheet
|
||||
RefPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue