Fix Range.compareBoundaryPoint

START_TO_END and END_TO_START had their logic swapped. This fixes the remaining
862 failing cases in dom/ranges/Range-compareBoundaryPoints.html
This commit is contained in:
Karl Seguin
2026-02-13 15:06:17 +08:00
parent 0cae6ceca3
commit 934693924e

View File

@@ -150,10 +150,10 @@ pub fn compareBoundaryPoints(self: *const Range, how_raw: i32, source_range: *co
source_range._proto._start_offset, source_range._proto._start_offset,
), ),
1 => AbstractRange.compareBoundaryPoints( // START_TO_END 1 => AbstractRange.compareBoundaryPoints( // START_TO_END
self._proto._start_container, self._proto._end_container,
self._proto._start_offset, self._proto._end_offset,
source_range._proto._end_container, source_range._proto._start_container,
source_range._proto._end_offset, source_range._proto._start_offset,
), ),
2 => AbstractRange.compareBoundaryPoints( // END_TO_END 2 => AbstractRange.compareBoundaryPoints( // END_TO_END
self._proto._end_container, self._proto._end_container,
@@ -162,10 +162,10 @@ pub fn compareBoundaryPoints(self: *const Range, how_raw: i32, source_range: *co
source_range._proto._end_offset, source_range._proto._end_offset,
), ),
3 => AbstractRange.compareBoundaryPoints( // END_TO_START 3 => AbstractRange.compareBoundaryPoints( // END_TO_START
self._proto._end_container, self._proto._start_container,
self._proto._end_offset, self._proto._start_offset,
source_range._proto._start_container, source_range._proto._end_container,
source_range._proto._start_offset, source_range._proto._end_offset,
), ),
else => unreachable, else => unreachable,
}; };