[webkit-changes] [WebKit/WebKit] 5e8cbc: [Remote Inspection] Redundant nearby targets shoul...

Wenson Hsieh noreply at github.com
Thu May 9 13:09:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5e8cbc9e70f01a95d48990d9328ca7f167714e41
      https://github.com/WebKit/WebKit/commit/5e8cbc9e70f01a95d48990d9328ca7f167714e41
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
    M Source/WebCore/page/ElementTargetingController.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/element-targeting-2.html

  Log Message:
  -----------
  [Remote Inspection] Redundant nearby targets should not be surfaced to Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=273953

Reviewed by Abrar Rahman Protyasha.

Currently, it's possible for the "nearby targets" heuristic to discover redundant elements, in the
case where a nearby target is a parent of another. In this case, it makes sense to only surface the
parent target. Fix this by implementing an algorithm to filter out such elements from the final list
of nearby targets, such that the final list does not contain any target that is a child of another
target.

Changes covered by augmenting the API test ElementTargeting.NearbyOutOfFlowElements.

* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::filterRedundantNearbyTargets):
(WebCore::ElementTargetingController::extractTargets):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/element-targeting-2.html:

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



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