mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Cache the first <base href> (in tree order) in Document
When parsing relative URLs, we have to check the first <base href> in tree order (if one is available). This was getting *very* costly on large DOMs with many relative urls. This patch avoids all that repeated traversal by letting Document cache the first <base href> and invalidating the cache whenever a <base> element is added/removed/edited in the DOM. The browser was stuck doing this for a *very* long time when loading the ECMA-262 spec, and this removes that problem entirely.
This commit is contained in:
@@ -22,6 +22,7 @@ public:
|
||||
AK::URL const& frozen_base_url() const { return m_frozen_base_url; }
|
||||
|
||||
virtual void inserted() override;
|
||||
virtual void removed_from(Node*) override;
|
||||
virtual void parse_attribute(FlyString const& name, String const& value) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user