[webkit-changes] [WebKit/WebKit] 88a90c: REGRESSION(268312 at main): std::nullopt de-ref in `c...

Tim Nguyen noreply at github.com
Sun Sep 24 18:40:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 88a90c5d94439c6ef027a7daf26a0048f44f8df1
      https://github.com/WebKit/WebKit/commit/88a90c5d94439c6ef027a7daf26a0048f44f8df1
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-09-24 (Sun, 24 Sep 2023)

  Changed paths:
    M Source/WebCore/dom/ContentVisibilityDocumentState.cpp
    M Source/WebCore/dom/ContentVisibilityDocumentState.h
    M Source/WebCore/rendering/RenderElement.cpp

  Log Message:
  -----------
  REGRESSION(268312 at main): std::nullopt de-ref in `checkRelevancyOfContentVisibilityElement`
https://bugs.webkit.org/show_bug.cgi?id=262021
rdar://115966527

Reviewed by Cameron McCormack.

Fix a crash on builds that use a newer compiler, that affects many of the content-visibility tests.

The crash was happening because we were trying to access `oldRelevancy->isEmpty()` without checking if `oldRelevancy` isn't `std::nullopt`.
To resolve this, we use the `isRelevantToUser()` function which includes that check.

Also renamed skippedContentStateDidChange to updateAnimations for clarity, and switched the boolean arguments to an enum class for clarity.

* Source/WebCore/dom/ContentVisibilityDocumentState.cpp:
(WebCore::ContentVisibilityDocumentState::checkRelevancyOfContentVisibilityElement const):
(WebCore::ContentVisibilityDocumentState::updateAnimations):
(WebCore::ContentVisibilityDocumentState::skippedContentStateDidChange): Deleted.
* Source/WebCore/dom/ContentVisibilityDocumentState.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):

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




More information about the webkit-changes mailing list