Source/core/editing/DeleteSelectionCommand.cpp
// This method removes div elements with no attributes that have only one child or no children at all.
This method removes div elements with no attributes that have only one child or no children at all.
This method removes div elements with no attributes that have only one child or no children at all .
void DeleteSelectionCommand::removeRedundantBlocks()
{
    Node* node = m_endingPosition.containerNode();
    Node* rootNode = node->rootEditableElement();
    while (node != rootNode) {
        if (isRemovableBlock(node)) {
            if (node == m_endingPosition.anchorNode())
                updatePositionForNodeRemovalPreservingChildren(m_endingPosition, *node);
            CompositeEditCommand::removeNodePreservingChildren(node);
            node = m_endingPosition.anchorNode();
        } else
            node = node->parentNode();
    }
}
void DeleteSelectionCommand :: removeRedundantBlocks ( ) { Node * node = m_endingPosition . containerNode ( ) ; Node * rootNode = node -> rootEditableElement ( ) ; while ( node != rootNode ) { if ( isRemovableBlock ( node ) ) { if ( node == m_endingPosition . anchorNode ( ) ) updatePositionForNodeRemovalPreservingChildren ( m_endingPosition , * node ) ; CompositeEditCommand :: removeNodePreservingChildren ( node ) ; node = m_endingPosition . anchorNode ( ) ; } else node = node -> parentNode ( ) ; } }
This method removes div elements with no attributes that have only one child or no children at all.
This method removes div elements with no attributes that have only one child or no children at all .