OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 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 * 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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 Position endPos = selection.end(); | 1595 Position endPos = selection.end(); |
1596 candidate = endPos.upstream(); | 1596 candidate = endPos.upstream(); |
1597 if (candidate.isCandidate()) | 1597 if (candidate.isCandidate()) |
1598 endPos = candidate; | 1598 endPos = candidate; |
1599 | 1599 |
1600 // We can get into a state where the selection endpoints map to the same Vis
iblePosition when a selection is deleted | 1600 // We can get into a state where the selection endpoints map to the same Vis
iblePosition when a selection is deleted |
1601 // because we don't yet notify the FrameSelection of text removal. | 1601 // because we don't yet notify the FrameSelection of text removal. |
1602 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() !
= selection.visibleEnd()) { | 1602 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() !
= selection.visibleEnd()) { |
1603 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); | 1603 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); |
1604 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); | 1604 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); |
1605 if (startRenderer->view() == view && endRenderer->view() == view) | 1605 if (startRenderer && endRenderer && startRenderer->view() == view && end
Renderer->view() == view) |
1606 view->setSelection(startRenderer, startPos.deprecatedEditingOffset()
, endRenderer, endPos.deprecatedEditingOffset()); | 1606 view->setSelection(startRenderer, startPos.deprecatedEditingOffset()
, endRenderer, endPos.deprecatedEditingOffset()); |
1607 } | 1607 } |
1608 } | 1608 } |
1609 | 1609 |
1610 void FrameSelection::setCaretVisibility(CaretVisibility visibility) | 1610 void FrameSelection::setCaretVisibility(CaretVisibility visibility) |
1611 { | 1611 { |
1612 if (caretVisibility() == visibility) | 1612 if (caretVisibility() == visibility) |
1613 return; | 1613 return; |
1614 | 1614 |
1615 CaretBase::setCaretVisibility(visibility); | 1615 CaretBase::setCaretVisibility(visibility); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 sel.showTreeForThis(); | 1940 sel.showTreeForThis(); |
1941 } | 1941 } |
1942 | 1942 |
1943 void showTree(const blink::FrameSelection* sel) | 1943 void showTree(const blink::FrameSelection* sel) |
1944 { | 1944 { |
1945 if (sel) | 1945 if (sel) |
1946 sel->showTreeForThis(); | 1946 sel->showTreeForThis(); |
1947 } | 1947 } |
1948 | 1948 |
1949 #endif | 1949 #endif |
OLD | NEW |