mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Backed out changeset e7ec499159f7 (bug 1364361) for bustage at nsIFrame.h:3348: bad implicit conversion constructor for 'OwnedAnonBox'. r=backout
This commit is contained in:
parent
c21843350e
commit
9365133d05
@ -1189,10 +1189,15 @@ nsComboboxControlFrame::GetContentInsertionFrame() {
|
||||
}
|
||||
|
||||
void
|
||||
nsComboboxControlFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsComboboxControlFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
aResult.AppendElement(OwnedAnonBox(mDropdownFrame));
|
||||
aResult.AppendElement(OwnedAnonBox(mDisplayFrame));
|
||||
UpdateStyleOfChildAnonBox(mDropdownFrame, aStyleSet, aChangeList,
|
||||
aHintForThisFrame);
|
||||
UpdateStyleOfChildAnonBox(mDisplayFrame, aStyleSet, aChangeList,
|
||||
aHintForThisFrame);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -117,8 +117,10 @@ public:
|
||||
|
||||
virtual nsContainerFrame* GetContentInsertionFrame() override;
|
||||
|
||||
// Return the dropdown and display frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
// Update the style on the block wrappers around our kids.
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
// nsIFormControlFrame
|
||||
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override;
|
||||
|
@ -664,10 +664,13 @@ nsFieldSetFrame::GetNaturalBaselineBOffset(WritingMode aWM,
|
||||
}
|
||||
|
||||
void
|
||||
nsFieldSetFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsFieldSetFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
if (nsIFrame* kid = GetInner()) {
|
||||
aResult.AppendElement(OwnedAnonBox(kid));
|
||||
nsIFrame* kid = GetInner();
|
||||
if (kid) {
|
||||
UpdateStyleOfChildAnonBox(kid, aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,11 @@ public:
|
||||
return do_QueryFrame(GetInner());
|
||||
}
|
||||
|
||||
// Return the block wrapper around our kids.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
// Update the style on the block wrappers around our kids.
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
virtual mozilla::a11y::AccType AccessibleType() override;
|
||||
|
@ -396,12 +396,16 @@ nsHTMLButtonControlFrame::SetAdditionalStyleContext(int32_t aIndex,
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLButtonControlFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsHTMLButtonControlFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(mFrames.FirstChild(), "Must have our button-content anon box");
|
||||
MOZ_ASSERT(!mFrames.FirstChild()->GetNextSibling(),
|
||||
"Must only have our button-content anon box");
|
||||
aResult.AppendElement(OwnedAnonBox(mFrames.FirstChild()));
|
||||
UpdateStyleOfChildAnonBox(mFrames.FirstChild(),
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -98,9 +98,12 @@ public:
|
||||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
||||
}
|
||||
|
||||
// Return the ::-moz-button-content anonymous box.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
/**
|
||||
* Update the style of our ::-moz-button-content anonymous box.
|
||||
*/
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
protected:
|
||||
nsHTMLButtonControlFrame(nsStyleContext* aContext, nsIFrame::ClassID aID);
|
||||
|
||||
|
@ -1260,7 +1260,10 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
void
|
||||
nsColumnSetFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsColumnSetFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
// Everything in mFrames is continuations of the first thing in mFrames.
|
||||
nsIFrame* column = mFrames.FirstChild();
|
||||
@ -1273,7 +1276,7 @@ nsColumnSetFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
MOZ_ASSERT(column->StyleContext()->GetPseudo() ==
|
||||
nsCSSAnonBoxes::columnContent,
|
||||
"What sort of child is this?");
|
||||
aResult.AppendElement(OwnedAnonBox(column));
|
||||
UpdateStyleOfChildAnonBox(column, aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -77,8 +77,12 @@ public:
|
||||
*/
|
||||
void DrainOverflowColumns();
|
||||
|
||||
// Return the column-content frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
/**
|
||||
* Update the style on our column-content frames.
|
||||
*/
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override {
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "mozilla/GeckoRestyleManager.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/RestyleManagerInlines.h"
|
||||
#include "nsInlineFrame.h"
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsISelectionPrivate.h"
|
||||
@ -10201,10 +10201,10 @@ nsFrame::BoxMetrics() const
|
||||
}
|
||||
|
||||
void
|
||||
nsIFrame::UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame,
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
nsFrame::UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame,
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(aChildFrame->GetParent() == this,
|
||||
"This should only be used for children!");
|
||||
@ -10479,73 +10479,16 @@ nsIFrame::IsScrolledOutOfView()
|
||||
return IsFrameScrolledOutOfView(this);
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
void
|
||||
nsIFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
// As a special case, we check for {ib}-split block frames here, rather
|
||||
// than have an nsInlineFrame::AppendDirectlyOwnedAnonBoxes implementation
|
||||
// that returns them.
|
||||
//
|
||||
// (If we did handle them in AppendDirectlyOwnedAnonBoxes, we would have to
|
||||
// return *all* of the in-flow {ib}-split block frames, not just the first
|
||||
// one. For restyling, we really just need the first in flow, and the other
|
||||
// user of the AppendOwnedAnonBoxes API, AllChildIterator, doesn't need to
|
||||
// know about them at all, since these block frames never create NAC. So we
|
||||
// avoid any unncessary hashtable lookups for the {ib}-split frames by calling
|
||||
// UpdateStyleOfOwnedAnonBoxesForIBSplit directly here.)
|
||||
if (IsInlineFrame()) {
|
||||
if ((GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
|
||||
static_cast<nsInlineFrame*>(this)->
|
||||
UpdateStyleOfOwnedAnonBoxesForIBSplit(aStyleSet, aChangeList,
|
||||
aHintForThisFrame);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
AutoTArray<OwnedAnonBox,4> frames;
|
||||
AppendDirectlyOwnedAnonBoxes(frames);
|
||||
for (OwnedAnonBox& box : frames) {
|
||||
if (box.mUpdateStyleFn) {
|
||||
box.mUpdateStyleFn(this, box.mAnonBoxFrame,
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
} else {
|
||||
UpdateStyleOfChildAnonBox(box.mAnonBoxFrame,
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
nsIFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(!(GetStateBits() & NS_FRAME_OWNS_ANON_BOXES));
|
||||
MOZ_ASSERT(false, "Why did this get called?");
|
||||
}
|
||||
|
||||
void
|
||||
nsIFrame::DoAppendOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
{
|
||||
size_t i = aResult.Length();
|
||||
AppendDirectlyOwnedAnonBoxes(aResult);
|
||||
|
||||
// After appending the directly owned anonymous boxes of this frame to
|
||||
// aResult above, we need to check each of them to see if they own
|
||||
// any anonymous boxes themselves. Note that we keep progressing
|
||||
// through aResult, looking for additional entries in aResult from these
|
||||
// subsequent AppendDirectlyOwnedAnonBoxes calls. (Thus we can't
|
||||
// use a ranged for loop here.)
|
||||
|
||||
while (i < aResult.Length()) {
|
||||
nsIFrame* f = aResult[i].mAnonBoxFrame;
|
||||
if (f->GetStateBits() & NS_FRAME_OWNS_ANON_BOXES) {
|
||||
f->AppendDirectlyOwnedAnonBoxes(aResult);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame::CaretPosition::CaretPosition()
|
||||
: mContentOffset(0)
|
||||
{
|
||||
|
@ -701,6 +701,13 @@ protected:
|
||||
// Fire DOM event. If no aContent argument use frame's mContent.
|
||||
void FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent = nullptr);
|
||||
|
||||
// A helper for implementing UpdateStyleOfOwnedAnonBoxes for the specific case
|
||||
// of the owned anon box being a child of this frame.
|
||||
void UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame,
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
|
||||
private:
|
||||
void BoxReflow(nsBoxLayoutState& aState,
|
||||
nsPresContext* aPresContext,
|
||||
|
@ -1042,9 +1042,12 @@ public:
|
||||
return mHelper.IsRootScrollFrameOfDocument();
|
||||
}
|
||||
|
||||
// Return the scrolled frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override {
|
||||
aResult.AppendElement(OwnedAnonBox(mHelper.GetScrolledFrame()));
|
||||
// Update the style on our scrolled frame.
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override {
|
||||
UpdateStyleOfChildAnonBox(mHelper.GetScrolledFrame(), aStyleSet,
|
||||
aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
@ -1484,9 +1487,11 @@ public:
|
||||
return mHelper.IsRootScrollFrameOfDocument();
|
||||
}
|
||||
|
||||
// Return the scrolled frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override {
|
||||
aResult.AppendElement(OwnedAnonBox(mHelper.GetScrolledFrame()));
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override {
|
||||
UpdateStyleOfChildAnonBox(mHelper.GetScrolledFrame(), aStyleSet,
|
||||
aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
|
@ -414,12 +414,15 @@ nsHTMLCanvasFrame::GetContinuationOffset(nscoord* aWidth) const
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLCanvasFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsHTMLCanvasFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(mFrames.FirstChild(), "Must have our canvas content anon box");
|
||||
MOZ_ASSERT(!mFrames.FirstChild()->GetNextSibling(),
|
||||
"Must only have our canvas content anon box");
|
||||
aResult.AppendElement(OwnedAnonBox(mFrames.FirstChild()));
|
||||
UpdateStyleOfChildAnonBox(mFrames.FirstChild(),
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
@ -97,9 +97,12 @@ public:
|
||||
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
|
||||
}
|
||||
|
||||
// Return the ::-moz-html-canvas-content anonymous box.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
/**
|
||||
* Update the style of our ::-moz-html-canvas-content anonymous box.
|
||||
*/
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
protected:
|
||||
virtual ~nsHTMLCanvasFrame();
|
||||
|
||||
|
@ -3310,22 +3310,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
// This does the actual work of UpdateStyleOfOwnedAnonBoxes. It calls
|
||||
// AppendDirectlyOwnedAnonBoxes to find all of the anonymous boxes
|
||||
// owned by this frame, and then updates styles on each of them.
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
|
||||
// A helper for DoUpdateStyleOfOwnedAnonBoxes for the specific case
|
||||
// of the owned anon box being a child of this frame.
|
||||
void UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame,
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
|
||||
public:
|
||||
// A helper both for UpdateStyleOfChildAnonBox, and to update frame-backed
|
||||
// pseudo-elements in ServoRestyleManager.
|
||||
//
|
||||
@ -3334,57 +3318,17 @@ public:
|
||||
// and adding to the change list as appropriate.
|
||||
//
|
||||
// Returns the generated change hint for the frame.
|
||||
nsChangeHint UpdateStyleOfOwnedChildFrame(
|
||||
nsIFrame* aChildFrame,
|
||||
nsStyleContext* aNewStyleContext,
|
||||
nsStyleChangeList& aChangeList);
|
||||
|
||||
struct OwnedAnonBox
|
||||
{
|
||||
typedef void (*UpdateStyleFn)(nsIFrame* aOwningFrame, nsIFrame* aAnonBox,
|
||||
mozilla::ServoStyleSet&,
|
||||
nsStyleChangeList&, nsChangeHint);
|
||||
|
||||
OwnedAnonBox(nsIFrame* aAnonBoxFrame,
|
||||
UpdateStyleFn aUpdateStyleFn = nullptr)
|
||||
: mAnonBoxFrame(aAnonBoxFrame)
|
||||
, mUpdateStyleFn(aUpdateStyleFn)
|
||||
{}
|
||||
|
||||
nsIFrame* mAnonBoxFrame;
|
||||
UpdateStyleFn mUpdateStyleFn;
|
||||
};
|
||||
nsChangeHint UpdateStyleOfOwnedChildFrame(nsIFrame* aChildFrame,
|
||||
nsStyleContext* aNewStyleContext,
|
||||
nsStyleChangeList& aChangeList);
|
||||
|
||||
/**
|
||||
* Appends information about all of the anonymous boxes owned by this frame,
|
||||
* including other anonymous boxes owned by those which this frame owns
|
||||
* directly.
|
||||
* Hook subclasses can override to actually implement updating of style of
|
||||
* owned anon boxes.
|
||||
*/
|
||||
void AppendOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) {
|
||||
if (GetStateBits() & NS_FRAME_OWNS_ANON_BOXES) {
|
||||
if (IsInlineFrame()) {
|
||||
// See comment in nsIFrame::DoUpdateStyleOfOwnedAnonBoxes for why
|
||||
// we skip nsInlineFrames.
|
||||
return;
|
||||
}
|
||||
DoAppendOwnedAnonBoxes(aResult);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
// This does the actual work of AppendOwnedAnonBoxes.
|
||||
void DoAppendOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult);
|
||||
|
||||
public:
|
||||
/**
|
||||
* Hook subclasses can override to return their owned anonymous boxes.
|
||||
*
|
||||
* This function only appends anonymous boxes that are directly owned by
|
||||
* this frame, i.e. direct children or (for certain frames) a wrapper
|
||||
* parent, unlike AppendOwnedAnonBoxes, which will append all anonymous
|
||||
* boxes transitively owned by this frame.
|
||||
*/
|
||||
virtual void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult);
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
|
||||
/**
|
||||
* Determines whether a frame is visible for painting;
|
||||
|
@ -1014,10 +1014,9 @@ nsInlineFrame::AccessibleType()
|
||||
#endif
|
||||
|
||||
void
|
||||
nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit(
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
nsInlineFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(GetStateBits() & NS_FRAME_OWNS_ANON_BOXES,
|
||||
"Why did we get called?");
|
||||
|
@ -114,12 +114,12 @@ public:
|
||||
: (!GetNextInFlow());
|
||||
}
|
||||
|
||||
// Restyles the block wrappers around our non-inline-outside kids.
|
||||
// Update the style on the block wrappers around our non-inline-outside kids.
|
||||
// This will only be called when such wrappers in fact exist.
|
||||
void UpdateStyleOfOwnedAnonBoxesForIBSplit(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
protected:
|
||||
// Additional reflow state used during our reflow methods
|
||||
|
@ -5582,8 +5582,11 @@ SVGTextFrame::TransformFrameRectFromTextChild(const nsRect& aRect,
|
||||
}
|
||||
|
||||
void
|
||||
SVGTextFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
SVGTextFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(PrincipalChildList().FirstChild(), "Must have our anon box");
|
||||
aResult.AppendElement(OwnedAnonBox(PrincipalChildList().FirstChild()));
|
||||
UpdateStyleOfChildAnonBox(PrincipalChildList().FirstChild(),
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
@ -353,8 +353,12 @@ public:
|
||||
gfxRect TransformFrameRectFromTextChild(const nsRect& aRect,
|
||||
nsIFrame* aChildFrame);
|
||||
|
||||
// Return our ::-moz-svg-text anonymous box.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
/**
|
||||
* Update the style of our ::-moz-svg-text anonymous box.
|
||||
*/
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -572,8 +572,12 @@ nsSVGForeignObjectFrame::GetInvalidRegion()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGForeignObjectFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsSVGForeignObjectFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(PrincipalChildList().FirstChild(), "Must have our anon box");
|
||||
aResult.AppendElement(OwnedAnonBox(PrincipalChildList().FirstChild()));
|
||||
UpdateStyleOfChildAnonBox(PrincipalChildList().FirstChild(),
|
||||
aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
@ -82,8 +82,12 @@ public:
|
||||
|
||||
nsRect GetInvalidRegion();
|
||||
|
||||
// Return our ::-moz-svg-foreign-content anonymous box.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
/**
|
||||
* Update the style of our ::-moz-svg-foreign-content anonymous box.
|
||||
*/
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
|
@ -201,9 +201,13 @@ nsSVGMarkerFrame::SetParentCoordCtxProvider(SVGSVGElement *aContext)
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGMarkerFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsSVGMarkerFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
aResult.AppendElement(OwnedAnonBox(GetAnonymousChildFrame(this)));
|
||||
UpdateStyleOfChildAnonBox(GetAnonymousChildFrame(this), aStyleSet,
|
||||
aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -90,8 +90,10 @@ public:
|
||||
const nsSVGMark& aMark,
|
||||
float aStrokeWidth);
|
||||
|
||||
// Return our anonymous box child.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
// Update the style on our anonymous box child.
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
private:
|
||||
// stuff needed for callback
|
||||
|
@ -971,11 +971,14 @@ nsSVGOuterSVGFrame::VerticalScrollbarNotNeeded() const
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGOuterSVGFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsSVGOuterSVGFrame::DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
nsIFrame* anonKid = PrincipalChildList().FirstChild();
|
||||
MOZ_ASSERT(anonKid->IsSVGOuterSVGAnonChildFrame());
|
||||
aResult.AppendElement(OwnedAnonBox(anonKid));
|
||||
UpdateStyleOfChildAnonBox(anonKid, aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -99,8 +99,10 @@ public:
|
||||
bool IsSVGTransformed(Matrix* aOwnTransform,
|
||||
Matrix* aFromParentTransform) const override;
|
||||
|
||||
// Return our anonymous box child.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
// Update the style on our anonymous box child.
|
||||
void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
// nsISVGSVGFrame interface:
|
||||
virtual void NotifyViewportOrTransformChanged(uint32_t aFlags) override;
|
||||
|
@ -1065,12 +1065,14 @@ nsTableCellFrame::GetBorderWidth(WritingMode aWM) const
|
||||
}
|
||||
|
||||
void
|
||||
nsTableCellFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsTableCellFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
MOZ_ASSERT(kid && !kid->GetNextSibling(),
|
||||
"Table cells should have just one child");
|
||||
aResult.AppendElement(OwnedAnonBox(kid));
|
||||
UpdateStyleOfChildAnonBox(kid, aStyleSet, aChangeList, aHintForThisFrame);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
|
@ -158,8 +158,11 @@ public:
|
||||
|
||||
// there is no set row index because row index depends on the cell's parent row only
|
||||
|
||||
// Return our cell content frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
// Update the style on the block wrappers around our kids.
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
|
||||
/*---------------- nsITableCellLayout methods ------------------------*/
|
||||
|
||||
|
@ -8001,31 +8001,19 @@ nsTableFrame::InvalidateTableFrame(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
void
|
||||
nsTableFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
nsTableFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
nsIFrame* wrapper = GetParent();
|
||||
MOZ_ASSERT(wrapper->StyleContext()->GetPseudo() ==
|
||||
nsCSSAnonBoxes::tableWrapper,
|
||||
"What happened to our parent?");
|
||||
aResult.AppendElement(
|
||||
OwnedAnonBox(wrapper, &UpdateStyleOfOwnedAnonBoxesForTableWrapper));
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsTableFrame::UpdateStyleOfOwnedAnonBoxesForTableWrapper(
|
||||
nsIFrame* aOwningFrame,
|
||||
nsIFrame* aWrapperFrame,
|
||||
ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame)
|
||||
{
|
||||
MOZ_ASSERT(aWrapperFrame->StyleContext()->GetPseudo() ==
|
||||
MOZ_ASSERT(wrapper->StyleContext()->GetPseudo() ==
|
||||
nsCSSAnonBoxes::tableWrapper,
|
||||
"What happened to our parent?");
|
||||
|
||||
RefPtr<nsStyleContext> newContext =
|
||||
aStyleSet.ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::tableWrapper,
|
||||
aOwningFrame->StyleContext());
|
||||
StyleContext());
|
||||
|
||||
// Figure out whether we have an actual change. It's important that we do
|
||||
// this, even though all the wrapper's changes are due to properties it
|
||||
@ -8033,19 +8021,18 @@ nsTableFrame::UpdateStyleOfOwnedAnonBoxesForTableWrapper(
|
||||
// style structs and hence changes to them aren't reflected in
|
||||
// aHintForThisFrame at all.
|
||||
uint32_t equalStructs, samePointerStructs; // Not used, actually.
|
||||
nsChangeHint wrapperHint = aWrapperFrame->StyleContext()->CalcStyleDifference(
|
||||
nsChangeHint wrapperHint = wrapper->StyleContext()->CalcStyleDifference(
|
||||
newContext,
|
||||
&equalStructs,
|
||||
&samePointerStructs);
|
||||
if (wrapperHint) {
|
||||
aChangeList.AppendChange(aWrapperFrame, aWrapperFrame->GetContent(),
|
||||
wrapperHint);
|
||||
aChangeList.AppendChange(wrapper, wrapper->GetContent(), wrapperHint);
|
||||
}
|
||||
|
||||
for (nsIFrame* cur = aWrapperFrame; cur; cur = cur->GetNextContinuation()) {
|
||||
for (nsIFrame* cur = wrapper; cur; cur = cur->GetNextContinuation()) {
|
||||
cur->SetStyleContext(newContext);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!(aWrapperFrame->GetStateBits() & NS_FRAME_OWNS_ANON_BOXES),
|
||||
MOZ_ASSERT(!(wrapper->GetStateBits() & NS_FRAME_OWNS_ANON_BOXES),
|
||||
"Wrapper frame doesn't have any anon boxes of its own!");
|
||||
}
|
||||
|
@ -593,16 +593,12 @@ public:
|
||||
|
||||
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
|
||||
|
||||
// Return our wrapper frame.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
// Update the style of our table wrapper frame.
|
||||
virtual void DoUpdateStyleOfOwnedAnonBoxes(
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame) override;
|
||||
protected:
|
||||
static void UpdateStyleOfOwnedAnonBoxesForTableWrapper(
|
||||
nsIFrame* aOwningFrame,
|
||||
nsIFrame* aWrapperFrame,
|
||||
mozilla::ServoStyleSet& aStyleSet,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aHintForThisFrame);
|
||||
|
||||
/** protected constructor.
|
||||
* @see NewFrame
|
||||
|
Loading…
Reference in New Issue
Block a user