| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY); | 416 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY); |
| 417 return; | 417 return; |
| 418 } | 418 } |
| 419 | 419 |
| 420 Range* originalRange = selection.firstRange(); | 420 Range* originalRange = selection.firstRange(); |
| 421 | 421 |
| 422 if (originalRange->startContainer()->document() != newRange->startContainer(
)->document()) { | 422 if (originalRange->startContainer()->document() != newRange->startContainer(
)->document()) { |
| 423 addConsoleError("The given range does not belong to the current selectio
n's document."); | 423 addConsoleError("The given range does not belong to the current selectio
n's document."); |
| 424 return; | 424 return; |
| 425 } | 425 } |
| 426 if (originalRange->startContainer()->treeScope() != newRange->startContainer
()->treeScope()) { | 426 if (originalRange->startContainer()->treeScopeOrDocument() != newRange->star
tContainer()->treeScopeOrDocument()) { |
| 427 addConsoleError("The given range and the current selection belong to two
different document fragments."); | 427 addConsoleError("The given range and the current selection belong to two
different document fragments."); |
| 428 return; | 428 return; |
| 429 } | 429 } |
| 430 | 430 |
| 431 if (originalRange->compareBoundaryPoints(Range::START_TO_END, newRange, ASSE
RT_NO_EXCEPTION) < 0 | 431 if (originalRange->compareBoundaryPoints(Range::START_TO_END, newRange, ASSE
RT_NO_EXCEPTION) < 0 |
| 432 || newRange->compareBoundaryPoints(Range::START_TO_END, originalRange, A
SSERT_NO_EXCEPTION) < 0) { | 432 || newRange->compareBoundaryPoints(Range::START_TO_END, originalRange, A
SSERT_NO_EXCEPTION) < 0) { |
| 433 addConsoleError("Discontiguous selection is not supported."); | 433 addConsoleError("Discontiguous selection is not supported."); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 | 436 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 569 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 570 } | 570 } |
| 571 | 571 |
| 572 DEFINE_TRACE(DOMSelection) | 572 DEFINE_TRACE(DOMSelection) |
| 573 { | 573 { |
| 574 visitor->trace(m_treeScope); | 574 visitor->trace(m_treeScope); |
| 575 DOMWindowProperty::trace(visitor); | 575 DOMWindowProperty::trace(visitor); |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace blink | 578 } // namespace blink |
| OLD | NEW |