| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 m_frame->selection().clear(); | 395 m_frame->selection().clear(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void DOMSelection::addRange(Range* newRange) | 398 void DOMSelection::addRange(Range* newRange) |
| 399 { | 399 { |
| 400 ASSERT(newRange); | 400 ASSERT(newRange); |
| 401 | 401 |
| 402 if (!m_frame) | 402 if (!m_frame) |
| 403 return; | 403 return; |
| 404 | 404 |
| 405 if (!newRange->inDocument()) { | 405 if (!newRange->inShadowIncludingDocument()) { |
| 406 addConsoleError("The given range isn't in document."); | 406 addConsoleError("The given range isn't in document."); |
| 407 return; | 407 return; |
| 408 } | 408 } |
| 409 | 409 |
| 410 FrameSelection& selection = m_frame->selection(); | 410 FrameSelection& selection = m_frame->selection(); |
| 411 | 411 |
| 412 if (selection.isNone()) { | 412 if (selection.isNone()) { |
| 413 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY); | 413 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY); |
| 414 return; | 414 return; |
| 415 } | 415 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 566 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 567 } | 567 } |
| 568 | 568 |
| 569 DEFINE_TRACE(DOMSelection) | 569 DEFINE_TRACE(DOMSelection) |
| 570 { | 570 { |
| 571 visitor->trace(m_treeScope); | 571 visitor->trace(m_treeScope); |
| 572 DOMWindowProperty::trace(visitor); | 572 DOMWindowProperty::trace(visitor); |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace blink | 575 } // namespace blink |
| OLD | NEW |