Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 055d5a97c962454efc1124c46f7cac5b35812164
      
https://github.com/WebKit/WebKit/commit/055d5a97c962454efc1124c46f7cac5b35812164
  Author: Matt Woodrow <[email protected]>
  Date:   2025-02-21 (Fri, 21 Feb 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderFragmentedFlow.cpp
    M Source/WebCore/rendering/RenderFragmentedFlow.h
    M Source/WebCore/rendering/RenderLayerModelObject.cpp
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/style/RenderStyleConstants.cpp
    M Source/WebCore/rendering/style/RenderStyleConstants.h
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

  Log Message:
  -----------
  RenderObject::isOutOfFlowPositioned can be read before it gets set.
https://bugs.webkit.org/show_bug.cgi?id=287778
<rdar://144956226>

Reviewed by Alan Baradlay.

RenderBoxModelObject::updateFromStyle updates the cached position flags using
the new RenderStyle object.

RenderElement::styleDidChange (which happens earlier) can schedule layout, which
depends on the state of these flags.

Call updateFromStyle to update any cached state before continuing to handle the
post-style-change code.

As a result of this change, `RenderElement::styleDidChange` ancestor marking now
correctly sets the 'positioned child needs layout' bit on the container for
changed positioned children, rather than always setting 'normal child needs
layout'. This results in simplified layout happening more often.

This exposes a bug where changes to the display property may require static
positions to be recomputed, which doesn't get done with simplified layout. Adds
a check for this to ensure we don't use simplified layout for this subset.

This also exposes a second bug with intrusive scrollbars, where overflow changes
on positioned children may results in the addition/removal of scrollbars and
require a full layout to adjust to the new size. Adds checks for this at the two
entry points for simplified layout and switches back to regular layout requests.

Enables two existing tests (which were incorrectly disabled) that caught these
two bugs.

Since we now sometimes refuse simplified layout upfront, rename
setNeedsSimplifiedNormalFlowLayout to setNeedsLayoutForOverflowChange, and
StyleDifference::SimplifiedLayout to Overflow to better represent the request
being made (and have the details of what layout type happens be internal).

Deduplicate some StyleDifference -> layout request code into
setNeedsLayoutForStyleDifference.

Remove markFragmentsForOverflowLayoutIfNeeded since it was unused.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowChangesMayAffectLayout const):
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference const):
(WebCore::RenderElement::repaintBeforeStyleChange):
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::setNeedsLayoutForStyleDifference):
(WebCore::RenderElement::setNeedsLayoutForOverflowChange):
(WebCore::RenderElement::setNeedsSimplifiedNormalFlowLayout): Deleted.
* Source/WebCore/rendering/RenderElement.h:
(WebCore::RenderElement::overflowChangesMayAffectLayout const):
* Source/WebCore/rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::markFragmentsForOverflowLayoutIfNeeded): 
Deleted.
* Source/WebCore/rendering/RenderFragmentedFlow.h:
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::markContainingBlocksForLayout):
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::repaintAndMarkContainingBlockDirtyBeforeTearDown):

Canonical link: https://commits.webkit.org/290831@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