Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 330933002: Revert of Removing "using" declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
91 using namespace HTMLNames; 92 using namespace HTMLNames;
92 using namespace WTF; 93 using namespace WTF;
93 using namespace Unicode; 94 using namespace Unicode;
94 95
95 Editor::RevealSelectionScope::RevealSelectionScope(Editor* editor) 96 Editor::RevealSelectionScope::RevealSelectionScope(Editor* editor)
96 : m_editor(editor) 97 : m_editor(editor)
97 { 98 {
98 ++m_editor->m_preventRevealSelection; 99 ++m_editor->m_preventRevealSelection;
99 } 100 }
100 101
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 IntRect startCaretRect = RenderedPosition(VisiblePosition(range->startPositi on()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine); 1123 IntRect startCaretRect = RenderedPosition(VisiblePosition(range->startPositi on()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine);
1123 if (startCaretRect == LayoutRect()) 1124 if (startCaretRect == LayoutRect())
1124 return IntRect(); 1125 return IntRect();
1125 1126
1126 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition() ).deepEquivalent(), UPSTREAM).absoluteRect(); 1127 IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition() ).deepEquivalent(), UPSTREAM).absoluteRect();
1127 if (endCaretRect == LayoutRect()) 1128 if (endCaretRect == LayoutRect())
1128 return IntRect(); 1129 return IntRect();
1129 1130
1130 if (startCaretRect.y() == endCaretRect.y()) { 1131 if (startCaretRect.y() == endCaretRect.y()) {
1131 // start and end are on the same line 1132 // start and end are on the same line
1132 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()), 1133 return IntRect(min(startCaretRect.x(), endCaretRect.x()),
1133 startCaretRect.y(), 1134 startCaretRect.y(),
1134 std::abs(endCaretRect.x() - startCaretRect.x()), 1135 abs(endCaretRect.x() - startCaretRect.x()),
1135 std::max(startCaretRect.height(), endCaretRect.height())); 1136 max(startCaretRect.height(), endCaretRect.height()));
1136 } 1137 }
1137 1138
1138 // 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
1139 return IntRect(startCaretRect.x(), 1140 return IntRect(startCaretRect.x(),
1140 startCaretRect.y(), 1141 startCaretRect.y(),
1141 startCaretRect.width() + extraWidthToEndOfLine, 1142 startCaretRect.width() + extraWidthToEndOfLine,
1142 startCaretRect.height()); 1143 startCaretRect.height());
1143 } 1144 }
1144 1145
1145 void Editor::computeAndSetTypingStyle(StylePropertySet* style, EditAction editin gAction) 1146 void Editor::computeAndSetTypingStyle(StylePropertySet* style, EditAction editin gAction)
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1303 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1303 } 1304 }
1304 1305
1305 void Editor::trace(Visitor* visitor) 1306 void Editor::trace(Visitor* visitor)
1306 { 1307 {
1307 visitor->trace(m_lastEditCommand); 1308 visitor->trace(m_lastEditCommand);
1308 visitor->trace(m_mark); 1309 visitor->trace(m_mark);
1309 } 1310 }
1310 1311
1311 } // namespace WebCore 1312 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698