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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Issue 2729823002: Make FormatBlockCommand::elementForFormatBlockCommand() to take EphemeralRange (Closed)
Patch Set: 2017-03-02T16:28:37 Created 3 years, 9 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
OLDNEW
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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 static String valueForeColor(LocalFrame& frame, Event*) { 2069 static String valueForeColor(LocalFrame& frame, Event*) {
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(firstRangeOf(selection)); 2079 FormatBlockCommand::elementForFormatBlockCommand(
Xiaocheng 2017/03/02 20:21:05 This patch has conflict with https://codereview.ch
yosin_UTC9 2017/03/09 05:18:40 The patch is committed. There is no conflict anymo
2080 firstEphemeralRangeOf(selection));
2080 if (!formatBlockElement) 2081 if (!formatBlockElement)
2081 return ""; 2082 return "";
2082 return formatBlockElement->localName(); 2083 return formatBlockElement->localName();
2083 } 2084 }
2084 2085
2085 // Map of functions 2086 // Map of functions
2086 2087
2087 static const EditorInternalCommand* internalCommand(const String& commandName) { 2088 static const EditorInternalCommand* internalCommand(const String& commandName) {
2088 static const EditorInternalCommand kEditorCommands[] = { 2089 static const EditorInternalCommand kEditorCommands[] = {
2089 // 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
2751 *m_frame, DirectionBackward, WordGranularity); 2752 *m_frame, DirectionBackward, WordGranularity);
2752 case WebEditingCommandType::DeleteWordForward: 2753 case WebEditingCommandType::DeleteWordForward:
2753 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward, 2754 return RangesFromCurrentSelectionOrExtendCaret(*m_frame, DirectionForward,
2754 WordGranularity); 2755 WordGranularity);
2755 default: 2756 default:
2756 return targetRangesForInputEvent(*target); 2757 return targetRangesForInputEvent(*target);
2757 } 2758 }
2758 } 2759 }
2759 2760
2760 } // namespace blink 2761 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698