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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1579 Position endPos = selection.end(); | 1579 Position endPos = selection.end(); |
1580 candidate = endPos.upstream(); | 1580 candidate = endPos.upstream(); |
1581 if (candidate.isCandidate()) | 1581 if (candidate.isCandidate()) |
1582 endPos = candidate; | 1582 endPos = candidate; |
1583 | 1583 |
1584 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted | 1584 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted |
1585 // because we don't yet notify the FrameSelection of text removal. | 1585 // because we don't yet notify the FrameSelection of text removal. |
1586 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) { | 1586 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) { |
1587 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); | 1587 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); |
1588 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); | 1588 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); |
1589 view->setSelection(startRenderer, startPos.deprecatedEditingOffset(), en dRenderer, endPos.deprecatedEditingOffset()); | 1589 if (startRenderer->view() == view && endRenderer->view() == view) |
Yuta Kitamura
2014/04/14 06:23:40
This line would probably deserve some comments bec
yosin_UTC9
2014/04/14 08:03:56
Done.
| |
1590 view->setSelection(startRenderer, startPos.deprecatedEditingOffset() , endRenderer, endPos.deprecatedEditingOffset()); | |
1590 } | 1591 } |
1591 } | 1592 } |
1592 | 1593 |
1593 void FrameSelection::setCaretVisibility(CaretVisibility visibility) | 1594 void FrameSelection::setCaretVisibility(CaretVisibility visibility) |
1594 { | 1595 { |
1595 if (caretVisibility() == visibility) | 1596 if (caretVisibility() == visibility) |
1596 return; | 1597 return; |
1597 | 1598 |
1598 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 1599 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
1599 if (m_caretPaint) { | 1600 if (m_caretPaint) { |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1876 sel.showTreeForThis(); | 1877 sel.showTreeForThis(); |
1877 } | 1878 } |
1878 | 1879 |
1879 void showTree(const WebCore::FrameSelection* sel) | 1880 void showTree(const WebCore::FrameSelection* sel) |
1880 { | 1881 { |
1881 if (sel) | 1882 if (sel) |
1882 sel->showTreeForThis(); | 1883 sel->showTreeForThis(); |
1883 } | 1884 } |
1884 | 1885 |
1885 #endif | 1886 #endif |
OLD | NEW |