| 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 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 focusObject = focusObject->parentObject(); | 2022 focusObject = focusObject->parentObject(); |
| 2023 } | 2023 } |
| 2024 | 2024 |
| 2025 if (!anchorNode || !focusNode) | 2025 if (!anchorNode || !focusNode) |
| 2026 return; | 2026 return; |
| 2027 | 2027 |
| 2028 LocalFrame* frame = getLayoutObject()->frame(); | 2028 LocalFrame* frame = getLayoutObject()->frame(); |
| 2029 if (!frame) | 2029 if (!frame) |
| 2030 return; | 2030 return; |
| 2031 | 2031 |
| 2032 // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets n
eeds to be audited. |
| 2033 // see http://crbug.com/590369 for more details. |
| 2034 // This callsite should probably move up the stack. |
| 2035 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2036 |
| 2032 // Set the selection based on visible positions, because the offsets in acce
ssibility nodes | 2037 // Set the selection based on visible positions, because the offsets in acce
ssibility nodes |
| 2033 // are based on visible indexes, which often skips redundant whitespace, for
example. | 2038 // are based on visible indexes, which often skips redundant whitespace, for
example. |
| 2034 VisiblePosition anchorVisiblePosition = anchorNode->isTextNode() | 2039 VisiblePosition anchorVisiblePosition = anchorNode->isTextNode() |
| 2035 ? blink::visiblePositionForIndex(selection.anchorOffset, anchorNode->par
entNode()) | 2040 ? blink::visiblePositionForIndex(selection.anchorOffset, anchorNode->par
entNode()) |
| 2036 : createVisiblePosition(Position(anchorNode, selection.anchorOffset)); | 2041 : createVisiblePosition(Position(anchorNode, selection.anchorOffset)); |
| 2037 VisiblePosition focusVisiblePosition = focusNode->isTextNode() | 2042 VisiblePosition focusVisiblePosition = focusNode->isTextNode() |
| 2038 ? blink::visiblePositionForIndex(selection.focusOffset, focusNode->paren
tNode()) | 2043 ? blink::visiblePositionForIndex(selection.focusOffset, focusNode->paren
tNode()) |
| 2039 : createVisiblePosition(Position(focusNode, selection.focusOffset)); | 2044 : createVisiblePosition(Position(focusNode, selection.focusOffset)); |
| 2040 frame->selection().setSelection(VisibleSelection(anchorVisiblePosition, focu
sVisiblePosition)); | 2045 frame->selection().setSelection(VisibleSelection(anchorVisiblePosition, focu
sVisiblePosition)); |
| 2041 } | 2046 } |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 result.unite(labelRect); | 2576 result.unite(labelRect); |
| 2572 } | 2577 } |
| 2573 } | 2578 } |
| 2574 } | 2579 } |
| 2575 } | 2580 } |
| 2576 | 2581 |
| 2577 return result; | 2582 return result; |
| 2578 } | 2583 } |
| 2579 | 2584 |
| 2580 } // namespace blink | 2585 } // namespace blink |
| OLD | NEW |