| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 * Copyright (C) 2009 Igalia S.L. | 4 * Copyright (C) 2009 Igalia S.L. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "core/editing/Editor.h" | 28 #include "core/editing/Editor.h" |
| 29 | 29 |
| 30 #include "bindings/core/v8/ExceptionState.h" | 30 #include "bindings/core/v8/ExceptionState.h" |
| 31 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 31 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 32 #include "core/CSSPropertyNames.h" | 32 #include "core/CSSPropertyNames.h" |
| 33 #include "core/CSSValueKeywords.h" | 33 #include "core/CSSValueKeywords.h" |
| 34 #include "core/HTMLNames.h" | 34 #include "core/HTMLNames.h" |
| 35 #include "core/clipboard/Pasteboard.h" | 35 #include "core/clipboard/Pasteboard.h" |
| 36 #include "core/css/CSSIdentifierValue.h" |
| 36 #include "core/css/CSSValueList.h" | 37 #include "core/css/CSSValueList.h" |
| 37 #include "core/css/StylePropertySet.h" | 38 #include "core/css/StylePropertySet.h" |
| 38 #include "core/dom/DocumentFragment.h" | 39 #include "core/dom/DocumentFragment.h" |
| 39 #include "core/dom/TagCollection.h" | 40 #include "core/dom/TagCollection.h" |
| 40 #include "core/editing/EditingUtilities.h" | 41 #include "core/editing/EditingUtilities.h" |
| 41 #include "core/editing/FrameSelection.h" | 42 #include "core/editing/FrameSelection.h" |
| 42 #include "core/editing/SelectionModifier.h" | 43 #include "core/editing/SelectionModifier.h" |
| 43 #include "core/editing/commands/CreateLinkCommand.h" | 44 #include "core/editing/commands/CreateLinkCommand.h" |
| 44 #include "core/editing/commands/EditorCommandNames.h" | 45 #include "core/editing/commands/EditorCommandNames.h" |
| 45 #include "core/editing/commands/FormatBlockCommand.h" | 46 #include "core/editing/commands/FormatBlockCommand.h" |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 } | 1242 } |
| 1242 | 1243 |
| 1243 static bool executeSetMark(LocalFrame& frame, Event*, EditorCommandSource, const
String&) | 1244 static bool executeSetMark(LocalFrame& frame, Event*, EditorCommandSource, const
String&) |
| 1244 { | 1245 { |
| 1245 frame.editor().setMark(frame.selection().selection()); | 1246 frame.editor().setMark(frame.selection().selection()); |
| 1246 return true; | 1247 return true; |
| 1247 } | 1248 } |
| 1248 | 1249 |
| 1249 static bool executeStrikethrough(LocalFrame& frame, Event*, EditorCommandSource
source, const String&) | 1250 static bool executeStrikethrough(LocalFrame& frame, Event*, EditorCommandSource
source, const String&) |
| 1250 { | 1251 { |
| 1251 CSSPrimitiveValue* lineThrough = CSSPrimitiveValue::createIdentifier(CSSValu
eLineThrough); | 1252 CSSIdentifierValue* lineThrough = CSSIdentifierValue::create(CSSValueLineThr
ough); |
| 1252 return executeToggleStyleInList(frame, source, InputEvent::InputType::Strike
Through, CSSPropertyWebkitTextDecorationsInEffect, lineThrough); | 1253 return executeToggleStyleInList(frame, source, InputEvent::InputType::Strike
Through, CSSPropertyWebkitTextDecorationsInEffect, lineThrough); |
| 1253 } | 1254 } |
| 1254 | 1255 |
| 1255 static bool executeStyleWithCSS(LocalFrame& frame, Event*, EditorCommandSource,
const String& value) | 1256 static bool executeStyleWithCSS(LocalFrame& frame, Event*, EditorCommandSource,
const String& value) |
| 1256 { | 1257 { |
| 1257 frame.editor().setShouldStyleWithCSS(!equalIgnoringCase(value, "false")); | 1258 frame.editor().setShouldStyleWithCSS(!equalIgnoringCase(value, "false")); |
| 1258 return true; | 1259 return true; |
| 1259 } | 1260 } |
| 1260 | 1261 |
| 1261 static bool executeUseCSS(LocalFrame& frame, Event*, EditorCommandSource, const
String& value) | 1262 static bool executeUseCSS(LocalFrame& frame, Event*, EditorCommandSource, const
String& value) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 } | 1297 } |
| 1297 | 1298 |
| 1298 static bool executeTranspose(LocalFrame& frame, Event*, EditorCommandSource, con
st String&) | 1299 static bool executeTranspose(LocalFrame& frame, Event*, EditorCommandSource, con
st String&) |
| 1299 { | 1300 { |
| 1300 frame.editor().transpose(); | 1301 frame.editor().transpose(); |
| 1301 return true; | 1302 return true; |
| 1302 } | 1303 } |
| 1303 | 1304 |
| 1304 static bool executeUnderline(LocalFrame& frame, Event*, EditorCommandSource sour
ce, const String&) | 1305 static bool executeUnderline(LocalFrame& frame, Event*, EditorCommandSource sour
ce, const String&) |
| 1305 { | 1306 { |
| 1306 CSSPrimitiveValue* underline = CSSPrimitiveValue::createIdentifier(CSSValueU
nderline); | 1307 CSSIdentifierValue* underline = CSSIdentifierValue::create(CSSValueUnderline
); |
| 1307 return executeToggleStyleInList(frame, source, InputEvent::InputType::Underl
ine, CSSPropertyWebkitTextDecorationsInEffect, underline); | 1308 return executeToggleStyleInList(frame, source, InputEvent::InputType::Underl
ine, CSSPropertyWebkitTextDecorationsInEffect, underline); |
| 1308 } | 1309 } |
| 1309 | 1310 |
| 1310 static bool executeUndo(LocalFrame& frame, Event*, EditorCommandSource, const St
ring&) | 1311 static bool executeUndo(LocalFrame& frame, Event*, EditorCommandSource, const St
ring&) |
| 1311 { | 1312 { |
| 1312 frame.editor().undo(); | 1313 frame.editor().undo(); |
| 1313 return true; | 1314 return true; |
| 1314 } | 1315 } |
| 1315 | 1316 |
| 1316 static bool executeUnlink(LocalFrame& frame, Event*, EditorCommandSource, const
String&) | 1317 static bool executeUnlink(LocalFrame& frame, Event*, EditorCommandSource, const
String&) |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 case WebEditingCommandType::DeleteWordBackward: | 1968 case WebEditingCommandType::DeleteWordBackward: |
| 1968 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionBackwa
rd, WordGranularity); | 1969 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionBackwa
rd, WordGranularity); |
| 1969 case WebEditingCommandType::DeleteWordForward: | 1970 case WebEditingCommandType::DeleteWordForward: |
| 1970 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForwar
d, WordGranularity); | 1971 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForwar
d, WordGranularity); |
| 1971 default: | 1972 default: |
| 1972 return nullptr; | 1973 return nullptr; |
| 1973 } | 1974 } |
| 1974 } | 1975 } |
| 1975 | 1976 |
| 1976 } // namespace blink | 1977 } // namespace blink |
| OLD | NEW |