Bug 1398581: Address followup comments. r=me
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 11 Sep 2017 17:19:05 +0200
changeset 662405 d5a9ae0983b8f2111b131bdf2480ea77ceb264e7
parent 662404 2c284ff4354aa075579a85d4dd13ca1bf7d41f86
child 662406 a0075a30bc7f657f5896c77f7ea5b7da081ec1c4
push id79074
push userbmo:mstriemer@mozilla.com
push dateMon, 11 Sep 2017 17:17:14 +0000
reviewersme
bugs1398581
milestone57.0a1
Bug 1398581: Address followup comments. r=me MozReview-Commit-ID: CymOOl4VLPj
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -11879,17 +11879,17 @@ nsCSSFrameConstructor::CreateLetterFrame
     if (sc->IsServo() && parentFrame->IsLineFrame()) {
       ServoStyleContext* parentStyleIgnoringFirstLine =
         aBlockFrame->StyleContext()->AsServo();
       sc =
         mPresShell->StyleSet()->AsServo()->ReparentStyleContext(
           sc->AsServo(),
           parentStyleContext->AsServo(),
           parentStyleIgnoringFirstLine,
-          parentStyleIgnoringFirstLine,
+          parentStyleContext->AsServo(),
           blockContent->AsElement());
     }
 
     RefPtr<nsStyleContext> textSC = mPresShell->StyleSet()->
       ResolveStyleForText(aTextContent, sc);
 
     // Create a new text frame (the original one will be discarded)
     // pass a temporary stylecontext, the correct one will be set
@@ -12267,29 +12267,16 @@ nsCSSFrameConstructor::RecoverLetterFram
     continuation =
       static_cast<nsContainerFrame*>(continuation->GetNextContinuation());
   } while (continuation);
 
   if (parentFrame) {
     // Take the old textFrame out of the parent's child list
     RemoveFrame(kPrincipalList, textFrame);
 
-    // When we got the first-letter style from servo, it gave us the style not
-    // affected by the first-line bits.  So we may need to reparent the new
-    // frames' styles to deal with that.  Note that we already used parentFrame
-    // to inherit from, so the only case in which we need to fix something up is
-    // if parentFrame is itself a ::first-line frame, because in that case we
-    // have to do inheritance partially from it and partially from the block.
-    auto* restyleManager = RestyleManager();
-    if (parentFrame->IsLineFrame() && restyleManager->IsServo()) {
-      for (nsIFrame* f : letterFrames) {
-        restyleManager->ReparentStyleContext(f);
-      }
-    }
-
     // Insert in the letter frame(s)
     parentFrame->InsertFrames(kPrincipalList, prevFrame, letterFrames);
   }
 }
 
 //----------------------------------------------------------------------
 
 // listbox Widget Routines