Attachment #802691: Replace GetParentStyleContextFrame with GetParentStyleContext which can return frame-less display:contents style contexts. for bug #907396

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

(-)a/layout/base/RestyleManager.cpp (-27 / +15 lines)
Line     Link Here 
 Lines 1516-1539   VerifyContextParent(nsPresContext* aPres Link Here 
1516
                    nsStyleContext* aContext, nsStyleContext* aParentContext)
1516
                    nsStyleContext* aContext, nsStyleContext* aParentContext)
1517
{
1517
{
1518
  // get the contexts not provided
1518
  // get the contexts not provided
1519
  if (!aContext) {
1519
  if (!aContext) {
1520
    aContext = aFrame->StyleContext();
1520
    aContext = aFrame->StyleContext();
1521
  }
1521
  }
1522
1522
1523
  if (!aParentContext) {
1523
  if (!aParentContext) {
1524
    // Get the correct parent context from the frame
1524
    nsIFrame* providerFrame;
1525
    //  - if the frame is a placeholder, we get the out of flow frame's context
1525
    aParentContext = aFrame->GetParentStyleContext(&providerFrame);
1526
    //    as the parent context instead of asking the frame
1527
1528
    // get the parent context from the frame (indirectly)
1529
    nsIFrame* providerFrame = aFrame->GetParentStyleContextFrame();
1530
    if (providerFrame)
1531
      aParentContext = providerFrame->StyleContext();
1532
    // aParentContext could still be null
1526
    // aParentContext could still be null
1533
  }
1527
  }
1534
1528
1535
  NS_ASSERTION(aContext, "Failure to get required contexts");
1529
  NS_ASSERTION(aContext, "Failure to get required contexts");
1536
  nsStyleContext* actualParentContext = aContext->GetParent();
1530
  nsStyleContext* actualParentContext = aContext->GetParent();
1537
1531
1538
  if (aParentContext) {
1532
  if (aParentContext) {
1539
    if (aParentContext != actualParentContext) {
1533
    if (aParentContext != actualParentContext) {
 Lines 1735-1764   RestyleManager::ReparentStyleContext(nsI Link Here 
1735
    } while ((outOfFlow = outOfFlow->GetNextContinuation()));
1729
    } while ((outOfFlow = outOfFlow->GetNextContinuation()));
1736
  }
1730
  }
1737
1731
1738
  // DO NOT verify the style tree before reparenting.  The frame
1732
  // DO NOT verify the style tree before reparenting.  The frame
1739
  // tree has already been changed, so this check would just fail.
1733
  // tree has already been changed, so this check would just fail.
1740
  nsStyleContext* oldContext = aFrame->StyleContext();
1734
  nsStyleContext* oldContext = aFrame->StyleContext();
1741
1735
1742
  nsRefPtr<nsStyleContext> newContext;
1736
  nsRefPtr<nsStyleContext> newContext;
1743
  nsIFrame* providerFrame = aFrame->GetParentStyleContextFrame();
1737
  nsIFrame* providerFrame;
1738
  nsStyleContext* newParentContext = aFrame->GetParentStyleContext(&providerFrame);
1744
  bool isChild = providerFrame && providerFrame->GetParent() == aFrame;
1739
  bool isChild = providerFrame && providerFrame->GetParent() == aFrame;
1745
  nsStyleContext* newParentContext = nullptr;
1746
  nsIFrame* providerChild = nullptr;
1740
  nsIFrame* providerChild = nullptr;
1747
  if (isChild) {
1741
  if (isChild) {
1748
    ReparentStyleContext(providerFrame);
1742
    ReparentStyleContext(providerFrame);
1749
    newParentContext = providerFrame->StyleContext();
1743
    newParentContext = providerFrame->StyleContext();
1750
    providerChild = providerFrame;
1744
    providerChild = providerFrame;
1751
  } else if (providerFrame) {
1752
    newParentContext = providerFrame->StyleContext();
1753
  } else {
1754
    NS_NOTREACHED("Reparenting something that has no usable parent? "
1755
                  "Shouldn't happen!");
1756
  }
1745
  }
1746
  NS_ASSERTION(newParentContext, "Reparenting something that has no usable"
1747
               " parent? Shouldn't happen!");
1757
  // XXX need to do something here to produce the correct style context for
1748
  // XXX need to do something here to produce the correct style context for
1758
  // an IB split whose first inline part is inside a first-line frame.
1749
  // an IB split whose first inline part is inside a first-line frame.
1759
  // Currently the first IB anonymous block's style context takes the first
1750
  // Currently the first IB anonymous block's style context takes the first
1760
  // part's style context as parent, which is wrong since first-line style
1751
  // part's style context as parent, which is wrong since first-line style
1761
  // should not apply to the anonymous block.
1752
  // should not apply to the anonymous block.
1762
1753
1763
#ifdef DEBUG
1754
#ifdef DEBUG
1764
  {
1755
  {
 Lines 2053-2068   ElementRestyler::Restyle(nsRestyleHint a Link Here 
2053
  // |mFrame->GetContent()|, make more sense.  However, we can't,
2044
  // |mFrame->GetContent()|, make more sense.  However, we can't,
2054
  // because of frame trees like the one in
2045
  // because of frame trees like the one in
2055
  // https://bugzilla.mozilla.org/show_bug.cgi?id=472353#c14 .  Once we
2046
  // https://bugzilla.mozilla.org/show_bug.cgi?id=472353#c14 .  Once we
2056
  // fix bug 242277 we should be able to make this make more sense.
2047
  // fix bug 242277 we should be able to make this make more sense.
2057
  NS_ASSERTION(mFrame->GetContent() || !mParentContent ||
2048
  NS_ASSERTION(mFrame->GetContent() || !mParentContent ||
2058
               !mParentContent->GetParent(),
2049
               !mParentContent->GetParent(),
2059
               "frame must have content (unless at the top of the tree)");
2050
               "frame must have content (unless at the top of the tree)");
2060
2051
2052
  AutoDisplayContentsAncestorPusher adcp(mTreeMatchContext, mFrame->PresContext(),
2053
      mFrame->GetContent() ? mFrame->GetContent()->GetParent() : nullptr);
2054
2061
  if (mContent && mContent->IsElement()) {
2055
  if (mContent && mContent->IsElement()) {
2062
    mContent->OwnerDoc()->FlushPendingLinkUpdates();
2056
    mContent->OwnerDoc()->FlushPendingLinkUpdates();
2063
    RestyleTracker::RestyleData restyleData;
2057
    RestyleTracker::RestyleData restyleData;
2064
    if (mRestyleTracker.GetRestyleData(mContent->AsElement(), &restyleData)) {
2058
    if (mRestyleTracker.GetRestyleData(mContent->AsElement(), &restyleData)) {
2065
      if (NS_UpdateHint(mHintsHandled, restyleData.mChangeHint)) {
2059
      if (NS_UpdateHint(mHintsHandled, restyleData.mChangeHint)) {
2066
        mChangeList->AppendChange(mFrame, mContent, restyleData.mChangeHint);
2060
        mChangeList->AppendChange(mFrame, mContent, restyleData.mChangeHint);
2067
      }
2061
      }
2068
      aRestyleHint = nsRestyleHint(aRestyleHint | restyleData.mRestyleHint);
2062
      aRestyleHint = nsRestyleHint(aRestyleHint | restyleData.mRestyleHint);
 Lines 2105-2134   ElementRestyler::RestyleSelf(nsRestyleHi Link Here 
2105
#ifdef ACCESSIBILITY
2099
#ifdef ACCESSIBILITY
2106
  mWasFrameVisible = nsIPresShell::IsAccessibilityActive() ?
2100
  mWasFrameVisible = nsIPresShell::IsAccessibilityActive() ?
2107
    oldContext->StyleVisibility()->IsVisible() : false;
2101
    oldContext->StyleVisibility()->IsVisible() : false;
2108
#endif
2102
#endif
2109
2103
2110
  nsIAtom* const pseudoTag = oldContext->GetPseudo();
2104
  nsIAtom* const pseudoTag = oldContext->GetPseudo();
2111
  const nsCSSPseudoElements::Type pseudoType = oldContext->GetPseudoType();
2105
  const nsCSSPseudoElements::Type pseudoType = oldContext->GetPseudoType();
2112
2106
2113
  nsStyleContext* parentContext;
2114
  // Get the frame providing the parent style context.  If it is a
2107
  // Get the frame providing the parent style context.  If it is a
2115
  // child, then resolve the provider first.
2108
  // child, then resolve the provider first.
2116
  nsIFrame* providerFrame = mFrame->GetParentStyleContextFrame();
2109
  nsIFrame* providerFrame;
2110
  nsStyleContext* parentContext = mFrame->GetParentStyleContext(&providerFrame);
2117
  bool isChild = providerFrame && providerFrame->GetParent() == mFrame;
2111
  bool isChild = providerFrame && providerFrame->GetParent() == mFrame;
2118
  if (!isChild) {
2112
  if (isChild) {
2119
    if (providerFrame)
2120
      parentContext = providerFrame->StyleContext();
2121
    else
2122
      parentContext = nullptr;
2123
  }
2124
  else {
2125
    MOZ_ASSERT(providerFrame->GetContent() == mFrame->GetContent(),
2113
    MOZ_ASSERT(providerFrame->GetContent() == mFrame->GetContent(),
2126
               "Postcondition for GetParentStyleContextFrame() violated. "
2114
               "Postcondition for GetParentStyleContext() violated. "
2127
               "That means we need to add the current element to the "
2115
               "That means we need to add the current element to the "
2128
               "ancestor filter.");
2116
               "ancestor filter.");
2129
2117
2130
    // resolve the provider here (before mFrame below).
2118
    // resolve the provider here (before mFrame below).
2131
2119
2132
    // assumeDifferenceHint forces the parent's change to be also
2120
    // assumeDifferenceHint forces the parent's change to be also
2133
    // applied to this frame, no matter what
2121
    // applied to this frame, no matter what
2134
    // nsStyleContext::CalcStyleDifference says. CalcStyleDifference
2122
    // nsStyleContext::CalcStyleDifference says. CalcStyleDifference
 Lines 2144-2160   ElementRestyler::RestyleSelf(nsRestyleHi Link Here 
2144
    // The provider's new context becomes the parent context of
2132
    // The provider's new context becomes the parent context of
2145
    // mFrame's context.
2133
    // mFrame's context.
2146
    parentContext = providerFrame->StyleContext();
2134
    parentContext = providerFrame->StyleContext();
2147
    // Set |mResolvedChild| so we don't bother resolving the
2135
    // Set |mResolvedChild| so we don't bother resolving the
2148
    // provider again.
2136
    // provider again.
2149
    mResolvedChild = providerFrame;
2137
    mResolvedChild = providerFrame;
2150
  }
2138
  }
2151
2139
2152
  if (providerFrame != mFrame->GetParent()) {
2140
  if (providerFrame != mFrame->GetParent() && true /* XXX display:contents case? */) {
2153
    // We don't actually know what the parent style context's
2141
    // We don't actually know what the parent style context's
2154
    // non-inherited hints were, so assume the worst.
2142
    // non-inherited hints were, so assume the worst.
2155
    mParentFrameHintsNotHandledForDescendants =
2143
    mParentFrameHintsNotHandledForDescendants =
2156
      nsChangeHint_Hints_NotHandledForDescendants;
2144
      nsChangeHint_Hints_NotHandledForDescendants;
2157
  }
2145
  }
2158
2146
2159
#ifdef DEBUG
2147
#ifdef DEBUG
2160
  {
2148
  {
 Lines 2646-2662   ElementRestyler::RestyleContentChildren( Link Here 
2646
          // want to pass that on to the out-of-flow reresolve, since that
2634
          // want to pass that on to the out-of-flow reresolve, since that
2647
          // can lead to the out-of-flow not getting reflowed when it should
2635
          // can lead to the out-of-flow not getting reflowed when it should
2648
          // be (eg a reresolve starting at <body> that involves reflowing
2636
          // be (eg a reresolve starting at <body> that involves reflowing
2649
          // the <body> would miss reflowing fixed-pos nodes that also need
2637
          // the <body> would miss reflowing fixed-pos nodes that also need
2650
          // reflow).  In the cases when the out-of-flow _is_ a geometric
2638
          // reflow).  In the cases when the out-of-flow _is_ a geometric
2651
          // descendant of a frame we already have a reflow hint for,
2639
          // descendant of a frame we already have a reflow hint for,
2652
          // reflow coalescing should keep us from doing the work twice.
2640
          // reflow coalescing should keep us from doing the work twice.
2653
2641
2654
          // |nsFrame::GetParentStyleContextFrame| checks being out
2642
          // |nsFrame::GetParentStyleContext| checks being out
2655
          // of flow so that this works correctly.
2643
          // of flow so that this works correctly.
2656
          do {
2644
          do {
2657
            ElementRestyler oofRestyler(*this, outOfFlowFrame,
2645
            ElementRestyler oofRestyler(*this, outOfFlowFrame,
2658
                                        FOR_OUT_OF_FLOW_CHILD);
2646
                                        FOR_OUT_OF_FLOW_CHILD);
2659
            oofRestyler.Restyle(aChildRestyleHint);
2647
            oofRestyler.Restyle(aChildRestyleHint);
2660
          } while ((outOfFlowFrame = outOfFlowFrame->GetNextContinuation()));
2648
          } while ((outOfFlowFrame = outOfFlowFrame->GetNextContinuation()));
2661
2649
2662
          // reresolve placeholder's context under the same parent
2650
          // reresolve placeholder's context under the same parent
(-)a/layout/base/nsCSSFrameConstructor.cpp (-4 / +8 lines)
Line     Link Here 
 Lines 2405-2421   nsCSSFrameConstructor::ConstructDocEleme Link Here 
2405
  NS_ASSERTION(processChildren ? !mRootElementFrame :
2405
  NS_ASSERTION(processChildren ? !mRootElementFrame :
2406
                 mRootElementFrame == contentFrame,
2406
                 mRootElementFrame == contentFrame,
2407
               "unexpected mRootElementFrame");
2407
               "unexpected mRootElementFrame");
2408
  mRootElementFrame = contentFrame;
2408
  mRootElementFrame = contentFrame;
2409
2409
2410
  // Figure out which frame has the main style for the document element,
2410
  // Figure out which frame has the main style for the document element,
2411
  // assigning it to mRootElementStyleFrame.
2411
  // assigning it to mRootElementStyleFrame.
2412
  // Backgrounds should be propagated from that frame to the viewport.
2412
  // Backgrounds should be propagated from that frame to the viewport.
2413
  mRootElementStyleFrame = contentFrame->GetParentStyleContextFrame();
2413
  contentFrame->GetParentStyleContext(&mRootElementStyleFrame);
2414
  bool isChild = mRootElementStyleFrame &&
2414
  bool isChild = mRootElementStyleFrame &&
2415
                 mRootElementStyleFrame->GetParent() == contentFrame;
2415
                 mRootElementStyleFrame->GetParent() == contentFrame;
2416
  if (!isChild) {
2416
  if (!isChild) {
2417
    mRootElementStyleFrame = mRootElementFrame;
2417
    mRootElementStyleFrame = mRootElementFrame;
2418
  }
2418
  }
2419
2419
2420
  if (processChildren) {
2420
  if (processChildren) {
2421
    // Still need to process the child content
2421
    // Still need to process the child content
 Lines 5884-5908   nsCSSFrameConstructor::IsValidSibling(ns Link Here 
5884
      (NS_STYLE_DISPLAY_TABLE_COLUMN       == siblingDisplay) ||
5884
      (NS_STYLE_DISPLAY_TABLE_COLUMN       == siblingDisplay) ||
5885
      (NS_STYLE_DISPLAY_TABLE_CAPTION      == siblingDisplay) ||
5885
      (NS_STYLE_DISPLAY_TABLE_CAPTION      == siblingDisplay) ||
5886
      (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == siblingDisplay) ||
5886
      (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == siblingDisplay) ||
5887
      (NS_STYLE_DISPLAY_TABLE_ROW_GROUP    == siblingDisplay) ||
5887
      (NS_STYLE_DISPLAY_TABLE_ROW_GROUP    == siblingDisplay) ||
5888
      (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == siblingDisplay) ||
5888
      (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == siblingDisplay) ||
5889
      nsGkAtoms::menuFrame == parentType) {
5889
      nsGkAtoms::menuFrame == parentType) {
5890
    // if we haven't already, construct a style context to find the display type of aContent
5890
    // if we haven't already, construct a style context to find the display type of aContent
5891
    if (UNSET_DISPLAY == aDisplay) {
5891
    if (UNSET_DISPLAY == aDisplay) {
5892
      nsRefPtr<nsStyleContext> styleContext;
5892
      nsIFrame* styleParent;
5893
      nsIFrame* styleParent = aSibling->GetParentStyleContextFrame();
5893
      aSibling->GetParentStyleContext(&styleParent);
5894
      if (!styleParent) {
5895
        styleParent = aSibling->GetParent();
5896
      }
5894
      if (!styleParent) {
5897
      if (!styleParent) {
5895
        NS_NOTREACHED("Shouldn't happen");
5898
        NS_NOTREACHED("Shouldn't happen");
5896
        return false;
5899
        return false;
5897
      }
5900
      }
5898
      // XXXbz when this code is killed, the state argument to
5901
      // XXXbz when this code is killed, the state argument to
5899
      // ResolveStyleContext can be made non-optional.
5902
      // ResolveStyleContext can be made non-optional.
5900
      styleContext = ResolveStyleContext(styleParent, aContent, nullptr);
5903
      nsRefPtr<nsStyleContext> styleContext =
5904
        ResolveStyleContext(styleParent, aContent, nullptr);
5901
      const nsStyleDisplay* display = styleContext->StyleDisplay();
5905
      const nsStyleDisplay* display = styleContext->StyleDisplay();
5902
      aDisplay = display->mDisplay;
5906
      aDisplay = display->mDisplay;
5903
    }
5907
    }
5904
    if (nsGkAtoms::menuFrame == parentType) {
5908
    if (nsGkAtoms::menuFrame == parentType) {
5905
      return
5909
      return
5906
        (NS_STYLE_DISPLAY_POPUP == aDisplay) ==
5910
        (NS_STYLE_DISPLAY_POPUP == aDisplay) ==
5907
        (NS_STYLE_DISPLAY_POPUP == siblingDisplay);
5911
        (NS_STYLE_DISPLAY_POPUP == siblingDisplay);
5908
    }
5912
    }
(-)a/layout/base/nsDisplayList.cpp (-3 / +10 lines)
Line     Link Here 
 Lines 3706-3726   nsDisplayTransform::GetDeltaToMozPerspec Link Here 
3706
3706
3707
  /* For both of the coordinates, if the value of -moz-perspective-origin is a
3707
  /* For both of the coordinates, if the value of -moz-perspective-origin is a
3708
   * percentage, it's relative to the size of the frame.  Otherwise, if it's
3708
   * percentage, it's relative to the size of the frame.  Otherwise, if it's
3709
   * a distance, it's already computed for us!
3709
   * a distance, it's already computed for us!
3710
   */
3710
   */
3711
3711
3712
  //TODO: Should this be using our bounds or the parent's bounds?
3712
  //TODO: Should this be using our bounds or the parent's bounds?
3713
  // How do we handle aBoundsOverride in the latter case?
3713
  // How do we handle aBoundsOverride in the latter case?
3714
  nsIFrame* parent = aFrame->GetParentStyleContextFrame();
3714
  nsIFrame* parent;
3715
  if (!parent) {
3715
  nsStyleContext* psc = aFrame->GetParentStyleContext(&parent);
3716
  if (!psc) {
3716
    return gfxPoint3D();
3717
    return gfxPoint3D();
3717
  }
3718
  }
3718
  const nsStyleDisplay* display = parent->StyleDisplay();
3719
  if (!parent) {
3720
    parent = aFrame->GetParent();
3721
    if (!parent) {
3722
      return gfxPoint3D();
3723
    }
3724
  }
3725
  const nsStyleDisplay* display = psc->StyleDisplay();
3719
  nsRect boundingRect = nsDisplayTransform::GetFrameBoundsForTransform(parent);
3726
  nsRect boundingRect = nsDisplayTransform::GetFrameBoundsForTransform(parent);
3720
3727
3721
  /* Allows us to access named variables by index. */
3728
  /* Allows us to access named variables by index. */
3722
  gfxPoint3D result;
3729
  gfxPoint3D result;
3723
  result.z = 0.0f;
3730
  result.z = 0.0f;
3724
  gfxFloat* coords[2] = {&result.x, &result.y};
3731
  gfxFloat* coords[2] = {&result.x, &result.y};
3725
  const nscoord* dimensions[2] =
3732
  const nscoord* dimensions[2] =
3726
    {&boundingRect.width, &boundingRect.height};
3733
    {&boundingRect.width, &boundingRect.height};
(-)a/layout/generic/nsFrame.cpp (-14 / +33 lines)
Line     Link Here 
 Lines 7224-7283   nsFrame::CorrectStyleParentFrame(nsIFram Link Here 
7224
  // We can get here if the root element is absolutely positioned.
7224
  // We can get here if the root element is absolutely positioned.
7225
  // We can't test for this very accurately, but it can only happen
7225
  // We can't test for this very accurately, but it can only happen
7226
  // when the prospective parent is a canvas frame.
7226
  // when the prospective parent is a canvas frame.
7227
  NS_ASSERTION(aProspectiveParent->GetType() == nsGkAtoms::canvasFrame,
7227
  NS_ASSERTION(aProspectiveParent->GetType() == nsGkAtoms::canvasFrame,
7228
               "Should have found a parent before this");
7228
               "Should have found a parent before this");
7229
  return nullptr;
7229
  return nullptr;
7230
}
7230
}
7231
7231
7232
nsIFrame*
7232
nsStyleContext*
7233
nsFrame::DoGetParentStyleContextFrame() const
7233
nsFrame::DoGetParentStyleContext(nsIFrame** aProviderFrame) const
7234
{
7234
{
7235
  if (mContent && !mContent->GetParent() &&
7235
  *aProviderFrame = nullptr;
7236
      !StyleContext()->GetPseudo()) {
7236
  nsFrameManager* fm = PresContext()->FrameManager();
7237
    // we're a frame for the root.  We have no style context parent.
7237
  if (MOZ_LIKELY(mContent)) {
7238
    return nullptr;
7238
    nsIContent* parentContent = mContent->GetParent();
7239
    if (MOZ_LIKELY(parentContent)) {
7240
      nsIAtom* pseudo = StyleContext()->GetPseudo();
7241
      if (!pseudo || !mContent->IsElement() ||
7242
          !nsCSSAnonBoxes::IsAnonBox(pseudo) ||
7243
          /* if next is true then it's really a request for the table frame's
7244
             parent context, see nsTable[Outer]Frame::GetParentStyleContext. */
7245
          pseudo == nsCSSAnonBoxes::tableOuter) {
7246
        nsStyleContext* sc = fm->GetDisplayContents(parentContent);
7247
        if (MOZ_UNLIKELY(sc)) {
7248
          return sc;
7249
        }
7250
      }
7251
    } else {
7252
      if (!StyleContext()->GetPseudo()) {
7253
        // we're a frame for the root.  We have no style context parent.
7254
        return nullptr;
7255
      }
7256
    }
7239
  }
7257
  }
7240
  
7258
  
7241
  if (!(mState & NS_FRAME_OUT_OF_FLOW)) {
7259
  if (!(mState & NS_FRAME_OUT_OF_FLOW)) {
7242
    /*
7260
    /*
7243
     * If this frame is an anonymous block created when an inline with a block
7261
     * If this frame is an anonymous block created when an inline with a block
7244
     * inside it got split, then the parent style context is on its preceding
7262
     * inside it got split, then the parent style context is on its preceding
7245
     * inline. We can get to it using GetIBSpecialSiblingForAnonymousBlock.
7263
     * inline. We can get to it using GetIBSpecialSiblingForAnonymousBlock.
7246
     */
7264
     */
7247
    if (mState & NS_FRAME_IS_SPECIAL) {
7265
    if (mState & NS_FRAME_IS_SPECIAL) {
7248
      nsIFrame* specialSibling = GetIBSpecialSiblingForAnonymousBlock(this);
7266
      nsIFrame* specialSibling = GetIBSpecialSiblingForAnonymousBlock(this);
7249
      if (specialSibling) {
7267
      if (specialSibling) {
7250
        return specialSibling;
7268
        return (*aProviderFrame = specialSibling)->StyleContext();
7251
      }
7269
      }
7252
    }
7270
    }
7253
7271
7254
    // If this frame is one of the blocks that split an inline, we must
7272
    // If this frame is one of the blocks that split an inline, we must
7255
    // return the "special" inline parent, i.e., the parent that this
7273
    // return the "special" inline parent, i.e., the parent that this
7256
    // frame would have if we didn't mangle the frame structure.
7274
    // frame would have if we didn't mangle the frame structure.
7257
    return GetCorrectedParent(this);
7275
    *aProviderFrame = GetCorrectedParent(this);
7276
    return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
7258
  }
7277
  }
7259
7278
7260
  // For out-of-flow frames, we must resolve underneath the
7279
  // For out-of-flow frames, we must resolve underneath the
7261
  // placeholder's parent.
7280
  // placeholder's parent.
7262
  const nsIFrame* oofFrame = this;
7281
  const nsIFrame* oofFrame = this;
7263
  if ((oofFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
7282
  if ((oofFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
7264
      GetPrevInFlow()) {
7283
      GetPrevInFlow()) {
7265
    // Out of flows that are continuations do not
7284
    // Out of flows that are continuations do not
7266
    // have placeholders. Use their first-in-flow's placeholder.
7285
    // have placeholders. Use their first-in-flow's placeholder.
7267
    oofFrame = oofFrame->GetFirstInFlow();
7286
    oofFrame = oofFrame->GetFirstInFlow();
7268
  }
7287
  }
7269
  nsIFrame* placeholder = oofFrame->PresContext()->FrameManager()->
7288
  nsIFrame* placeholder = fm->GetPlaceholderFrameFor(oofFrame);
7270
                            GetPlaceholderFrameFor(oofFrame);
7271
  if (!placeholder) {
7289
  if (!placeholder) {
7272
    NS_NOTREACHED("no placeholder frame for out-of-flow frame");
7290
    NS_NOTREACHED("no placeholder frame for out-of-flow frame");
7273
    return GetCorrectedParent(this);
7291
    *aProviderFrame = GetCorrectedParent(this);
7274
  }
7292
    return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
7275
  return placeholder->GetParentStyleContextFrame();
7293
  }
7294
  return placeholder->GetParentStyleContext(aProviderFrame);
7276
}
7295
}
7277
7296
7278
void
7297
void
7279
nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
7298
nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
7280
{
7299
{
7281
  if (!aFrame || !*aFrame)
7300
  if (!aFrame || !*aFrame)
7282
    return;
7301
    return;
7283
  nsIFrame *child = *aFrame;
7302
  nsIFrame *child = *aFrame;
(-)a/layout/generic/nsFrame.h (-4 / +10 lines)
Line     Link Here 
 Lines 226-253   public: Link Here 
226
226
227
  NS_IMETHOD  GetOffsets(int32_t &aStart, int32_t &aEnd) const MOZ_OVERRIDE;
227
  NS_IMETHOD  GetOffsets(int32_t &aStart, int32_t &aEnd) const MOZ_OVERRIDE;
228
  virtual void ChildIsDirty(nsIFrame* aChild) MOZ_OVERRIDE;
228
  virtual void ChildIsDirty(nsIFrame* aChild) MOZ_OVERRIDE;
229
229
230
#ifdef ACCESSIBILITY
230
#ifdef ACCESSIBILITY
231
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
231
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
232
#endif
232
#endif
233
233
234
  virtual nsIFrame* GetParentStyleContextFrame() const MOZ_OVERRIDE {
234
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const MOZ_OVERRIDE {
235
    return DoGetParentStyleContextFrame();
235
    return DoGetParentStyleContext(aProviderFrame);
236
  }
236
  }
237
237
238
  /**
238
  /**
239
   * Do the work for getting the parent style context frame so that
239
   * Do the work for getting the parent style context frame so that
240
   * other frame's |GetParentStyleContextFrame| methods can call this
240
   * other frame's |GetParentStyleContext| methods can call this
241
   * method on *another* frame.  (This function handles out-of-flow
241
   * method on *another* frame.  (This function handles out-of-flow
242
   * frames by using the frame manager's placeholder map and it also
242
   * frames by using the frame manager's placeholder map and it also
243
   * handles block-within-inline and generated content wrappers.)
243
   * handles block-within-inline and generated content wrappers.)
244
   *
245
   * @param aProviderFrame (out) the frame associated with the returned value
246
   *     or null if the style context is for display:contents content.
247
   * @return The style context that should be the parent of this frame's
248
   *         style context.  Null is permitted, and means that this frame's
249
   *         style context should be the root of the style context tree.
244
   */
250
   */
245
  nsIFrame* DoGetParentStyleContextFrame() const;
251
  nsStyleContext* DoGetParentStyleContext(nsIFrame** aProviderFrame) const;
246
252
247
  virtual bool IsEmpty() MOZ_OVERRIDE;
253
  virtual bool IsEmpty() MOZ_OVERRIDE;
248
  virtual bool IsSelfEmpty() MOZ_OVERRIDE;
254
  virtual bool IsSelfEmpty() MOZ_OVERRIDE;
249
255
250
  virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
256
  virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
251
  virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
257
  virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
252
  virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
258
  virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
253
  virtual void AddInlineMinWidth(nsRenderingContext *aRenderingContext,
259
  virtual void AddInlineMinWidth(nsRenderingContext *aRenderingContext,
(-)a/layout/generic/nsIFrame.h (-2 / +4 lines)
Line     Link Here 
 Lines 2516-2536   public: Link Here 
2516
  /**
2516
  /**
2517
   * Get the frame whose style context should be the parent of this
2517
   * Get the frame whose style context should be the parent of this
2518
   * frame's style context (i.e., provide the parent style context).
2518
   * frame's style context (i.e., provide the parent style context).
2519
   * This frame must either be an ancestor of this frame or a child.  If
2519
   * This frame must either be an ancestor of this frame or a child.  If
2520
   * this returns a child frame, then the child frame must be sure to
2520
   * this returns a child frame, then the child frame must be sure to
2521
   * return a grandparent or higher!  Furthermore, if a child frame is
2521
   * return a grandparent or higher!  Furthermore, if a child frame is
2522
   * returned it must have the same GetContent() as this frame.
2522
   * returned it must have the same GetContent() as this frame.
2523
   *
2523
   *
2524
   * @return The frame whose style context should be the parent of this frame's
2524
   * @param aProviderFrame (out) the frame associated with the returned value
2525
   *     or nullptr if the style context is for display:contents content.
2526
   * @return The style context that should be the parent of this frame's
2525
   *         style context.  Null is permitted, and means that this frame's
2527
   *         style context.  Null is permitted, and means that this frame's
2526
   *         style context should be the root of the style context tree.
2528
   *         style context should be the root of the style context tree.
2527
   */
2529
   */
2528
  virtual nsIFrame* GetParentStyleContextFrame() const = 0;
2530
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const = 0;
2529
2531
2530
  /**
2532
  /**
2531
   * Determines whether a frame is visible for painting;
2533
   * Determines whether a frame is visible for painting;
2532
   * taking into account whether it is painting a selection or printing.
2534
   * taking into account whether it is painting a selection or printing.
2533
   */
2535
   */
2534
  bool IsVisibleForPainting(nsDisplayListBuilder* aBuilder);
2536
  bool IsVisibleForPainting(nsDisplayListBuilder* aBuilder);
2535
  /**
2537
  /**
2536
   * Determines whether a frame is visible for painting or collapsed;
2538
   * Determines whether a frame is visible for painting or collapsed;
(-)a/layout/generic/nsPlaceholderFrame.cpp (-3 / +14 lines)
Line     Link Here 
 Lines 174-198   nsPlaceholderFrame::CanContinueTextRun() Link Here 
174
  if (!mOutOfFlowFrame) {
174
  if (!mOutOfFlowFrame) {
175
    return false;
175
    return false;
176
  }
176
  }
177
  // first-letter frames can continue text runs, and placeholders for floated
177
  // first-letter frames can continue text runs, and placeholders for floated
178
  // first-letter frames can too
178
  // first-letter frames can too
179
  return mOutOfFlowFrame->CanContinueTextRun();
179
  return mOutOfFlowFrame->CanContinueTextRun();
180
}
180
}
181
181
182
nsIFrame*
182
nsStyleContext*
183
nsPlaceholderFrame::GetParentStyleContextFrame() const
183
nsPlaceholderFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
184
{
184
{
185
  NS_PRECONDITION(GetParent(), "How can we not have a parent here?");
185
  NS_PRECONDITION(GetParent(), "How can we not have a parent here?");
186
186
187
  nsIContent* parentContent = mContent ? mContent->GetParent() : nullptr;
188
  if (parentContent) {
189
    nsStyleContext* sc =
190
      PresContext()->FrameManager()->GetDisplayContents(parentContent);
191
    if (sc) {
192
      *aProviderFrame = nullptr;
193
      return sc;
194
    }
195
  }
196
187
  // Lie about our pseudo so we can step out of all anon boxes and
197
  // Lie about our pseudo so we can step out of all anon boxes and
188
  // pseudo-elements.  The other option would be to reimplement the
198
  // pseudo-elements.  The other option would be to reimplement the
189
  // {ib} split gunk here.
199
  // {ib} split gunk here.
190
  return CorrectStyleParentFrame(GetParent(), nsGkAtoms::placeholderFrame);
200
  *aProviderFrame = CorrectStyleParentFrame(GetParent(), nsGkAtoms::placeholderFrame);
201
  return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
191
}
202
}
192
203
193
204
194
#ifdef DEBUG
205
#ifdef DEBUG
195
static void
206
static void
196
PaintDebugPlaceholder(nsIFrame* aFrame, nsRenderingContext* aCtx,
207
PaintDebugPlaceholder(nsIFrame* aFrame, nsRenderingContext* aCtx,
197
                      const nsRect& aDirtyRect, nsPoint aPt)
208
                      const nsRect& aDirtyRect, nsPoint aPt)
198
{
209
{
(-)a/layout/generic/nsPlaceholderFrame.h (-1 / +1 lines)
Line     Link Here 
 Lines 132-148   public: Link Here 
132
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE
132
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE
133
  {
133
  {
134
    nsIFrame* realFrame = GetRealFrameForPlaceholder(this);
134
    nsIFrame* realFrame = GetRealFrameForPlaceholder(this);
135
    return realFrame ? realFrame->AccessibleType() :
135
    return realFrame ? realFrame->AccessibleType() :
136
                       nsFrame::AccessibleType();
136
                       nsFrame::AccessibleType();
137
  }
137
  }
138
#endif
138
#endif
139
139
140
  virtual nsIFrame* GetParentStyleContextFrame() const MOZ_OVERRIDE;
140
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const MOZ_OVERRIDE;
141
141
142
  /**
142
  /**
143
   * @return the out-of-flow for aFrame if aFrame is a placeholder; otherwise
143
   * @return the out-of-flow for aFrame if aFrame is a placeholder; otherwise
144
   * aFrame
144
   * aFrame
145
   */
145
   */
146
  static nsIFrame* GetRealFrameFor(nsIFrame* aFrame) {
146
  static nsIFrame* GetRealFrameFor(nsIFrame* aFrame) {
147
    NS_PRECONDITION(aFrame, "Must have a frame to work with");
147
    NS_PRECONDITION(aFrame, "Must have a frame to work with");
148
    if (aFrame->GetType() == nsGkAtoms::placeholderFrame) {
148
    if (aFrame->GetType() == nsGkAtoms::placeholderFrame) {
(-)a/layout/tables/nsTableColGroupFrame.cpp (-3 / +3 lines)
Line     Link Here 
 Lines 294-312   nsTableColGroupFrame::RemoveFrame(ChildL Link Here 
294
    nsTableColFrame* colFrame = (nsTableColFrame*)aOldFrame;
294
    nsTableColFrame* colFrame = (nsTableColFrame*)aOldFrame;
295
    if (colFrame->GetColType() == eColContent) {
295
    if (colFrame->GetColType() == eColContent) {
296
      contentRemoval = true;
296
      contentRemoval = true;
297
      // Remove any anonymous column frames this <col> produced via a colspan
297
      // Remove any anonymous column frames this <col> produced via a colspan
298
      nsTableColFrame* col = colFrame->GetNextCol();
298
      nsTableColFrame* col = colFrame->GetNextCol();
299
      nsTableColFrame* nextCol;
299
      nsTableColFrame* nextCol;
300
      while (col && col->GetColType() == eColAnonymousCol) {
300
      while (col && col->GetColType() == eColAnonymousCol) {
301
#ifdef DEBUG
301
#ifdef DEBUG
302
        nsIFrame* providerFrame = colFrame->GetParentStyleContextFrame();
302
        nsIFrame* providerFrame;
303
        if (colFrame->StyleContext()->GetParent() ==
303
        nsStyleContext* psc = colFrame->GetParentStyleContext(&providerFrame);
304
            providerFrame->StyleContext()) {
304
        if (colFrame->StyleContext()->GetParent() == psc) {
305
          NS_ASSERTION(col->StyleContext() == colFrame->StyleContext() &&
305
          NS_ASSERTION(col->StyleContext() == colFrame->StyleContext() &&
306
                       col->GetContent() == colFrame->GetContent(),
306
                       col->GetContent() == colFrame->GetContent(),
307
                       "How did that happen??");
307
                       "How did that happen??");
308
        }
308
        }
309
        // else colFrame is being removed because of a frame
309
        // else colFrame is being removed because of a frame
310
        // reconstruct on it, and its style context is still the old
310
        // reconstruct on it, and its style context is still the old
311
        // one, so we can't assert anything about how it compares to
311
        // one, so we can't assert anything about how it compares to
312
        // col's style context.
312
        // col's style context.
(-)a/layout/tables/nsTableFrame.cpp (-3 / +4 lines)
Line     Link Here 
 Lines 124-152   struct BCPropertyData Link Here 
124
  BCPixelSize mTopBorderWidth;
124
  BCPixelSize mTopBorderWidth;
125
  BCPixelSize mRightBorderWidth;
125
  BCPixelSize mRightBorderWidth;
126
  BCPixelSize mBottomBorderWidth;
126
  BCPixelSize mBottomBorderWidth;
127
  BCPixelSize mLeftBorderWidth;
127
  BCPixelSize mLeftBorderWidth;
128
  BCPixelSize mLeftCellBorderWidth;
128
  BCPixelSize mLeftCellBorderWidth;
129
  BCPixelSize mRightCellBorderWidth;
129
  BCPixelSize mRightCellBorderWidth;
130
};
130
};
131
131
132
nsIFrame*
132
nsStyleContext*
133
nsTableFrame::GetParentStyleContextFrame() const
133
nsTableFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
134
{
134
{
135
  // Since our parent, the table outer frame, returned this frame, we
135
  // Since our parent, the table outer frame, returned this frame, we
136
  // must return whatever our parent would normally have returned.
136
  // must return whatever our parent would normally have returned.
137
137
138
  NS_PRECONDITION(mParent, "table constructed without outer table");
138
  NS_PRECONDITION(mParent, "table constructed without outer table");
139
  if (!mContent->GetParent() && !StyleContext()->GetPseudo()) {
139
  if (!mContent->GetParent() && !StyleContext()->GetPseudo()) {
140
    // We're the root.  We have no style context parent.
140
    // We're the root.  We have no style context parent.
141
    *aProviderFrame = nullptr;
141
    return nullptr;
142
    return nullptr;
142
  }
143
  }
143
144
144
  return static_cast<nsFrame*>(GetParent())->DoGetParentStyleContextFrame();
145
  return static_cast<nsFrame*>(GetParent())->DoGetParentStyleContext(aProviderFrame);
145
}
146
}
146
147
147
148
148
nsIAtom*
149
nsIAtom*
149
nsTableFrame::GetType() const
150
nsTableFrame::GetType() const
150
{
151
{
151
  return nsGkAtoms::tableFrame;
152
  return nsGkAtoms::tableFrame;
152
}
153
}
(-)a/layout/tables/nsTableFrame.h (-1 / +1 lines)
Line     Link Here 
 Lines 328-344   public: Link Here 
328
  nsresult ReflowTable(nsHTMLReflowMetrics&     aDesiredSize,
328
  nsresult ReflowTable(nsHTMLReflowMetrics&     aDesiredSize,
329
                       const nsHTMLReflowState& aReflowState,
329
                       const nsHTMLReflowState& aReflowState,
330
                       nscoord                  aAvailHeight,
330
                       nscoord                  aAvailHeight,
331
                       nsIFrame*&               aLastChildReflowed,
331
                       nsIFrame*&               aLastChildReflowed,
332
                       nsReflowStatus&          aStatus);
332
                       nsReflowStatus&          aStatus);
333
333
334
  nsFrameList& GetColGroups();
334
  nsFrameList& GetColGroups();
335
335
336
  virtual nsIFrame* GetParentStyleContextFrame() const MOZ_OVERRIDE;
336
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const MOZ_OVERRIDE;
337
337
338
  /**
338
  /**
339
   * Get the "type" of the frame
339
   * Get the "type" of the frame
340
   *
340
   *
341
   * @see nsGkAtoms::tableFrame
341
   * @see nsGkAtoms::tableFrame
342
   */
342
   */
343
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
343
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
344
344
(-)a/layout/tables/nsTableOuterFrame.cpp (-10 / +21 lines)
Line     Link Here 
 Lines 1-13    Link Here 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
#include "nsTableOuterFrame.h"
6
#include "nsTableOuterFrame.h"
7
8
#include "nsFrameManager.h"
6
#include "nsTableFrame.h"
9
#include "nsTableFrame.h"
7
#include "nsTableCellFrame.h"
10
#include "nsTableCellFrame.h"
8
#include "nsStyleContext.h"
11
#include "nsStyleContext.h"
9
#include "nsStyleConsts.h"
12
#include "nsStyleConsts.h"
10
#include "nsPresContext.h"
13
#include "nsPresContext.h"
11
#include "nsCSSRendering.h"
14
#include "nsCSSRendering.h"
12
#include "nsIContent.h"
15
#include "nsIContent.h"
13
#include "prinrval.h"
16
#include "prinrval.h"
 Lines 86-120   nsTableCaptionFrame::ComputeAutoSize(nsR Link Here 
86
    if (min > aCBSize.width)
89
    if (min > aCBSize.width)
87
      min = aCBSize.width;
90
      min = aCBSize.width;
88
    if (min > result.width)
91
    if (min > result.width)
89
      result.width = min;
92
      result.width = min;
90
  }
93
  }
91
  return result;
94
  return result;
92
}
95
}
93
96
94
nsIFrame*
97
nsStyleContext*
95
nsTableCaptionFrame::GetParentStyleContextFrame() const
98
nsTableCaptionFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
96
{
99
{
97
  NS_PRECONDITION(mContent->GetParent(),
100
  MOZ_ASSERT(GetContent()->GetParent(), "How could we not have a parent here?");
98
                  "How could we not have a parent here?");
99
    
101
    
102
  nsStyleContext* sc =
103
    PresContext()->FrameManager()->GetDisplayContents(GetContent()->GetParent());
104
  if (sc) {
105
    *aProviderFrame = nullptr;
106
    return sc;
107
  }
108
100
  // The caption's style context parent is the inner frame, unless
109
  // The caption's style context parent is the inner frame, unless
101
  // it's anonymous.
110
  // it's anonymous.
102
  nsIFrame* outerFrame = GetParent();
111
  nsIFrame* outerFrame = GetParent();
103
  if (outerFrame && outerFrame->GetType() == nsGkAtoms::tableOuterFrame) {
112
  if (outerFrame && outerFrame->GetType() == nsGkAtoms::tableOuterFrame) {
104
    nsIFrame* innerFrame = outerFrame->GetFirstPrincipalChild();
113
    nsIFrame* innerFrame = outerFrame->GetFirstPrincipalChild();
105
    if (innerFrame) {
114
    if (innerFrame) {
106
      return nsFrame::CorrectStyleParentFrame(innerFrame,
115
      // XXX probably wrong if we want to deal with display:contents
107
                                              StyleContext()->GetPseudo());
116
      *aProviderFrame = nsFrame::CorrectStyleParentFrame(innerFrame,
117
                                   StyleContext()->GetPseudo());
118
      return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
108
    }
119
    }
109
  }
120
  }
110
121
111
  NS_NOTREACHED("Where is our inner table frame?");
122
  NS_NOTREACHED("Where is our inner table frame?");
112
  return nsBlockFrame::GetParentStyleContextFrame();
123
  return nsBlockFrame::GetParentStyleContext(aProviderFrame);
113
}
124
}
114
125
115
#ifdef ACCESSIBILITY
126
#ifdef ACCESSIBILITY
116
a11y::AccType
127
a11y::AccType
117
nsTableCaptionFrame::AccessibleType()
128
nsTableCaptionFrame::AccessibleType()
118
{
129
{
119
  if (!GetRect().IsEmpty()) {
130
  if (!GetRect().IsEmpty()) {
120
    return a11y::eHTMLCaptionType;
131
    return a11y::eHTMLCaptionType;
 Lines 325-354   nsTableOuterFrame::BuildDisplayListForIn Link Here 
325
  nsIFrame* kid = mFrames.FirstChild();
336
  nsIFrame* kid = mFrames.FirstChild();
326
  // The children should be in content order
337
  // The children should be in content order
327
  while (kid) {
338
  while (kid) {
328
    BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
339
    BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
329
    kid = kid->GetNextSibling();
340
    kid = kid->GetNextSibling();
330
  }
341
  }
331
}
342
}
332
343
333
nsIFrame*
344
nsStyleContext*
334
nsTableOuterFrame::GetParentStyleContextFrame() const
345
nsTableOuterFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
335
{
346
{
336
  // The table outer frame and the (inner) table frame split the style
347
  // The table outer frame and the (inner) table frame split the style
337
  // data by giving the table frame the style context associated with
348
  // data by giving the table frame the style context associated with
338
  // the table content node and creating a style context for the outer
349
  // the table content node and creating a style context for the outer
339
  // frame that is a *child* of the table frame's style context,
350
  // frame that is a *child* of the table frame's style context,
340
  // matching the ::-moz-table-outer pseudo-element.  html.css has a
351
  // matching the ::-moz-table-outer pseudo-element.  html.css has a
341
  // rule that causes that pseudo-element (and thus the outer table)
352
  // rule that causes that pseudo-element (and thus the outer table)
342
  // to inherit *some* style properties from the table frame.  The
353
  // to inherit *some* style properties from the table frame.  The
343
  // children of the table inherit directly from the inner table, and
354
  // children of the table inherit directly from the inner table, and
344
  // the outer table's style context is a leaf.
355
  // the outer table's style context is a leaf.
345
356
346
  return InnerTableFrame();
357
  return (*aProviderFrame = InnerTableFrame())->StyleContext();
347
}
358
}
348
359
349
// INCREMENTAL REFLOW HELPER FUNCTIONS 
360
// INCREMENTAL REFLOW HELPER FUNCTIONS 
350
361
351
void
362
void
352
nsTableOuterFrame::InitChildReflowState(nsPresContext&    aPresContext,                     
363
nsTableOuterFrame::InitChildReflowState(nsPresContext&    aPresContext,                     
353
                                        nsHTMLReflowState& aReflowState)
364
                                        nsHTMLReflowState& aReflowState)
354
                                    
365
                                    
(-)a/layout/tables/nsTableOuterFrame.h (-2 / +2 lines)
Line     Link Here 
 Lines 21-37   public: Link Here 
21
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
21
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
22
  friend nsIFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext*  aContext);
22
  friend nsIFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext*  aContext);
23
23
24
  virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
24
  virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
25
                                 nsSize aCBSize, nscoord aAvailableWidth,
25
                                 nsSize aCBSize, nscoord aAvailableWidth,
26
                                 nsSize aMargin, nsSize aBorder,
26
                                 nsSize aMargin, nsSize aBorder,
27
                                 nsSize aPadding, bool aShrinkWrap);
27
                                 nsSize aPadding, bool aShrinkWrap);
28
28
29
  virtual nsIFrame* GetParentStyleContextFrame() const;
29
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const MOZ_OVERRIDE;
30
30
31
#ifdef ACCESSIBILITY
31
#ifdef ACCESSIBILITY
32
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
32
  virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
33
#endif
33
#endif
34
34
35
#ifdef DEBUG
35
#ifdef DEBUG
36
  NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
36
  NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
37
#endif
37
#endif
 Lines 125-141   public: Link Here 
125
   * @see nsGkAtoms::tableOuterFrame
125
   * @see nsGkAtoms::tableOuterFrame
126
   */
126
   */
127
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
127
  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
128
128
129
#ifdef DEBUG
129
#ifdef DEBUG
130
  NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
130
  NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
131
#endif
131
#endif
132
132
133
  virtual nsIFrame* GetParentStyleContextFrame() const MOZ_OVERRIDE;
133
  virtual nsStyleContext* GetParentStyleContext(nsIFrame** aProviderFrame) const MOZ_OVERRIDE;
134
134
135
  /**
135
  /**
136
   * Return the content for the cell at the given row and column.
136
   * Return the content for the cell at the given row and column.
137
   */
137
   */
138
  nsIContent* GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const;
138
  nsIContent* GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const;
139
139
140
  /**
140
  /**
141
   * Return the number of rows in the table.
141
   * Return the number of rows in the table.

Return to bug 907396