| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Even though this applyStyle operates on a Range, it still sets an | 218 // Even though this applyStyle operates on a Range, it still sets an |
| 219 // endingSelection(). It tries to set a VisibleSelection around the content | 219 // endingSelection(). It tries to set a VisibleSelection around the content |
| 220 // it operated on. So, that VisibleSelection will either | 220 // it operated on. So, that VisibleSelection will either |
| 221 // (a) select the line break we inserted, or it will | 221 // (a) select the line break we inserted, or it will |
| 222 // (b) be a caret just before the line break (if the line break is at the | 222 // (b) be a caret just before the line break (if the line break is at the |
| 223 // end of a block it isn't selectable). | 223 // end of a block it isn't selectable). |
| 224 // So, this next call sets the endingSelection() to a caret just after the | 224 // So, this next call sets the endingSelection() to a caret just after the |
| 225 // line break that we inserted, or just before it if it's at the end of a | 225 // line break that we inserted, or just before it if it's at the end of a |
| 226 // block. | 226 // block. |
| 227 SetEndingSelection(SelectionInDOMTree::Builder() | 227 SetEndingSelection(SelectionInDOMTree::Builder() |
| 228 .Collapse(EndingSelection().end()) | 228 .Collapse(EndingSelection().End()) |
| 229 .Build()); | 229 .Build()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 RebalanceWhitespace(); | 232 RebalanceWhitespace(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| OLD | NEW |