Bug 1224101 part.1 Backout bug 1215816 from Aurora r=smaug a=ritu
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 17 Nov 2015 10:24:34 -0800
changeset 303749 b5ca0fa6c80c45fac4bdff9ef218cad3766f8ce0
parent 303748 40f1515c4d0530fcefc2f479da0a734f60ecea24
child 303750 ce2dd840a84ebb2176c65c2b537073c6d0c4f9c4
push idunknown
push userunknown
push dateunknown
reviewerssmaug, ritu
bugs1224101, 1215816
milestone44.0a2
Bug 1224101 part.1 Backout bug 1215816 from Aurora r=smaug a=ritu
dom/base/nsContentIterator.cpp
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -395,28 +395,17 @@ nsContentIterator::Init(nsIDOMRange* aDO
 
   // Find last node in range.
 
   bool endIsData = endNode->IsNodeOfType(nsINode::eDATA_NODE);
 
   if (endIsData || !endNode->HasChildren() || endIndx == 0) {
     if (mPre) {
       if (endNode->IsContent()) {
-        // If the end node is an empty element and the end offset is 0,
-        // the last element should be the previous node (i.e., shouldn't
-        // include the end node in the range).
-        if (!endIsData && !endNode->HasChildren() && !endIndx) {
-          mLast = GetPrevSibling(endNode);
-          if (!NodeIsInTraversalRange(mLast, mPre, startNode, startIndx,
-                                      endNode, endIndx)) {
-            mLast = nullptr;
-          }
-        } else {
-          mLast = endNode->AsContent();
-        }
+        mLast = endNode->AsContent();
       } else {
         // Not much else to do here...
         mLast = nullptr;
       }
     } else {
       // post-order
       //
       // XXX: In the future, if end offset is before the first character in the