mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
LibWeb: Note what's causing a style invalidation to happen
You can now build with STYLE_INVALIDATION_DEBUG and get a debug stream of reasons why style invalidations are happening and where. I've rewritten this code many times, so instead of throwing it away once again, I figured we should at least have it behind a flag.
This commit is contained in:
parent
1f5c49f40d
commit
ddbfac38b0
Notes:
github-actions[bot]
2024-09-08 07:46:37 +00:00
Author: https://github.com/awesomekling
Commit: ddbfac38b0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1276
20 changed files with 92 additions and 38 deletions
|
@ -52,6 +52,39 @@ enum class FragmentSerializationMode {
|
|||
Outer,
|
||||
};
|
||||
|
||||
#define ENUMERATE_STYLE_INVALIDATION_REASONS(X) \
|
||||
X(AdoptedStyleSheetsList) \
|
||||
X(AnimationEffectSetAssociatedAnimation) \
|
||||
X(CSSFontLoaded) \
|
||||
X(CSSImportRule) \
|
||||
X(DidLoseFocus) \
|
||||
X(DidReceiveFocus) \
|
||||
X(EditingInsertion) \
|
||||
X(ElementAttributeChange) \
|
||||
X(ElementSetShadowRoot) \
|
||||
X(HTMLInputElementSetChecked) \
|
||||
X(HTMLObjectElementUpdateLayoutAndChildObjects) \
|
||||
X(HTMLSelectElementSetIsOpen) \
|
||||
X(Hover) \
|
||||
X(MediaQueryChangedMatchState) \
|
||||
X(NavigableSetViewportSize) \
|
||||
X(NodeInsertBefore) \
|
||||
X(NodeRemove) \
|
||||
X(NodeSetTextContent) \
|
||||
X(Other) \
|
||||
X(SetSelectorText) \
|
||||
X(SettingsChange) \
|
||||
X(StyleSheetDeleteRule) \
|
||||
X(StyleSheetInsertRule) \
|
||||
X(StyleSheetListAddSheet) \
|
||||
X(StyleSheetListRemoveSheet)
|
||||
|
||||
enum class StyleInvalidationReason {
|
||||
#define __ENUMERATE_STYLE_INVALIDATION_REASON(reason) reason,
|
||||
ENUMERATE_STYLE_INVALIDATION_REASONS(__ENUMERATE_STYLE_INVALIDATION_REASON)
|
||||
#undef __ENUMERATE_STYLE_INVALIDATION_REASON
|
||||
};
|
||||
|
||||
class Node : public EventTarget {
|
||||
WEB_PLATFORM_OBJECT(Node, EventTarget);
|
||||
|
||||
|
@ -227,7 +260,7 @@ public:
|
|||
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; }
|
||||
|
||||
void invalidate_style();
|
||||
void invalidate_style(StyleInvalidationReason);
|
||||
|
||||
void set_document(Badge<Document>, Document&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue