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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 return IntRect(); | 1125 return IntRect(); |
1126 | 1126 |
1127 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition()
).deepEquivalent(), UPSTREAM).absoluteRect(); | 1127 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition()
).deepEquivalent(), UPSTREAM).absoluteRect(); |
1128 if (endCaretRect == LayoutRect()) | 1128 if (endCaretRect == LayoutRect()) |
1129 return IntRect(); | 1129 return IntRect(); |
1130 | 1130 |
1131 if (startCaretRect.y() == endCaretRect.y()) { | 1131 if (startCaretRect.y() == endCaretRect.y()) { |
1132 // start and end are on the same line | 1132 // start and end are on the same line |
1133 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()), | 1133 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()), |
1134 startCaretRect.y(), | 1134 startCaretRect.y(), |
1135 std::abs(endCaretRect.x() - startCaretRect.x()), | 1135 ::abs(endCaretRect.x() - startCaretRect.x()), |
1136 std::max(startCaretRect.height(), endCaretRect.height())); | 1136 std::max(startCaretRect.height(), endCaretRect.height())); |
1137 } | 1137 } |
1138 | 1138 |
1139 // start and end aren't on the same line, so go from start to the end of its
line | 1139 // start and end aren't on the same line, so go from start to the end of its
line |
1140 return IntRect(startCaretRect.x(), | 1140 return IntRect(startCaretRect.x(), |
1141 startCaretRect.y(), | 1141 startCaretRect.y(), |
1142 startCaretRect.width() + extraWidthToEndOfLine, | 1142 startCaretRect.width() + extraWidthToEndOfLine, |
1143 startCaretRect.height()); | 1143 startCaretRect.height()); |
1144 } | 1144 } |
1145 | 1145 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1303 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
1304 } | 1304 } |
1305 | 1305 |
1306 void Editor::trace(Visitor* visitor) | 1306 void Editor::trace(Visitor* visitor) |
1307 { | 1307 { |
1308 visitor->trace(m_lastEditCommand); | 1308 visitor->trace(m_lastEditCommand); |
1309 visitor->trace(m_mark); | 1309 visitor->trace(m_mark); |
1310 } | 1310 } |
1311 | 1311 |
1312 } // namespace WebCore | 1312 } // namespace WebCore |
OLD | NEW |