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

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

Issue 1854583003: Make leadingWhitespacePosition() to respect "white-space" CSS property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-04-01T14:49:00 Created 4 years, 8 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, 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // FIXME: isRichlyEditablePosition should also take EUpdateStyle. 234 // FIXME: isRichlyEditablePosition should also take EUpdateStyle.
235 CORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEdi table, EUpdateStyle = UpdateStyle); 235 CORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEdi table, EUpdateStyle = UpdateStyle);
236 bool isEditablePosition(const PositionInFlatTree&, EditableType = ContentIsEdita ble, EUpdateStyle = UpdateStyle); 236 bool isEditablePosition(const PositionInFlatTree&, EditableType = ContentIsEdita ble, EUpdateStyle = UpdateStyle);
237 bool isRichlyEditablePosition(const Position&, EditableType = ContentIsEditable) ; 237 bool isRichlyEditablePosition(const Position&, EditableType = ContentIsEditable) ;
238 bool lineBreakExistsAtPosition(const Position&); 238 bool lineBreakExistsAtPosition(const Position&);
239 bool isAtUnsplittableElement(const Position&); 239 bool isAtUnsplittableElement(const Position&);
240 240
241 // miscellaneous functions on Position 241 // miscellaneous functions on Position
242 242
243 enum WhitespacePositionOption { NotConsiderNonCollapsibleWhitespace, ConsiderNon CollapsibleWhitespace }; 243 enum WhitespacePositionOption { NotConsiderNonCollapsibleWhitespace, ConsiderNon CollapsibleWhitespace };
244
245 // |leadingWhitespacePosition(position)| returns a previous position of
246 // |position| if it is at collapsible whitespace, otherwise it returns null
247 // position. When it is called with |NotConsiderNonCollapsibleWhitespace| and
248 // a previous position in a element which has CSS property "white-space:pre",
249 // or its variant, |leadingWhitespacePosition()| returns null position.
250 // TODO(yosin) We should rename |leadingWhitespacePosition()| to
251 // |leadingCollapsibleWhitespacePosition()| as this function really returns.
244 Position leadingWhitespacePosition(const Position&, TextAffinity, WhitespacePosi tionOption = NotConsiderNonCollapsibleWhitespace); 252 Position leadingWhitespacePosition(const Position&, TextAffinity, WhitespacePosi tionOption = NotConsiderNonCollapsibleWhitespace);
245 Position trailingWhitespacePosition(const Position&, TextAffinity, WhitespacePos itionOption = NotConsiderNonCollapsibleWhitespace); 253 Position trailingWhitespacePosition(const Position&, TextAffinity, WhitespacePos itionOption = NotConsiderNonCollapsibleWhitespace);
246 unsigned numEnclosingMailBlockquotes(const Position&); 254 unsigned numEnclosingMailBlockquotes(const Position&);
247 void updatePositionForNodeRemoval(Position&, Node&); 255 void updatePositionForNodeRemoval(Position&, Node&);
248 256
249 // ------------------------------------------------------------------------- 257 // -------------------------------------------------------------------------
250 // VisiblePosition 258 // VisiblePosition
251 // ------------------------------------------------------------------------- 259 // -------------------------------------------------------------------------
252 260
253 // Functions returning VisiblePosition 261 // Functions returning VisiblePosition
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us. 345 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us.
338 return character == '\'' || character == rightSingleQuotationMarkCharacter | | character == hebrewPunctuationGershayimCharacter; 346 return character == '\'' || character == rightSingleQuotationMarkCharacter | | character == hebrewPunctuationGershayimCharacter;
339 } 347 }
340 348
341 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph); 349 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph);
342 const String& nonBreakingSpaceString(); 350 const String& nonBreakingSpaceString();
343 351
344 } // namespace blink 352 } // namespace blink
345 353
346 #endif 354 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698