| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (newSelection.isNone()) | 78 if (newSelection.isNone()) |
| 79 return; | 79 return; |
| 80 setEndingSelection(newSelection); | 80 setEndingSelection(newSelection); |
| 81 } | 81 } |
| 82 | 82 |
| 83 VisibleSelection selection = selectionForParagraphIteration(endingSelection(
)); | 83 VisibleSelection selection = selectionForParagraphIteration(endingSelection(
)); |
| 84 VisiblePosition startOfSelection = selection.visibleStart(); | 84 VisiblePosition startOfSelection = selection.visibleStart(); |
| 85 VisiblePosition endOfSelection = selection.visibleEnd(); | 85 VisiblePosition endOfSelection = selection.visibleEnd(); |
| 86 ASSERT(!startOfSelection.isNull()); | 86 ASSERT(!startOfSelection.isNull()); |
| 87 ASSERT(!endOfSelection.isNull()); | 87 ASSERT(!endOfSelection.isNull()); |
| 88 RefPtr<ContainerNode> startScope; | 88 RefPtrWillBeRawPtr<ContainerNode> startScope = nullptr; |
| 89 int startIndex = indexForVisiblePosition(startOfSelection, startScope); | 89 int startIndex = indexForVisiblePosition(startOfSelection, startScope); |
| 90 RefPtr<ContainerNode> endScope; | 90 RefPtrWillBeRawPtr<ContainerNode> endScope = nullptr; |
| 91 int endIndex = indexForVisiblePosition(endOfSelection, endScope); | 91 int endIndex = indexForVisiblePosition(endOfSelection, endScope); |
| 92 | 92 |
| 93 formatSelection(startOfSelection, endOfSelection); | 93 formatSelection(startOfSelection, endOfSelection); |
| 94 | 94 |
| 95 document().updateLayoutIgnorePendingStylesheets(); | 95 document().updateLayoutIgnorePendingStylesheets(); |
| 96 | 96 |
| 97 ASSERT(startScope == endScope); | 97 ASSERT(startScope == endScope); |
| 98 ASSERT(startIndex >= 0); | 98 ASSERT(startIndex >= 0); |
| 99 ASSERT(startIndex <= endIndex); | 99 ASSERT(startIndex <= endIndex); |
| 100 if (startScope == endScope && startIndex >= 0 && startIndex <= endIndex) { | 100 if (startScope == endScope && startIndex >= 0 && startIndex <= endIndex) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const | 283 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const |
| 284 { | 284 { |
| 285 RefPtr<Element> element = createHTMLElement(document(), m_tagName); | 285 RefPtr<Element> element = createHTMLElement(document(), m_tagName); |
| 286 if (m_inlineStyle.length()) | 286 if (m_inlineStyle.length()) |
| 287 element->setAttribute(styleAttr, m_inlineStyle); | 287 element->setAttribute(styleAttr, m_inlineStyle); |
| 288 return element.release(); | 288 return element.release(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } | 291 } |
| OLD | NEW |