Revert "LibWeb: Cache intrinsic sizes across layout runs"

This reverts commit 12c6ac78e2.

Very large performance regression when viewing GitHub repository pages.
This commit is contained in:
Andreas Kling 2025-03-08 12:08:51 +01:00
commit 73a4b176cf
Notes: github-actions[bot] 2025-03-08 11:10:16 +00:00
13 changed files with 102 additions and 108 deletions

View file

@ -91,26 +91,6 @@ enum class StyleInvalidationReason {
#undef __ENUMERATE_STYLE_INVALIDATION_REASON
};
#define ENUMERATE_SET_NEEDS_LAYOUT_REASONS(X) \
X(CharacterDataReplaceData) \
X(FinalizeACrossDocumentNavigation) \
X(HTMLImageElementReactToChangesInTheEnvironment) \
X(HTMLImageElementUpdateTheImageData) \
X(HTMLVideoElementSetVideoTrack) \
X(KeyframeEffect) \
X(LayoutTreeUpdate) \
X(NavigableSetViewportSize) \
X(SVGImageElementFetchTheDocument) \
X(StyleChange)
enum class SetNeedsLayoutReason {
#define ENUMERATE_SET_NEEDS_LAYOUT_REASON(e) e,
ENUMERATE_SET_NEEDS_LAYOUT_REASONS(ENUMERATE_SET_NEEDS_LAYOUT_REASON)
#undef ENUMERATE_SET_NEEDS_LAYOUT_REASON
};
[[nodiscard]] StringView to_string(SetNeedsLayoutReason);
class Node : public EventTarget
, public TreeNode<Node> {
WEB_PLATFORM_OBJECT(Node, EventTarget);
@ -311,10 +291,6 @@ public:
void set_needs_style_update(bool);
void set_needs_style_update_internal(bool) { m_needs_style_update = true; }
bool needs_layout_update() const { return m_needs_layout_update; }
void set_needs_layout_update(SetNeedsLayoutReason);
void reset_needs_layout_update() { m_needs_layout_update = false; }
bool child_needs_style_update() const { return m_child_needs_style_update; }
void set_child_needs_style_update(bool b) { m_child_needs_style_update = b; }
@ -552,8 +528,6 @@ protected:
bool m_child_needs_style_update { false };
bool m_entire_subtree_needs_style_update { false };
bool m_needs_layout_update { false };
UniqueNodeID m_unique_id;
// https://dom.spec.whatwg.org/#registered-observer-list