| 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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 | 1323 |
| 1324 bool shouldUpdateStart = start.isOffsetInAnchor() && start.computeContainerN
ode() == end.computeContainerNode(); | 1324 bool shouldUpdateStart = start.isOffsetInAnchor() && start.computeContainerN
ode() == end.computeContainerNode(); |
| 1325 Text* text = toText(end.anchorNode()); | 1325 Text* text = toText(end.anchorNode()); |
| 1326 splitTextNode(text, end.offsetInContainerNode()); | 1326 splitTextNode(text, end.offsetInContainerNode()); |
| 1327 | 1327 |
| 1328 Node* prevNode = text->previousSibling(); | 1328 Node* prevNode = text->previousSibling(); |
| 1329 if (!prevNode || !prevNode->isTextNode()) | 1329 if (!prevNode || !prevNode->isTextNode()) |
| 1330 return; | 1330 return; |
| 1331 | 1331 |
| 1332 Position newStart = shouldUpdateStart ? Position(toText(prevNode), start.off
setInContainerNode()) : start; | 1332 Position newStart = shouldUpdateStart ? Position(toText(prevNode), start.off
setInContainerNode()) : start; |
| 1333 updateStartEnd(newStart, lastPositionInNode(prevNode)); | 1333 updateStartEnd(newStart, Position::lastPositionInNode(prevNode)); |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Pos
ition& end) | 1336 void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Pos
ition& end) |
| 1337 { | 1337 { |
| 1338 DCHECK(start.computeContainerNode()->isTextNode()) << start; | 1338 DCHECK(start.computeContainerNode()->isTextNode()) << start; |
| 1339 | 1339 |
| 1340 Position newEnd; | 1340 Position newEnd; |
| 1341 if (start.computeContainerNode() == end.computeContainerNode()) | 1341 if (start.computeContainerNode() == end.computeContainerNode()) |
| 1342 newEnd = Position(end.computeContainerNode(), end.offsetInContainerNode(
) - start.offsetInContainerNode()); | 1342 newEnd = Position(end.computeContainerNode(), end.offsetInContainerNode(
) - start.offsetInContainerNode()); |
| 1343 else | 1343 else |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 DEFINE_TRACE(ApplyStyleCommand) | 1731 DEFINE_TRACE(ApplyStyleCommand) |
| 1732 { | 1732 { |
| 1733 visitor->trace(m_style); | 1733 visitor->trace(m_style); |
| 1734 visitor->trace(m_start); | 1734 visitor->trace(m_start); |
| 1735 visitor->trace(m_end); | 1735 visitor->trace(m_end); |
| 1736 visitor->trace(m_styledInlineElement); | 1736 visitor->trace(m_styledInlineElement); |
| 1737 CompositeEditCommand::trace(visitor); | 1737 CompositeEditCommand::trace(visitor); |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 } // namespace blink | 1740 } // namespace blink |
| OLD | NEW |