| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // feedback. | 256 // feedback. |
| 257 if (data == " " && !canEditRichly() && | 257 if (data == " " && !canEditRichly() && |
| 258 isCaretAtStartOfWrappedLine(frame().selection())) { | 258 isCaretAtStartOfWrappedLine(frame().selection())) { |
| 259 insertLineBreak(); | 259 insertLineBreak(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 return insertTextWithoutSendingTextEvent(data, false, event); | 262 return insertTextWithoutSendingTextEvent(data, false, event); |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool Editor::canEdit() const { | 265 bool Editor::canEdit() const { |
| 266 return frame().selection().rootEditableElement(); | 266 return frame() |
| 267 .selection() |
| 268 .computeVisibleSelectionInDOMTreeDeprecated() |
| 269 .rootEditableElement(); |
| 267 } | 270 } |
| 268 | 271 |
| 269 bool Editor::canEditRichly() const { | 272 bool Editor::canEditRichly() const { |
| 270 return frame() | 273 return frame() |
| 271 .selection() | 274 .selection() |
| 272 .computeVisibleSelectionInDOMTreeDeprecated() | 275 .computeVisibleSelectionInDOMTreeDeprecated() |
| 273 .isContentRichlyEditable(); | 276 .isContentRichlyEditable(); |
| 274 } | 277 } |
| 275 | 278 |
| 276 // WinIE uses onbeforecut and onbeforepaste to enables the cut and paste menu | 279 // WinIE uses onbeforecut and onbeforepaste to enables the cut and paste menu |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 | 1733 |
| 1731 DEFINE_TRACE(Editor) { | 1734 DEFINE_TRACE(Editor) { |
| 1732 visitor->trace(m_frame); | 1735 visitor->trace(m_frame); |
| 1733 visitor->trace(m_lastEditCommand); | 1736 visitor->trace(m_lastEditCommand); |
| 1734 visitor->trace(m_undoStack); | 1737 visitor->trace(m_undoStack); |
| 1735 visitor->trace(m_mark); | 1738 visitor->trace(m_mark); |
| 1736 visitor->trace(m_typingStyle); | 1739 visitor->trace(m_typingStyle); |
| 1737 } | 1740 } |
| 1738 | 1741 |
| 1739 } // namespace blink | 1742 } // namespace blink |
| OLD | NEW |