Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 class LayoutPoint; | 37 class LayoutPoint; |
| 38 | 38 |
| 39 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; | 39 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; |
| 40 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft }; | 40 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft }; |
| 41 | 41 |
| 42 class CORE_EXPORT VisibleSelection { | 42 class CORE_EXPORT VisibleSelection { |
| 43 DISALLOW_ALLOCATION(); | 43 DISALLOW_ALLOCATION(); |
| 44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection); | 44 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(VisibleSelection); |
| 45 public: | 45 public: |
| 46 class InDOMTree { | |
|
tkent
2015/06/17 08:14:28
The name |InDOMTree| sounds weird though I have no
| |
| 47 public: | |
| 48 using PositionType = Position; | |
| 49 | |
| 50 static PositionType selectionBase(const VisibleSelection& selection) { r eturn selection.base(); } | |
| 51 static PositionType selectionExtent(const VisibleSelection& selection) { return selection.extent(); } | |
| 52 static PositionType selectionStart(const VisibleSelection& selection) { return selection.start(); } | |
| 53 static PositionType selectionEnd(const VisibleSelection& selection) { re turn selection.end(); } | |
| 54 }; | |
| 55 | |
| 46 VisibleSelection(); | 56 VisibleSelection(); |
| 47 | 57 |
| 48 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); | 58 VisibleSelection(const Position&, EAffinity, bool isDirectional = false); |
| 49 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); | 59 VisibleSelection(const Position&, const Position&, EAffinity = SEL_DEFAULT_A FFINITY, bool isDirectional = false); |
| 50 | 60 |
| 51 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false); | 61 explicit VisibleSelection(const Range*, EAffinity = SEL_DEFAULT_AFFINITY, bo ol isDirectional = false); |
| 52 | 62 |
| 53 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false ); | 63 explicit VisibleSelection(const VisiblePosition&, bool isDirectional = false ); |
| 54 VisibleSelection(const VisiblePosition&, const VisiblePosition&, bool isDire ctional = false); | 64 VisibleSelection(const VisiblePosition&, const VisiblePosition&, bool isDire ctional = false); |
| 55 | 65 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 | 209 |
| 200 } // namespace blink | 210 } // namespace blink |
| 201 | 211 |
| 202 #ifndef NDEBUG | 212 #ifndef NDEBUG |
| 203 // Outside the WebCore namespace for ease of invocation from gdb. | 213 // Outside the WebCore namespace for ease of invocation from gdb. |
| 204 void showTree(const blink::VisibleSelection&); | 214 void showTree(const blink::VisibleSelection&); |
| 205 void showTree(const blink::VisibleSelection*); | 215 void showTree(const blink::VisibleSelection*); |
| 206 #endif | 216 #endif |
| 207 | 217 |
| 208 #endif // VisibleSelection_h | 218 #endif // VisibleSelection_h |
| OLD | NEW |