[webkit-changes] [WebKit/WebKit] 2a33af: Cherry-pick 287414 at main (23bfb2f9346e). https://bu...

Sammy Gill noreply at github.com
Tue Dec 17 05:00:39 PST 2024


  Branch: refs/heads/webkitglib/2.46
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a33afccdf088c43021ddde73d5dbc6b97d54e13
      https://github.com/WebKit/WebKit/commit/2a33afccdf088c43021ddde73d5dbc6b97d54e13
  Author: Jani Hautakangas <jani at igalia.com>
  Date:   2024-12-16 (Mon, 16 Dec 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp

  Log Message:
  -----------
  Cherry-pick 287414 at main (23bfb2f9346e). https://bugs.webkit.org/show_bug.cgi?id=283914

    REGRESSION(285820 at main): [TextureMapper][GTK][WPE] ASSERTION FAILED: textureIndex < m_textures.size() on luna.amazon.com
    https://bugs.webkit.org/show_bug.cgi?id=283914

    Reviewed by Fujii Hironori.

    The needsUpdate state for flattened layers was incorrectly reset before the
    layer was fully updated. This issue occurred when processing large layers
    that required tiling, as the state was based on the number of tile textures
    being greater than zero. This fix adjusts the logic to correctly account for
    layers that require multiple tiles to render.

    * Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:

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

Canonical link: https://commits.webkit.org/282416.365@webkitglib/2.46


  Commit: 0ee188047a3060ed3b8ca592afba89300cc55f4c
      https://github.com/WebKit/WebKit/commit/0ee188047a3060ed3b8ca592afba89300cc55f4c
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-12-16 (Mon, 16 Dec 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp
    M Source/WebKit/UIProcess/API/APIContentRuleListStore.h
    M Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm

  Log Message:
  -----------
  Cherry-pick 287319 at main (fa5d8d81450b). https://bugs.webkit.org/show_bug.cgi?id=283996

    Crash at API::getContentRuleListSourceFromMappedFile().
    https://webkit.org/b/283996
    rdar://140450689

    Reviewed by Alex Christensen.

    Make the handling of getContentRuleListSourceFromMappedFile() more robust by checking header sizes
    to the mapped data size. This was failing when the version got bumped and fallback to recompiling
    from the original source was needed.

    Improved mismatch version testing by dropping the version by one and keeping all the compiled data
    the same to test proper version upgrades from the original source.

    Added two corrupt size tests to error on invalid data sizes or empty data (missing source).

    * Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp:
    (API::getContentRuleListSourceFromMappedFile): Added logging and size checks.
    (API::ContentRuleListStore::lookupContentRuleListFile): Check fileSize() against the mapped data.
    (API::ContentRuleListStore::invalidateContentRuleListVersion): Changed to set the version back by one.
    (API::ContentRuleListStore::corruptContentRuleListHeader): Added.
    * Source/WebKit/UIProcess/API/APIContentRuleListStore.h:
    * Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm:
    (-[WKContentRuleListStore _corruptContentRuleListHeaderForIdentifier:usingCurrentVersion:]): Added.
    * Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
    * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm:
    (TEST_F(WKContentRuleListStoreTest, VersionMismatch)): Updated expectations since source is preserved now.
    (TEST_F(WKContentRuleListStoreTest, CorruptHeaderEmpty)): Added.
    (TEST_F(WKContentRuleListStoreTest, CorruptHeaderRandom)): Added.

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

Canonical link: https://commits.webkit.org/282416.366@webkitglib/2.46


  Commit: 8c6557aff455d0ea35bc709c7c44f2fb04e25625
      https://github.com/WebKit/WebKit/commit/8c6557aff455d0ea35bc709c7c44f2fb04e25625
  Author: Philippe Normand <philn at igalia.com>
  Date:   2024-12-16 (Mon, 16 Dec 2024)

  Changed paths:
    M Source/WebCore/platform/soup/PublicSuffixStoreSoup.cpp

  Log Message:
  -----------
  Cherry-pick 287853 at main (a8b6ea5c059f). https://bugs.webkit.org/show_bug.cgi?id=284711

    REGRESSION(287061 at main): [SOUP] Prevent early destruction of the tld string in PublicSuffixStore
    https://bugs.webkit.org/show_bug.cgi?id=284711

    Reviewed by Michael Catanzaro.

    Make sure the string passed to soup_tld_get_base_domain() is not destroyed before usage.

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

Canonical link: https://commits.webkit.org/282416.367@webkitglib/2.46


  Commit: f3276d3ebeaf41ec85435c45a65192b597e5ced6
      https://github.com/WebKit/WebKit/commit/f3276d3ebeaf41ec85435c45a65192b597e5ced6
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-12-17 (Tue, 17 Dec 2024)

  Changed paths:
    A PerformanceTests/Layout/nested-grids-single-item-content-change.html
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderGrid.h

  Log Message:
  -----------
  Cherry-pick 287890 at main (6efee9d4dde0). https://bugs.webkit.org/show_bug.cgi?id=279492

    REGRESSION(281090 at main): Sluggish animations on some shopify stores
    https://bugs.webkit.org/show_bug.cgi?id=279492
    rdar://135791322

    Reviewed by Brandon Stewart.

    In 281090 at main, we added an extra bit of information for the grid to keep track of on its
    grid items. In particular, we expanded the grid's capabilities to keep track of whether or
    not any of its grid items needed to perform stretch alignment. This included some extra
    invalidation inside of GridTrackSizingAlgorithm::logicalHeightForGridItem, as performing
    layout on a grid item would clear its stretched size.

    However, this seems to expose an issue in which we experience thrashing when rerunning the
    grid layout. This can become an issue because of 2 main aspects of grid layout currently:

    1.) We rerun the full grid track sizing algorithm each time (i.e. little partial layout)
    2.) Grid track sizing may need to query the intrinsic sizes of an item. If an item was
    previously stretched, we will clear that size, compute the intrinsic sizes for track
    sizing, and then stretch the item again.

    These 2 issues unfortunately get compounded in the presence of nested grid content.

    This patch aims to address 2 by caching the intrinsic logical height of a grid item
    to try to avoid the adverse effects of recomputing it. This cache will specifically be
    used to cache the intrinsic logical heights of grid items that are computed during the
    first pass of row sizing. That means the values that it contains are only valid for that
    portion of the track sizing algorithm code, and the track sizing algorithm should only
    populate it with sizes during that step.

    Availability -
    The cache will live on RenderGrid, which will determine whether or not
    it will be available to use by the rest of the code. This availability is dependent on the
    type of the current grid content. The cache is available to use if none
    of the following are true:

    1.) The grid is a subgrid

    2.) Any of the items are a subgrid

    3.) The grid is a masonry grid

    4.) Any of the items are being baseline aligned (due to the  intrinsic size implications
    of baseline-aligned grid items in the spec).

    5.) The grid is contained in a fragmented flow.

    Invalidation -
    If we have an existing cache that is still valid to use during another
    pass of layout (i.e. it is still available), then we may need to
    invalidate the items.

    1.) Before we run grid layout, we will check to see if any of the grid
    item renderers have been dirtied. If so, we will then invalidate that
    item if it is in the cache and recompute the intrinsic size during the
    track sizing algorithm.

    2.) If the grid experiences any sort of style mutation, we just
    invalidate the entire cache.

    3.) During track sizing, we may end up changing the inline constraints
    that were used to compute the logical height in a previous pass. If this
    is the case, then we need to invalidate the item in the cache as a
    different set of constraints may result in a different logical height.

    API -
    This cache is exposed by RenderGrid via intrinsicLogicalHeightsForRowSizingFirstPass()
    so that callers can either query, invalidate, or populate it. Callers should only expect
    to be able to use the cache if it is made available by RenderGrid.

    Inside logicalHeightForGridItem, we will check to see if this cache exists and if it
    contains a value we previously computed for the item. If we do not have a value for this
    item, we will just compute it and add it to the cache afterwards.

    nested-grids-single-item-content-change.html was added as a performance
    test to demonstrate the effectiveness of this change. On my M1 Pro MBP,
    running this test went from ~950 runs/s to ~1900 runs/s.

    * Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
    (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForGridItem const):
    (WebCore::GridTrackSizingAlgorithmStrategy::minContentContributionForGridItem const):
    (WebCore::GridTrackSizingAlgorithmStrategy::maxContentContributionForGridItem const):
    * Source/WebCore/rendering/RenderGrid.cpp:
    (WebCore::RenderGrid::styleDidChange):
    (WebCore::RenderGrid::layoutGrid):
    (WebCore::RenderGrid::isSubgrid const):
    (WebCore::RenderGrid::updateIntrinsicLogicalHeightsForRowSizingFirstPassCacheAvailability):
    (WebCore::RenderGrid::intrinsicLogicalHeightsForRowSizingFirstPass const):
    (WebCore::RenderGrid::canCreateIntrinsicLogicalHeightsForRowSizingFirstPassCache const):
    (WebCore::GridItemSizeCache::setSizeForGridItem):
    (WebCore::GridItemSizeCache::sizeForItem const):
    (WebCore::GridItemSizeCache::invalidateSizeForItem):
    * Source/WebCore/rendering/RenderGrid.h:

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

Canonical link: https://commits.webkit.org/282416.368@webkitglib/2.46


Compare: https://github.com/WebKit/WebKit/compare/03755c44779c...f3276d3ebeaf

To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list