Bug 1328540 - trim trailing whitespaces. draft
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 04 Jan 2017 23:55:16 +0800
changeset 455978 38d834622e3b0aef61e27e498d4b99fceff46ce6
parent 455977 e8d2314e9e97eefc886763b2c4a4dc666fa37152
child 541081 b4f83021ea25988e1cced3eea7195e3473655231
push id40336
push userjichen@mozilla.com
push dateWed, 04 Jan 2017 15:57:43 +0000
bugs1328540
milestone53.0a1
Bug 1328540 - trim trailing whitespaces. Trim trailing whitespaces for files that are touched in this bug: gfxTextRun.h gfxTextRun.cpp nsTextFrame.cpp nsCSSProps.cpp MozReview-Commit-ID: FmiW2QiCoFv
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxTextRun.h
layout/generic/nsTextFrame.cpp
layout/style/nsCSSProps.cpp
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -235,17 +235,17 @@ gfxTextRun::SetPotentialLineBreaks(Range
 
 gfxTextRun::LigatureData
 gfxTextRun::ComputeLigatureData(Range aPartRange,
                                 PropertyProvider *aProvider) const
 {
     NS_ASSERTION(aPartRange.start < aPartRange.end,
                  "Computing ligature data for empty range");
     NS_ASSERTION(aPartRange.end <= GetLength(), "Character length overflow");
-  
+
     LigatureData result;
     const CompressedGlyph *charGlyphs = mCharacterGlyphs;
 
     uint32_t i;
     for (i = aPartRange.start; !charGlyphs[i].IsLigatureGroupStart(); --i) {
         NS_ASSERTION(i > 0, "Ligature at the start of the run??");
     }
     result.mRange.start = i;
@@ -383,17 +383,17 @@ gfxTextRun::GetAdjustedSpacingArray(Rang
     return true;
 }
 
 void
 gfxTextRun::ShrinkToLigatureBoundaries(Range* aRange) const
 {
     if (aRange->start >= aRange->end)
         return;
-  
+
     const CompressedGlyph *charGlyphs = mCharacterGlyphs;
 
     while (aRange->start < aRange->end &&
            !charGlyphs[aRange->start].IsLigatureGroupStart()) {
         ++aRange->start;
     }
     if (aRange->end < GetLength()) {
         while (aRange->end > aRange->start &&
@@ -431,17 +431,17 @@ ClipPartialLigature(const gfxTextRun* aT
     if (aLigature->mClipAfterPart) {
         gfxFloat endEdge =
             aOrigin + aTextRun->GetDirection() * aLigature->mPartWidth;
         if (aTextRun->IsRightToLeft()) {
             *aStart = std::max(*aStart, endEdge);
         } else {
             *aEnd = std::min(*aEnd, endEdge);
         }
-    }    
+    }
 }
 
 void
 gfxTextRun::DrawPartialLigature(gfxFont *aFont, Range aRange,
                                 gfxPoint *aPt, PropertyProvider *aProvider,
                                 TextRunDrawParams& aParams,
                                 uint16_t aOrientation) const
 {
@@ -780,17 +780,17 @@ gfxTextRun::AccumulatePartialLigatureMet
     ClipPartialLigature(this, &bboxLeft, &bboxRight, origin, &data);
     metrics.mBoundingBox.x = bboxLeft;
     metrics.mBoundingBox.width = bboxRight - bboxLeft;
 
     // mBoundingBox is now relative to the left baseline origin for the entire
     // ligature. Shift it left.
     metrics.mBoundingBox.x -=
         IsRightToLeft() ? metrics.mAdvanceWidth - (data.mPartAdvance + data.mPartWidth)
-            : data.mPartAdvance;    
+            : data.mPartAdvance;
     metrics.mAdvanceWidth = data.mPartWidth;
 
     aMetrics->CombineWith(metrics, IsRightToLeft());
 }
 
 gfxTextRun::Metrics
 gfxTextRun::MeasureText(Range aRange,
                         gfxFont::BoundingBoxType aBoundingBoxType,
@@ -896,17 +896,17 @@ gfxTextRun::BreakAndMeasureText(uint32_t
                 GetAdjustedSpacing(this, bufferRange, aProvider, spacingBuffer);
             }
             if (haveHyphenation) {
                 aProvider->GetHyphenationBreaks(bufferRange, hyphenBuffer);
             }
         }
 
         // There can't be a word-wrap break opportunity at the beginning of the
-        // line: if the width is too small for even one character to fit, it 
+        // line: if the width is too small for even one character to fit, it
         // could be the first and last break opportunity on the line, and that
         // would trigger an infinite loop.
         if (aSuppressBreak != eSuppressAllBreaks &&
             (aSuppressBreak != eSuppressInitialBreak || i > aStart)) {
             bool atNaturalBreak = mCharacterGlyphs[i].CanBreakBefore() == 1;
             bool atHyphenationBreak = !atNaturalBreak &&
                 haveHyphenation && hyphenBuffer[i - bufferRange.start];
             bool atBreak = atNaturalBreak || atHyphenationBreak;
@@ -914,17 +914,17 @@ gfxTextRun::BreakAndMeasureText(uint32_t
                 aCanWordWrap && mCharacterGlyphs[i].IsClusterStart() &&
                 *aBreakPriority <= gfxBreakPriority::eWordWrapBreak;
 
             if (atBreak || wordWrapping) {
                 gfxFloat hyphenatedAdvance = advance;
                 if (atHyphenationBreak) {
                     hyphenatedAdvance += aProvider->GetHyphenWidth();
                 }
-            
+
                 if (lastBreak < 0 || width + hyphenatedAdvance - trimmableAdvance <= aWidth) {
                     // We can break here.
                     lastBreak = i;
                     lastBreakTrimmableChars = trimmableChars;
                     lastBreakTrimmableAdvance = trimmableAdvance;
                     lastBreakUsedHyphenation = atHyphenationBreak;
                     *aBreakPriority = atBreak ? gfxBreakPriority::eNormalBreak
                                               : gfxBreakPriority::eWordWrapBreak;
@@ -934,30 +934,30 @@ gfxTextRun::BreakAndMeasureText(uint32_t
                 advance = 0;
                 if (width - trimmableAdvance > aWidth) {
                     // No more text fits. Abort
                     aborted = true;
                     break;
                 }
             }
         }
-        
+
         gfxFloat charAdvance;
         if (i >= ligatureRange.start && i < ligatureRange.end) {
             charAdvance = GetAdvanceForGlyphs(Range(i, i + 1));
             if (haveSpacing) {
                 PropertyProvider::Spacing *space =
                     &spacingBuffer[i - bufferRange.start];
                 charAdvance += space->mBefore + space->mAfter;
             }
         } else {
             charAdvance =
                 ComputePartialLigatureWidth(Range(i, i + 1), aProvider);
         }
-        
+
         advance += charAdvance;
         if (aTrimWhitespace || aWhitespaceCanHang) {
             if (mCharacterGlyphs[i].CharIsSpace()) {
                 ++trimmableChars;
                 trimmableAdvance += charAdvance;
             } else {
                 trimmableAdvance = 0;
                 trimmableChars = 0;
@@ -1108,17 +1108,17 @@ gfxTextRun::AddGlyphRun(gfxFont *aFont, 
                         uint32_t aUTF16Offset, bool aForceNewRun,
                         uint16_t aOrientation)
 {
     NS_ASSERTION(aFont, "adding glyph run for null font!");
     NS_ASSERTION(aOrientation != gfxTextRunFactory::TEXT_ORIENT_VERTICAL_MIXED,
                  "mixed orientation should have been resolved");
     if (!aFont) {
         return NS_OK;
-    }    
+    }
     uint32_t numGlyphRuns = mGlyphRuns.Length();
     if (!aForceNewRun && numGlyphRuns > 0) {
         GlyphRun *lastGlyphRun = &mGlyphRuns[numGlyphRuns - 1];
 
         NS_ASSERTION(lastGlyphRun->mCharacterOffset <= aUTF16Offset,
                      "Glyph runs out of order (and run not forced)");
 
         // Don't append a run if the font is already the one we want
@@ -1368,17 +1368,17 @@ gfxTextRun::SetSpaceGlyph(gfxFont* aFont
     uint32_t flags = gfxTextRunFactory::TEXT_IS_8BIT |
                      gfxTextRunFactory::TEXT_IS_ASCII |
                      gfxTextRunFactory::TEXT_IS_PERSISTENT |
                      aOrientation;
     bool vertical =
         (GetFlags() & gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT) != 0;
     gfxShapedWord* sw = aFont->GetShapedWord(aDrawTarget,
                                              &space, 1,
-                                             gfxShapedWord::HashMix(0, ' '), 
+                                             gfxShapedWord::HashMix(0, ' '),
                                              Script::LATIN,
                                              vertical,
                                              mAppUnitsPerDevUnit,
                                              flags,
                                              nullptr);
     if (sw) {
         AddGlyphRun(aFont, gfxTextRange::kFontGroup, aCharIndex, false,
                     aOrientation);
@@ -1434,17 +1434,17 @@ gfxTextRun::FetchGlyphExtents(DrawTarget
         }
 
         uint32_t start = run.mCharacterOffset;
         uint32_t end = i + 1 < runCount ?
             mGlyphRuns[i + 1].mCharacterOffset : GetLength();
         bool fontIsSetup = false;
         uint32_t j;
         gfxGlyphExtents *extents = font->GetOrCreateGlyphExtents(mAppUnitsPerDevUnit);
-  
+
         for (j = start; j < end; ++j) {
             const gfxTextRun::CompressedGlyph *glyphData = &charGlyphs[j];
             if (glyphData->IsSimpleGlyph()) {
                 // If we're in speed mode, don't set up glyph extents here; we'll
                 // just return "optimistic" glyph bounds later
                 if (needsGlyphExtents) {
                     uint32_t glyphIndex = glyphData->GetSimpleGlyph();
                     if (!extents->IsGlyphKnown(glyphIndex)) {
@@ -1906,23 +1906,23 @@ gfxFontGroup *
 gfxFontGroup::Copy(const gfxFontStyle *aStyle)
 {
     gfxFontGroup *fg =
         new gfxFontGroup(mFamilyList, aStyle, mTextPerf,
                          mUserFontSet, mDevToCssSize);
     return fg;
 }
 
-bool 
+bool
 gfxFontGroup::IsInvalidChar(uint8_t ch)
 {
     return ((ch & 0x7f) < 0x20 || ch == 0x7f);
 }
 
-bool 
+bool
 gfxFontGroup::IsInvalidChar(char16_t ch)
 {
     // All printable 7-bit ASCII values are OK
     if (ch >= ' ' && ch < 0x7f) {
         return false;
     }
     // No point in sending non-printing control chars through font shaping
     if (ch <= 0x9f) {
@@ -3143,17 +3143,17 @@ gfxFontGroup::WhichPrefFontSupportsChar(
 
     return nullptr;
 }
 
 already_AddRefed<gfxFont>
 gfxFontGroup::WhichSystemFontSupportsChar(uint32_t aCh, uint32_t aNextCh,
                                           Script aRunScript)
 {
-    gfxFontEntry *fe = 
+    gfxFontEntry *fe =
         gfxPlatformFontList::PlatformFontList()->
             SystemFindFontForChar(aCh, aNextCh, aRunScript, &mStyle);
     if (fe) {
         bool wantBold = mStyle.ComputeWeight() >= 6;
         RefPtr<gfxFont> font =
             fe->FindOrMakeFont(&mStyle, wantBold && !fe->IsBold());
         return font.forget();
     }
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -66,25 +66,25 @@ struct gfxTextRunDrawCallbacks {
     bool mShouldPaintSVGGlyphs;
 };
 
 /**
  * gfxTextRun is an abstraction for drawing and measuring substrings of a run
  * of text. It stores runs of positioned glyph data, each run having a single
  * gfxFont. The glyphs are associated with a string of source text, and the
  * gfxTextRun APIs take parameters that are offsets into that source text.
- * 
+ *
  * gfxTextRuns are mostly immutable. The only things that can change are
  * inter-cluster spacing and line break placement. Spacing is always obtained
  * lazily by methods that need it, it is not cached. Line breaks are stored
  * persistently (insofar as they affect the shaping of glyphs; gfxTextRun does
  * not actually do anything to explicitly account for line breaks). Initially
  * there are no line breaks. The textrun can record line breaks before or after
  * any given cluster. (Line breaks specified inside clusters are ignored.)
- * 
+ *
  * It is important that zero-length substrings are handled correctly. This will
  * be on the test!
  */
 class gfxTextRun : public gfxShapedText
 {
     NS_INLINE_DECL_REFCOUNTING(gfxTextRun);
 
 protected:
@@ -159,33 +159,33 @@ public:
     };
 
     // All coordinates are in layout/app units
 
     /**
      * Set the potential linebreaks for a substring of the textrun. These are
      * the "allow break before" points. Initially, there are no potential
      * linebreaks.
-     * 
+     *
      * This can change glyphs and/or geometry! Some textruns' shapes
      * depend on potential line breaks (e.g., title-case-converting textruns).
      * This function is virtual so that those textruns can reshape themselves.
-     * 
+     *
      * @return true if this changed the linebreaks, false if the new line
      * breaks are the same as the old
      */
     virtual bool SetPotentialLineBreaks(Range aRange,
                                         const uint8_t* aBreakBefore);
 
     /**
      * Layout provides PropertyProvider objects. These allow detection of
      * potential line break points and computation of spacing. We pass the data
      * this way to allow lazy data acquisition; for example BreakAndMeasureText
      * will want to only ask for properties of text it's actually looking at.
-     * 
+     *
      * NOTE that requested spacing may not actually be applied, if the textrun
      * is unable to apply it in some context. Exception: spacing around a
      * whitespace character MUST always be applied.
      */
     class PropertyProvider {
     public:
         // Detect hyphenation break opportunities in the given range; breaks
         // not at cluster boundaries will be ignored.
@@ -234,29 +234,29 @@ public:
         gfxTextRunDrawCallbacks* callbacks = nullptr;
         explicit DrawParams(gfxContext* aContext) : context(aContext) {}
     };
 
     /**
      * Draws a substring. Uses only GetSpacing from aBreakProvider.
      * The provided point is the baseline origin on the left of the string
      * for LTR, on the right of the string for RTL.
-     * 
+     *
      * Drawing should respect advance widths in the sense that for LTR runs,
      *   Draw(Range(start, middle), pt, ...) followed by
      *   Draw(Range(middle, end), gfxPoint(pt.x + advance, pt.y), ...)
      * should have the same effect as
      *   Draw(Range(start, end), pt, ...)
      *
      * For RTL runs the rule is:
      *   Draw(Range(middle, end), pt, ...) followed by
      *   Draw(Range(start, middle), gfxPoint(pt.x + advance, pt.y), ...)
      * should have the same effect as
      *   Draw(Range(start, end), pt, ...)
-     * 
+     *
      * Glyphs should be drawn in logical content order, which can be significant
      * if they overlap (perhaps due to negative spacing).
      */
     void Draw(Range aRange, gfxPoint aPt, const DrawParams& aParams) const;
 
     /**
      * Draws the emphasis marks for this text run. Uses only GetSpacing
      * from aProvider. The provided point is the baseline origin of the
@@ -297,36 +297,36 @@ public:
     gfxFloat GetAdvanceWidth() const {
         return GetAdvanceWidth(Range(this), nullptr);
     }
 
     /**
      * Clear all stored line breaks for the given range (both before and after),
      * and then set the line-break state before aRange.start to aBreakBefore and
      * after the last cluster to aBreakAfter.
-     * 
+     *
      * We require that before and after line breaks be consistent. For clusters
      * i and i+1, we require that if there is a break after cluster i, a break
      * will be specified before cluster i+1. This may be temporarily violated
      * (e.g. after reflowing line L and before reflowing line L+1); to handle
      * these temporary violations, we say that there is a break betwen i and i+1
      * if a break is specified after i OR a break is specified before i+1.
-     * 
+     *
      * This can change textrun geometry! The existence of a linebreak can affect
      * the advance width of the cluster before the break (when kerning) or the
      * geometry of one cluster before the break or any number of clusters
      * after the break. (The one-cluster-before-the-break limit is somewhat
      * arbitrary; if some scripts require breaking it, then we need to
      * alter nsTextFrame::TrimTrailingWhitespace, perhaps drastically becase
      * it could affect the layout of frames before it...)
-     * 
+     *
      * We return true if glyphs or geometry changed, false otherwise. This
      * function is virtual so that gfxTextRun subclasses can reshape
      * properly.
-     * 
+     *
      * @param aAdvanceWidthDelta if non-null, returns the change in advance
      * width of the given range.
      */
     virtual bool SetLineBreaks(Range aRange,
                                bool aLineBreakBefore, bool aLineBreakAfter,
                                gfxFloat* aAdvanceWidthDelta);
 
     enum SuppressBreak {
@@ -383,17 +383,17 @@ public:
      * SetLineBreaks(aStart, N, aLineBreakBefore, N < aMaxLength, aProvider)
      *
      * @param aCanWordWrap true if we can break between any two grapheme
      * clusters. This is set by overflow-wrap|word-wrap: break-word
      *
      * @param aBreakPriority in/out the priority of the break opportunity
      * saved in the line. If we are prioritizing break opportunities, we will
      * not set a break with a lower priority. @see gfxBreakPriority.
-     * 
+     *
      * Note that negative advance widths are possible especially if negative
      * spacing is provided.
      */
     uint32_t BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
                                  bool aLineBreakBefore, gfxFloat aWidth,
                                  PropertyProvider *aProvider,
                                  SuppressBreak aSuppressBreak,
                                  gfxFloat *aTrimWhitespace,
@@ -586,21 +586,21 @@ public:
         Range mRange;
         // appunits advance to the start of the ligature part within the ligature;
         // never includes any spacing
         gfxFloat mPartAdvance;
         // appunits width of the ligature part; includes before-spacing
         // when the part is at the start of the ligature, and after-spacing
         // when the part is as the end of the ligature
         gfxFloat mPartWidth;
-        
+
         bool mClipBeforePart;
         bool mClipAfterPart;
     };
-    
+
     // return storage used by this run, for memory reporter;
     // nsTransformedTextRun needs to override this as it holds additional data
     virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
       MOZ_MUST_OVERRIDE;
     virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
       MOZ_MUST_OVERRIDE;
 
     // Get the size, if it hasn't already been gotten, marking as it goes.
@@ -671,17 +671,17 @@ protected:
      */
     static void* AllocateStorageForTextRun(size_t aSize, uint32_t aLength);
 
     // Pointer to the array of CompressedGlyph records; must be initialized
     // when the object is constructed.
     CompressedGlyph *mCharacterGlyphs;
 
 private:
-    // **** general helpers **** 
+    // **** general helpers ****
 
     // Get the total advance for a range of glyphs.
     int32_t GetAdvanceForGlyphs(Range aRange) const;
 
     // Spacing for characters outside the range aSpacingStart/aSpacingEnd
     // is assumed to be zero; such characters are not passed to aProvider.
     // This is useful to protect aProvider from being passed character indices
     // it is not currently able to handle.
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -122,17 +122,17 @@ struct TabWidthStore {
   // range will be ignored.)
   void ApplySpacing(gfxTextRun::PropertyProvider::Spacing *aSpacing,
                     uint32_t aOffset, uint32_t aLength);
 
   // Offset up to which tabs have been measured; positions beyond this have not
   // been calculated yet but may be appended if needed later.  It's a DOM
   // offset relative to the current frame's offset.
   uint32_t mLimit;
- 
+
   // Need to recalc tab offsets if frame content offset differs from this.
   int32_t mValidForContentOffset;
 
   // A TabWidth record for each tab character measured so far.
   nsTArray<TabWidth> mWidths;
 };
 
 namespace {
@@ -211,22 +211,22 @@ static const nsFrameState TEXT_REFLOW_FL
    TEXT_NO_RENDERED_GLYPHS;
 
 static const nsFrameState TEXT_WHITESPACE_FLAGS =
     TEXT_IS_ONLY_WHITESPACE |
     TEXT_ISNOT_ONLY_WHITESPACE;
 
 /*
  * Some general notes
- * 
+ *
  * Text frames delegate work to gfxTextRun objects. The gfxTextRun object
  * transforms text to positioned glyphs. It can report the geometry of the
  * glyphs and paint them. Text frames configure gfxTextRuns by providing text,
  * spacing, language, and other information.
- * 
+ *
  * A gfxTextRun can cover more than one DOM text node. This is necessary to
  * get kerning, ligatures and shaping for text that spans multiple text nodes
  * but is all the same font.
  *
  * The userdata for a gfxTextRun object can be:
  *
  *   - A nsTextFrame* in the case a text run maps to only one flow. In this
  *   case, the textrun's user data pointer is a pointer to mStartFrame for that
@@ -274,17 +274,17 @@ struct SimpleTextRunUserData {
 };
 
 /**
  * We use an array of these objects to record which text frames
  * are associated with the textrun. mStartFrame is the start of a list of
  * text frames. Some sequence of its continuations are covered by the textrun.
  * A content textnode can have at most one TextRunMappedFlow associated with it
  * for a given textrun.
- * 
+ *
  * mDOMOffsetToBeforeTransformOffset is added to DOM offsets for those frames to obtain
  * the offset into the before-transformation text of the textrun. It can be
  * positive (when a text node starts in the middle of a text run) or
  * negative (when a text run starts in the middle of a text node). Of course
  * it can also be zero.
  */
 struct TextRunMappedFlow {
   nsTextFrame* mStartFrame;
@@ -733,17 +733,17 @@ int32_t nsTextFrame::GetInFlowContentLen
   FlowLengthProperty* flowLength =
     static_cast<FlowLengthProperty*>(mContent->GetProperty(nsGkAtoms::flowlength));
 
   /**
    * This frame must start inside the cached flow. If the flow starts at
    * mContentOffset but this frame is empty, logically it might be before the
    * start of the cached flow.
    */
-  if (flowLength && 
+  if (flowLength &&
       (flowLength->mStartOffset < mContentOffset ||
        (flowLength->mStartOffset == mContentOffset && GetContentEnd() > mContentOffset)) &&
       flowLength->mEndFlowOffset > mContentOffset) {
 #ifdef DEBUG
     NS_ASSERTION(flowLength->mEndFlowOffset >= GetContentEnd(),
 		 "frame crosses fixed continuation boundary");
 #endif
     return flowLength->mEndFlowOffset - mContentOffset;
@@ -797,17 +797,17 @@ IsCSSWordSpacingSpace(const nsTextFragme
   case '\r':
   case '\t': return !aStyleText->WhiteSpaceIsSignificant();
   case '\n': return !aStyleText->NewlineIsSignificant(aFrame);
   default: return false;
   }
 }
 
 // Check whether the string aChars/aLength starts with space that's
-// trimmable according to CSS 'white-space:normal/nowrap'. 
+// trimmable according to CSS 'white-space:normal/nowrap'.
 static bool IsTrimmableSpace(const char16_t* aChars, uint32_t aLength)
 {
   NS_ASSERTION(aLength > 0, "No text for IsSpace!");
 
   char16_t ch = *aChars;
   if (ch == ' ')
     return !nsTextFrameUtils::IsSpaceCombiningSequenceTail(aChars + 1, aLength - 1);
   return ch == '\t' || ch == '\f' || ch == '\n' || ch == '\r';
@@ -1075,17 +1075,17 @@ public:
     nsTextFrame* mStartFrame;
     nsTextFrame* mEndFrame;
     // When we consider breaking between elements, the nearest common
     // ancestor of the elements containing the characters is the one whose
     // CSS 'white-space' property governs. So this records the nearest common
     // ancestor of mStartFrame and the previous text frame, or null if there
     // was no previous text frame on this line.
     nsIFrame*    mAncestorControllingInitialBreak;
-    
+
     int32_t GetContentEnd() {
       return mEndFrame ? mEndFrame->GetContentOffset()
           : mStartFrame->GetContent()->GetText()->GetLength();
     }
   };
 
   class BreakSink final : public nsILineBreakSink {
   public:
@@ -1100,17 +1100,17 @@ public:
                            uint8_t* aBreakBefore) override {
       gfxTextRun::Range range(aOffset + mOffsetIntoTextRun,
                               aOffset + mOffsetIntoTextRun + aLength);
       if (mTextRun->SetPotentialLineBreaks(range, aBreakBefore)) {
         // Be conservative and assume that some breaks have been set
         mTextRun->ClearFlagBits(nsTextFrameUtils::TEXT_NO_BREAKS);
       }
     }
-    
+
     virtual void SetCapitalization(uint32_t aOffset, uint32_t aLength,
                                    bool* aCapitalize) override {
       MOZ_ASSERT(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_TRANSFORMED,
                  "Text run should be transformed!");
       if (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_TRANSFORMED) {
         nsTransformedTextRun* transformedTextRun =
           static_cast<nsTransformedTextRun*>(mTextRun.get());
         transformedTextRun->SetCapitalization(aOffset + mOffsetIntoTextRun, aLength,
@@ -1276,17 +1276,17 @@ CanTextCrossFrameBoundary(nsIFrame* aFra
     } else {
       MOZ_ASSERT(aType != nsGkAtoms::rubyTextContainerFrame,
                  "Shouldn't call this method for ruby text container");
       result.mFrameToScan = nullptr;
       result.mOverflowFrameToScan = nullptr;
       result.mTextRunCanCrossFrameBoundary = false;
       result.mLineBreakerCanCrossFrameBoundary = false;
     }
-  }    
+  }
   return result;
 }
 
 BuildTextRunsScanner::FindBoundaryResult
 BuildTextRunsScanner::FindBoundaries(nsIFrame* aFrame, FindBoundaryState* aState)
 {
   nsIAtom* frameType = aFrame->GetType();
   if (frameType == nsGkAtoms::rubyTextContainerFrame) {
@@ -1305,17 +1305,17 @@ BuildTextRunsScanner::FindBoundaries(nsI
       if (aState->mSeenSpaceForLineBreakingOnThisLine)
         return FB_FOUND_VALID_TEXTRUN_BOUNDARY;
     }
     if (!aState->mFirstTextFrame) {
       aState->mFirstTextFrame = textFrame;
     }
     aState->mLastTextFrame = textFrame;
   }
-  
+
   if (aFrame == aState->mStopAtFrame)
     return FB_STOPPED_AT_STOP_FRAME;
 
   if (textFrame) {
     if (!aState->mSeenSpaceForLineBreakingOnThisLine) {
       const nsTextFragment* frag = textFrame->GetContent()->GetText();
       uint32_t start = textFrame->GetContentOffset();
       const void* text = frag->Is2b()
@@ -1323,27 +1323,27 @@ BuildTextRunsScanner::FindBoundaries(nsI
           : static_cast<const void*>(frag->Get1b() + start);
       if (TextContainsLineBreakerWhiteSpace(text, textFrame->GetContentLength(),
                                             frag->Is2b())) {
         aState->mSeenSpaceForLineBreakingOnThisLine = true;
         if (aState->mSeenTextRunBoundaryOnLaterLine)
           return FB_FOUND_VALID_TEXTRUN_BOUNDARY;
       }
     }
-    return FB_CONTINUE; 
+    return FB_CONTINUE;
   }
 
   FrameTextTraversal traversal =
     CanTextCrossFrameBoundary(aFrame, frameType);
   if (!traversal.mTextRunCanCrossFrameBoundary) {
     aState->mSeenTextRunBoundaryOnThisLine = true;
     if (aState->mSeenSpaceForLineBreakingOnThisLine)
       return FB_FOUND_VALID_TEXTRUN_BOUNDARY;
   }
-  
+
   for (nsIFrame* f = traversal.NextFrameToScan(); f;
        f = traversal.NextFrameToScan()) {
     FindBoundaryResult result = FindBoundaries(f, aState);
     if (result != FB_CONTINUE)
       return result;
   }
 
   if (!traversal.mTextRunCanCrossFrameBoundary) {
@@ -1357,17 +1357,17 @@ BuildTextRunsScanner::FindBoundaries(nsI
 
 // build text runs for the 200 lines following aForFrame, and stop after that
 // when we get a chance.
 #define NUM_LINES_TO_BUILD_TEXT_RUNS 200
 
 /**
  * General routine for building text runs. This is hairy because of the need
  * to build text runs that span content nodes.
- * 
+ *
  * @param aContext The gfxContext we're using to construct this text run.
  * @param aForFrame The nsTextFrame for which we're building this text run.
  * @param aLineContainer the line container containing aForFrame; if null,
  *        we'll walk the ancestors to find it.  It's required to be non-null
  *        when aForFrameLine is non-null.
  * @param aForFrameLine the line containing aForFrame; if null, we'll figure
  *        out the line (slowly)
  * @param aWhichTextRun The type of text run we want to build. If font inflation
@@ -1377,17 +1377,17 @@ static void
 BuildTextRuns(DrawTarget* aDrawTarget, nsTextFrame* aForFrame,
               nsIFrame* aLineContainer,
               const nsLineList::iterator* aForFrameLine,
               nsTextFrame::TextRunType aWhichTextRun)
 {
   MOZ_ASSERT(aForFrame, "for no frame?");
   NS_ASSERTION(!aForFrameLine || aLineContainer,
                "line but no line container");
-  
+
   nsIFrame* lineContainerChild = aForFrame;
   if (!aLineContainer) {
     if (aForFrame->IsFloatingFirstLetterChild()) {
       lineContainerChild = aForFrame->PresContext()->PresShell()->
         GetPlaceholderFrameFor(aForFrame->GetParent());
     }
     aLineContainer = FindLineContainer(lineContainerChild);
   } else {
@@ -1608,17 +1608,17 @@ void BuildTextRunsScanner::FlushFrames(b
         IsTextRunValidForMappedFlows(mCurrentFramesAllSameTextRun)) {
       // Optimization: We do not need to (re)build the textrun.
       textRun = mCurrentFramesAllSameTextRun;
 
       // Feed this run's text into the linebreaker to provide context.
       if (!SetupLineBreakerContext(textRun)) {
         return;
       }
- 
+
       // Update mNextRunContextInfo appropriately
       mNextRunContextInfo = nsTextFrameUtils::INCOMING_NONE;
       if (textRun->GetFlags() & nsTextFrameUtils::TEXT_TRAILING_WHITESPACE) {
         mNextRunContextInfo |= nsTextFrameUtils::INCOMING_WHITESPACE;
       }
       if (textRun->GetFlags() & gfxTextRunFactory::TEXT_TRAILING_ARABICCHAR) {
         mNextRunContextInfo |= nsTextFrameUtils::INCOMING_ARABICCHAR;
       }
@@ -2133,20 +2133,20 @@ BuildTextRunsScanner::BuildTextRunForFra
         if (NS_MATHML_IS_DTLS_SET(presData.flags)) {
           mathFlags |= MathMLTextRunFactory::MATH_FONT_FEATURE_DTLS;
           anyMathMLStyling = true;
         }
       }
     }
     nsIFrame* child = mLineContainer;
     uint8_t oldScriptLevel = 0;
-    while (parent && 
+    while (parent &&
            child->HasAnyStateBits(NS_FRAME_MATHML_SCRIPT_DESCENDANT)) {
       // Reconstruct the script level ignoring any user overrides. It is
-      // calculated this way instead of using scriptlevel to ensure the 
+      // calculated this way instead of using scriptlevel to ensure the
       // correct ssty font feature setting is used even if the user sets a
       // different (especially negative) scriptlevel.
       nsIMathMLFrame* mathFrame= do_QueryFrame(parent);
       if (mathFrame) {
         sstyScriptLevel += mathFrame->ScriptIncrement(child);
       }
       if (sstyScriptLevel < oldScriptLevel) {
         // overflow
@@ -2271,17 +2271,17 @@ BuildTextRunsScanner::BuildTextRunForFra
   }
 
   // Convert linebreak coordinates to transformed string offsets
   NS_ASSERTION(nextBreakIndex == mLineBreakBeforeFrames.Length(),
                "Didn't find all the frames to break-before...");
   gfxSkipCharsIterator iter(skipChars);
   AutoTArray<uint32_t,50> textBreakPointsAfterTransform;
   for (uint32_t i = 0; i < textBreakPoints.Length(); ++i) {
-    nsTextFrameUtils::AppendLineBreakOffset(&textBreakPointsAfterTransform, 
+    nsTextFrameUtils::AppendLineBreakOffset(&textBreakPointsAfterTransform,
             iter.ConvertOriginalToSkipped(textBreakPoints[i]));
   }
   if (mStartOfLine) {
     nsTextFrameUtils::AppendLineBreakOffset(&textBreakPointsAfterTransform,
                                             transformedLength);
   }
 
   // Setup factory chain
@@ -2616,17 +2616,17 @@ BuildTextRunsScanner::SetupBreakSinksFor
         mLineBreaker.AppendText(hyphenationLanguage, text + offset,
                                 length, flags, sink);
       } else {
         const uint8_t* text = reinterpret_cast<const uint8_t*>(aTextPtr);
         mLineBreaker.AppendText(hyphenationLanguage, text + offset,
                                 length, flags, sink);
       }
     }
-    
+
     iter = iterNext;
   }
 }
 
 static bool
 MayCharacterHaveEmphasisMark(uint32_t aCh)
 {
   auto category = unicode::GetGeneralCategory(aCh);
@@ -3052,17 +3052,17 @@ static bool IsInBounds(const gfxSkipChar
 
 class MOZ_STACK_CLASS PropertyProvider : public gfxTextRun::PropertyProvider {
   typedef gfxTextRun::Range Range;
 
 public:
   /**
    * Use this constructor for reflow, when we don't know what text is
    * really mapped by the frame and we have a lot of other data around.
-   * 
+   *
    * @param aLength can be INT32_MAX to indicate we cover all the text
    * associated with aFrame up to where its flow chain ends in the given
    * textrun. If INT32_MAX is passed, justification and hyphen-related methods
    * cannot be called, nor can GetOriginalLength().
    */
   PropertyProvider(gfxTextRun* aTextRun, const nsStyleText* aTextStyle,
                    const nsTextFragment* aFrag, nsTextFrame* aFrame,
                    const gfxSkipCharsIterator& aStart, int32_t aLength,
@@ -3181,17 +3181,17 @@ protected:
   gfxFontGroup*         mFontGroup;
   RefPtr<nsFontMetrics> mFontMetrics;
   const nsStyleText*    mTextStyle;
   const nsTextFragment* mFrag;
   nsIFrame*             mLineContainer;
   nsTextFrame*          mFrame;
   gfxSkipCharsIterator  mStart;  // Offset in original and transformed string
   gfxSkipCharsIterator  mTempIterator;
-  
+
   // Either null, or pointing to the frame's TabWidthProperty.
   TabWidthStore*        mTabWidths;
   // How far we've done tab-width calculation; this is ONLY valid when
   // mTabWidths is nullptr (otherwise rely on mTabWidths->mLimit instead).
   // It's a DOM offset relative to the current frame's offset.
   uint32_t              mTabWidthsAnalyzedLimit;
 
   int32_t               mLength; // DOM string length, may be INT32_MAX
@@ -3518,17 +3518,17 @@ PropertyProvider::CalcTabWidths(Range aR
         }
       } else {
         if (!mTabWidths) {
           mTabWidths = new TabWidthStore(mFrame->GetContentOffset());
           mFrame->Properties().Set(TabWidthProperty(), mTabWidths);
         }
         double nextTab = AdvanceToNextTab(mOffsetFromBlockOriginForTabs,
                 mFrame, mTextRun, aTabWidth);
-        mTabWidths->mWidths.AppendElement(TabWidth(i - startOffset, 
+        mTabWidths->mWidths.AppendElement(TabWidth(i - startOffset,
                 NSToIntRound(nextTab - mOffsetFromBlockOriginForTabs)));
         mOffsetFromBlockOriginForTabs = nextTab;
       }
 
       mOffsetFromBlockOriginForTabs += spacing.mAfter;
     }
 
     if (mTabWidths) {
@@ -3778,17 +3778,17 @@ nsTextPaintStyle::GetSelectionColors(nsc
 }
 
 void
 nsTextPaintStyle::GetHighlightColors(nscolor* aForeColor,
                                      nscolor* aBackColor)
 {
   NS_ASSERTION(aForeColor, "aForeColor is null");
   NS_ASSERTION(aBackColor, "aBackColor is null");
-  
+
   nscolor backColor =
     LookAndFeel::GetColor(LookAndFeel::eColorID_TextHighlightBackground);
   nscolor foreColor =
     LookAndFeel::GetColor(LookAndFeel::eColorID_TextHighlightForeground);
   EnsureSufficientContrast(&foreColor, &backColor);
   *aForeColor = foreColor;
   *aBackColor = backColor;
 }
@@ -4305,17 +4305,17 @@ public:
   }
   virtual nsIFrame* FirstInFlow() const override;
   virtual nsIFrame* FirstContinuation() const override;
 
   virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                  InlineMinISizeData *aData) override;
   virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                   InlinePrefISizeData *aData) override;
-  
+
 protected:
   explicit nsContinuingTextFrame(nsStyleContext* aContext) : nsTextFrame(aContext) {}
   nsIFrame* mPrevContinuation;
 };
 
 void
 nsContinuingTextFrame::Init(nsIContent*       aContent,
                             nsContainerFrame* aParent,
@@ -4477,17 +4477,17 @@ nsContinuingTextFrame::AddInlineMinISize
 /* virtual */ void
 nsContinuingTextFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                           InlinePrefISizeData *aData)
 {
   // Do nothing, since the first-in-flow accounts for everything.
   return;
 }
 
-static void 
+static void
 DestroySelectionDetails(SelectionDetails* aDetails)
 {
   while (aDetails) {
     SelectionDetails* next = aDetails->mNext;
     delete aDetails;
     aDetails = next;
   }
 }
@@ -5121,17 +5121,17 @@ nsDisplayText::RenderToContext(gfxContex
 
 void
 nsTextFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists)
 {
   if (!IsVisibleForPainting(aBuilder))
     return;
-  
+
   DO_GLOBAL_REFLOW_COUNT_DSP("nsTextFrame");
 
   const nsStyleColor* sc = StyleColor();
   const nsStyleText* st = StyleText();
   bool isTextTransparent =
     NS_GET_A(sc->CalcComplexColor(st->mWebkitTextFillColor)) == 0 &&
     NS_GET_A(sc->CalcComplexColor(st->mWebkitTextStrokeColor)) == 0;
   Maybe<bool> isSelected;
@@ -5304,17 +5304,17 @@ nsTextFrame::GetTextDecorations(
       break;
     }
 
     const nsStyleTextReset *const styleText = context->StyleTextReset();
     const uint8_t textDecorations = styleText->mTextDecorationLine;
 
     if (!useOverride &&
         (NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL & textDecorations)) {
-      // This handles the <a href="blah.html"><font color="green">La 
+      // This handles the <a href="blah.html"><font color="green">La
       // la la</font></a> case. The link underline should be green.
       useOverride = true;
       overrideColor =
         nsLayoutUtils::GetColor(f, eCSSProperty_text_decoration_color);
     }
 
     nsBlockFrame* fBlock = nsLayoutUtils::GetAsBlock(f);
     const bool firstBlock = !nearestBlockFound && fBlock;
@@ -5882,17 +5882,17 @@ nsTextFrame::DrawSelectionDecorations(gf
         // IME decoration lines should not be drawn on the both ends, i.e., we
         // need to cut both edges of the decoration lines.  Because same style
         // IME selections can adjoin, but the users need to be able to know
         // where are the boundaries of the selections.
         //
         //  X: underline
         //
         //     IME selection #1        IME selection #2      IME selection #3
-        //  |                     |                      |                    
+        //  |                     |                      |
         //  | XXXXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXX
         //  +---------------------+----------------------+--------------------
         //   ^                   ^ ^                    ^ ^
         //  gap                  gap                    gap
         params.pt.x += 1.0;
         params.lineSize.width -= 2.0;
       }
       if (isIMEType && aRangeStyle.IsDefined()) {
@@ -6104,20 +6104,20 @@ SelectionIterator::SelectionIterator(Sel
 bool SelectionIterator::GetNextSegment(gfxFloat* aXOffset,
                                        gfxTextRun::Range* aRange,
                                        gfxFloat* aHyphenWidth,
                                        SelectionType* aSelectionType,
                                        TextRangeStyle* aStyle)
 {
   if (mIterator.GetOriginalOffset() >= int32_t(mOriginalRange.end))
     return false;
-  
+
   // save offset into transformed string now
   uint32_t runOffset = mIterator.GetSkippedOffset();
-  
+
   uint32_t index = mIterator.GetOriginalOffset() - mOriginalRange.start;
   SelectionDetails* sdptr = mSelectionDetails[index];
   SelectionType selectionType =
     sdptr ? sdptr->mSelectionType : SelectionType::eNone;
   TextRangeStyle style;
   if (sdptr) {
     style = sdptr->mTextRangeStyle;
   }
@@ -7226,20 +7226,20 @@ nsTextFrame::GetSelectionStatus(int16_t*
 }
 
 bool
 nsTextFrame::IsVisibleInSelection(nsISelection* aSelection)
 {
   // Check the quick way first
   if (!GetContent()->IsSelectionDescendant())
     return false;
-    
+
   SelectionDetails* details = GetSelectionDetails();
   bool found = false;
-    
+
   // where are the selection points "really"
   SelectionDetails *sdptr = details;
   while (sdptr) {
     if (sdptr->mEnd > GetContentOffset() &&
         sdptr->mStart < GetContentEnd() &&
         sdptr->mSelectionType == SelectionType::eNormal) {
       found = true;
       break;
@@ -7744,17 +7744,17 @@ nsTextFrame::GetChildFrameContainingOffs
             continue; // use the first of the empty frames with this offset
           }
         }
         break;
       }
       f = prev;
     }
   }
-  
+
   *aOutOffset = aContentOffset - f->GetContentOffset();
   *aOutFrame = f;
 
   // cache the frame we found
   Properties().Set(OffsetToFrameProperty(), f);
   f->AddStateBits(TEXT_IN_OFFSET_CACHE);
 
   return NS_OK;
@@ -7900,17 +7900,17 @@ nsTextFrame::PeekOffsetCharacter(bool aF
             IsAcceptableCaretPosition(iter, aRespectClusters, mTextRun, this)) {
           *aOffset = i - mContentOffset;
           return FOUND;
         }
       }
     }
     *aOffset = contentLength;
   }
-  
+
   return CONTINUE;
 }
 
 bool
 ClusterIterator::IsWhitespace()
 {
   NS_ASSERTION(mCharIndex >= 0, "No cluster selected");
   return IsSelectionSpace(mFrag, mCharIndex);
@@ -8157,34 +8157,34 @@ FindEndOfPunctuationRun(const nsTextFrag
 /**
  * Returns true if this text frame completes the first-letter, false
  * if it does not contain a true "letter".
  * If returns true, then it also updates aLength to cover just the first-letter
  * text.
  *
  * XXX :first-letter should be handled during frame construction
  * (and it has a good bit in common with nextBidi)
- * 
+ *
  * @param aLength an in/out parameter: on entry contains the maximum length to
  * return, on exit returns length of the first-letter fragment (which may
  * include leading and trailing punctuation, for example)
  */
 static bool
 FindFirstLetterRange(const nsTextFragment* aFrag,
                      const gfxTextRun* aTextRun,
                      int32_t aOffset, const gfxSkipCharsIterator& aIter,
                      int32_t* aLength)
 {
   int32_t i;
   int32_t length = *aLength;
   int32_t endOffset = aOffset + length;
   gfxSkipCharsIterator iter(aIter);
 
   // skip leading whitespace, then consume clusters that start with punctuation
-  i = FindEndOfPunctuationRun(aFrag, aTextRun, &iter, aOffset, 
+  i = FindEndOfPunctuationRun(aFrag, aTextRun, &iter, aOffset,
                               GetTrimmableWhitespaceCount(aFrag, aOffset, length, 1),
                               endOffset);
   if (i == length)
     return false;
 
   // If the next character is not a letter or number, there is no first-letter.
   // Return true so that we don't go on looking, but set aLength to 0.
   if (!nsContentUtils::IsAlphanumericAt(aFrag, aOffset + i)) {
@@ -8302,17 +8302,17 @@ nsTextFrame::SetFontSizeInflation(float 
     }
     return;
   }
 
   AddStateBits(TEXT_HAS_FONT_INFLATION);
   Properties().Set(FontSizeInflationProperty(), aInflation);
 }
 
-/* virtual */ 
+/* virtual */
 void nsTextFrame::MarkIntrinsicISizesDirty()
 {
   ClearTextRuns();
   nsFrame::MarkIntrinsicISizesDirty();
 }
 
 // XXX this doesn't handle characters shaped by line endings. We need to
 // temporarily override the "current line ending" settings.
@@ -8511,17 +8511,17 @@ nsTextFrame::AddInlinePrefISizeForFlow(n
     EnsureTextRun(aTextRunType, aRenderingContext->GetDrawTarget(),
                   aData->LineContainer(), aData->mLine, &flowEndInTextRun);
   gfxTextRun *textRun = GetTextRun(aTextRunType);
   if (!textRun)
     return;
 
   // Pass null for the line container. This will disable tab spacing, but that's
   // OK since we can't really handle tabs for intrinsic sizing anyway.
-  
+
   const nsStyleText* textStyle = StyleText();
   const nsTextFragment* frag = mContent->GetText();
   PropertyProvider provider(textRun, textStyle, frag, this,
                             iter, INT32_MAX, nullptr, 0, aTextRunType);
 
   // text-combine-upright frame is constantly 1em on inline-axis.
   if (StyleContext()->IsTextCombined()) {
     aData->mCurrentLine += provider.GetFontMetrics()->EmHeight();
@@ -8782,17 +8782,17 @@ RemoveEmptyInFlows(nsTextFrame* aFrame, 
   NS_ASSERTION(aFirstToNotRemove->GetPrevContinuation() ==
                aFirstToNotRemove->GetPrevInFlow() &&
                aFirstToNotRemove->GetPrevInFlow() != nullptr,
                "aFirstToNotRemove should have a fluid prev continuation");
   NS_ASSERTION(aFrame->GetPrevContinuation() ==
                aFrame->GetPrevInFlow() &&
                aFrame->GetPrevInFlow() != nullptr,
                "aFrame should have a fluid prev continuation");
-  
+
   nsIFrame* prevContinuation = aFrame->GetPrevContinuation();
   nsIFrame* lastRemoved = aFirstToNotRemove->GetPrevContinuation();
 
   for (nsTextFrame* f = aFrame; f != aFirstToNotRemove;
        f = static_cast<nsTextFrame*>(f->GetNextContinuation())) {
     // f is going to be destroyed soon, after it is unlinked from the
     // continuation chain. If its textrun is going to be destroyed we need to
     // do it now, before we unlink the frames to remove from the flow,
@@ -9090,17 +9090,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
   if (textStyle->NewlineIsSignificant(this)) {
     cachedNewlineOffset =
       static_cast<NewlineProperty*>(mContent->GetProperty(nsGkAtoms::newline));
     if (cachedNewlineOffset && cachedNewlineOffset->mStartOffset <= offset &&
         (cachedNewlineOffset->mNewlineOffset == -1 ||
          cachedNewlineOffset->mNewlineOffset >= offset)) {
       contentNewLineOffset = cachedNewlineOffset->mNewlineOffset;
     } else {
-      contentNewLineOffset = FindChar(frag, offset, 
+      contentNewLineOffset = FindChar(frag, offset,
                                       mContent->TextLength() - offset, '\n');
     }
     if (contentNewLineOffset < offset + length) {
       /*
         The new line offset could be outside this frame if the frame has been
         split by bidi resolution. In that case we won't use it in this reflow
         (newLineOffset will remain -1), but we will still cache it in mContent
       */
@@ -9178,17 +9178,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
         // Change this frame's length to the first-letter length right now
         // so that when we rebuild the textrun it will be built with the
         // right first-letter boundary
         SetLength(offset + length - GetContentOffset(), &aLineLayout,
                   ALLOW_FRAME_CREATION_AND_DESTRUCTION);
         // Ensure that the textrun will be rebuilt
         ClearTextRuns();
       }
-    } 
+    }
   }
 
   float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
 
   if (!IsCurrentFontInflation(fontSizeInflation)) {
     // FIXME: Ideally, if we already have a text run, we'd move it to be
     // the uninflated text run.
     ClearTextRun(nullptr, nsTextFrame::eInflated);
@@ -9220,17 +9220,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
 
   NS_ASSERTION(gfxSkipCharsIterator(iter).ConvertOriginalToSkipped(offset + length)
                     <= mTextRun->GetLength(),
                "Text run does not map enough text for our reflow");
 
   /////////////////////////////////////////////////////////////////////
   // See how much text should belong to this text frame, and measure it
   /////////////////////////////////////////////////////////////////////
-  
+
   iter.SetOriginalOffset(offset);
   nscoord xOffsetForTabs = (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TAB) ?
     (aLineLayout.GetCurrentFrameInlineDistanceFromBlock() -
        lineContainer->GetUsedBorderAndPadding().left)
     : -1;
   PropertyProvider provider(mTextRun, textStyle, frag, this, iter, length,
       lineContainer, xOffsetForTabs, nsTextFrame::eInflated);
 
@@ -9631,17 +9631,17 @@ nsTextFrame::TrimTrailingWhiteSpace(Draw
   uint32_t trimmedStart = start.GetSkippedOffset();
 
   const nsTextFragment* frag = mContent->GetText();
   TrimmedOffsets trimmed = GetTrimmedOffsets(frag, true);
   gfxSkipCharsIterator trimmedEndIter = start;
   const nsStyleText* textStyle = StyleText();
   gfxFloat delta = 0;
   uint32_t trimmedEnd = trimmedEndIter.ConvertOriginalToSkipped(trimmed.GetEnd());
-  
+
   if (!(GetStateBits() & TEXT_TRIMMED_TRAILING_WHITESPACE) &&
       trimmed.GetEnd() < GetContentEnd()) {
     gfxSkipCharsIterator end = trimmedEndIter;
     uint32_t endOffset = end.ConvertOriginalToSkipped(GetContentOffset() + contentLength);
     if (trimmedEnd < endOffset) {
       // We can't be dealing with tabs here ... they wouldn't be trimmed. So it's
       // OK to pass null for the line container.
       PropertyProvider provider(mTextRun, textStyle, frag, this, start, contentLength,
@@ -9950,17 +9950,17 @@ nsTextFrame::GetType() const
 }
 
 /* virtual */ bool
 nsTextFrame::IsEmpty()
 {
   NS_ASSERTION(!(mState & TEXT_IS_ONLY_WHITESPACE) ||
                !(mState & TEXT_ISNOT_ONLY_WHITESPACE),
                "Invalid state");
-  
+
   // XXXldb Should this check compatibility mode as well???
   const nsStyleText* textStyle = StyleText();
   if (textStyle->WhiteSpaceIsSignificant()) {
     // XXX shouldn't we return true if the length is zero?
     return false;
   }
 
   if (mState & TEXT_ISNOT_ONLY_WHITESPACE) {
@@ -10034,17 +10034,17 @@ nsTextFrame::List(FILE* out, const char*
   ListGeneric(str, aPrefix, aFlags);
 
   str += nsPrintfCString(" [run=%p]", static_cast<void*>(mTextRun));
 
   // Output the first/last content offset and prev/next in flow info
   bool isComplete = uint32_t(GetContentEnd()) == GetContent()->TextLength();
   str += nsPrintfCString("[%d,%d,%c] ", GetContentOffset(), GetContentLength(),
           isComplete ? 'T':'F');
-  
+
   if (IsSelected()) {
     str += " SELECTED";
   }
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
 #ifdef DEBUG
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -201,17 +201,17 @@ nsCSSProps::AddRefTable(void)
       }
     }
 
     BuildShorthandsContainingTable();
 
     static bool prefObserversInited = false;
     if (!prefObserversInited) {
       prefObserversInited = true;
-      
+
       #define OBSERVE_PROP(pref_, id_)                                        \
         if (pref_[0]) {                                                       \
           Preferences::AddBoolVarCache(&gPropertyEnabled[id_],                \
                                        pref_);                                \
         }
 
       #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_,     \
                        kwtable_, stylestruct_, stylestructoffset_, animtype_) \
@@ -2868,17 +2868,17 @@ static const nsCSSPropertyID gFlexSubpro
 static const nsCSSPropertyID gFlexFlowSubpropTable[] = {
   eCSSProperty_flex_direction,
   eCSSProperty_flex_wrap,
   eCSSProperty_UNKNOWN
 };
 
 static const nsCSSPropertyID gGridTemplateSubpropTable[] = {
   eCSSProperty_grid_template_areas,
-  eCSSProperty_grid_template_rows, 
+  eCSSProperty_grid_template_rows,
   eCSSProperty_grid_template_columns,
   eCSSProperty_UNKNOWN
 };
 
 static const nsCSSPropertyID gGridSubpropTable[] = {
   eCSSProperty_grid_template_areas,
   eCSSProperty_grid_template_rows,
   eCSSProperty_grid_template_columns,