Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5bf1e53b58e2750a1baf86c765ecd359df8205d8
      
https://github.com/WebKit/WebKit/commit/5bf1e53b58e2750a1baf86c765ecd359df8205d8
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-06 (Tue, 06 Oct 2026)

  Changed paths:
    M LayoutTests/fast/dom/rangeIntersectsRange-expected.txt
    M LayoutTests/fast/dom/rangeIntersectsRange.html
    M Source/WebCore/dom/SimpleRange.cpp

  Log Message:
  -----------
  intersectsForTesting returns containment instead of intersection for 
ComposedTreeIncludingPseudoElements
https://bugs.webkit.org/show_bug.cgi?id=318317
rdar://181104146

Reviewed by Ryosuke Niwa.

Both intersectsForTesting overloads in SimpleRange.cpp handled the
ComposedTreeIncludingPseudoElements case by calling contains<> instead
of intersects<>, a copy/paste error: every other tree-type case (Tree,
ShadowIncludingTree, ComposedTree) calls intersects<>. As a result, for
that tree type the function returned whether the outer range fully
contained the inner range/node rather than whether they merely overlap,
so overlapping-but-not-contained inputs wrongly reported false.

This code is only reachable from tests via Internals, so there is no
product-code impact, but the testing predicate was returning the wrong
answer.

* Source/WebCore/dom/SimpleRange.cpp:
(WebCore::intersectsForTesting):
* LayoutTests/fast/dom/rangeIntersectsRange.html:
* LayoutTests/fast/dom/rangeIntersectsRange-expected.txt:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to