| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 RefPtrWillBeRawPtr<EditingStyle> typingStyle = nullptr; | 1125 RefPtrWillBeRawPtr<EditingStyle> typingStyle = nullptr; |
| 1126 if (frame().selection().typingStyle()) { | 1126 if (frame().selection().typingStyle()) { |
| 1127 typingStyle = frame().selection().typingStyle()->copy(); | 1127 typingStyle = frame().selection().typingStyle()->copy(); |
| 1128 typingStyle->overrideWithStyle(style); | 1128 typingStyle->overrideWithStyle(style); |
| 1129 } else { | 1129 } else { |
| 1130 typingStyle = EditingStyle::create(style); | 1130 typingStyle = EditingStyle::create(style); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 typingStyle->prepareToApplyAt(frame().selection().selection().visibleStart()
.deepEquivalent(), EditingStyle::PreserveWritingDirection); | 1133 typingStyle->prepareToApplyAt(frame().selection().selection().visibleStart()
.deepEquivalent(), EditingStyle::PreserveWritingDirection); |
| 1134 | 1134 |
| 1135 // Handle block styles, substracting these from the typing style. | 1135 // Handle block styles, subtracting these from the typing style. |
| 1136 RefPtrWillBeRawPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveB
lockProperties(); | 1136 RefPtrWillBeRawPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveB
lockProperties(); |
| 1137 if (!blockStyle->isEmpty()) { | 1137 if (!blockStyle->isEmpty()) { |
| 1138 ASSERT(frame().document()); | 1138 ASSERT(frame().document()); |
| 1139 ApplyStyleCommand::create(*frame().document(), blockStyle.get(), editing
Action)->apply(); | 1139 ApplyStyleCommand::create(*frame().document(), blockStyle.get(), editing
Action)->apply(); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 // Set the remaining style as the typing style. | 1142 // Set the remaining style as the typing style. |
| 1143 frame().selection().setTypingStyle(typingStyle); | 1143 frame().selection().setTypingStyle(typingStyle); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 DEFINE_TRACE(Editor) | 1303 DEFINE_TRACE(Editor) |
| 1304 { | 1304 { |
| 1305 visitor->trace(m_frame); | 1305 visitor->trace(m_frame); |
| 1306 visitor->trace(m_lastEditCommand); | 1306 visitor->trace(m_lastEditCommand); |
| 1307 visitor->trace(m_mark); | 1307 visitor->trace(m_mark); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 } // namespace blink | 1310 } // namespace blink |
| OLD | NEW |