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

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

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-02T16:51:41 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) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 2066
2067 bool isTextSecurityNode(const Node* node) { 2067 bool isTextSecurityNode(const Node* node) {
2068 return node && node->layoutObject() && 2068 return node && node->layoutObject() &&
2069 node->layoutObject()->style()->textSecurity() != TSNONE; 2069 node->layoutObject()->style()->textSecurity() != TSNONE;
2070 } 2070 }
2071 2071
2072 const StaticRangeVector* targetRangesForInputEvent(const Node& node) { 2072 const StaticRangeVector* targetRangesForInputEvent(const Node& node) {
2073 if (!hasRichlyEditableStyle(node)) 2073 if (!hasRichlyEditableStyle(node))
2074 return nullptr; 2074 return nullptr;
2075 return new StaticRangeVector( 2075 return new StaticRangeVector(
2076 1, StaticRange::create( 2076 1, StaticRange::create(createRange(firstEphemeralRangeOf(
2077 firstRangeOf(node.document() 2077 node.document()
2078 .frame() 2078 .frame()
2079 ->selection() 2079 ->selection()
2080 .computeVisibleSelectionInDOMTreeDeprecated()))); 2080 .computeVisibleSelectionInDOMTreeDeprecated()))));
2081 } 2081 }
2082 2082
2083 DispatchEventResult dispatchBeforeInputInsertText(Node* target, 2083 DispatchEventResult dispatchBeforeInputInsertText(Node* target,
2084 const String& data) { 2084 const String& data) {
2085 if (!RuntimeEnabledFeatures::inputEventEnabled()) 2085 if (!RuntimeEnabledFeatures::inputEventEnabled())
2086 return DispatchEventResult::NotCanceled; 2086 return DispatchEventResult::NotCanceled;
2087 if (!target) 2087 if (!target)
2088 return DispatchEventResult::NotCanceled; 2088 return DispatchEventResult::NotCanceled;
2089 // TODO(chongz): Pass appropriate |ranges| after it's defined on spec. 2089 // TODO(chongz): Pass appropriate |ranges| after it's defined on spec.
2090 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype 2090 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 return InputType::DeleteWordBackward; 2160 return InputType::DeleteWordBackward;
2161 if (granularity == LineBoundary) 2161 if (granularity == LineBoundary)
2162 return InputType::DeleteLineBackward; 2162 return InputType::DeleteLineBackward;
2163 return InputType::DeleteContentBackward; 2163 return InputType::DeleteContentBackward;
2164 default: 2164 default:
2165 return InputType::None; 2165 return InputType::None;
2166 } 2166 }
2167 } 2167 }
2168 2168
2169 } // namespace blink 2169 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698