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 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 return valueStyle(frame, CSSPropertyColor); | 2070 return valueStyle(frame, CSSPropertyColor); |
2071 } | 2071 } |
2072 | 2072 |
2073 static String valueFormatBlock(LocalFrame& frame, Event*) { | 2073 static String valueFormatBlock(LocalFrame& frame, Event*) { |
2074 const VisibleSelection& selection = | 2074 const VisibleSelection& selection = |
2075 frame.selection().computeVisibleSelectionInDOMTreeDeprecated(); | 2075 frame.selection().computeVisibleSelectionInDOMTreeDeprecated(); |
2076 if (!selection.isNonOrphanedCaretOrRange() || !selection.isContentEditable()) | 2076 if (!selection.isNonOrphanedCaretOrRange() || !selection.isContentEditable()) |
2077 return ""; | 2077 return ""; |
2078 Element* formatBlockElement = | 2078 Element* formatBlockElement = |
2079 FormatBlockCommand::elementForFormatBlockCommand( | 2079 FormatBlockCommand::elementForFormatBlockCommand( |
2080 createRange(firstEphemeralRangeOf(selection))); | 2080 firstEphemeralRangeOf(selection)); |
2081 if (!formatBlockElement) | 2081 if (!formatBlockElement) |
2082 return ""; | 2082 return ""; |
2083 return formatBlockElement->localName(); | 2083 return formatBlockElement->localName(); |
2084 } | 2084 } |
2085 | 2085 |
2086 // Map of functions | 2086 // Map of functions |
2087 | 2087 |
2088 static const EditorInternalCommand* internalCommand(const String& commandName) { | 2088 static const EditorInternalCommand* internalCommand(const String& commandName) { |
2089 static const EditorInternalCommand kEditorCommands[] = { | 2089 static const EditorInternalCommand kEditorCommands[] = { |
2090 // Lists all commands in blink::WebEditingCommandType. | 2090 // Lists all commands in blink::WebEditingCommandType. |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2752 *m_frame, DirectionBackward, WordGranularity); | 2752 *m_frame, DirectionBackward, WordGranularity); |
2753 case WebEditingCommandType::DeleteWordForward: | 2753 case WebEditingCommandType::DeleteWordForward: |
2754 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, | 2754 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, |
2755 WordGranularity); | 2755 WordGranularity); |
2756 default: | 2756 default: |
2757 return targetRangesForInputEvent(*target); | 2757 return targetRangesForInputEvent(*target); |
2758 } | 2758 } |
2759 } | 2759 } |
2760 | 2760 |
2761 } // namespace blink | 2761 } // namespace blink |
OLD | NEW |