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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1148 if (isStyledInlineElementToRemove(elem.get())) { | 1148 if (isStyledInlineElementToRemove(elem.get())) { |
1149 styleToPushDown = EditingStyle::create(); | 1149 styleToPushDown = EditingStyle::create(); |
1150 childNode = elem->firstChild(); | 1150 childNode = elem->firstChild(); |
1151 } | 1151 } |
1152 | 1152 |
1153 removeInlineStyleFromElement(style, elem.get(), RemoveIfNeeded, styl eToPushDown.get()); | 1153 removeInlineStyleFromElement(style, elem.get(), RemoveIfNeeded, styl eToPushDown.get()); |
1154 if (!elem->inDocument()) { | 1154 if (!elem->inDocument()) { |
1155 if (s.deprecatedNode() == elem) { | 1155 if (s.deprecatedNode() == elem) { |
1156 // Since elem must have been fully selected, and it is at th e start | 1156 // Since elem must have been fully selected, and it is at th e start |
1157 // of the selection, it is clear we can set the new s offset to 0. | 1157 // of the selection, it is clear we can set the new s offset to 0. |
1158 ASSERT(s.anchorType() == Position::PositionIsBeforeAnchor || s.offsetInContainerNode() <= 0); | 1158 ASSERT(s.anchorType() == Position::PositionIsBeforeAnchor || s.anchorType() == Position::PositionIsBeforeChildren || s.offsetInContainerNode () <= 0); |
Yuta Kitamura
2014/07/01 09:12:35
Who creates the position of type PositionIsBeforeC
yosin_UTC9
2014/07/02 03:30:36
In the attached test case, |firstPositionInOrBefor
Yuta Kitamura
2014/07/02 07:27:21
I don't understand your reasoning. This ASSERT is
yosin_UTC9
2014/07/02 08:04:03
The ASSERT and firstPositionInOrBeforeNode() is in
Yuta Kitamura
2014/07/03 05:11:29
Okay, I think this is an oversight from rniwa's ch
| |
1159 s = firstPositionInOrBeforeNode(next.get()); | 1159 s = firstPositionInOrBeforeNode(next.get()); |
1160 } | 1160 } |
1161 if (e.deprecatedNode() == elem) { | 1161 if (e.deprecatedNode() == elem) { |
1162 // Since elem must have been fully selected, and it is at th e end | 1162 // Since elem must have been fully selected, and it is at th e end |
1163 // of the selection, it is clear we can set the new e offset to | 1163 // of the selection, it is clear we can set the new e offset to |
1164 // the max range offset of prev. | 1164 // the max range offset of prev. |
1165 ASSERT(s.anchorType() == Position::PositionIsAfterAnchor || !offsetIsBeforeLastNodeOffset(s.offsetInContainerNode(), s.containerNode())); | 1165 ASSERT(s.anchorType() == Position::PositionIsAfterAnchor || !offsetIsBeforeLastNodeOffset(s.offsetInContainerNode(), s.containerNode())); |
1166 e = lastPositionInOrAfterNode(prev.get()); | 1166 e = lastPositionInOrAfterNode(prev.get()); |
1167 } | 1167 } |
1168 } | 1168 } |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1572 void ApplyStyleCommand::trace(Visitor* visitor) | 1572 void ApplyStyleCommand::trace(Visitor* visitor) |
1573 { | 1573 { |
1574 visitor->trace(m_style); | 1574 visitor->trace(m_style); |
1575 visitor->trace(m_start); | 1575 visitor->trace(m_start); |
1576 visitor->trace(m_end); | 1576 visitor->trace(m_end); |
1577 visitor->trace(m_styledInlineElement); | 1577 visitor->trace(m_styledInlineElement); |
1578 CompositeEditCommand::trace(visitor); | 1578 CompositeEditCommand::trace(visitor); |
1579 } | 1579 } |
1580 | 1580 |
1581 } | 1581 } |
OLD | NEW |