| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 , m_inlineStyle(inlineStyle) | 48 , m_inlineStyle(inlineStyle) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 ApplyBlockElementCommand::ApplyBlockElementCommand(Document& document, const Qua
lifiedName& tagName) | 52 ApplyBlockElementCommand::ApplyBlockElementCommand(Document& document, const Qua
lifiedName& tagName) |
| 53 : CompositeEditCommand(document) | 53 : CompositeEditCommand(document) |
| 54 , m_tagName(tagName) | 54 , m_tagName(tagName) |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ApplyBlockElementCommand::doApply() | 58 void ApplyBlockElementCommand::doApply(EditingState*) |
| 59 { | 59 { |
| 60 if (!endingSelection().rootEditableElement()) | 60 if (!endingSelection().rootEditableElement()) |
| 61 return; | 61 return; |
| 62 | 62 |
| 63 VisiblePosition visibleEnd = endingSelection().visibleEnd(); | 63 VisiblePosition visibleEnd = endingSelection().visibleEnd(); |
| 64 VisiblePosition visibleStart = endingSelection().visibleStart(); | 64 VisiblePosition visibleStart = endingSelection().visibleStart(); |
| 65 if (visibleStart.isNull() || visibleStart.isOrphan() || visibleEnd.isNull()
|| visibleEnd.isOrphan()) | 65 if (visibleStart.isNull() || visibleStart.isOrphan() || visibleEnd.isNull()
|| visibleEnd.isOrphan()) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 // When a selection ends at the start of a paragraph, we rarely paint | 68 // When a selection ends at the start of a paragraph, we rarely paint |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return element.release(); | 293 return element.release(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 DEFINE_TRACE(ApplyBlockElementCommand) | 296 DEFINE_TRACE(ApplyBlockElementCommand) |
| 297 { | 297 { |
| 298 visitor->trace(m_endOfLastParagraph); | 298 visitor->trace(m_endOfLastParagraph); |
| 299 CompositeEditCommand::trace(visitor); | 299 CompositeEditCommand::trace(visitor); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace blink | 302 } // namespace blink |
| OLD | NEW |