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 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 } | 487 } |
488 | 488 |
489 if (originalRange->compareBoundaryPoints(Range::kStartToEnd, newRange, | 489 if (originalRange->compareBoundaryPoints(Range::kStartToEnd, newRange, |
490 ASSERT_NO_EXCEPTION) < 0 || | 490 ASSERT_NO_EXCEPTION) < 0 || |
491 newRange->compareBoundaryPoints(Range::kStartToEnd, originalRange, | 491 newRange->compareBoundaryPoints(Range::kStartToEnd, originalRange, |
492 ASSERT_NO_EXCEPTION) < 0) { | 492 ASSERT_NO_EXCEPTION) < 0) { |
493 addConsoleError("Discontiguous selection is not supported."); | 493 addConsoleError("Discontiguous selection is not supported."); |
494 return; | 494 return; |
495 } | 495 } |
496 | 496 |
497 // FIXME: "Merge the ranges if they intersect" is Blink-specific behavior; oth
er browsers supporting discontiguous | 497 // FIXME: "Merge the ranges if they intersect" is Blink-specific behavior; |
498 // selection (obviously) keep each Range added and return it in getRangeAt().
But it's unclear if we can really | 498 // other browsers supporting discontiguous selection (obviously) keep each |
499 // do the same, since we don't support discontiguous selection. Further discus
sions at | 499 // Range added and return it in getRangeAt(). But it's unclear if we can |
| 500 // really do the same, since we don't support discontiguous selection. Further |
| 501 // discussions at |
500 // <https://code.google.com/p/chromium/issues/detail?id=353069>. | 502 // <https://code.google.com/p/chromium/issues/detail?id=353069>. |
501 | 503 |
502 Range* start = originalRange->compareBoundaryPoints( | 504 Range* start = originalRange->compareBoundaryPoints( |
503 Range::kStartToStart, newRange, ASSERT_NO_EXCEPTION) < 0 | 505 Range::kStartToStart, newRange, ASSERT_NO_EXCEPTION) < 0 |
504 ? originalRange | 506 ? originalRange |
505 : newRange; | 507 : newRange; |
506 Range* end = originalRange->compareBoundaryPoints(Range::kEndToEnd, newRange, | 508 Range* end = originalRange->compareBoundaryPoints(Range::kEndToEnd, newRange, |
507 ASSERT_NO_EXCEPTION) < 0 | 509 ASSERT_NO_EXCEPTION) < 0 |
508 ? newRange | 510 ? newRange |
509 : originalRange; | 511 : originalRange; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 m_treeScope->document().addConsoleMessage( | 659 m_treeScope->document().addConsoleMessage( |
658 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); | 660 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); |
659 } | 661 } |
660 | 662 |
661 DEFINE_TRACE(DOMSelection) { | 663 DEFINE_TRACE(DOMSelection) { |
662 visitor->trace(m_treeScope); | 664 visitor->trace(m_treeScope); |
663 DOMWindowProperty::trace(visitor); | 665 DOMWindowProperty::trace(visitor); |
664 } | 666 } |
665 | 667 |
666 } // namespace blink | 668 } // namespace blink |
OLD | NEW |