Bug 1367214, part 1 - Fix nsFrameManager::ChangeStyleContextInMap to work for direct children of a shadow root. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Thu, 03 Aug 2017 13:51:24 +0100
changeset 374682 a5e5540c7503623b3d84f6a6847c1f0803fe1a7f
parent 374681 8fe037e8da67f3b0d403a198cd24ef3ec3914b69
child 374683 2cb7c3957b57e81990f5051d1385d0bff2d44829
push id93749
push userjwatt@jwatt.org
push dateTue, 15 Aug 2017 07:56:11 +0000
treeherdermozilla-inbound@de339d0ca73b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1367214
milestone57.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 1367214, part 1 - Fix nsFrameManager::ChangeStyleContextInMap to work for direct children of a shadow root. r=dholbert This makes the code for changing the style context consistent with the code for getting and setting a style context. MozReview-Commit-ID: 5uKARvk0hSV
layout/base/nsFrameManager.cpp
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -226,17 +226,19 @@ nsFrameManager::ChangeStyleContextInMap(
 {
   MOZ_ASSERT(aMap, "expecting a map");
 
 #if defined(DEBUG_UNDISPLAYED_MAP) || defined(DEBUG_DISPLAY_BOX_CONTENTS_MAP)
    static int i = 0;
    printf("ChangeStyleContextInMap(%d): p=%p \n", i++, (void *)aContent);
 #endif
 
-  for (UndisplayedNode* node = aMap->GetFirstNode(aContent->GetParent());
+  nsIContent* parent = ParentForUndisplayedMap(aContent);
+
+  for (UndisplayedNode* node = aMap->GetFirstNode(parent);
        node; node = node->getNext()) {
     if (node->mContent == aContent) {
       node->mStyle = aStyleContext;
       return;
     }
   }
 
   MOZ_CRASH("couldn't find the entry to change");