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

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

Issue 2882093002: Make EUserSelect 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 973
974 for (Node& runner : NodeTraversal::AncestorsOf(node)) { 974 for (Node& runner : NodeTraversal::AncestorsOf(node)) {
975 if (IsBlockFlowElement(runner) || isHTMLBodyElement(runner)) 975 if (IsBlockFlowElement(runner) || isHTMLBodyElement(runner))
976 return ToElement(&runner); 976 return ToElement(&runner);
977 } 977 }
978 return nullptr; 978 return nullptr;
979 } 979 }
980 980
981 EUserSelect UsedValueOfUserSelect(const Node& node) { 981 EUserSelect UsedValueOfUserSelect(const Node& node) {
982 if (node.IsHTMLElement() && ToHTMLElement(node).IsTextControl()) 982 if (node.IsHTMLElement() && ToHTMLElement(node).IsTextControl())
983 return SELECT_TEXT; 983 return EUserSelect::kText;
984 if (!node.GetLayoutObject()) 984 if (!node.GetLayoutObject())
985 return SELECT_NONE; 985 return EUserSelect::kNone;
986 986
987 const ComputedStyle* style = node.GetLayoutObject()->Style(); 987 const ComputedStyle* style = node.GetLayoutObject()->Style();
988 if (style->UserModify() != EUserModify::kReadOnly) 988 if (style->UserModify() != EUserModify::kReadOnly)
989 return SELECT_TEXT; 989 return EUserSelect::kText;
990 990
991 return style->UserSelect(); 991 return style->UserSelect();
992 } 992 }
993 993
994 template <typename Strategy> 994 template <typename Strategy>
995 TextDirection DirectionOfEnclosingBlockAlgorithm( 995 TextDirection DirectionOfEnclosingBlockAlgorithm(
996 const PositionTemplate<Strategy>& position) { 996 const PositionTemplate<Strategy>& position) {
997 Element* enclosing_block_element = 997 Element* enclosing_block_element =
998 EnclosingBlock(PositionTemplate<Strategy>::FirstPositionInOrBeforeNode( 998 EnclosingBlock(PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(
999 position.ComputeContainerNode()), 999 position.ComputeContainerNode()),
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 return InputType::kDeleteSoftLineBackward; 2205 return InputType::kDeleteSoftLineBackward;
2206 if (granularity == kParagraphBoundary) 2206 if (granularity == kParagraphBoundary)
2207 return InputType::kDeleteHardLineBackward; 2207 return InputType::kDeleteHardLineBackward;
2208 return InputType::kDeleteContentBackward; 2208 return InputType::kDeleteContentBackward;
2209 default: 2209 default:
2210 return InputType::kNone; 2210 return InputType::kNone;
2211 } 2211 }
2212 } 2212 }
2213 2213
2214 } // namespace blink 2214 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStrategy.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698