Changeset 243621 in webkit
- Timestamp:
- Mar 28, 2019, 2:23:49 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/selection/containsNode-with-no-common-ancestor-expected.txt (added)
-
LayoutTests/editing/selection/containsNode-with-no-common-ancestor.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/DOMSelection.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243613 r243621 1 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Debug assert in DOMSelection::containsNode when node belongs to a different tree 4 https://bugs.webkit.org/show_bug.cgi?id=196342 5 6 Reviewed by Antti Koivisto. 7 8 Added a regression test to catch the debug assertion failure. The test always passed in release builds. 9 10 * editing/selection/containsNode-with-no-common-ancestor-expected.txt: Added. 11 * editing/selection/containsNode-with-no-common-ancestor.html: Added. 12 1 13 2019-03-28 Shawn Roberts <sroberts@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r243616 r243621 1 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Debug assert in DOMSelection::containsNode when node belongs to a different tree 4 https://bugs.webkit.org/show_bug.cgi?id=196342 5 6 Reviewed by Antti Koivisto. 7 8 The assertion was wrong. It's possible for Range::compareBoundaryPoints to return WRONG_DOCUMENT_ERR 9 when the node and the start container belong to two different trees. 10 11 Return false in such a case for now since it's unclear (unspecified) what these methods on Selection 12 should do with respect to shadow trees, preserving the current behavior of release builds. 13 14 Test: editing/selection/containsNode-with-no-common-ancestor.html 15 16 * page/DOMSelection.cpp: 17 (WebCore::DOMSelection::containsNode const): 18 1 19 2019-03-28 Tim Horton <timothy_horton@apple.com> 2 20 -
trunk/Source/WebCore/page/DOMSelection.cpp
r236917 r243621 416 416 417 417 auto startsResult = Range::compareBoundaryPoints(parentNode, nodeIndex, &selectedRange->startContainer(), selectedRange->startOffset()); 418 ASSERT(!startsResult.hasException()); 418 if (startsResult.hasException()) 419 return false; 420 419 421 auto endsResult = Range::compareBoundaryPoints(parentNode, nodeIndex + 1, &selectedRange->endContainer(), selectedRange->endOffset()); 420 422 ASSERT(!endsResult.hasException());
Note:
See TracChangeset
for help on using the changeset viewer.