Bug 1369187: Don't return an old style context for ::first-line and ::first-letter, but not crash either. r=bholley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 31 May 2017 19:15:14 +0200
changeset 410000 cf869515f9be63a3665cbe5b207e436c6dbb6da1
parent 409999 e3e4beb7042b4d8eca079f0a62f3fdf5098729a2
child 410001 2fca98f65d11afcadd5dfaf04956d545b5990f61
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1369187
milestone55.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 1369187: Don't return an old style context for ::first-line and ::first-letter, but not crash either. r=bholley This will make us reframe until fixed. It's not hard to fix, just requires to discuss how :) MozReview-Commit-ID: 1vlRUSuMqtp
layout/base/ServoRestyleManager.cpp
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -510,16 +510,22 @@ ServoRestyleManager::FrameForPseudoEleme
   if (aPseudoTagOrNull == nsCSSPseudoElements::before) {
     return nsLayoutUtils::GetBeforeFrame(aContent);
   }
 
   if (aPseudoTagOrNull == nsCSSPseudoElements::after) {
     return nsLayoutUtils::GetAfterFrame(aContent);
   }
 
+  if (aPseudoTagOrNull == nsCSSPseudoElements::firstLine ||
+      aPseudoTagOrNull == nsCSSPseudoElements::firstLetter) {
+    // TODO(emilio, bz): Figure out the best way to diff these styles.
+    return nullptr;
+  }
+
   MOZ_CRASH("Unkown pseudo-element given to "
             "ServoRestyleManager::FrameForPseudoElement");
   return nullptr;
 }
 
 void
 ServoRestyleManager::DoProcessPendingRestyles(TraversalRestyleBehavior
                                                 aRestyleBehavior)