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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years 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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 } 949 }
950 950
951 template <typename Strategy> 951 template <typename Strategy>
952 TextDirection directionOfEnclosingBlockAlgorithm( 952 TextDirection directionOfEnclosingBlockAlgorithm(
953 const PositionTemplate<Strategy>& position) { 953 const PositionTemplate<Strategy>& position) {
954 Element* enclosingBlockElement = 954 Element* enclosingBlockElement =
955 enclosingBlock(PositionTemplate<Strategy>::firstPositionInOrBeforeNode( 955 enclosingBlock(PositionTemplate<Strategy>::firstPositionInOrBeforeNode(
956 position.computeContainerNode()), 956 position.computeContainerNode()),
957 CannotCrossEditingBoundary); 957 CannotCrossEditingBoundary);
958 if (!enclosingBlockElement) 958 if (!enclosingBlockElement)
959 return LTR; 959 return TextDirection::Ltr;
960 LayoutObject* layoutObject = enclosingBlockElement->layoutObject(); 960 LayoutObject* layoutObject = enclosingBlockElement->layoutObject();
961 return layoutObject ? layoutObject->style()->direction() : LTR; 961 return layoutObject ? layoutObject->style()->direction() : TextDirection::Ltr;
962 } 962 }
963 963
964 TextDirection directionOfEnclosingBlock(const Position& position) { 964 TextDirection directionOfEnclosingBlock(const Position& position) {
965 return directionOfEnclosingBlockAlgorithm<EditingStrategy>(position); 965 return directionOfEnclosingBlockAlgorithm<EditingStrategy>(position);
966 } 966 }
967 967
968 TextDirection directionOfEnclosingBlock(const PositionInFlatTree& position) { 968 TextDirection directionOfEnclosingBlock(const PositionInFlatTree& position) {
969 return directionOfEnclosingBlockAlgorithm<EditingInFlatTreeStrategy>( 969 return directionOfEnclosingBlockAlgorithm<EditingInFlatTreeStrategy>(
970 position); 970 position);
971 } 971 }
972 972
973 TextDirection primaryDirectionOf(const Node& node) { 973 TextDirection primaryDirectionOf(const Node& node) {
974 TextDirection primaryDirection = LTR; 974 TextDirection primaryDirection = TextDirection::Ltr;
975 for (const LayoutObject* r = node.layoutObject(); r; r = r->parent()) { 975 for (const LayoutObject* r = node.layoutObject(); r; r = r->parent()) {
976 if (r->isLayoutBlockFlow()) { 976 if (r->isLayoutBlockFlow()) {
977 primaryDirection = r->style()->direction(); 977 primaryDirection = r->style()->direction();
978 break; 978 break;
979 } 979 }
980 } 980 }
981 981
982 return primaryDirection; 982 return primaryDirection;
983 } 983 }
984 984
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 return InputType::DeleteWordBackward; 2142 return InputType::DeleteWordBackward;
2143 if (granularity == LineBoundary) 2143 if (granularity == LineBoundary)
2144 return InputType::DeleteLineBackward; 2144 return InputType::DeleteLineBackward;
2145 return InputType::DeleteContentBackward; 2145 return InputType::DeleteContentBackward;
2146 default: 2146 default:
2147 return InputType::None; 2147 return InputType::None;
2148 } 2148 }
2149 } 2149 }
2150 2150
2151 } // namespace blink 2151 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698