Skip to content

Commit

Permalink
Apply patch. rdar://123547221
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Robson committed Feb 28, 2024
1 parent 520088d commit b6258f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/WebCore/style/StyleTreeResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ auto TreeResolver::resolveElement(Element& element, const RenderStyle* existingS
auto update = createAnimatedElementUpdate(WTFMove(resolvedStyle), styleable, parent().change, resolutionContext);
auto descendantsToResolve = computeDescendantsToResolve(update.change, element.styleValidity(), parent().descendantsToResolve);

if (&element == m_document.documentElement()) {
bool isDocumentElement = &element == m_document.documentElement();
if (isDocumentElement) {
if (styleChangeAffectsRelativeUnits(*update.style, existingStyle)) {
// "rem" units are relative to the document element's font size so we need to recompute everything.
scope().resolver->invalidateMatchedDeclarationsCache();
Expand Down Expand Up @@ -308,7 +309,8 @@ auto TreeResolver::resolveElement(Element& element, const RenderStyle* existingS
resolveAndAddPseudoElementStyle(PseudoId::Before);
resolveAndAddPseudoElementStyle(PseudoId::After);
resolveAndAddPseudoElementStyle(PseudoId::Backdrop);
resolveAndAddPseudoElementStyle(PseudoId::ViewTransition);
if (isDocumentElement && m_document.hasViewTransitionPseudoElementTree())
resolveAndAddPseudoElementStyle(PseudoId::ViewTransition);

#if ENABLE(TOUCH_ACTION_REGIONS)
// FIXME: Track this exactly.
Expand Down Expand Up @@ -348,8 +350,8 @@ std::optional<ElementUpdate> TreeResolver::resolvePseudoElement(Element& element
return { };
if (pseudoId == PseudoId::Scrollbar && elementUpdate.style->overflowX() != Overflow::Scroll && elementUpdate.style->overflowY() != Overflow::Scroll)
return { };
if (pseudoId == PseudoId::ViewTransition && (!element.document().hasViewTransitionPseudoElementTree() || &element != element.document().documentElement()))
return { };
if (pseudoId == PseudoId::ViewTransition)
ASSERT(element.document().hasViewTransitionPseudoElementTree() && &element == element.document().documentElement());

if (!elementUpdate.style->hasPseudoStyle(pseudoId))
return resolveAncestorPseudoElement(element, pseudoId, elementUpdate);
Expand Down

0 comments on commit b6258f0

Please sign in to comment.