| OLD | NEW |
| 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 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 | 2075 |
| 2076 bool isTextSecurityNode(const Node* node) { | 2076 bool isTextSecurityNode(const Node* node) { |
| 2077 return node && node->layoutObject() && | 2077 return node && node->layoutObject() && |
| 2078 node->layoutObject()->style()->textSecurity() != TSNONE; | 2078 node->layoutObject()->style()->textSecurity() != TSNONE; |
| 2079 } | 2079 } |
| 2080 | 2080 |
| 2081 const StaticRangeVector* targetRangesForInputEvent(const Node& node) { | 2081 const StaticRangeVector* targetRangesForInputEvent(const Node& node) { |
| 2082 if (!hasRichlyEditableStyle(node)) | 2082 if (!hasRichlyEditableStyle(node)) |
| 2083 return nullptr; | 2083 return nullptr; |
| 2084 return new StaticRangeVector( | 2084 return new StaticRangeVector( |
| 2085 1, StaticRange::create( | 2085 1, StaticRange::create(createRange(firstEphemeralRangeOf( |
| 2086 firstRangeOf(node.document() | 2086 node.document() |
| 2087 .frame() | 2087 .frame() |
| 2088 ->selection() | 2088 ->selection() |
| 2089 .computeVisibleSelectionInDOMTreeDeprecated()))); | 2089 .computeVisibleSelectionInDOMTreeDeprecated())))); |
| 2090 } | 2090 } |
| 2091 | 2091 |
| 2092 DispatchEventResult dispatchBeforeInputInsertText(Node* target, | 2092 DispatchEventResult dispatchBeforeInputInsertText(Node* target, |
| 2093 const String& data) { | 2093 const String& data) { |
| 2094 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 2094 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
| 2095 return DispatchEventResult::NotCanceled; | 2095 return DispatchEventResult::NotCanceled; |
| 2096 if (!target) | 2096 if (!target) |
| 2097 return DispatchEventResult::NotCanceled; | 2097 return DispatchEventResult::NotCanceled; |
| 2098 // TODO(chongz): Pass appropriate |ranges| after it's defined on spec. | 2098 // TODO(chongz): Pass appropriate |ranges| after it's defined on spec. |
| 2099 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype | 2099 // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2169 return InputType::DeleteWordBackward; | 2169 return InputType::DeleteWordBackward; |
| 2170 if (granularity == LineBoundary) | 2170 if (granularity == LineBoundary) |
| 2171 return InputType::DeleteLineBackward; | 2171 return InputType::DeleteLineBackward; |
| 2172 return InputType::DeleteContentBackward; | 2172 return InputType::DeleteContentBackward; |
| 2173 default: | 2173 default: |
| 2174 return InputType::None; | 2174 return InputType::None; |
| 2175 } | 2175 } |
| 2176 } | 2176 } |
| 2177 | 2177 |
| 2178 } // namespace blink | 2178 } // namespace blink |
| OLD | NEW |