| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 m_private->setSelection(axSelection); | 846 m_private->setSelection(axSelection); |
| 847 return; | 847 return; |
| 848 } | 848 } |
| 849 | 849 |
| 850 unsigned WebAXObject::selectionEnd() const | 850 unsigned WebAXObject::selectionEnd() const |
| 851 { | 851 { |
| 852 if (isDetached()) | 852 if (isDetached()) |
| 853 return 0; | 853 return 0; |
| 854 | 854 |
| 855 AXObject::AXRange axSelection = m_private->selectionUnderObject(); | 855 AXObject::AXRange axSelection = m_private->selectionUnderObject(); |
| 856 if (axSelection.focusOffset < 0) | |
| 857 return 0; | |
| 858 | 856 |
| 859 return axSelection.focusOffset; | 857 return axSelection.focusOffset; |
| 860 } | 858 } |
| 861 | 859 |
| 862 unsigned WebAXObject::selectionStart() const | 860 unsigned WebAXObject::selectionStart() const |
| 863 { | 861 { |
| 864 if (isDetached()) | 862 if (isDetached()) |
| 865 return 0; | 863 return 0; |
| 866 | 864 |
| 867 AXObject::AXRange axSelection = m_private->selectionUnderObject(); | 865 AXObject::AXRange axSelection = m_private->selectionUnderObject(); |
| 868 if (axSelection.anchorOffset < 0) | |
| 869 return 0; | |
| 870 | 866 |
| 871 return axSelection.anchorOffset; | 867 return axSelection.anchorOffset; |
| 872 } | 868 } |
| 873 | 869 |
| 874 unsigned WebAXObject::selectionEndLineNumber() const | 870 unsigned WebAXObject::selectionEndLineNumber() const |
| 875 { | 871 { |
| 876 if (isDetached()) | 872 if (isDetached()) |
| 877 return 0; | 873 return 0; |
| 878 | 874 |
| 879 VisiblePosition position = m_private->visiblePositionForIndex(selectionEnd()
); | 875 VisiblePosition position = m_private->visiblePositionForIndex(selectionEnd()
); |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 m_private = object; | 1609 m_private = object; |
| 1614 return *this; | 1610 return *this; |
| 1615 } | 1611 } |
| 1616 | 1612 |
| 1617 WebAXObject::operator PassRefPtrWillBeRawPtr<AXObject>() const | 1613 WebAXObject::operator PassRefPtrWillBeRawPtr<AXObject>() const |
| 1618 { | 1614 { |
| 1619 return m_private.get(); | 1615 return m_private.get(); |
| 1620 } | 1616 } |
| 1621 | 1617 |
| 1622 } // namespace blink | 1618 } // namespace blink |
| OLD | NEW |