Bug 1539366 - Use a temporary object to compute the mPIStartBorderData coords so that we don't clobber the regular state. r=mats a=jcristau
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 27 May 2019 20:38:26 +0000
changeset 536704 43f54f4b1e2aa7cc51a8dc003951672f12bcc89e
parent 536703 d2388f832a7d352a8e97b1474518521b1e3c6523
child 536705 17b33cebec207345fbd4408eee75f8b6af239c42
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats, jcristau
bugs1539366
milestone68.0
Bug 1539366 - Use a temporary object to compute the mPIStartBorderData coords so that we don't clobber the regular state. r=mats a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D26649
layout/painting/nsCSSRendering.cpp
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -183,22 +183,25 @@ struct InlineBackgroundData {
     if (!saved.mIsValid || saved.mFrame != mPIStartBorderData.mFrame) {
       if (aFrame == mPIStartBorderData.mFrame) {
         if (mVertical) {
           mPIStartBorderData.SetCoord(joinedBorderArea.y);
         } else {
           mPIStartBorderData.SetCoord(joinedBorderArea.x);
         }
       } else if (mPIStartBorderData.mFrame) {
+        // Copy data to a temporary object so that computing the
+        // continous rect here doesn't clobber our normal state.
+        InlineBackgroundData temp = *this;
         if (mVertical) {
           mPIStartBorderData.SetCoord(
-              GetContinuousRect(mPIStartBorderData.mFrame).y);
+              temp.GetContinuousRect(mPIStartBorderData.mFrame).y);
         } else {
           mPIStartBorderData.SetCoord(
-              GetContinuousRect(mPIStartBorderData.mFrame).x);
+              temp.GetContinuousRect(mPIStartBorderData.mFrame).x);
         }
       }
     } else {
       // ... and restore it when possible.
       mPIStartBorderData.SetCoord(saved.mCoord);
 
     }
     if (mVertical) {