| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 addConsoleError("Discontiguous selection is not supported."); | 489 addConsoleError("Discontiguous selection is not supported."); |
| 490 return; | 490 return; |
| 491 } | 491 } |
| 492 | 492 |
| 493 // FIXME: "Merge the ranges if they intersect" is Blink-specific behavior; | 493 // FIXME: "Merge the ranges if they intersect" is Blink-specific behavior; |
| 494 // other browsers supporting discontiguous selection (obviously) keep each | 494 // other browsers supporting discontiguous selection (obviously) keep each |
| 495 // Range added and return it in getRangeAt(). But it's unclear if we can | 495 // Range added and return it in getRangeAt(). But it's unclear if we can |
| 496 // really do the same, since we don't support discontiguous selection. Further | 496 // really do the same, since we don't support discontiguous selection. Further |
| 497 // discussions at | 497 // discussions at |
| 498 // <https://code.google.com/p/chromium/issues/detail?id=353069>. | 498 // <https://code.google.com/p/chromium/issues/detail?id=353069>. |
| 499 UseCounter::count(frame(), UseCounter::SelectionAddRangeIntersect); |
| 499 | 500 |
| 500 Range* start = originalRange->compareBoundaryPoints( | 501 Range* start = originalRange->compareBoundaryPoints( |
| 501 Range::kStartToStart, newRange, ASSERT_NO_EXCEPTION) < 0 | 502 Range::kStartToStart, newRange, ASSERT_NO_EXCEPTION) < 0 |
| 502 ? originalRange | 503 ? originalRange |
| 503 : newRange; | 504 : newRange; |
| 504 Range* end = originalRange->compareBoundaryPoints(Range::kEndToEnd, newRange, | 505 Range* end = originalRange->compareBoundaryPoints(Range::kEndToEnd, newRange, |
| 505 ASSERT_NO_EXCEPTION) < 0 | 506 ASSERT_NO_EXCEPTION) < 0 |
| 506 ? newRange | 507 ? newRange |
| 507 : originalRange; | 508 : originalRange; |
| 508 const EphemeralRange merged = | 509 const EphemeralRange merged = |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 m_treeScope->document().addConsoleMessage( | 666 m_treeScope->document().addConsoleMessage( |
| 666 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); | 667 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); |
| 667 } | 668 } |
| 668 | 669 |
| 669 DEFINE_TRACE(DOMSelection) { | 670 DEFINE_TRACE(DOMSelection) { |
| 670 visitor->trace(m_treeScope); | 671 visitor->trace(m_treeScope); |
| 671 ContextClient::trace(visitor); | 672 ContextClient::trace(visitor); |
| 672 } | 673 } |
| 673 | 674 |
| 674 } // namespace blink | 675 } // namespace blink |
| OLD | NEW |