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

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-09T13:09:11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698