| 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 ASSERT(n); | 496 if (!n) |
| 497 return; |
| 497 | 498 |
| 498 // This doesn't (and shouldn't) select text node characters. | 499 // This doesn't (and shouldn't) select text node characters. |
| 499 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); | 500 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); |
| 500 } | 501 } |
| 501 | 502 |
| 502 String DOMSelection::toString() | 503 String DOMSelection::toString() |
| 503 { | 504 { |
| 504 if (!m_frame) | 505 if (!m_frame) |
| 505 return String(); | 506 return String(); |
| 506 | 507 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 560 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 560 } | 561 } |
| 561 | 562 |
| 562 void DOMSelection::trace(Visitor* visitor) | 563 void DOMSelection::trace(Visitor* visitor) |
| 563 { | 564 { |
| 564 visitor->trace(m_treeScope); | 565 visitor->trace(m_treeScope); |
| 565 DOMWindowProperty::trace(visitor); | 566 DOMWindowProperty::trace(visitor); |
| 566 } | 567 } |
| 567 | 568 |
| 568 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |