Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5e8cbc9e70f01a95d48990d9328ca7f167714e41
      
https://github.com/WebKit/WebKit/commit/5e8cbc9e70f01a95d48990d9328ca7f167714e41
  Author: Wenson Hsieh <[email protected]>
  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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to