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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 if (!m_frame) { | 231 if (!m_frame) { |
232 m_selection = s; | 232 m_selection = s; |
233 return; | 233 return; |
234 } | 234 } |
235 | 235 |
236 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra
meSelection::setSelection | 236 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra
meSelection::setSelection |
237 // if document->frame() == m_frame we can get into an infinite loop | 237 // if document->frame() == m_frame we can get into an infinite loop |
238 if (s.base().anchorNode()) { | 238 if (s.base().anchorNode()) { |
239 Document& document = *s.base().document(); | 239 Document& document = *s.base().document(); |
240 if (document.frame() && document.frame() != m_frame && document != m_fra
me->document()) { | 240 if (document.frame() && document.frame() != m_frame && document != m_fra
me->document()) { |
241 RefPtr<LocalFrame> guard = document.frame(); | 241 RefPtrWillBeRawPtr<LocalFrame> guard(document.frame()); |
242 document.frame()->selection().setSelection(s, options, align, granul
arity); | 242 document.frame()->selection().setSelection(s, options, align, granul
arity); |
243 // It's possible that during the above set selection, this FrameSele
ction has been modified by | 243 // It's possible that during the above set selection, this FrameSele
ction has been modified by |
244 // selectFrameElementInParentIfFullySelected, but that the selection
is no longer valid since | 244 // selectFrameElementInParentIfFullySelected, but that the selection
is no longer valid since |
245 // the frame is about to be destroyed. If this is the case, clear ou
r selection. | 245 // the frame is about to be destroyed. If this is the case, clear ou
r selection. |
246 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) | 246 if (guard->hasBeenClosed() && !m_selection.isNonOrphanedCaretOrRange
()) |
247 clear(); | 247 clear(); |
248 return; | 248 return; |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 m_granularity = granularity; | 252 m_granularity = granularity; |
253 | 253 |
254 if (closeTyping) | 254 if (closeTyping) |
255 TypingCommand::closeTyping(m_frame); | 255 TypingCommand::closeTyping(m_frame); |
256 | 256 |
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 | 1886 |
1887 void FrameSelection::showTreeForThis() const | 1887 void FrameSelection::showTreeForThis() const |
1888 { | 1888 { |
1889 m_selection.showTreeForThis(); | 1889 m_selection.showTreeForThis(); |
1890 } | 1890 } |
1891 | 1891 |
1892 #endif | 1892 #endif |
1893 | 1893 |
1894 void FrameSelection::trace(Visitor* visitor) | 1894 void FrameSelection::trace(Visitor* visitor) |
1895 { | 1895 { |
| 1896 visitor->trace(m_frame); |
1896 visitor->trace(m_selection); | 1897 visitor->trace(m_selection); |
1897 visitor->trace(m_originalBase); | 1898 visitor->trace(m_originalBase); |
1898 visitor->trace(m_logicalRange); | 1899 visitor->trace(m_logicalRange); |
1899 visitor->trace(m_previousCaretNode); | 1900 visitor->trace(m_previousCaretNode); |
1900 visitor->trace(m_typingStyle); | 1901 visitor->trace(m_typingStyle); |
1901 VisibleSelection::ChangeObserver::trace(visitor); | 1902 VisibleSelection::ChangeObserver::trace(visitor); |
1902 } | 1903 } |
1903 | 1904 |
1904 void FrameSelection::setCaretRectNeedsUpdate() | 1905 void FrameSelection::setCaretRectNeedsUpdate() |
1905 { | 1906 { |
(...skipping 19 matching lines...) Expand all Loading... |
1925 sel.showTreeForThis(); | 1926 sel.showTreeForThis(); |
1926 } | 1927 } |
1927 | 1928 |
1928 void showTree(const blink::FrameSelection* sel) | 1929 void showTree(const blink::FrameSelection* sel) |
1929 { | 1930 { |
1930 if (sel) | 1931 if (sel) |
1931 sel->showTreeForThis(); | 1932 sel->showTreeForThis(); |
1932 } | 1933 } |
1933 | 1934 |
1934 #endif | 1935 #endif |
OLD | NEW |