Bug 1596768 - Remove GetBindingParent usage in nsRange assertions. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 15 Nov 2019 16:17:46 +0000
changeset 502214 0ece9bc4cec274c87d92469c2b145621f4704cfd
parent 502213 8a8024c8caf0674a3c9509323e2a587e53c416be
child 502215 d7d66b80b6e5ca09a275ed0dc91e1d83fbd642ab
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1596768
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596768 - Remove GetBindingParent usage in nsRange assertions. r=smaug They want to check that the root is correct, do so explicitly. Depends on D53197 Differential Revision: https://phabricator.services.mozilla.com/D53198
dom/base/nsRange.cpp
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -929,20 +929,20 @@ void nsRange::DoSetRange(const RangeBoun
                RangeUtils::ComputeRootNode(aStartBoundary.Container()) &&
            aRootNode == RangeUtils::ComputeRootNode(aEndBoundary.Container())),
       "Wrong root");
 
   MOZ_ASSERT(
       !aRootNode || (!aStartBoundary.IsSet() && !aEndBoundary.IsSet()) ||
           (aStartBoundary.Container()->IsContent() &&
            aEndBoundary.Container()->IsContent() &&
-           aRootNode == static_cast<nsIContent*>(aStartBoundary.Container())
-                            ->GetBindingParent() &&
-           aRootNode == static_cast<nsIContent*>(aEndBoundary.Container())
-                            ->GetBindingParent()) ||
+           aRootNode ==
+               RangeUtils::ComputeRootNode(aStartBoundary.Container()) &&
+           aRootNode ==
+               RangeUtils::ComputeRootNode(aEndBoundary.Container())) ||
           (!aRootNode->GetParentNode() &&
            (aRootNode->IsDocument() || aRootNode->IsAttr() ||
             aRootNode->IsDocumentFragment() ||
             /*For backward compatibility*/
             aRootNode->IsContent())),
       "Bad root");
 
   if (mRoot != aRootNode) {