Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 97dead34520722837b8810cc4d3e7210b77a447e
      
https://github.com/WebKit/WebKit/commit/97dead34520722837b8810cc4d3e7210b77a447e
  Author: Simon Fraser <[email protected]>
  Date:   2025-05-06 (Tue, 06 May 2025)

  Changed paths:
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ElementRareData.h
    M Source/WebCore/rendering/RenderBoxModelObject.cpp
    M Source/WebCore/rendering/RenderObject.h
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h
    M Source/WebCore/style/StyleChange.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  Some minor style resolution optimizations
https://bugs.webkit.org/show_bug.cgi?id=292614
rdar://150770799

Reviewed by Antti Koivisto.

Address various issues found during profiling of code under 
Style::TreeResolver::resolve().

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::mayHaveKeyframeEffects const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementRareData.h:
(WebCore::ElementRareData::hasAnimationRareData const): Helper to give us a 
fast path to knowing
that the are no keyframe effects on this element.
* Source/WebCore/rendering/RenderBoxModelObject.cpp: For reasons I can't 
explain, moving this
call to setPaintContainmentApplies() seems to reduce sample count in this 
function.
(WebCore::RenderBoxModelObject::updateFromStyle):
* Source/WebCore/rendering/RenderObject.h: Prettify (makes it easier to 
renumber when adding bits.)
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateBeforeDescendants):
(WebCore::RenderTreeUpdater::updateAfterDescendants):
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::keyframeEffectStackForElementAndPseudoId): Early return to avoid 
constructing the
PseudoElementIdentifier.
(WebCore::needsPseudoElementForAnimation):
(WebCore::createContentRenderers):
These functions were confusing. It seems that 
`needsPseudoElementForAnimation()` was only ever called
with a PseudoElement to support the assertion in `createContentRenderers()`. 
Instead, use some code
inside a `#if ASSERT_ENABLED` block. This also allows us to collapse the calls 
to
`!elementIsTargetedByKeyframeEffectRequiringPseudoElement(&current, pseudoId) 
&& !elementHasDisplayAnimationForPseudoId(current, pseudoId))`
into one, which avoids fetching `element.keyframeEffectStack()` twice.
(WebCore::RenderTreeUpdater::GeneratedContent::updateBeforeOrAfterPseudoElement):
 Renamed, since
this function only handles ::before and ::after.
(WebCore::elementIsTargetedByKeyframeEffectRequiringPseudoElement): Deleted.
(WebCore::elementHasDisplayAnimationForPseudoId): Deleted.
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Deleted.
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h:
* Source/WebCore/style/StyleChange.cpp:
(WebCore::Style::determineChanges): Code was doubled up.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement): `is<HTMLMeterElement>(element)`
is equivalent to `element.hasTagName(HTMLNames::meterTag)`.
(WebCore::Style::TreeResolver::resolvePseudoElement): 
`isViewTransitionPseudoElement` was only used inside the assertion.
(WebCore::Style::TreeResolver::generatePositionOptionsIfNeeded):

Canonical link: https://commits.webkit.org/294572@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to