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

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

Issue 2089993003: Get rid of EUpdateStyle parameter from isEditablePosition() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-27T14:42:23 Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class HTMLBRElement; 58 class HTMLBRElement;
59 class HTMLElement; 59 class HTMLElement;
60 class HTMLLIElement; 60 class HTMLLIElement;
61 class HTMLSpanElement; 61 class HTMLSpanElement;
62 class HTMLUListElement; 62 class HTMLUListElement;
63 class Node; 63 class Node;
64 class Range; 64 class Range;
65 65
66 // This file contains a set of helper functions used by the editing commands 66 // This file contains a set of helper functions used by the editing commands
67 67
68 CORE_EXPORT bool needsLayoutTreeUpdate(const Node&);
69 CORE_EXPORT bool needsLayoutTreeUpdate(const Position&);
70
68 // ------------------------------------------------------------------------- 71 // -------------------------------------------------------------------------
69 // Node 72 // Node
70 // ------------------------------------------------------------------------- 73 // -------------------------------------------------------------------------
71 74
72 // Functions returning Node 75 // Functions returning Node
73 76
74 // highestEditableRoot returns the highest editable node. If the 77 // highestEditableRoot returns the highest editable node. If the
75 // rootEditableElement of the speicified Position is <body>, this returns the 78 // rootEditableElement of the speicified Position is <body>, this returns the
76 // <body>. Otherwise, this searches ancestors for the highest editable node in 79 // <body>. Otherwise, this searches ancestors for the highest editable node in
77 // defiance of editing boundaries. This returns a Document if designMode="on" 80 // defiance of editing boundaries. This returns a Document if designMode="on"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // positions don't have common ancestor. 221 // positions don't have common ancestor.
219 int comparePositionsInDOMTree(Node* containerA, int offsetA, Node* containerB, i nt offsetB, bool* disconnected = nullptr); 222 int comparePositionsInDOMTree(Node* containerA, int offsetA, Node* containerB, i nt offsetB, bool* disconnected = nullptr);
220 int comparePositionsInFlatTree(Node* containerA, int offsetA, Node* containerB, int offsetB, bool* disconnected = nullptr); 223 int comparePositionsInFlatTree(Node* containerA, int offsetA, Node* containerB, int offsetB, bool* disconnected = nullptr);
221 // TODO(yosin): We replace |comparePositions()| by |Position::opeator<()| to 224 // TODO(yosin): We replace |comparePositions()| by |Position::opeator<()| to
222 // utilize |DCHECK_XX()|. 225 // utilize |DCHECK_XX()|.
223 int comparePositions(const Position&, const Position&); 226 int comparePositions(const Position&, const Position&);
224 int comparePositions(const PositionWithAffinity&, const PositionWithAffinity&); 227 int comparePositions(const PositionWithAffinity&, const PositionWithAffinity&);
225 228
226 // boolean functions on Position 229 // boolean functions on Position
227 230
228 enum EUpdateStyle { UpdateStyle, DoNotUpdateStyle };
229 // FIXME: Both isEditablePosition and isRichlyEditablePosition rely on up-to-dat e 231 // FIXME: Both isEditablePosition and isRichlyEditablePosition rely on up-to-dat e
230 // style to give proper results. They shouldn't update style by default, but 232 // style to give proper results. They shouldn't update style by default, but
231 // should make it clear that that is the contract. 233 // should make it clear that that is the contract.
232 // FIXME: isRichlyEditablePosition should also take EUpdateStyle. 234 CORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEdi table);
233 CORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEdi table, EUpdateStyle = UpdateStyle); 235 bool isEditablePosition(const PositionInFlatTree&, EditableType = ContentIsEdita ble);
234 bool isEditablePosition(const PositionInFlatTree&, EditableType = ContentIsEdita ble, EUpdateStyle = UpdateStyle);
235 bool isRichlyEditablePosition(const Position&, EditableType = ContentIsEditable) ; 236 bool isRichlyEditablePosition(const Position&, EditableType = ContentIsEditable) ;
236 bool lineBreakExistsAtPosition(const Position&); 237 bool lineBreakExistsAtPosition(const Position&);
237 bool isAtUnsplittableElement(const Position&); 238 bool isAtUnsplittableElement(const Position&);
238 239
239 // miscellaneous functions on Position 240 // miscellaneous functions on Position
240 241
241 enum WhitespacePositionOption { NotConsiderNonCollapsibleWhitespace, ConsiderNon CollapsibleWhitespace }; 242 enum WhitespacePositionOption { NotConsiderNonCollapsibleWhitespace, ConsiderNon CollapsibleWhitespace };
242 243
243 // |leadingWhitespacePosition(position)| returns a previous position of 244 // |leadingWhitespacePosition(position)| returns a previous position of
244 // |position| if it is at collapsible whitespace, otherwise it returns null 245 // |position| if it is at collapsible whitespace, otherwise it returns null
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // ------------------------------------------------------------------------- 354 // -------------------------------------------------------------------------
354 355
355 // Functions dispatch InputEvent 356 // Functions dispatch InputEvent
356 DispatchEventResult dispatchBeforeInputInsertText(EventTarget*, const String& da ta); 357 DispatchEventResult dispatchBeforeInputInsertText(EventTarget*, const String& da ta);
357 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget*, InputEvent: :InputType, const String& data, InputEvent::EventCancelable); 358 DispatchEventResult dispatchBeforeInputFromComposition(EventTarget*, InputEvent: :InputType, const String& data, InputEvent::EventCancelable);
358 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget*, InputEvent::I nputType, const String& data, const RangeVector*); 359 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget*, InputEvent::I nputType, const String& data, const RangeVector*);
359 360
360 } // namespace blink 361 } // namespace blink
361 362
362 #endif 363 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698