| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2009 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 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 if (!parent_element || !parent_element->previousSibling()) | 1606 if (!parent_element || !parent_element->previousSibling()) |
| 1607 return; | 1607 return; |
| 1608 Node* first_text_node = parent_element->previousSibling()->lastChild(); | 1608 Node* first_text_node = parent_element->previousSibling()->lastChild(); |
| 1609 if (!first_text_node || !first_text_node->IsTextNode()) | 1609 if (!first_text_node || !first_text_node->IsTextNode()) |
| 1610 return; | 1610 return; |
| 1611 | 1611 |
| 1612 Position new_start = | 1612 Position new_start = |
| 1613 should_update_start | 1613 should_update_start |
| 1614 ? Position(ToText(first_text_node), start.OffsetInContainerNode()) | 1614 ? Position(ToText(first_text_node), start.OffsetInContainerNode()) |
| 1615 : start; | 1615 : start; |
| 1616 UpdateStartEnd(new_start, Position::AfterNode(first_text_node)); | 1616 UpdateStartEnd(new_start, Position::AfterNode(*first_text_node)); |
| 1617 } | 1617 } |
| 1618 | 1618 |
| 1619 bool ApplyStyleCommand::ShouldSplitTextElement(Element* element, | 1619 bool ApplyStyleCommand::ShouldSplitTextElement(Element* element, |
| 1620 EditingStyle* style) { | 1620 EditingStyle* style) { |
| 1621 if (!element || !element->IsHTMLElement()) | 1621 if (!element || !element->IsHTMLElement()) |
| 1622 return false; | 1622 return false; |
| 1623 | 1623 |
| 1624 return ShouldRemoveInlineStyleFromElement(style, ToHTMLElement(element)); | 1624 return ShouldRemoveInlineStyleFromElement(style, ToHTMLElement(element)); |
| 1625 } | 1625 } |
| 1626 | 1626 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 | 2046 |
| 2047 DEFINE_TRACE(ApplyStyleCommand) { | 2047 DEFINE_TRACE(ApplyStyleCommand) { |
| 2048 visitor->Trace(style_); | 2048 visitor->Trace(style_); |
| 2049 visitor->Trace(start_); | 2049 visitor->Trace(start_); |
| 2050 visitor->Trace(end_); | 2050 visitor->Trace(end_); |
| 2051 visitor->Trace(styled_inline_element_); | 2051 visitor->Trace(styled_inline_element_); |
| 2052 CompositeEditCommand::Trace(visitor); | 2052 CompositeEditCommand::Trace(visitor); |
| 2053 } | 2053 } |
| 2054 | 2054 |
| 2055 } // namespace blink | 2055 } // namespace blink |
| OLD | NEW |