Chromium Code Reviews| Index: Source/core/editing/VisibleSelection.cpp |
| diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp |
| index 411437768c0c3bf2662cf67cf1c0bde506e3a3eb..59c2c5f1fb6a1e315571786c62d7bae8688f8331 100644 |
| --- a/Source/core/editing/VisibleSelection.cpp |
| +++ b/Source/core/editing/VisibleSelection.cpp |
| @@ -192,6 +192,18 @@ PassRefPtrWillBeRawPtr<Range> VisibleSelection::firstRange() const |
| return Range::create(*start.document(), start, end); |
| } |
| +bool VisibleSelection::intersectsNode(Node* node) const |
| +{ |
| + if (isNone()) |
| + return false; |
| + Position start = m_start.parentAnchoredEquivalent(); |
| + Position end = m_end.parentAnchoredEquivalent(); |
| + TrackExceptionState exceptionState; |
| + if (Range::intersectsNode(node, start, end, exceptionState)) |
|
yosin_UTC9
2014/09/05 01:07:56
nit: Just |return Range::intersectsNode(node, star
yosin_UTC9
2014/09/05 01:07:56
Can we use |ASSERT_NO_EXCEPTION| instead of |excep
Mads Ager (chromium)
2014/09/05 08:22:52
Hmm, good point. I thought we could as well, but i
Mads Ager (chromium)
2014/09/05 08:22:52
Yes! Thanks! :)
|
| + return true; |
| + return false; |
| +} |
| + |
| PassRefPtrWillBeRawPtr<Range> VisibleSelection::toNormalizedRange() const |
| { |
| if (isNone()) |