OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 AXObject::AXRange AXLayoutObject::selection() const | 1843 AXObject::AXRange AXLayoutObject::selection() const |
1844 { | 1844 { |
1845 AXRange textSelection = textControlSelection(); | 1845 AXRange textSelection = textControlSelection(); |
1846 if (textSelection.isValid()) | 1846 if (textSelection.isValid()) |
1847 return textSelection; | 1847 return textSelection; |
1848 | 1848 |
1849 if (!layoutObject() || !layoutObject()->frame()) | 1849 if (!layoutObject() || !layoutObject()->frame()) |
1850 return AXRange(); | 1850 return AXRange(); |
1851 | 1851 |
1852 VisibleSelection selection = layoutObject()->frame()->selection().selection(
); | 1852 VisibleSelection selection = layoutObject()->frame()->selection().selection(
); |
1853 RefPtrWillBeRawPtr<Range> selectionRange = selection.firstRange(); | 1853 RefPtrWillBeRawPtr<Range> selectionRange = firstRangeOf(selection); |
1854 if (!selectionRange) | 1854 if (!selectionRange) |
1855 return AXRange(); | 1855 return AXRange(); |
1856 | 1856 |
1857 int anchorOffset = selectionRange->startOffset(); | 1857 int anchorOffset = selectionRange->startOffset(); |
1858 ASSERT(anchorOffset >= 0); | 1858 ASSERT(anchorOffset >= 0); |
1859 int focusOffset = selectionRange->endOffset(); | 1859 int focusOffset = selectionRange->endOffset(); |
1860 ASSERT(focusOffset >= 0); | 1860 ASSERT(focusOffset >= 0); |
1861 | 1861 |
1862 Node* anchorNode = selectionRange->startContainer(); | 1862 Node* anchorNode = selectionRange->startContainer(); |
1863 ASSERT(anchorNode); | 1863 ASSERT(anchorNode); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 AXObject::AXRange AXLayoutObject::selectionUnderObject() const | 1904 AXObject::AXRange AXLayoutObject::selectionUnderObject() const |
1905 { | 1905 { |
1906 AXRange textSelection = textControlSelection(); | 1906 AXRange textSelection = textControlSelection(); |
1907 if (textSelection.isValid()) | 1907 if (textSelection.isValid()) |
1908 return textSelection; | 1908 return textSelection; |
1909 | 1909 |
1910 if (!layoutObject() || !layoutObject()->frame()) | 1910 if (!layoutObject() || !layoutObject()->frame()) |
1911 return AXRange(); | 1911 return AXRange(); |
1912 | 1912 |
1913 VisibleSelection selection = layoutObject()->frame()->selection().selection(
); | 1913 VisibleSelection selection = layoutObject()->frame()->selection().selection(
); |
1914 RefPtrWillBeRawPtr<Range> selectionRange = selection.firstRange(); | 1914 RefPtrWillBeRawPtr<Range> selectionRange = firstRangeOf(selection); |
1915 ContainerNode* parentNode = node()->parentNode(); | 1915 ContainerNode* parentNode = node()->parentNode(); |
1916 int nodeIndex = node()->nodeIndex(); | 1916 int nodeIndex = node()->nodeIndex(); |
1917 if (!selectionRange | 1917 if (!selectionRange |
1918 // Selection is contained in node. | 1918 // Selection is contained in node. |
1919 || !(parentNode | 1919 || !(parentNode |
1920 && selectionRange->comparePoint(parentNode, nodeIndex, IGNORE_EXCEPTION)
< 0 | 1920 && selectionRange->comparePoint(parentNode, nodeIndex, IGNORE_EXCEPTION)
< 0 |
1921 && selectionRange->comparePoint(parentNode, nodeIndex + 1, IGNORE_EXCEPT
ION) > 0)) { | 1921 && selectionRange->comparePoint(parentNode, nodeIndex + 1, IGNORE_EXCEPT
ION) > 0)) { |
1922 return AXRange(); | 1922 return AXRange(); |
1923 } | 1923 } |
1924 | 1924 |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2647 if (label && label->layoutObject()) { | 2647 if (label && label->layoutObject()) { |
2648 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2648 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2649 result.unite(labelRect); | 2649 result.unite(labelRect); |
2650 } | 2650 } |
2651 } | 2651 } |
2652 | 2652 |
2653 return result; | 2653 return result; |
2654 } | 2654 } |
2655 | 2655 |
2656 } // namespace blink | 2656 } // namespace blink |
OLD | NEW |