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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRang
e->startContainer(), selectedRange->startOffset(), exceptionState) < 0 && !excep
tionState.hadException()); | 486 || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRang
e->startContainer(), selectedRange->startOffset(), exceptionState) < 0 && !excep
tionState.hadException()); |
487 ASSERT(!exceptionState.hadException()); | 487 ASSERT(!exceptionState.hadException()); |
488 if (nodeFullyUnselected) | 488 if (nodeFullyUnselected) |
489 return false; | 489 return false; |
490 | 490 |
491 return allowPartial || n->isTextNode(); | 491 return allowPartial || n->isTextNode(); |
492 } | 492 } |
493 | 493 |
494 void DOMSelection::selectAllChildren(Node* n, ExceptionState& exceptionState) | 494 void DOMSelection::selectAllChildren(Node* n, ExceptionState& exceptionState) |
495 { | 495 { |
496 if (!n) | 496 ASSERT(n); |
497 return; | |
498 | 497 |
499 // This doesn't (and shouldn't) select text node characters. | 498 // This doesn't (and shouldn't) select text node characters. |
500 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); | 499 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); |
501 } | 500 } |
502 | 501 |
503 String DOMSelection::toString() | 502 String DOMSelection::toString() |
504 { | 503 { |
505 if (!m_frame) | 504 if (!m_frame) |
506 return String(); | 505 return String(); |
507 | 506 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 559 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
561 } | 560 } |
562 | 561 |
563 void DOMSelection::trace(Visitor* visitor) | 562 void DOMSelection::trace(Visitor* visitor) |
564 { | 563 { |
565 visitor->trace(m_treeScope); | 564 visitor->trace(m_treeScope); |
566 DOMWindowProperty::trace(visitor); | 565 DOMWindowProperty::trace(visitor); |
567 } | 566 } |
568 | 567 |
569 } // namespace blink | 568 } // namespace blink |
OLD | NEW |