mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
LibWeb: Add an engine-internal CSS realm for internal style parsing
This is used for default UA style right now, and we'll expand its use in the near future. Note that this required teaching the CSS parser to handle url() functions when there's no document URL to resolve them against. If we don't handle that, namespace rules in UA style don't parse correctly.
This commit is contained in:
parent
c12f8b80dc
commit
ba030f0363
Notes:
github-actions[bot]
2025-03-25 23:58:04 +00:00
Author: https://github.com/awesomekling
Commit: ba030f0363
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4081
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/shannonbooth
4 changed files with 44 additions and 13 deletions
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/CSSStyleProperties.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
|
@ -1814,6 +1815,8 @@ bool Parser::is_parsing_svg_presentation_attribute() const
|
|||
// FIXME: URLs shouldn't be completed during parsing, but when used.
|
||||
Optional<URL::URL> Parser::complete_url(StringView relative_url) const
|
||||
{
|
||||
if (!m_url.is_valid())
|
||||
return URL::Parser::basic_parse(relative_url);
|
||||
return m_url.complete_url(relative_url);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue