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 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 } | 1617 } |
1618 #endif | 1618 #endif |
1619 | 1619 |
1620 // We need to update style in case the node containing the selection is made
display:none. | 1620 // We need to update style in case the node containing the selection is made
display:none. |
1621 m_frame->document()->updateStyleIfNeeded(); | 1621 m_frame->document()->updateStyleIfNeeded(); |
1622 | 1622 |
1623 RenderView* view = m_frame->contentRenderer(); | 1623 RenderView* view = m_frame->contentRenderer(); |
1624 if (!view) | 1624 if (!view) |
1625 return; | 1625 return; |
1626 | 1626 |
1627 VisibleSelection selection = this->selection(); | 1627 VisibleSelection selection(m_selection.visibleStart(), m_selection.visibleEn
d()); |
1628 | 1628 |
1629 if (!selection.isRange()) { | 1629 if (!selection.isRange()) { |
1630 view->clearSelection(); | 1630 view->clearSelection(); |
1631 return; | 1631 return; |
1632 } | 1632 } |
1633 | 1633 |
1634 // Use the rightmost candidate for the start of the selection, and the leftm
ost candidate for the end of the selection. | 1634 // Use the rightmost candidate for the start of the selection, and the leftm
ost candidate for the end of the selection. |
1635 // Example: foo <a>bar</a>. Imagine that a line wrap occurs after 'foo', an
d that 'bar' is selected. If we pass [foo, 3] | 1635 // Example: foo <a>bar</a>. Imagine that a line wrap occurs after 'foo', an
d that 'bar' is selected. If we pass [foo, 3] |
1636 // as the start of the selection, the selection painting code will think tha
t content on the line containing 'foo' is selected | 1636 // as the start of the selection, the selection painting code will think tha
t content on the line containing 'foo' is selected |
1637 // and will fill the gap before 'bar'. | 1637 // and will fill the gap before 'bar'. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 sel.showTreeForThis(); | 1907 sel.showTreeForThis(); |
1908 } | 1908 } |
1909 | 1909 |
1910 void showTree(const WebCore::FrameSelection* sel) | 1910 void showTree(const WebCore::FrameSelection* sel) |
1911 { | 1911 { |
1912 if (sel) | 1912 if (sel) |
1913 sel->showTreeForThis(); | 1913 sel->showTreeForThis(); |
1914 } | 1914 } |
1915 | 1915 |
1916 #endif | 1916 #endif |
OLD | NEW |