| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 #include "core/page/Page.h" | 81 #include "core/page/Page.h" |
| 82 #include "core/rendering/HitTestResult.h" | 82 #include "core/rendering/HitTestResult.h" |
| 83 #include "core/rendering/RenderImage.h" | 83 #include "core/rendering/RenderImage.h" |
| 84 #include "core/svg/SVGImageElement.h" | 84 #include "core/svg/SVGImageElement.h" |
| 85 #include "platform/KillRing.h" | 85 #include "platform/KillRing.h" |
| 86 #include "platform/weborigin/KURL.h" | 86 #include "platform/weborigin/KURL.h" |
| 87 #include "wtf/unicode/CharacterNames.h" | 87 #include "wtf/unicode/CharacterNames.h" |
| 88 | 88 |
| 89 namespace WebCore { | 89 namespace WebCore { |
| 90 | 90 |
| 91 using namespace std; | |
| 92 using namespace HTMLNames; | 91 using namespace HTMLNames; |
| 93 using namespace WTF; | 92 using namespace WTF; |
| 94 using namespace Unicode; | 93 using namespace Unicode; |
| 95 | 94 |
| 96 Editor::RevealSelectionScope::RevealSelectionScope(Editor* editor) | 95 Editor::RevealSelectionScope::RevealSelectionScope(Editor* editor) |
| 97 : m_editor(editor) | 96 : m_editor(editor) |
| 98 { | 97 { |
| 99 ++m_editor->m_preventRevealSelection; | 98 ++m_editor->m_preventRevealSelection; |
| 100 } | 99 } |
| 101 | 100 |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 IntRect startCaretRect = RenderedPosition(VisiblePosition(range->startPositi
on()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine); | 1122 IntRect startCaretRect = RenderedPosition(VisiblePosition(range->startPositi
on()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine); |
| 1124 if (startCaretRect == LayoutRect()) | 1123 if (startCaretRect == LayoutRect()) |
| 1125 return IntRect(); | 1124 return IntRect(); |
| 1126 | 1125 |
| 1127 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition()
).deepEquivalent(), UPSTREAM).absoluteRect(); | 1126 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition()
).deepEquivalent(), UPSTREAM).absoluteRect(); |
| 1128 if (endCaretRect == LayoutRect()) | 1127 if (endCaretRect == LayoutRect()) |
| 1129 return IntRect(); | 1128 return IntRect(); |
| 1130 | 1129 |
| 1131 if (startCaretRect.y() == endCaretRect.y()) { | 1130 if (startCaretRect.y() == endCaretRect.y()) { |
| 1132 // start and end are on the same line | 1131 // start and end are on the same line |
| 1133 return IntRect(min(startCaretRect.x(), endCaretRect.x()), | 1132 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()), |
| 1134 startCaretRect.y(), | 1133 startCaretRect.y(), |
| 1135 abs(endCaretRect.x() - startCaretRect.x()), | 1134 std::abs(endCaretRect.x() - startCaretRect.x()), |
| 1136 max(startCaretRect.height(), endCaretRect.height())); | 1135 std::max(startCaretRect.height(), endCaretRect.height())); |
| 1137 } | 1136 } |
| 1138 | 1137 |
| 1139 // start and end aren't on the same line, so go from start to the end of its
line | 1138 // start and end aren't on the same line, so go from start to the end of its
line |
| 1140 return IntRect(startCaretRect.x(), | 1139 return IntRect(startCaretRect.x(), |
| 1141 startCaretRect.y(), | 1140 startCaretRect.y(), |
| 1142 startCaretRect.width() + extraWidthToEndOfLine, | 1141 startCaretRect.width() + extraWidthToEndOfLine, |
| 1143 startCaretRect.height()); | 1142 startCaretRect.height()); |
| 1144 } | 1143 } |
| 1145 | 1144 |
| 1146 void Editor::computeAndSetTypingStyle(StylePropertySet* style, EditAction editin
gAction) | 1145 void Editor::computeAndSetTypingStyle(StylePropertySet* style, EditAction editin
gAction) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1302 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
| 1304 } | 1303 } |
| 1305 | 1304 |
| 1306 void Editor::trace(Visitor* visitor) | 1305 void Editor::trace(Visitor* visitor) |
| 1307 { | 1306 { |
| 1308 visitor->trace(m_lastEditCommand); | 1307 visitor->trace(m_lastEditCommand); |
| 1309 visitor->trace(m_mark); | 1308 visitor->trace(m_mark); |
| 1310 } | 1309 } |
| 1311 | 1310 |
| 1312 } // namespace WebCore | 1311 } // namespace WebCore |
| OLD | NEW |