[webkit-changes] [WebKit/WebKit] 62aba9: Change BaselineGroup's items HashSet to WeakHashSet.

Sammy Gill noreply at github.com
Tue May 16 17:53:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 62aba919edb6ed15b57340857d66d55c4d6034df
      https://github.com/WebKit/WebKit/commit/62aba919edb6ed15b57340857d66d55c4d6034df
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M Source/WebCore/rendering/BaselineAlignment.cpp
    M Source/WebCore/rendering/BaselineAlignment.h
    M Source/WebCore/rendering/GridBaselineAlignment.cpp

  Log Message:
  -----------
  Change BaselineGroup's items HashSet to WeakHashSet.
https://bugs.webkit.org/show_bug.cgi?id=256795
rdar://109363884

Reviewed by Tim Nguyen.

In order to keep track of items within a baseline sharing group, this
class currently stores raw pointers to renderers within a HashSet.
To improve upon this we can change the HashSet into a WeakHashSet
since the baseline alignment code does not need to express any
sort of ownership over the renderers.

The size() method on BaselineGroup was also changed to computeSize()
to make it clear that we will need to non-trivially determine the
number of items in the baseline sharing group.

* Source/WebCore/rendering/BaselineAlignment.cpp:
(WebCore::BaselineGroup::update):
(WebCore::BaselineGroup::isCompatible const):
* Source/WebCore/rendering/BaselineAlignment.h:
(WebCore::BaselineGroup::computeSize const):
(WebCore::BaselineGroup::size const): Deleted.
* Source/WebCore/rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::baselineOffsetForChild const):

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




More information about the webkit-changes mailing list