[webkit-changes] [WebKit/WebKit] 55e9a6: `DocumentMarkerController::possiblyHasMarkers` can...

Aditya Keerthi noreply at github.com
Mon Mar 6 14:15:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 55e9a6904b90968a17928515bfc4058c721e4774
      https://github.com/WebKit/WebKit/commit/55e9a6904b90968a17928515bfc4058c721e4774
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-03-06 (Mon, 06 Mar 2023)

  Changed paths:
    M Source/WebCore/dom/DocumentMarkerController.cpp
    M Source/WebCore/dom/DocumentMarkerController.h

  Log Message:
  -----------
  `DocumentMarkerController::possiblyHasMarkers` can be incorrect following animated marker removal
https://bugs.webkit.org/show_bug.cgi?id=253450
rdar://106297392

Reviewed by Wenson Hsieh.

260842 at main added a filter function to `DocumentMarkerController::removeMarkers`
to support the removal of animated markers once their animation had finished.
However, this method unconditionally clears the input marker types from
`m_possiblyExistingMarkerTypes`. Following the introduction of a filter function,
it is no longer true that a marker matching the marker type passed into
`removeMarkers` is always removed.

To fix, keep track of which marker types were preserved by the filter function,
and exclude them from the set of types to remove from `m_possiblyExistingMarkerTypes`.

This issue is observable via a debug assertion in `DocumentMarkerController::hasMarkers`.

* Source/WebCore/dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::removeMarkers):

Maintain a set of completely removed marker types as the marker map is
iterated over. At the end, only remove marker types that were not preserved from
`m_possiblyExistingMarkerTypes`.

(WebCore::DocumentMarkerController::removeMarkersFromList):

Return the set of completely removed marker types.

* Source/WebCore/dom/DocumentMarkerController.h:

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




More information about the webkit-changes mailing list