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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 } | 1275 } |
1276 | 1276 |
1277 IntRect FrameSelection::absoluteCaretBounds() | 1277 IntRect FrameSelection::absoluteCaretBounds() |
1278 { | 1278 { |
1279 ASSERT(m_frame->document()->lifecycle().state() != DocumentLifecycle::InPain
tInvalidation); | 1279 ASSERT(m_frame->document()->lifecycle().state() != DocumentLifecycle::InPain
tInvalidation); |
1280 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 1280 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
1281 if (!isNonOrphanedCaret(m_selection)) { | 1281 if (!isNonOrphanedCaret(m_selection)) { |
1282 clearCaretRect(); | 1282 clearCaretRect(); |
1283 } else { | 1283 } else { |
1284 if (isTextFormControl(m_selection)) | 1284 if (isTextFormControl(m_selection)) |
1285 updateCaretRect(PositionWithAffinity(m_selection.start().isCandidate
() ? m_selection.start() : Position(), m_selection.affinity())); | 1285 updateCaretRect(PositionWithAffinity(isVisuallyEquivalentCandidate(m
_selection.start()) ? m_selection.start() : Position(), m_selection.affinity()))
; |
1286 else | 1286 else |
1287 updateCaretRect(VisiblePosition(m_selection.start(), m_selection.aff
inity())); | 1287 updateCaretRect(VisiblePosition(m_selection.start(), m_selection.aff
inity())); |
1288 } | 1288 } |
1289 return absoluteBoundsForLocalRect(m_selection.start().anchorNode(), localCar
etRectWithoutUpdate()); | 1289 return absoluteBoundsForLocalRect(m_selection.start().anchorNode(), localCar
etRectWithoutUpdate()); |
1290 } | 1290 } |
1291 | 1291 |
1292 static LayoutRect localCaretRect(const VisibleSelection& m_selection, const Posi
tionWithAffinity& caretPosition, LayoutObject*& layoutObject) | 1292 static LayoutRect localCaretRect(const VisibleSelection& m_selection, const Posi
tionWithAffinity& caretPosition, LayoutObject*& layoutObject) |
1293 { | 1293 { |
1294 layoutObject = nullptr; | 1294 layoutObject = nullptr; |
1295 if (!isNonOrphanedCaret(m_selection)) | 1295 if (!isNonOrphanedCaret(m_selection)) |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 | 2058 |
2059 void showTree(const blink::FrameSelection* sel) | 2059 void showTree(const blink::FrameSelection* sel) |
2060 { | 2060 { |
2061 if (sel) | 2061 if (sel) |
2062 sel->showTreeForThis(); | 2062 sel->showTreeForThis(); |
2063 else | 2063 else |
2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
2065 } | 2065 } |
2066 | 2066 |
2067 #endif | 2067 #endif |
OLD | NEW |