| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 template <typename Strategy> | 820 template <typename Strategy> |
| 821 void VisibleSelectionTemplate<Strategy>::didChange() | 821 void VisibleSelectionTemplate<Strategy>::didChange() |
| 822 { | 822 { |
| 823 if (m_changeObserver) | 823 if (m_changeObserver) |
| 824 m_changeObserver->didChangeVisibleSelection(); | 824 m_changeObserver->didChangeVisibleSelection(); |
| 825 } | 825 } |
| 826 | 826 |
| 827 template <typename Strategy> | 827 template <typename Strategy> |
| 828 static bool isValidPosition(const PositionTemplate<Strategy>& position) | 828 static bool isValidPosition(const PositionTemplate<Strategy>& position) |
| 829 { | 829 { |
| 830 if (!position.inDocument()) | 830 if (!position.inShadowIncludingDocument()) |
| 831 return false; | 831 return false; |
| 832 | 832 |
| 833 if (!position.isOffsetInAnchor()) | 833 if (!position.isOffsetInAnchor()) |
| 834 return true; | 834 return true; |
| 835 | 835 |
| 836 if (position.offsetInContainerNode() < 0) | 836 if (position.offsetInContainerNode() < 0) |
| 837 return false; | 837 return false; |
| 838 | 838 |
| 839 const unsigned offset = static_cast<unsigned>(position.offsetInContainerNode
()); | 839 const unsigned offset = static_cast<unsigned>(position.offsetInContainerNode
()); |
| 840 const unsigned nodeLength = position.anchorNode()->lengthOfContents(); | 840 const unsigned nodeLength = position.anchorNode()->lengthOfContents(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 { | 975 { |
| 976 sel.showTreeForThis(); | 976 sel.showTreeForThis(); |
| 977 } | 977 } |
| 978 | 978 |
| 979 void showTree(const blink::VisibleSelectionInFlatTree* sel) | 979 void showTree(const blink::VisibleSelectionInFlatTree* sel) |
| 980 { | 980 { |
| 981 if (sel) | 981 if (sel) |
| 982 sel->showTreeForThis(); | 982 sel->showTreeForThis(); |
| 983 } | 983 } |
| 984 #endif | 984 #endif |
| OLD | NEW |