| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!m_fragment) | 150 if (!m_fragment) |
| 151 return; | 151 return; |
| 152 if (!m_fragment->firstChild()) | 152 if (!m_fragment->firstChild()) |
| 153 return; | 153 return; |
| 154 | 154 |
| 155 RefPtrWillBeRawPtr<Element> editableRoot = selection.rootEditableElement(); | 155 RefPtrWillBeRawPtr<Element> editableRoot = selection.rootEditableElement(); |
| 156 ASSERT(editableRoot); | 156 ASSERT(editableRoot); |
| 157 if (!editableRoot) | 157 if (!editableRoot) |
| 158 return; | 158 return; |
| 159 | 159 |
| 160 Node* shadowAncestorNode = editableRoot->deprecatedShadowAncestorNode(); | 160 Node* shadowAncestorNode; |
| 161 if (editableRoot->isInShadowTree()) |
| 162 shadowAncestorNode = editableRoot->shadowHost(); |
| 163 else |
| 164 shadowAncestorNode = editableRoot.get(); |
| 161 | 165 |
| 162 if (!editableRoot->getAttributeEventListener(EventTypeNames::webkitBeforeTex
tInserted) && | 166 if (!editableRoot->getAttributeEventListener(EventTypeNames::webkitBeforeTex
tInserted) && |
| 163 // FIXME: Remove these checks once textareas and textfields actually reg
ister an event handler. | 167 // FIXME: Remove these checks once textareas and textfields actually reg
ister an event handler. |
| 164 !(shadowAncestorNode && shadowAncestorNode->renderer() && shadowAncestor
Node->renderer()->isTextControl()) && | 168 !(shadowAncestorNode && shadowAncestorNode->renderer() && shadowAncestor
Node->renderer()->isTextControl()) && |
| 165 editableRoot->rendererIsRichlyEditable()) { | 169 editableRoot->rendererIsRichlyEditable()) { |
| 166 removeInterchangeNodes(m_fragment.get()); | 170 removeInterchangeNodes(m_fragment.get()); |
| 167 return; | 171 return; |
| 168 } | 172 } |
| 169 | 173 |
| 170 RefPtrWillBeRawPtr<Element> holder = insertFragmentForTestRendering(editable
Root.get()); | 174 RefPtrWillBeRawPtr<Element> holder = insertFragmentForTestRendering(editable
Root.get()); |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 void ReplaceSelectionCommand::trace(Visitor* visitor) | 1528 void ReplaceSelectionCommand::trace(Visitor* visitor) |
| 1525 { | 1529 { |
| 1526 visitor->trace(m_startOfInsertedContent); | 1530 visitor->trace(m_startOfInsertedContent); |
| 1527 visitor->trace(m_endOfInsertedContent); | 1531 visitor->trace(m_endOfInsertedContent); |
| 1528 visitor->trace(m_insertionStyle); | 1532 visitor->trace(m_insertionStyle); |
| 1529 visitor->trace(m_documentFragment); | 1533 visitor->trace(m_documentFragment); |
| 1530 CompositeEditCommand::trace(visitor); | 1534 CompositeEditCommand::trace(visitor); |
| 1531 } | 1535 } |
| 1532 | 1536 |
| 1533 } // namespace WebCore | 1537 } // namespace WebCore |
| OLD | NEW |