Backed out changeset 36687c035662 (bug 1463115) for frequent mochitest failures on Linux-debug
authorJonathan Kew <jkew@mozilla.com>
Fri, 01 Jun 2018 18:03:13 +0100
changeset 477647 f63e09b914570efce8e047f4f51aaf58ead46f75
parent 477646 7c76daa75842e03504329d23ecdfe0b723d02494
child 477648 9eabcc7a5eae3a16644bf06b5b0211e093251d66
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1463115
milestone62.0a1
backs out36687c035662d43b744ddb1ead29e65d139fae66
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
Backed out changeset 36687c035662 (bug 1463115) for frequent mochitest failures on Linux-debug
dom/base/nsRange.cpp
dom/base/nsRange.h
dom/chrome-webidl/InspectorUtils.webidl
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/generic/nsTextFrame.h
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3152,17 +3152,17 @@ nsRange::GetClientRectsAndTexts(
   nsLayoutUtils::RectListBuilder builder(aResult.mRectList);
 
   CollectClientRectsAndText(&builder, &aResult.mTextList, this,
     mStart.Container(), mStart.Offset(), mEnd.Container(), mEnd.Offset(), true, true);
 }
 
 nsresult
 nsRange::GetUsedFontFaces(nsTArray<nsAutoPtr<InspectorFontFace>>& aResult,
-                          uint32_t aMaxRanges, bool aSkipCollapsedWhitespace)
+                          uint32_t aMaxRanges)
 {
   NS_ENSURE_TRUE(mStart.Container(), NS_ERROR_UNEXPECTED);
 
   nsCOMPtr<nsINode> startContainer = do_QueryInterface(mStart.Container());
   nsCOMPtr<nsINode> endContainer = do_QueryInterface(mEnd.Container());
 
   // Flush out layout so our frames are up to date.
   nsIDocument* doc = mStart.Container()->OwnerDoc();
@@ -3196,30 +3196,27 @@ nsRange::GetUsedFontFaces(nsTArray<nsAut
       continue;
     }
 
     if (content->IsText()) {
        if (node == startContainer) {
          int32_t offset = startContainer == endContainer ?
            mEnd.Offset() : content->GetText()->GetLength();
          nsLayoutUtils::GetFontFacesForText(frame, mStart.Offset(), offset,
-                                            true, fontFaces, aMaxRanges,
-                                            aSkipCollapsedWhitespace);
+                                            true, fontFaces, aMaxRanges);
          continue;
        }
        if (node == endContainer) {
          nsLayoutUtils::GetFontFacesForText(frame, 0, mEnd.Offset(),
-                                            true, fontFaces, aMaxRanges,
-                                            aSkipCollapsedWhitespace);
+                                            true, fontFaces, aMaxRanges);
          continue;
        }
     }
 
-    nsLayoutUtils::GetFontFacesForFrames(frame, fontFaces, aMaxRanges,
-                                         aSkipCollapsedWhitespace);
+    nsLayoutUtils::GetFontFacesForFrames(frame, fontFaces, aMaxRanges);
   }
 
   // Take ownership of the InspectorFontFaces in the table and move them into
   // the aResult outparam.
   for (auto iter = fontFaces.Iter(); !iter.Done(); iter.Next()) {
     aResult.AppendElement(std::move(iter.Data()));
   }
 
--- a/dom/base/nsRange.h
+++ b/dom/base/nsRange.h
@@ -265,18 +265,17 @@ public:
     return parentNode;
   }
 
   // aMaxRanges is the maximum number of text ranges to record for each face
   // (pass 0 to just get the list of faces, without recording exact ranges
   // where each face was used).
   nsresult GetUsedFontFaces(
       nsTArray<nsAutoPtr<mozilla::dom::InspectorFontFace>>& aResult,
-      uint32_t aMaxRanges,
-      bool aSkipCollapsedWhitespace);
+      uint32_t aMaxRanges);
 
   // nsIMutationObserver methods
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
   NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
 
--- a/dom/chrome-webidl/InspectorUtils.webidl
+++ b/dom/chrome-webidl/InspectorUtils.webidl
@@ -60,18 +60,17 @@ namespace InspectorUtils {
 
   // Get the font face(s) actually used to render the text in /range/,
   // as a collection of InspectorFontFace objects (below).
   // If /maxRanges/ is greater than zero, each InspectorFontFace will record
   // up to /maxRanges/ fragments of content that used the face, for the caller
   // to access via its .ranges attribute.
   [NewObject, Throws] sequence<InspectorFontFace> getUsedFontFaces(
       Range range,
-      optional unsigned long maxRanges = 0,
-      optional boolean skipCollapsedWhitespace = true);
+      optional unsigned long maxRanges = 0);
 
   sequence<DOMString> getCSSPseudoElementNames();
   void addPseudoClassLock(Element element,
                           DOMString pseudoClass,
                           optional boolean enabled = true);
   void removePseudoClassLock(Element element, DOMString pseudoClass);
   boolean hasPseudoClassLock(Element element, DOMString pseudoClass);
   void clearPseudoClassLocks(Element element);
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -7846,54 +7846,49 @@ nsLayoutUtils::AssertTreeOnlyEmptyNextIn
     }
   }
 }
 #endif
 
 static void
 GetFontFacesForFramesInner(nsIFrame* aFrame,
                            nsLayoutUtils::UsedFontFaceTable& aFontFaces,
-                           uint32_t aMaxRanges,
-                           bool aSkipCollapsedWhitespace)
+                           uint32_t aMaxRanges)
 {
   MOZ_ASSERT(aFrame, "NULL frame pointer");
 
   if (aFrame->IsTextFrame()) {
     if (!aFrame->GetPrevContinuation()) {
       nsLayoutUtils::GetFontFacesForText(aFrame, 0, INT32_MAX, true,
-                                         aFontFaces, aMaxRanges,
-                                         aSkipCollapsedWhitespace);
+                                         aFontFaces, aMaxRanges);
     }
     return;
   }
 
   nsIFrame::ChildListID childLists[] = { nsIFrame::kPrincipalList,
                                          nsIFrame::kPopupList };
   for (size_t i = 0; i < ArrayLength(childLists); ++i) {
     nsFrameList children(aFrame->GetChildList(childLists[i]));
     for (nsFrameList::Enumerator e(children); !e.AtEnd(); e.Next()) {
       nsIFrame* child = e.get();
       child = nsPlaceholderFrame::GetRealFrameFor(child);
-      GetFontFacesForFramesInner(child, aFontFaces, aMaxRanges,
-                                 aSkipCollapsedWhitespace);
+      GetFontFacesForFramesInner(child, aFontFaces, aMaxRanges);
     }
   }
 }
 
 /* static */ nsresult
 nsLayoutUtils::GetFontFacesForFrames(nsIFrame* aFrame,
                                      UsedFontFaceTable& aFontFaces,
-                                     uint32_t aMaxRanges,
-                                     bool aSkipCollapsedWhitespace)
+                                     uint32_t aMaxRanges)
 {
   MOZ_ASSERT(aFrame, "NULL frame pointer");
 
   while (aFrame) {
-    GetFontFacesForFramesInner(aFrame, aFontFaces, aMaxRanges,
-                               aSkipCollapsedWhitespace);
+    GetFontFacesForFramesInner(aFrame, aFontFaces, aMaxRanges);
     aFrame = GetNextContinuationOrIBSplitSibling(aFrame);
   }
 
   return NS_OK;
 }
 
 static void
 AddFontsFromTextRun(gfxTextRun* aTextRun,
@@ -7954,18 +7949,17 @@ AddFontsFromTextRun(gfxTextRun* aTextRun
 }
 
 /* static */ void
 nsLayoutUtils::GetFontFacesForText(nsIFrame* aFrame,
                                    int32_t aStartOffset,
                                    int32_t aEndOffset,
                                    bool aFollowContinuations,
                                    UsedFontFaceTable& aFontFaces,
-                                   uint32_t aMaxRanges,
-                                   bool aSkipCollapsedWhitespace)
+                                   uint32_t aMaxRanges)
 {
   MOZ_ASSERT(aFrame, "NULL frame pointer");
 
   if (!aFrame->IsTextFrame()) {
     return;
   }
 
   if (!aFrame->StyleVisibility()->IsVisible()) {
@@ -7995,23 +7989,19 @@ nsLayoutUtils::GetFontFacesForText(nsIFr
       next = static_cast<nsTextFrame*>(curr->GetNextContinuation());
       while (next && next->GetTextRun(nsTextFrame::eInflated) == textRun) {
         fend = std::min(next->GetContentEnd(), aEndOffset);
         next = fend < aEndOffset ?
           static_cast<nsTextFrame*>(next->GetNextContinuation()) : nullptr;
       }
     }
 
-    if (!aSkipCollapsedWhitespace ||
-        (curr->HasAnyNoncollapsedCharacters() &&
-         curr->HasNonSuppressedText())) {
-      gfxTextRun::Range range(iter.ConvertOriginalToSkipped(fstart),
-                              iter.ConvertOriginalToSkipped(fend));
-      AddFontsFromTextRun(textRun, curr, iter, range, aFontFaces, aMaxRanges);
-    }
+    gfxTextRun::Range range(iter.ConvertOriginalToSkipped(fstart),
+                            iter.ConvertOriginalToSkipped(fend));
+    AddFontsFromTextRun(textRun, curr, iter, range, aFontFaces, aMaxRanges);
 
     curr = next;
   } while (aFollowContinuations && curr);
 }
 
 /* static */
 size_t
 nsLayoutUtils::SizeOfTextRunsForFrames(nsIFrame* aFrame,
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2283,33 +2283,31 @@ public:
 
   /**
    * Adds all font faces used in the frame tree starting from aFrame
    * to the list aFontFaceList.
    * aMaxRanges: maximum number of text ranges to record for each face.
    */
   static nsresult GetFontFacesForFrames(nsIFrame* aFrame,
                                         UsedFontFaceTable& aResult,
-                                        uint32_t aMaxRanges,
-                                        bool aSkipCollapsedWhitespace);
+                                        uint32_t aMaxRanges);
 
   /**
    * Adds all font faces used within the specified range of text in aFrame,
    * and optionally its continuations, to the list in aFontFaceList.
    * Pass 0 and INT32_MAX for aStartOffset and aEndOffset to specify the
    * entire text is to be considered.
    * aMaxRanges: maximum number of text ranges to record for each face.
    */
   static void GetFontFacesForText(nsIFrame* aFrame,
                                   int32_t aStartOffset,
                                   int32_t aEndOffset,
                                   bool aFollowContinuations,
                                   UsedFontFaceTable& aResult,
-                                  uint32_t aMaxRanges,
-                                  bool aSkipCollapsedWhitespace);
+                                  uint32_t aMaxRanges);
 
   /**
    * Walks the frame tree starting at aFrame looking for textRuns.
    * If |clear| is true, just clears the TEXT_RUN_MEMORY_ACCOUNTED flag
    * on each textRun found (and |aMallocSizeOf| is not used).
    * If |clear| is false, adds the storage used for each textRun to the
    * total, and sets the TEXT_RUN_MEMORY_ACCOUNTED flag to avoid double-
    * accounting. (Runs with this flag already set will be skipped.)
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -661,18 +661,16 @@ public:
 
   bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
 
   void AssignJustificationGaps(const mozilla::JustificationAssignment& aAssign);
   mozilla::JustificationAssignment GetJustificationAssignment() const;
 
   uint32_t CountGraphemeClusters() const;
 
-  bool HasAnyNoncollapsedCharacters() override;
-
 protected:
   virtual ~nsTextFrame();
 
   RefPtr<gfxTextRun> mTextRun;
   nsTextFrame* mNextContinuation;
   // The key invariant here is that mContentOffset never decreases along
   // a next-continuation chain. And of course mContentOffset is always <= the
   // the text node's content length, and the mContentOffset for the first frame
@@ -879,16 +877,18 @@ protected:
     SelectionType aSelectionType);
 
   ContentOffsets GetCharacterOffsetAtFramePointInternal(
     const nsPoint& aPoint,
     bool aForInsertionPoint);
 
   void ClearFrameOffsetCache();
 
+  bool HasAnyNoncollapsedCharacters() override;
+
   void ClearMetrics(ReflowOutput& aMetrics);
 
   /**
    * UpdateIteratorFromOffset() updates the iterator from a given offset.
    * Also, aInOffset may be updated to cluster start if aInOffset isn't
    * the offset of cluster start.
    */
   void UpdateIteratorFromOffset(const PropertyProvider& aProperties,
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -612,22 +612,20 @@ InspectorUtils::GetCleanComputedStyleFor
 
   return nsComputedDOMStyle::GetComputedStyle(aElement, aPseudo);
 }
 
 /* static */ void
 InspectorUtils::GetUsedFontFaces(GlobalObject& aGlobalObject,
                                  nsRange& aRange,
                                  uint32_t aMaxRanges,
-                                 bool aSkipCollapsedWhitespace,
                                  nsTArray<nsAutoPtr<InspectorFontFace>>& aResult,
                                  ErrorResult& aRv)
 {
-  nsresult rv = aRange.GetUsedFontFaces(aResult, aMaxRanges,
-                                        aSkipCollapsedWhitespace);
+  nsresult rv = aRange.GetUsedFontFaces(aResult, aMaxRanges);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
 }
 
 static EventStates
 GetStatesForPseudoClass(const nsAString& aStatePseudo)
 {
--- a/layout/inspector/InspectorUtils.h
+++ b/layout/inspector/InspectorUtils.h
@@ -220,17 +220,16 @@ public:
                                  bool aClearActiveDocument,
                                  ErrorResult& aRv);
   static uint64_t GetContentState(GlobalObject& aGlobal, Element& aElement);
 
   static void GetUsedFontFaces(GlobalObject& aGlobal,
                                nsRange& aRange,
                                uint32_t aMaxRanges, // max number of ranges to
                                                     // record for each face
-                               bool aSkipCollapsedWhitespace,
                                nsTArray<nsAutoPtr<InspectorFontFace>>& aResult,
                                ErrorResult& aRv);
 
   /**
    * Get the names of all the supported pseudo-elements.
    * Pseudo-elements which are only accepted in UA style sheets are
    * not included.
    */