WebCore:
Reviewed by Sam.
- fix http://bugs.webkit.org/show_bug.cgi?id=11997
Ranges are not fixed after mutation (affects Acid3 test 13)
Test: fast/dom/Range/mutation.html
* WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
and NodeWithIndexBefore.h.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
with call to Document::textRemoved.
(WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
with call to Document::textInserted.
(WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
and Document::shiftMarkers with call to Document::textRemoved.
(WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
and Document::shiftMarkers with call to Document::textRemoved and
Document::textInserted.
(WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::childrenChanged): Added a call to
Document::nodeChildrenChanged when the nmber of children was changed (and not
by the parser).
(WebCore::dispatchChildRemovalEvents): Updated for name change.
* dom/Document.cpp:
(WebCore::Document::~Document): Assert that all ranges are gone.
(WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
all ranges.
(WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
Added code to call nodeWillBeRemoved on all ranges.
(WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
also calls shiftMarkers.
(WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
calls removeMarkers and shiftMarkers.
(WebCore::Document::textNodesMerged): Added. Ca