Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Side by Side Diff: Source/core/editing/ApplyStyleCommand.cpp

Issue 332613003: Make RemoveFormat command to work with mixed editable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/editing/execCommand/remove-foramt-mixed-editable-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/remove-foramt-mixed-editable-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698