| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 if (r->compareBoundaryPoints(Range::START_TO_END, range.get(), ec) > -1)
{ | 414 if (r->compareBoundaryPoints(Range::START_TO_END, range.get(), ec) > -1)
{ |
| 415 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) ==
-1) | 415 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) ==
-1) |
| 416 // The original range and r intersect. | 416 // The original range and r intersect. |
| 417 selection->setSelection(VisibleSelection(r->startPosition(), ran
ge->endPosition(), DOWNSTREAM)); | 417 selection->setSelection(VisibleSelection(r->startPosition(), ran
ge->endPosition(), DOWNSTREAM)); |
| 418 else | 418 else |
| 419 // r contains the original range. | 419 // r contains the original range. |
| 420 selection->setSelection(VisibleSelection(r)); | 420 selection->setSelection(VisibleSelection(r)); |
| 421 } | 421 } |
| 422 } else { | 422 } else { |
| 423 // We don't support discontiguous selection. We don't do anything if r a
nd range don't intersect. | 423 // We don't support discontiguous selection. We don't do anything if r a
nd range don't intersect. |
| 424 if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1)
{ | 424 if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1 &
& !ec) { |
| 425 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) ==
-1) | 425 if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) ==
-1) |
| 426 // The original range contains r. | 426 // The original range contains r. |
| 427 selection->setSelection(VisibleSelection(range.get())); | 427 selection->setSelection(VisibleSelection(range.get())); |
| 428 else | 428 else |
| 429 // The original range and r intersect. | 429 // The original range and r intersect. |
| 430 selection->setSelection(VisibleSelection(range->startPosition(),
r->endPosition(), DOWNSTREAM)); | 430 selection->setSelection(VisibleSelection(range->startPosition(),
r->endPosition(), DOWNSTREAM)); |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | 434 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 bool DOMSelection::isValidForPosition(Node* node) const | 510 bool DOMSelection::isValidForPosition(Node* node) const |
| 511 { | 511 { |
| 512 ASSERT(m_frame); | 512 ASSERT(m_frame); |
| 513 if (!node) | 513 if (!node) |
| 514 return true; | 514 return true; |
| 515 return node->document() == m_frame->document(); | 515 return node->document() == m_frame->document(); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace WebCore | 518 } // namespace WebCore |
| OLD | NEW |