Bug 1305422 - part 10 - don't call size_forward in nsHTMLContentSerializer.cpp; r=baku
authorNathan Froyd <froydnj@mozilla.com>
Thu, 29 Sep 2016 22:33:57 -0400
changeset 315881 32b8ba9f7a51219440ba512f2a120d0d85e139e5
parent 315880 55be43ac96c9037c2245b3cf0b90f59b38364984
child 315882 088bfcd8f3cb583e0357c73b8ce03b8bea95df3d
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1305422
milestone52.0a1
Bug 1305422 - part 10 - don't call size_forward in nsHTMLContentSerializer.cpp; r=baku
dom/base/nsHTMLContentSerializer.cpp
--- a/dom/base/nsHTMLContentSerializer.cpp
+++ b/dom/base/nsHTMLContentSerializer.cpp
@@ -526,17 +526,17 @@ nsHTMLContentSerializer::AppendAndTransl
     nsReadingIterator<char16_t> iter;
 
     const uint8_t* entityTable = mInAttribute ? kAttrEntities : kEntities;
     nsAutoCString entityReplacement;
 
     for (aStr.BeginReading(iter);
          iter != done_reading;
          iter.advance(int32_t(advanceLength))) {
-      uint32_t fragmentLength = iter.size_forward();
+      uint32_t fragmentLength = done_reading - iter;
       uint32_t lengthReplaced = 0; // the number of UTF-16 codepoints
                                     //  replaced by a particular entity
       const char16_t* c = iter.get();
       const char16_t* fragmentStart = c;
       const char16_t* fragmentEnd = c + fragmentLength;
       const char* entityText = nullptr;
       const char* fullConstEntityText = nullptr;
       char* fullEntityText = nullptr;