Attachment #802692: Make RestyleManager::RestyleElement and nsCSSFrameConstructor::MaybeRecreateFramesForElement deal with display:contents elements. for bug #907396

View | Details | Raw Unified | Return to bug 907396
Collapse All | Expand All

(-)a/layout/base/RestyleManager.cpp (-8 / +93 lines)
Line     Link Here 
 Lines 803-819   RestyleManager::RestyleElement(Element* Link Here 
803
    FrameConstructor()->RecreateFramesForContent(aElement, false);
803
    FrameConstructor()->RecreateFramesForContent(aElement, false);
804
  } else if (aPrimaryFrame) {
804
  } else if (aPrimaryFrame) {
805
    nsStyleChangeList changeList;
805
    nsStyleChangeList changeList;
806
    ComputeStyleChangeFor(aPrimaryFrame, &changeList, aMinHint,
806
    ComputeStyleChangeFor(aPrimaryFrame, &changeList, aMinHint,
807
                          aRestyleTracker, aRestyleDescendants);
807
                          aRestyleTracker, aRestyleDescendants);
808
    ProcessRestyledFrames(changeList);
808
    ProcessRestyledFrames(changeList);
809
  } else {
809
  } else {
810
    // no frames, reconstruct for content
810
    // no frames, reconstruct for content
811
    FrameConstructor()->MaybeRecreateFramesForElement(aElement);
811
    nsStyleContext* newContext =
812
      FrameConstructor()->MaybeRecreateFramesForElement(aElement);
813
    if (newContext &&
814
        newContext->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
815
      // Style change for a display:contents node that did not recreate frames.
816
      nsStyleChangeList changeList;
817
      {
818
        // First, reresolve contexts for descendant undisplayed content.
819
        TreeMatchContext treeMatchContext(true,
820
                                          nsRuleWalker::eRelevantLinkUnvisited,
821
                                          mPresContext->Document());
822
        nsIContent* parent = aElement->GetParent();
823
        Element* parentElement =
824
          parent && parent->IsElement() ? parent->AsElement() : nullptr;
825
        treeMatchContext.InitAncestors(parentElement);
826
        nsTArray<nsIContent*> visibleKidsOfHiddenElement;
827
        ElementRestyler restyler(mPresContext, aElement, &changeList,
828
                                 aMinHint, aRestyleTracker,
829
                                 treeMatchContext,
830
                                 visibleKidsOfHiddenElement);
831
        restyler.DoRestyleUndisplayedDescendants(nsRestyleHint(0), aElement,
832
                                                 newContext);
833
      }
834
      // Then process child frames for content that is a descendant of aElement.
835
      // XXX perhaps it's better to walk child frames (before reresolving
836
      // XXX undisplayed contexts above) and mark those that has a stylecontext
837
      // XXX leading up to aElement's old context? (instead of the
838
      // XXX ContentIsDescendantOf check below)
839
      nsIFrame* ancestorFrame = nullptr;
840
      for (nsIContent* ancestor = aElement->GetParent();
841
           ancestor && !ancestorFrame;
842
           ancestor = ancestor->GetParent()) {
843
        ancestorFrame = ancestor->GetPrimaryFrame();
844
      }
845
      MOZ_ASSERT(ancestorFrame, "display:contents node in map although it's a "
846
                                "display:none descendant?");
847
      nsIFrame::ChildListIterator lists(ancestorFrame);
848
      for ( ; !lists.IsDone(); lists.Next()) {
849
        nsFrameList::Enumerator childFrames(lists.CurrentList());
850
        for (; !childFrames.AtEnd(); childFrames.Next()) {
851
          nsIFrame* f = childFrames.get();
852
          nsIContent* c = f->GetContent();
853
          if (nsContentUtils::ContentIsDescendantOf(c, aElement) &&
854
              !f->GetPrevContinuation()) {
855
            if (!(f->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
856
              ComputeStyleChangeFor(f, &changeList, aMinHint,
857
                                    aRestyleTracker, aRestyleDescendants);
858
            }
859
          }
860
        }
861
      }
862
      ProcessRestyledFrames(changeList);
863
    }
812
  }
864
  }
813
}
865
}
814
866
815
// Forwarded nsIDocumentObserver method, to handle restyling (and
867
// Forwarded nsIDocumentObserver method, to handle restyling (and
816
// passing the notification to the frame).
868
// passing the notification to the frame).
817
nsresult
869
nsresult
818
RestyleManager::ContentStateChanged(nsIContent* aContent,
870
RestyleManager::ContentStateChanged(nsIContent* aContent,
819
                                    nsEventStates aStateMask)
871
                                    nsEventStates aStateMask)
 Lines 1986-2001   ElementRestyler::ElementRestyler(ParentC Link Here 
1986
  , mDesiredA11yNotifications(aParentRestyler.mDesiredA11yNotifications)
2038
  , mDesiredA11yNotifications(aParentRestyler.mDesiredA11yNotifications)
1987
  , mKidsDesiredA11yNotifications(mDesiredA11yNotifications)
2039
  , mKidsDesiredA11yNotifications(mDesiredA11yNotifications)
1988
  , mOurA11yNotification(eDontNotify)
2040
  , mOurA11yNotification(eDontNotify)
1989
  , mVisibleKidsOfHiddenElement(aParentRestyler.mVisibleKidsOfHiddenElement)
2041
  , mVisibleKidsOfHiddenElement(aParentRestyler.mVisibleKidsOfHiddenElement)
1990
#endif
2042
#endif
1991
{
2043
{
1992
}
2044
}
1993
2045
2046
ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
2047
                                 nsIContent* aContent,
2048
                                 nsStyleChangeList* aChangeList,
2049
                                 nsChangeHint aHintsHandledByAncestors,
2050
                                 RestyleTracker& aRestyleTracker,
2051
                                 TreeMatchContext& aTreeMatchContext,
2052
                                 nsTArray<nsIContent*>&
2053
                                 aVisibleKidsOfHiddenElement)
2054
  : mPresContext(aPresContext)
2055
  , mFrame(nullptr)
2056
  , mParentContent(nullptr)
2057
  , mContent(aContent)
2058
  , mChangeList(aChangeList)
2059
  , mHintsHandled(NS_SubtractHint(aHintsHandledByAncestors,
2060
                  NS_HintsNotHandledForDescendantsIn(aHintsHandledByAncestors)))
2061
  , mParentFrameHintsNotHandledForDescendants(nsChangeHint(0))
2062
  , mHintsNotHandledForDescendants(nsChangeHint(0))
2063
  , mRestyleTracker(aRestyleTracker)
2064
  , mTreeMatchContext(aTreeMatchContext)
2065
  , mResolvedChild(nullptr)
2066
#ifdef ACCESSIBILITY
2067
  , mDesiredA11yNotifications(eSendAllNotifications)
2068
  , mKidsDesiredA11yNotifications(mDesiredA11yNotifications)
2069
  , mOurA11yNotification(eDontNotify)
2070
  , mVisibleKidsOfHiddenElement(aVisibleKidsOfHiddenElement)
2071
#endif
2072
{
2073
}
2074
1994
void
2075
void
1995
ElementRestyler::CaptureChange(nsStyleContext* aOldContext,
2076
ElementRestyler::CaptureChange(nsStyleContext* aOldContext,
1996
                               nsStyleContext* aNewContext,
2077
                               nsStyleContext* aNewContext,
1997
                               nsChangeHint aChangeToAssume)
2078
                               nsChangeHint aChangeToAssume)
1998
{
2079
{
1999
  // Check some invariants about replacing one style context with another.
2080
  // Check some invariants about replacing one style context with another.
2000
  NS_ASSERTION(aOldContext->GetPseudo() == aNewContext->GetPseudo(),
2081
  NS_ASSERTION(aOldContext->GetPseudo() == aNewContext->GetPseudo(),
2001
               "old and new style contexts should have the same pseudo");
2082
               "old and new style contexts should have the same pseudo");
 Lines 2400-2436   ElementRestyler::RestyleUndisplayedDesce Link Here 
2400
    checkUndisplayed = mFrame == mPresContext->FrameConstructor()->
2481
    checkUndisplayed = mFrame == mPresContext->FrameConstructor()->
2401
                                   GetDocElementContainingBlock();
2482
                                   GetDocElementContainingBlock();
2402
    undisplayedParent = nullptr;
2483
    undisplayedParent = nullptr;
2403
  } else {
2484
  } else {
2404
    checkUndisplayed = !!mFrame->GetContent();
2485
    checkUndisplayed = !!mFrame->GetContent();
2405
    undisplayedParent = mFrame->GetContent();
2486
    undisplayedParent = mFrame->GetContent();
2406
  }
2487
  }
2407
  if (checkUndisplayed) {
2488
  if (checkUndisplayed) {
2408
    DoRestyleUndisplayedDescendants(aChildRestyleHint, undisplayedParent);
2489
    DoRestyleUndisplayedDescendants(aChildRestyleHint, undisplayedParent,
2490
                                    mFrame->StyleContext());
2409
  }
2491
  }
2410
}
2492
}
2411
2493
2412
void
2494
void
2413
ElementRestyler::DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
2495
ElementRestyler::DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
2414
                                                 nsIContent* aParent)
2496
                                                 nsIContent* aParent,
2497
                                                 nsStyleContext* aParentContext)
2415
{
2498
{
2416
  nsCSSFrameConstructor* fc = mPresContext->FrameConstructor();
2499
  nsCSSFrameConstructor* fc = mPresContext->FrameConstructor();
2417
  UndisplayedNode* nodes = fc->GetAllUndisplayedContentIn(aParent);
2500
  UndisplayedNode* nodes = fc->GetAllUndisplayedContentIn(aParent);
2418
  RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
2501
  RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
2419
                          NS_STYLE_DISPLAY_NONE);
2502
                          aParentContext, NS_STYLE_DISPLAY_NONE);
2420
  nodes = fc->GetAllDisplayContentsIn(aParent);
2503
  nodes = fc->GetAllDisplayContentsIn(aParent);
2421
  RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
2504
  RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
2422
                          NS_STYLE_DISPLAY_CONTENTS);
2505
                          aParentContext, NS_STYLE_DISPLAY_CONTENTS);
2423
}
2506
}
2424
2507
2425
void
2508
void
2426
ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
2509
ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
2427
                                         UndisplayedNode* aUndisplayed,
2510
                                         UndisplayedNode* aUndisplayed,
2428
                                         nsIContent*      aUndisplayedParent,
2511
                                         nsIContent*      aUndisplayedParent,
2512
                                         nsStyleContext*  aParentContext,
2429
                                         const uint8_t    aDisplay)
2513
                                         const uint8_t    aDisplay)
2430
{
2514
{
2431
  nsIContent* undisplayedParent = aUndisplayedParent;
2515
  nsIContent* undisplayedParent = aUndisplayedParent;
2432
  UndisplayedNode* undisplayed = aUndisplayed;
2516
  UndisplayedNode* undisplayed = aUndisplayed;
2433
  for (TreeMatchContext::AutoAncestorPusher
2517
  for (TreeMatchContext::AutoAncestorPusher
2434
         pushAncestor(undisplayed, mTreeMatchContext,
2518
         pushAncestor(undisplayed, mTreeMatchContext,
2435
                      undisplayedParent ? undisplayedParent->AsElement()
2519
                      undisplayedParent ? undisplayedParent->AsElement()
2436
                                        : nullptr);
2520
                                        : nullptr);
 Lines 2460-2496   ElementRestyler::RestyleUndisplayedNodes Link Here 
2460
      thisChildHint =
2544
      thisChildHint =
2461
        nsRestyleHint(thisChildHint | undisplayedRestyleData.mRestyleHint);
2545
        nsRestyleHint(thisChildHint | undisplayedRestyleData.mRestyleHint);
2462
    }
2546
    }
2463
    nsRefPtr<nsStyleContext> undisplayedContext;
2547
    nsRefPtr<nsStyleContext> undisplayedContext;
2464
    nsStyleSet* styleSet = mPresContext->StyleSet();
2548
    nsStyleSet* styleSet = mPresContext->StyleSet();
2465
    if (thisChildHint) {
2549
    if (thisChildHint) {
2466
      undisplayedContext =
2550
      undisplayedContext =
2467
        styleSet->ResolveStyleFor(undisplayed->mContent->AsElement(),
2551
        styleSet->ResolveStyleFor(undisplayed->mContent->AsElement(),
2468
                                  mFrame->StyleContext(),
2552
                                  aParentContext,
2469
                                  mTreeMatchContext);
2553
                                  mTreeMatchContext);
2470
    } else {
2554
    } else {
2471
      undisplayedContext =
2555
      undisplayedContext =
2472
        styleSet->ReparentStyleContext(undisplayed->mStyle,
2556
        styleSet->ReparentStyleContext(undisplayed->mStyle,
2473
                                       mFrame->StyleContext(),
2557
                                       aParentContext,
2474
                                       undisplayed->mContent->AsElement());
2558
                                       undisplayed->mContent->AsElement());
2475
    }
2559
    }
2476
    const nsStyleDisplay* display = undisplayedContext->StyleDisplay();
2560
    const nsStyleDisplay* display = undisplayedContext->StyleDisplay();
2477
    if (display->mDisplay != aDisplay) {
2561
    if (display->mDisplay != aDisplay) {
2478
      NS_ASSERTION(undisplayed->mContent, "Must have undisplayed content");
2562
      NS_ASSERTION(undisplayed->mContent, "Must have undisplayed content");
2479
      mChangeList->AppendChange(nullptr, undisplayed->mContent,
2563
      mChangeList->AppendChange(nullptr, undisplayed->mContent,
2480
                                NS_STYLE_HINT_FRAMECHANGE);
2564
                                NS_STYLE_HINT_FRAMECHANGE);
2481
      // The node should be removed from the undisplayed map when
2565
      // The node should be removed from the undisplayed map when
2482
      // we reframe it.
2566
      // we reframe it.
2483
    } else {
2567
    } else {
2484
      // update the undisplayed node with the new context
2568
      // update the undisplayed node with the new context
2485
      undisplayed->mStyle = undisplayedContext;
2569
      undisplayed->mStyle = undisplayedContext;
2486
2570
2487
      if (aDisplay == NS_STYLE_DISPLAY_CONTENTS) {
2571
      if (aDisplay == NS_STYLE_DISPLAY_CONTENTS) {
2488
        DoRestyleUndisplayedDescendants(aChildRestyleHint, undisplayed->mContent);
2572
        DoRestyleUndisplayedDescendants(aChildRestyleHint, undisplayed->mContent,
2573
                                        undisplayed->mStyle);
2489
      }
2574
      }
2490
    }
2575
    }
2491
  }
2576
  }
2492
}
2577
}
2493
2578
2494
void
2579
void
2495
ElementRestyler::RestyleBeforePseudo()
2580
ElementRestyler::RestyleBeforePseudo()
2496
{
2581
{
(-)a/layout/base/RestyleManager.h (-1 / +13 lines)
Line     Link Here 
 Lines 318-333   public: Link Here 
318
   * have been handled by ancestors, and by the end of Restyle it
318
   * have been handled by ancestors, and by the end of Restyle it
319
   * represents the hints that have been handled for this frame.  This
319
   * represents the hints that have been handled for this frame.  This
320
   * method is intended to be called after Restyle, to find out what
320
   * method is intended to be called after Restyle, to find out what
321
   * hints have been handled for this frame.
321
   * hints have been handled for this frame.
322
   */
322
   */
323
  nsChangeHint HintsHandledForFrame() { return mHintsHandled; }
323
  nsChangeHint HintsHandledForFrame() { return mHintsHandled; }
324
324
325
private:
325
private:
326
 friend class mozilla::RestyleManager;
327
  // For restyling undisplayed content only (mFrame==null).
328
  ElementRestyler(nsPresContext* aPresContext,
329
                  nsIContent* aParentContent,
330
                  nsStyleChangeList* aChangeList,
331
                  nsChangeHint aHintsHandledByAncestors,
332
                  RestyleTracker& aRestyleTracker,
333
                  TreeMatchContext& aTreeMatchContext,
334
                  nsTArray<nsIContent*>& aVisibleKidsOfHiddenElement);
335
326
  /**
336
  /**
327
   * First half of Restyle().
337
   * First half of Restyle().
328
   */
338
   */
329
  void RestyleSelf(nsRestyleHint aRestyleHint);
339
  void RestyleSelf(nsRestyleHint aRestyleHint);
330
340
331
  /**
341
  /**
332
   * Restyle the children of this frame (and, in turn, their children).
342
   * Restyle the children of this frame (and, in turn, their children).
333
   *
343
   *
 Lines 342-361   private: Link Here 
342
                     nsStyleContext* aNewContext,
352
                     nsStyleContext* aNewContext,
343
                     nsChangeHint aChangeToAssume);
353
                     nsChangeHint aChangeToAssume);
344
354
345
  /**
355
  /**
346
   * Helpers for RestyleChildren().
356
   * Helpers for RestyleChildren().
347
   */
357
   */
348
  void RestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint);
358
  void RestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint);
349
  void DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
359
  void DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
350
                                       nsIContent* aParent);
360
                                       nsIContent* aParent,
361
                                       nsStyleContext* aParentStyleContext);
351
  void RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
362
  void RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
352
                               UndisplayedNode* aUndisplayed,
363
                               UndisplayedNode* aUndisplayed,
353
                               nsIContent*      aUndisplayedParent,
364
                               nsIContent*      aUndisplayedParent,
365
                               nsStyleContext*  aParentStyleContext,
354
                               const uint8_t    aDisplay);
366
                               const uint8_t    aDisplay);
355
  void RestyleBeforePseudo();
367
  void RestyleBeforePseudo();
356
  void RestyleAfterPseudo();
368
  void RestyleAfterPseudo();
357
  void RestyleContentChildren(nsRestyleHint aChildRestyleHint);
369
  void RestyleContentChildren(nsRestyleHint aChildRestyleHint);
358
  void InitializeAccessibilityNotifications();
370
  void InitializeAccessibilityNotifications();
359
  void SendAccessibilityNotifications();
371
  void SendAccessibilityNotifications();
360
372
361
  enum DesiredA11yNotifications {
373
  enum DesiredA11yNotifications {
(-)a/layout/base/nsCSSFrameConstructor.cpp (-13 / +21 lines)
Line     Link Here 
 Lines 8283-8330   nsCSSFrameConstructor::CaptureStateForFr Link Here 
8283
8283
8284
static bool EqualURIs(mozilla::css::URLValue *aURI1,
8284
static bool EqualURIs(mozilla::css::URLValue *aURI1,
8285
                      mozilla::css::URLValue *aURI2)
8285
                      mozilla::css::URLValue *aURI2)
8286
{
8286
{
8287
  return aURI1 == aURI2 ||    // handle null==null, and optimize
8287
  return aURI1 == aURI2 ||    // handle null==null, and optimize
8288
         (aURI1 && aURI2 && aURI1->URIEquals(*aURI2));
8288
         (aURI1 && aURI2 && aURI1->URIEquals(*aURI2));
8289
}
8289
}
8290
8290
8291
nsresult
8291
nsStyleContext*
8292
nsCSSFrameConstructor::MaybeRecreateFramesForElement(Element* aElement)
8292
nsCSSFrameConstructor::MaybeRecreateFramesForElement(Element* aElement)
8293
{
8293
{
8294
  nsRefPtr<nsStyleContext> oldContext = GetUndisplayedContent(aElement);
8294
  nsRefPtr<nsStyleContext> oldContext = GetUndisplayedContent(aElement);
8295
  uint8_t oldDisplay = NS_STYLE_DISPLAY_NONE;
8295
  if (!oldContext) {
8296
  if (!oldContext) {
8296
    if ((oldContext = GetDisplayContents(aElement))) {
8297
    oldContext = GetDisplayContents(aElement);
8297
        NS_ERROR("MaybeRecreateFramesForElement GetDisplayContents");
8298
    if (!oldContext) {
8298
    }
8299
      return nullptr;
8299
    return NS_OK;
8300
    }
8301
    oldDisplay = NS_STYLE_DISPLAY_CONTENTS;
8300
  }
8302
  }
8301
8303
8302
  // The parent has a frame, so try resolving a new context.
8304
  // The parent has a frame, so try resolving a new context.
8303
  nsRefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
8305
  nsRefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
8304
    ResolveStyleFor(aElement, oldContext->GetParent());
8306
    ResolveStyleFor(aElement, oldContext->GetParent());
8305
8307
8306
  ChangeUndisplayedContent(aElement, newContext);
8308
  if (oldDisplay == NS_STYLE_DISPLAY_NONE) {
8309
    ChangeUndisplayedContent(aElement, newContext);
8310
  } else {
8311
    ChangeDisplayContents(aElement, newContext);
8312
  }
8313
8307
  const nsStyleDisplay* disp = newContext->StyleDisplay();
8314
  const nsStyleDisplay* disp = newContext->StyleDisplay();
8308
  if (disp->mDisplay == NS_STYLE_DISPLAY_NONE) {
8315
  if (oldDisplay == disp->mDisplay) {
8309
    // We can skip trying to recreate frames here, but only if our style
8316
    // We can skip trying to recreate frames here, but only if our style
8310
    // context does not have a binding URI that differs from our old one.
8317
    // context does not have a binding URI that differs from our old one.
8311
    // Otherwise, we should try to recreate, because we may want to apply the
8318
    // Otherwise, we should try to recreate, because we may want to apply the
8312
    // new binding
8319
    // new binding
8313
    if (!disp->mBinding) {
8320
    if (!disp->mBinding) {
8314
      return NS_OK;
8321
      return newContext;
8315
    }
8322
    }
8316
    const nsStyleDisplay* oldDisp = oldContext->PeekStyleDisplay();
8323
    const nsStyleDisplay* oldDisp = oldContext->PeekStyleDisplay();
8317
    if (oldDisp && EqualURIs(disp->mBinding, oldDisp->mBinding)) {
8324
    if (oldDisp && EqualURIs(disp->mBinding, oldDisp->mBinding)) {
8318
      return NS_OK;
8325
      return newContext;
8319
    }
8326
    }
8320
  }
8327
  }
8321
8328
8322
  return RecreateFramesForContent(aElement, false);
8329
  RecreateFramesForContent(aElement, false);
8330
  return nullptr;
8323
}
8331
}
8324
8332
8325
static nsIFrame*
8333
static nsIFrame*
8326
FindFirstNonWhitespaceChild(nsIFrame* aParentFrame)
8334
FindFirstNonWhitespaceChild(nsIFrame* aParentFrame)
8327
{
8335
{
8328
  nsIFrame* f = aParentFrame->GetFirstPrincipalChild();
8336
  nsIFrame* f = aParentFrame->GetFirstPrincipalChild();
8329
  while (f && f->GetType() == nsGkAtoms::textFrame &&
8337
  while (f && f->GetType() == nsGkAtoms::textFrame &&
8330
         f->GetContent()->TextIsOnlyWhitespace()) {
8338
         f->GetContent()->TextIsOnlyWhitespace()) {
(-)a/layout/base/nsCSSFrameConstructor.h (-1 / +8 lines)
Line     Link Here 
 Lines 1401-1417   private: Link Here 
1401
                        nsIFrame*                scrolledFrame,
1401
                        nsIFrame*                scrolledFrame,
1402
                        nsIContent*              aContent,
1402
                        nsIContent*              aContent,
1403
                        nsIFrame*                aParentFrame,
1403
                        nsIFrame*                aParentFrame,
1404
                        nsStyleContext*          aStyleContext,
1404
                        nsStyleContext*          aStyleContext,
1405
                        bool                     aBuildCombobox,
1405
                        bool                     aBuildCombobox,
1406
                        PendingBinding*          aPendingBinding,
1406
                        PendingBinding*          aPendingBinding,
1407
                        nsFrameItems&            aFrameItems);
1407
                        nsFrameItems&            aFrameItems);
1408
1408
1409
  nsresult MaybeRecreateFramesForElement(Element* aElement);
1409
  /**
1410
   * ReResolve style for aElement then recreate frames if required.
1411
   * Do nothing for other types of style changes, except for undisplayed nodes
1412
   * (display:none/contents) which will have their style context updated in the
1413
   * frame manager undisplayed maps.
1414
   * @return null if frames were recreated, the new style context otherwise
1415
   */
1416
  nsStyleContext* MaybeRecreateFramesForElement(Element* aElement);
1410
1417
1411
  // If aAsyncInsert is true then a restyle event will be posted to handle the
1418
  // If aAsyncInsert is true then a restyle event will be posted to handle the
1412
  // required ContentInserted call instead of doing it immediately.
1419
  // required ContentInserted call instead of doing it immediately.
1413
  nsresult RecreateFramesForContent(nsIContent* aContent, bool aAsyncInsert);
1420
  nsresult RecreateFramesForContent(nsIContent* aContent, bool aAsyncInsert);
1414
1421
1415
  // If removal of aFrame from the frame tree requires reconstruction of some
1422
  // If removal of aFrame from the frame tree requires reconstruction of some
1416
  // containing block (either of aFrame or of its parent) due to {ib} splits or
1423
  // containing block (either of aFrame or of its parent) due to {ib} splits or
1417
  // table pseudo-frames, recreate the relevant frame subtree.  The return value
1424
  // table pseudo-frames, recreate the relevant frame subtree.  The return value

Return to bug 907396