OLD | NEW |
---|---|
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 // Standard Annex #29, Unicode text segmentation[1]. | 51 // Standard Annex #29, Unicode text segmentation[1]. |
52 // [1] http://www.unicode.org/reports/tr29/ | 52 // [1] http://www.unicode.org/reports/tr29/ |
53 GraphemeCluster, | 53 GraphemeCluster, |
54 }; | 54 }; |
55 | 55 |
56 enum class DeleteDirection { | 56 enum class DeleteDirection { |
57 Forward, | 57 Forward, |
58 Backward, | 58 Backward, |
59 }; | 59 }; |
60 | 60 |
61 enum class EditCommandSource; | |
62 class CompositeEditCommand; | |
61 class Document; | 63 class Document; |
62 class Element; | 64 class Element; |
63 class HTMLElement; | 65 class HTMLElement; |
64 class HTMLSpanElement; | 66 class HTMLSpanElement; |
65 class Node; | 67 class Node; |
66 class Range; | 68 class Range; |
67 | 69 |
68 // This file contains a set of helper functions used by the editing commands | 70 // This file contains a set of helper functions used by the editing commands |
69 | 71 |
70 CORE_EXPORT bool needsLayoutTreeUpdate(const Node&); | 72 CORE_EXPORT bool needsLayoutTreeUpdate(const Node&); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 return character == '\'' || character == rightSingleQuotationMarkCharacter || | 406 return character == '\'' || character == rightSingleQuotationMarkCharacter || |
405 character == hebrewPunctuationGershayimCharacter; | 407 character == hebrewPunctuationGershayimCharacter; |
406 } | 408 } |
407 | 409 |
408 String stringWithRebalancedWhitespace(const String&, | 410 String stringWithRebalancedWhitespace(const String&, |
409 bool startIsStartOfParagraph, | 411 bool startIsStartOfParagraph, |
410 bool shouldEmitNBSPbeforeEnd); | 412 bool shouldEmitNBSPbeforeEnd); |
411 const String& nonBreakingSpaceString(); | 413 const String& nonBreakingSpaceString(); |
412 | 414 |
413 // ------------------------------------------------------------------------- | 415 // ------------------------------------------------------------------------- |
414 // Events | 416 // InputEvent |
415 // ------------------------------------------------------------------------- | 417 // ------------------------------------------------------------------------- |
416 | 418 |
417 // Functions dispatch InputEvent | |
418 DispatchEventResult dispatchBeforeInputInsertText(EventTarget*, | |
419 const String& data); | |
420 DispatchEventResult dispatchBeforeInputFromComposition( | |
421 EventTarget*, | |
422 InputEvent::InputType, | |
423 const String& data, | |
424 InputEvent::EventCancelable); | |
425 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget*, | |
426 InputEvent::InputType, | |
427 const RangeVector*); | |
428 DispatchEventResult dispatchBeforeInputDataTransfer(EventTarget*, | |
429 InputEvent::InputType, | |
430 DataTransfer*, | |
431 const RangeVector*); | |
chongz
2016/12/20 23:27:51
Combined into a single |dispatchBeforeInputEvent()
| |
432 | |
433 InputEvent::InputType deletionInputTypeFromTextGranularity(DeleteDirection, | 419 InputEvent::InputType deletionInputTypeFromTextGranularity(DeleteDirection, |
434 TextGranularity); | 420 TextGranularity); |
435 | 421 |
422 // TODO(chongz): Move |isComposingFromCommand()| and |isCancelableFromCommand| | |
423 // to 'CompositeEditCommand.cpp' after we've moved |Editor::appliedEditing()| to | |
424 // |CompositeEditCommand::appliedEditing()|. | |
425 // https://crbug.com/676001 | |
426 InputEvent::EventIsComposing isComposingFromCommand( | |
chongz
2016/12/20 23:27:51
Moved from |Editor.cpp::isComposingFromCommand()|.
| |
427 const CompositeEditCommand*); | |
428 InputEvent::EventCancelable isCancelableFromCommand( | |
chongz
2016/12/20 23:27:51
New method.
| |
429 const CompositeEditCommand*); | |
430 | |
431 // TODO(chongz): Move |dispatchBeforeInputEvent()| to 'CompositeEditCommand.cpp' | |
432 // after we've resolved the ordering issue WRT 'compositionupdate'. | |
433 // https://crbug.com/675820 | |
434 bool dispatchBeforeInputEvent(EditCommandSource, | |
chongz
2016/12/20 23:27:51
Combined from 4x |dispatchBeforeInput*()| above.
| |
435 LocalFrame*, | |
436 Node* target, | |
437 InputEvent::InputType, | |
438 const String& data, | |
439 DataTransfer*, | |
440 InputEvent::EventCancelable, | |
441 InputEvent::EventIsComposing, | |
442 const RangeVector*); | |
436 } // namespace blink | 443 } // namespace blink |
437 | 444 |
438 #endif | 445 #endif |
OLD | NEW |