Home | History | Annotate | Download | only in page

Lines Matching refs:Range

37 #include "Range.h"
191 return "Range";
333 PassRefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionCode& ec)
343 // If you're hitting this, you've added broken multi-range selection support
349 return Range::create(shadowAncestor->document(), container, offset, container, offset);
363 void DOMSelection::addRange(Range* r)
377 RefPtr<Range> range = selection->selection().toNormalizedRange();
379 if (r->compareBoundaryPoints(Range::START_TO_START, range.get(), ec) == -1) {
380 // We don't support discontiguous selection. We don't do anything if r and range don't intersect.
381 if (r->compareBoundaryPoints(Range::START_TO_END, range.get(), ec) > -1) {
382 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) == -1)
383 // The original range and r intersect.
384 selection->setSelection(VisibleSelection(r->startPosition(), range->endPosition(), DOWNSTREAM));
386 // r contains the original range.
390 // We don't support discontiguous selection. We don't do anything if r and range don't intersect.
391 if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1) {
392 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) == -1)
393 // The original range contains r.
394 selection->setSelection(VisibleSelection(range.get()));
396 // The original range and r intersect.
397 selection->setSelection(VisibleSelection(range->startPosition(), r->endPosition(), DOWNSTREAM));
415 RefPtr<Range> selectedRange = selection->selection().toNormalizedRange();
437 RefPtr<Range> selectedRange = selection->selection().toNormalizedRange();
443 bool nodeFullySelected = Range::compareBoundaryPoints(parentNode, nodeIndex, selectedRange->startContainer(ec), selectedRange->startOffset(ec)) >= 0
444 && Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRange->endContainer(ec), selectedRange->endOffset(ec)) <= 0;
449 bool nodeFullyUnselected = Range::compareBoundaryPoints(parentNode, nodeIndex, selectedRange->endContainer(ec), selectedRange->endOffset(ec)) > 0
450 || Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRange->startContainer(ec), selectedRange->startOffset(ec)) < 0;