LibWeb: Add CSS ParsingContext constructor with a realm and URL
This is useful for when we want to parse paths relative to the current ESO's api base url when there isn't a document, such as in a Worker context.
This commit is contained in:
parent
8872008958
commit
d76167b8a4
Notes:
sideshowbarker
2024-07-17 05:19:06 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/d76167b8a4 Pull-request: https://github.com/SerenityOS/serenity/pull/24339
2 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,13 @@ ParsingContext::ParsingContext(JS::Realm& realm, Mode mode)
|
|||
{
|
||||
}
|
||||
|
||||
ParsingContext::ParsingContext(JS::Realm& realm, URL::URL url, Mode mode)
|
||||
: m_realm(realm)
|
||||
, m_url(move(url))
|
||||
, m_mode(mode)
|
||||
{
|
||||
}
|
||||
|
||||
ParsingContext::ParsingContext(DOM::Document const& document, URL::URL url, Mode mode)
|
||||
: m_realm(const_cast<JS::Realm&>(document.realm()))
|
||||
, m_document(&document)
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
};
|
||||
|
||||
explicit ParsingContext(JS::Realm&, Mode = Mode::Normal);
|
||||
explicit ParsingContext(JS::Realm&, URL::URL, Mode = Mode::Normal);
|
||||
explicit ParsingContext(DOM::Document const&, Mode = Mode::Normal);
|
||||
explicit ParsingContext(DOM::Document const&, URL::URL, Mode = Mode::Normal);
|
||||
explicit ParsingContext(DOM::ParentNode&, Mode = Mode::Normal);
|
||||
|
|
Loading…
Add table
Reference in a new issue