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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 if (!m_node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) | 51 if (!m_node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) |
52 return; | 52 return; |
53 | 53 |
54 ExceptionCode ec = 0; | 54 ExceptionCode ec = 0; |
55 m_text = m_node->substringData(m_offset, m_count, ec); | 55 m_text = m_node->substringData(m_offset, m_count, ec); |
56 if (ec) | 56 if (ec) |
57 return; | 57 return; |
58 | 58 |
59 // Need to notify this before actually deleting the text | 59 // Need to notify this before actually deleting the text |
60 if (AXObjectCache* cache = document()->existingAXObjectCache()) | 60 if (AXObjectCache::accessibilityEnabled()) |
61 cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDel
eted, m_offset, m_text); | 61 document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AX
ObjectCache::AXTextDeleted, m_offset, m_text); |
62 | 62 |
63 m_node->deleteData(m_offset, m_count, ec); | 63 m_node->deleteData(m_offset, m_count, ec); |
64 } | 64 } |
65 | 65 |
66 void DeleteFromTextNodeCommand::doUnapply() | 66 void DeleteFromTextNodeCommand::doUnapply() |
67 { | 67 { |
68 ASSERT(m_node); | 68 ASSERT(m_node); |
69 | 69 |
70 if (!m_node->rendererIsEditable()) | 70 if (!m_node->rendererIsEditable()) |
71 return; | 71 return; |
72 | 72 |
73 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION); | 73 m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION); |
74 | 74 |
75 if (AXObjectCache* cache = document()->existingAXObjectCache()) | 75 if (AXObjectCache::accessibilityEnabled()) |
76 cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextIns
erted, m_offset, m_text); | 76 document()->axObjectCache()->nodeTextChangeNotification(m_node.get(), AX
ObjectCache::AXTextInserted, m_offset, m_text); |
77 } | 77 } |
78 | 78 |
79 #ifndef NDEBUG | 79 #ifndef NDEBUG |
80 void DeleteFromTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes) | 80 void DeleteFromTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes) |
81 { | 81 { |
82 addNodeAndDescendants(m_node.get(), nodes); | 82 addNodeAndDescendants(m_node.get(), nodes); |
83 } | 83 } |
84 #endif | 84 #endif |
85 | 85 |
86 } // namespace WebCore | 86 } // namespace WebCore |
OLD | NEW |