Chromium Code Reviews| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 if (shouldAlwaysUseDirectionalSelection(m_frame)) | 222 if (shouldAlwaysUseDirectionalSelection(m_frame)) |
| 223 s.setIsDirectional(true); | 223 s.setIsDirectional(true); |
| 224 | 224 |
| 225 if (!m_frame) { | 225 if (!m_frame) { |
| 226 m_selection = s; | 226 m_selection = s; |
| 227 return; | 227 return; |
| 228 } | 228 } |
| 229 | 229 |
| 230 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra meSelection::setSelection | 230 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra meSelection::setSelection |
| 231 // if document->frame() == m_frame we can get into an infinite loop | 231 // if document->frame() == m_frame we can get into an infinite loop |
| 232 if (s.base().anchorNode()) { | 232 if (s.start().anchorNode()) { |
|
Yuta Kitamura
2014/04/11 08:59:22
As far as I know, the relationship among base, ext
| |
| 233 Document& document = *s.base().document(); | 233 Document& document = *s.start().document(); |
| 234 if (document.frame() && document.frame() != m_frame && document != m_fra me->document()) { | 234 if (document.frame() && document.frame() != m_frame && document != m_fra me->document()) { |
| 235 RefPtr<LocalFrame> guard = document.frame(); | 235 RefPtr<LocalFrame> guard = document.frame(); |
| 236 document.frame()->selection().setSelection(s, options, align, granul arity); | 236 document.frame()->selection().setSelection(s, options, align, granul arity); |
| 237 // It's possible that during the above set selection, this FrameSele ction has been modified by | 237 // It's possible that during the above set selection, this FrameSele ction has been modified by |
| 238 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since | 238 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since |
| 239 // the frame is about to be destroyed. If this is the case, clear ou r selection. | 239 // the frame is about to be destroyed. If this is the case, clear ou r selection. |
| 240 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) | 240 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) |
| 241 clear(); | 241 clear(); |
| 242 return; | 242 return; |
| 243 } | 243 } |
| (...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1876 sel.showTreeForThis(); | 1876 sel.showTreeForThis(); |
| 1877 } | 1877 } |
| 1878 | 1878 |
| 1879 void showTree(const WebCore::FrameSelection* sel) | 1879 void showTree(const WebCore::FrameSelection* sel) |
| 1880 { | 1880 { |
| 1881 if (sel) | 1881 if (sel) |
| 1882 sel->showTreeForThis(); | 1882 sel->showTreeForThis(); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 #endif | 1885 #endif |
| OLD | NEW |