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 315873 32b8ba9f7a51219440ba512f2a120d0d85e139e5
parent 315872 55be43ac96c9037c2245b3cf0b90f59b38364984
child 315874 088bfcd8f3cb583e0357c73b8ce03b8bea95df3d
push id30757
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:02:43 +0000
treeherdermozilla-central@5ffed033557e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1305422
milestone52.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 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;