| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 // WebCore inserts <div><br></div> *before* the current block, which correct
ly moves the paragraph down but which doesn't | 1111 // WebCore inserts <div><br></div> *before* the current block, which correct
ly moves the paragraph down but which doesn't |
| 1112 // change the caret's DOM position (["hello", 0]). In these situations the a
bove FrameSelection::setSelection call | 1112 // change the caret's DOM position (["hello", 0]). In these situations the a
bove FrameSelection::setSelection call |
| 1113 // does not call EditorClient::respondToChangedSelection(), which, on the Ma
c, sends selection change notifications and | 1113 // does not call EditorClient::respondToChangedSelection(), which, on the Ma
c, sends selection change notifications and |
| 1114 // starts a new kill ring sequence, but we want to do these things (matches
AppKit). | 1114 // starts a new kill ring sequence, but we want to do these things (matches
AppKit). |
| 1115 if (selectionDidNotChangeDOMPosition) | 1115 if (selectionDidNotChangeDOMPosition) |
| 1116 client().respondToChangedSelection(m_frame, frame().selection().selectio
nType()); | 1116 client().respondToChangedSelection(m_frame, frame().selection().selectio
nType()); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 IntRect Editor::firstRectForRange(const EphemeralRange& range) const | 1119 IntRect Editor::firstRectForRange(const EphemeralRange& range) const |
| 1120 { | 1120 { |
| 1121 LayoutUnit extraWidthToEndOfLine = 0; | 1121 LayoutUnit extraWidthToEndOfLine; |
| 1122 ASSERT(range.isNotNull()); | 1122 ASSERT(range.isNotNull()); |
| 1123 | 1123 |
| 1124 IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startP
osition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthT
oEndOfLine); | 1124 IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startP
osition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthT
oEndOfLine); |
| 1125 if (startCaretRect.isEmpty()) | 1125 if (startCaretRect.isEmpty()) |
| 1126 return IntRect(); | 1126 return IntRect(); |
| 1127 | 1127 |
| 1128 IntRect endCaretRect = RenderedPosition(createVisiblePosition(range.endPosit
ion()).deepEquivalent(), TextAffinity::Upstream).absoluteRect(); | 1128 IntRect endCaretRect = RenderedPosition(createVisiblePosition(range.endPosit
ion()).deepEquivalent(), TextAffinity::Upstream).absoluteRect(); |
| 1129 if (endCaretRect.isEmpty()) | 1129 if (endCaretRect.isEmpty()) |
| 1130 return IntRect(); | 1130 return IntRect(); |
| 1131 | 1131 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 DEFINE_TRACE(Editor) | 1382 DEFINE_TRACE(Editor) |
| 1383 { | 1383 { |
| 1384 visitor->trace(m_frame); | 1384 visitor->trace(m_frame); |
| 1385 visitor->trace(m_lastEditCommand); | 1385 visitor->trace(m_lastEditCommand); |
| 1386 visitor->trace(m_mark); | 1386 visitor->trace(m_mark); |
| 1387 } | 1387 } |
| 1388 | 1388 |
| 1389 } // namespace blink | 1389 } // namespace blink |
| OLD | NEW |