mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
LibWeb: Add context to new CSS parser, and deprecate the old one
The new one is the same as the old one, just in the new Parser's source files. This isn't the most elegant solution but it seemed like the best option. And it's all temporary, after all.
This commit is contained in:
parent
390cc30a97
commit
004ae453d1
10 changed files with 83 additions and 41 deletions
|
@ -23,7 +23,7 @@ CSSLoader::CSSLoader(DOM::Element& owner_element)
|
|||
|
||||
void CSSLoader::load_from_text(const String& text)
|
||||
{
|
||||
m_style_sheet = parse_css(CSS::ParsingContext(m_owner_element.document()), text);
|
||||
m_style_sheet = parse_css(CSS::DeprecatedParsingContext(m_owner_element.document()), text);
|
||||
if (!m_style_sheet) {
|
||||
m_style_sheet = CSS::CSSStyleSheet::create({});
|
||||
m_style_sheet->set_owner_node(&m_owner_element);
|
||||
|
@ -51,7 +51,7 @@ void CSSLoader::resource_did_load()
|
|||
dbgln_if(CSS_LOADER_DEBUG, "CSSLoader: Resource did load, has encoded data. URL: {}", resource()->url());
|
||||
}
|
||||
|
||||
auto sheet = parse_css(CSS::ParsingContext(m_owner_element.document()), resource()->encoded_data());
|
||||
auto sheet = parse_css(CSS::DeprecatedParsingContext(m_owner_element.document()), resource()->encoded_data());
|
||||
if (!sheet) {
|
||||
dbgln_if(CSS_LOADER_DEBUG, "CSSLoader: Failed to parse stylesheet: {}", resource()->url());
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue