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

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

Issue 2868783005: Make ETextSecurity an enum class. (Closed)
Patch Set: Rebase Created 3 years, 7 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 2067
2068 bool IsInPasswordField(const Position& position) { 2068 bool IsInPasswordField(const Position& position) {
2069 TextControlElement* text_control = EnclosingTextControl(position); 2069 TextControlElement* text_control = EnclosingTextControl(position);
2070 return isHTMLInputElement(text_control) && 2070 return isHTMLInputElement(text_control) &&
2071 toHTMLInputElement(text_control)->type() == InputTypeNames::password; 2071 toHTMLInputElement(text_control)->type() == InputTypeNames::password;
2072 } 2072 }
2073 2073
2074 bool IsTextSecurityNode(const Node* node) { 2074 bool IsTextSecurityNode(const Node* node) {
2075 return node && node->GetLayoutObject() && 2075 return node && node->GetLayoutObject() &&
2076 node->GetLayoutObject()->Style()->TextSecurity() != TSNONE; 2076 node->GetLayoutObject()->Style()->TextSecurity() !=
2077 ETextSecurity::kNone;
2077 } 2078 }
2078 2079
2079 // If current position is at grapheme boundary, return 0; otherwise, return the 2080 // If current position is at grapheme boundary, return 0; otherwise, return the
2080 // distance to its nearest left grapheme boundary. 2081 // distance to its nearest left grapheme boundary.
2081 size_t ComputeDistanceToLeftGraphemeBoundary(const Position& position) { 2082 size_t ComputeDistanceToLeftGraphemeBoundary(const Position& position) {
2082 const Position& adjusted_position = PreviousPositionOf( 2083 const Position& adjusted_position = PreviousPositionOf(
2083 NextPositionOf(position, PositionMoveType::kGraphemeCluster), 2084 NextPositionOf(position, PositionMoveType::kGraphemeCluster),
2084 PositionMoveType::kGraphemeCluster); 2085 PositionMoveType::kGraphemeCluster);
2085 DCHECK_EQ(position.AnchorNode(), adjusted_position.AnchorNode()); 2086 DCHECK_EQ(position.AnchorNode(), adjusted_position.AnchorNode());
2086 DCHECK_GE(position.ComputeOffsetInContainerNode(), 2087 DCHECK_GE(position.ComputeOffsetInContainerNode(),
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 return InputType::kDeleteSoftLineBackward; 2205 return InputType::kDeleteSoftLineBackward;
2205 if (granularity == kParagraphBoundary) 2206 if (granularity == kParagraphBoundary)
2206 return InputType::kDeleteHardLineBackward; 2207 return InputType::kDeleteHardLineBackward;
2207 return InputType::kDeleteContentBackward; 2208 return InputType::kDeleteContentBackward;
2208 default: 2209 default:
2209 return InputType::kNone; 2210 return InputType::kNone;
2210 } 2211 }
2211 } 2212 }
2212 2213
2213 } // namespace blink 2214 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h ('k') | third_party/WebKit/Source/core/layout/LayoutText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698