| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. | 2  * Copyright (C) 2005, 2008 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54 | 54 | 
| 55     if (!m_node->rendererIsEditable()) | 55     if (!m_node->rendererIsEditable()) | 
| 56         return; | 56         return; | 
| 57 | 57 | 
| 58     if (passwordEchoEnabled) { | 58     if (passwordEchoEnabled) { | 
| 59         RenderText* renderText = toRenderText(m_node->renderer()); | 59         RenderText* renderText = toRenderText(m_node->renderer()); | 
| 60         if (renderText && renderText->isSecure()) | 60         if (renderText && renderText->isSecure()) | 
| 61             renderText->momentarilyRevealLastTypedCharacter(m_offset + m_text.le
    ngth() - 1); | 61             renderText->momentarilyRevealLastTypedCharacter(m_offset + m_text.le
    ngth() - 1); | 
| 62     } | 62     } | 
| 63 | 63 | 
| 64     m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION_STATE); | 64     m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION); | 
| 65 | 65 | 
| 66     if (AXObjectCache* cache = document()->existingAXObjectCache()) | 66     if (AXObjectCache* cache = document()->existingAXObjectCache()) | 
| 67         cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextIns
    erted, m_offset, m_text); | 67         cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextIns
    erted, m_offset, m_text); | 
| 68 } | 68 } | 
| 69 | 69 | 
| 70 void InsertIntoTextNodeCommand::doUnapply() | 70 void InsertIntoTextNodeCommand::doUnapply() | 
| 71 { | 71 { | 
| 72     if (!m_node->rendererIsEditable()) | 72     if (!m_node->rendererIsEditable()) | 
| 73         return; | 73         return; | 
| 74 | 74 | 
| 75     // Need to notify this before actually deleting the text | 75     // Need to notify this before actually deleting the text | 
| 76     if (AXObjectCache* cache = document()->existingAXObjectCache()) | 76     if (AXObjectCache* cache = document()->existingAXObjectCache()) | 
| 77         cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDel
    eted, m_offset, m_text); | 77         cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDel
    eted, m_offset, m_text); | 
| 78 | 78 | 
| 79     m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION_STATE); | 79     m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION); | 
| 80 } | 80 } | 
| 81 | 81 | 
| 82 #ifndef NDEBUG | 82 #ifndef NDEBUG | 
| 83 void InsertIntoTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes) | 83 void InsertIntoTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes) | 
| 84 { | 84 { | 
| 85     addNodeAndDescendants(m_node.get(), nodes); | 85     addNodeAndDescendants(m_node.get(), nodes); | 
| 86 } | 86 } | 
| 87 #endif | 87 #endif | 
| 88 | 88 | 
| 89 } // namespace WebCore | 89 } // namespace WebCore | 
| OLD | NEW | 
|---|