From kde-commits Sun Jan 13 20:56:04 2008 From: Harri Porten Date: Sun, 13 Jan 2008 20:56:04 +0000 To: kde-commits Subject: branches/KDE/4.0/kdelibs/khtml/xml Message-Id: <1200257764.150076.7416.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120025777710882 SVN commit 760977 by porten: I am not sure I can interpret this from the wording of the spec. But if insertNode() of the Range interface should actually insert a node into the range we'll have to extend it. Found in an Acid3 test that inserted a node in collapsed range. M +4 -0 dom2_rangeimpl.cpp --- branches/KDE/4.0/kdelibs/khtml/xml/dom2_rangeimpl.cpp #760976:760977 @@ -803,9 +803,13 @@ if (exceptioncode) return; m_startContainer->parentNode()->insertBefore( newNode, newText, exceptioncode ); + // ### adapt range? } else { m_startContainer->insertBefore( newNode, m_startContainer->childNode( m_startOffset ), exceptioncode ); + if (exceptioncode) + return; + ++m_endOffset; } }