Files
palemoon27/layout/tables/nsTableColGroupFrame.h
roytam1 7d12d066b1 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 766345 - Part 1 - Implement DEAA Antialiasing for transformed layers (v5 Patch). r=vladimir, r=djg (a5b4175d8)
- Bug 766345 - Part 2 - Implement Matrix4x4::TransformAndClipRect (v2 Patch). r=vladimir (fba290751)
- Bug 766345 - Part 3 - Implement correct clipping of DEAA edges for quads that cross the w=0 plane (v3 Patch). r=vlad (1574cd5e8)
- Bug 766345 - Part 4: Adjust reftests (v3 patch). r=vlad (8a78cc3c4)
- Bug 1158120 - Replace nsIntSize by mozilla::gfx::IntSize in gfx/layers. r=nical (39b6ad475)
- Bug 1170189 - Simplify TiledContentHost's render loop. r=BenWa (040aac295)
- Bug 1170189 - Simplify the client-side tiling code. r=BenWa (069820cf1)
- Bug 1170189 - Remove the TiledLayerComposer interface. r=BenWa (843da52ff)
- Bug 1158122 - Remove some of the occurences of nsIntRect in gfx. r=nical (600608f14)
- Bug 1181240 - Part 3: Replace gfx3DMatrix with Matrix4x4 in gfx,r=vlad (e27a99500)
- Bug 1181240 - Part 4: Remove gfx3DMatrix,r=vlad (36138a985)
- Bug 997709 part 1 - nsComboboxDisplayFrame can't be split so its reflow status is always NS_FRAME_COMPLETE. r=heycam (15696aad1)
- Bug 997709 part 2 - Prevent the nsComboboxDisplayFrame from being blockified if the parent context has display:flex/grid. r=heycam (7bedb6d69)
- Bug 1140216. Remove asserts that stuff that we never create is not null, since it clearly is null. r=jwatt (aad9d387b)
- Bug 997709 part 3 - tests. (50f3e3a16)
- Bug 1113206: Make nsComboboxControlFrame and nsListControlFrame use logical coordinates and support vertical writing modes - patch by smontagu with additions by jfkthame. r=jfkthame,smontagu (aaaff31e9)
- Bug 1181890 - Center children of ruby content frame if necessary after the bidi reposition. r=jfkthame (8b3b5fdb2)
- Bug 1123284 - pt 1 - Make nsTextBoxFrame somewhat aware of vertical writing mode, to allow <input type=file> to display properly. r=smontagu (b395ba174)
- Bug 1123284 - pt 2 - Fix Get{Min,Pref}ISize in nsLeafBoxFrame for vertical mode. r=smontagu (4a828e0ab)
- Bug 1079151 - patch 1 - Update constraint calculations in nsHTMLReflowState to work with logical coordinates. r=smontagu (ce11e8f6b)
- Bug 1079151 - patch 2 - Convert nsAbsoluteContainingBlock to use logial coordinates. r=smontagu (ad2b0000c)
- Bug 1079151 - patch 3 - Remove failure annotations from the vertical abs-pos reftests. r=smontagu (d95333230)
- Bug 1079151 - patch 4 - Handle unconstrained inline-size when computing constraints for an orthogonal absolutely-positioned block. r=smontagu (99ffede00)
- Bug 1079151 - Updated test files with corrected comments and references as needed. r=jfkthame (c655a98d0)
- Bug 1175492 - unpref transform-origin percentage handling for SVG elements r=jwatt (cda2fffa7)
- Bug 1175094 - Include borderPadding in the combobox's containerWidth, so that dropdown arrow is positioned correctly in RTL. r=smontagu (e93ccaa34)
- Bug 1177614 - Provide a utility method on nsHTMLReflowState to return the computed size including border-padding, for use as a container for logical coordinate conversions, or zero if unconstrained. r=dholbert (89feb2d8a)
- Bug 1180178: Add writing-mode and logical coordinates to frame dumps, r=jfkthame (786a6d878)
- Bug 1157569 - part 12 - Convert physical values from BCPropertyData to logical when returning from Get[Included]OuterBCBorder. r=roc (2d5790f2a)
- Bug 1157569 - part 13 - More conversion of physical to logical terminology in border-collapse calculations. r=dholbert (a85618bf4)
- Bug 1176523 - Convert Get/SetContinuousBCBorderWidth in nsTableColFrame and nsTableColGroupFrame to logical coordinates. r=dholbert (6198c6eb3)
- Bug 1157569 - part 14 - Finish conversion of border-collapse code in nsTableFrame to logical coordinates. r=dholbert (700bbf09b)
- Bug 1157569 - Reftest for RTL table with border-collapse. r=roc (aa4fc0092)
- Bug 1157569 - Followup to address review nits (renamings, comment updates) from parts 13 and 14. (6cccb95df)
- Bug 903135 - Multi platform MAR verification updater support. r=rstrong (7643732df)
- Bug 991993: Disable NSS for updater on OSX and enable native APIs. r=smichaud,rstrong (1490dead8)
2021-03-05 09:13:17 +08:00

257 lines
9.7 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsTableColGroupFrame_h__
#define nsTableColGroupFrame_h__
#include "mozilla/Attributes.h"
#include "nscore.h"
#include "nsContainerFrame.h"
#include "nsTableFrame.h"
#include "mozilla/WritingModes.h"
class nsTableColFrame;
/**
* nsTableColGroupFrame
* data structure to maintain information about a single table cell's frame
*
* @author sclark
*/
class nsTableColGroupFrame final : public nsContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
// default constructor supplied by the compiler
/** instantiate a new instance of nsTableRowFrame.
* @param aPresShell the pres shell for this frame
*
* @return the frame that was created
*/
friend nsTableColGroupFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
nsTableFrame* GetTableFrame() const
{
nsIFrame* parent = GetParent();
MOZ_ASSERT(parent && parent->GetType() == nsGkAtoms::tableFrame);
MOZ_ASSERT(!parent->GetPrevInFlow(),
"Col group should always be in a first-in-flow table frame");
return static_cast<nsTableFrame*>(parent);
}
/**
* ColGroups never paint anything, nor receive events.
*/
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {}
/** A colgroup can be caused by three things:
* 1) An element with table-column-group display
* 2) An element with a table-column display without a
* table-column-group parent
* 3) Cells that are not in a column (and hence get an anonymous
* column and colgroup).
* @return colgroup type
*/
nsTableColGroupType GetColType() const;
/** Set the colgroup type based on the creation cause
* @param aType - the reason why this colgroup is needed
*/
void SetColType(nsTableColGroupType aType);
/** Real in this context are colgroups that come from an element
* with table-column-group display or wrap around columns that
* come from an element with table-column display. Colgroups
* that are the result of wrapping cells in an anonymous
* column and colgroup are not considered real here.
* @param aTableFrame - the table parent of the colgroups
* @return the last real colgroup
*/
static nsTableColGroupFrame* GetLastRealColGroup(nsTableFrame* aTableFrame);
/** @see nsIFrame::DidSetStyleContext */
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) override;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) override;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) override;
/** remove the column aChild from the column group, if requested renumber
* the subsequent columns in this column group and all following column
* groups. see also ResetColIndices for this
* @param aChild - the column frame that needs to be removed
* @param aResetSubsequentColIndices - if true the columns that follow
* after aChild will be reenumerated
*/
void RemoveChild(nsTableColFrame& aChild,
bool aResetSubsequentColIndices);
/** reflow of a column group is a trivial matter of reflowing
* the col group's children (columns), and setting this frame
* to 0-size. Since tables are row-centric, column group frames
* don't play directly in the rendering game. They do however
* maintain important state that effects table and cell layout.
*/
virtual void Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::tableColGroupFrame
*/
virtual nsIAtom* GetType() const override;
virtual mozilla::WritingMode GetWritingMode() const override
{ return GetTableFrame()->GetWritingMode(); }
/** Add column frames to the table storages: colframe cache and cellmap
* this doesn't change the mFrames of the colgroup frame.
* @param aFirstColIndex - the index at which aFirstFrame should be inserted
* into the colframe cache.
* @param aResetSubsequentColIndices - the indices of the col frames
* after the insertion might need
* an update
* @param aCols - an iterator that can be used to iterate over the col
* frames to be added. Once this is done, the frames on the
* sbling chain of its .get() at that point will still need
* their col indices updated.
* @result - if there is no table frame or the table frame is not
* the first in flow it will return an error
*/
nsresult AddColsToTable(int32_t aFirstColIndex,
bool aResetSubsequentColIndices,
const nsFrameList::Slice& aCols);
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
void Dump(int32_t aIndent);
#endif
/** returns the number of columns represented by this group.
* if there are col children, count them (taking into account the span of each)
* else, check my own span attribute.
*/
virtual int32_t GetColCount() const;
/** first column on the child list */
nsTableColFrame * GetFirstColumn();
/** next sibling to aChildFrame that is a column frame, first column frame
* in the column group if aChildFrame is null
*/
nsTableColFrame * GetNextColumn(nsIFrame *aChildFrame);
/** @return - the position of the first column in this colgroup in the table
* colframe cache.
*/
int32_t GetStartColumnIndex();
/** set the position of the first column in this colgroup in the table
* colframe cache.
*/
void SetStartColumnIndex(int32_t aIndex);
/** helper method to get the span attribute for this colgroup */
int32_t GetSpan();
/** provide access to the mFrames list
*/
nsFrameList& GetWritableChildList();
/** set the column index for all frames starting at aStartColFrame, it
* will also reset the column indices in all subsequent colgroups
* @param aFirstColGroup - start the reset operation inside this colgroup
* @param aFirstColIndex - first column that is reset should get this index
* @param aStartColFrame - if specified the reset starts with this column
* inside the colgroup; if not specified, the reset
* starts with the first column
*/
static void ResetColIndices(nsIFrame* aFirstColGroup,
int32_t aFirstColIndex,
nsIFrame* aStartColFrame = nullptr);
/**
* Gets inner border widths before collapsing with cell borders
* Caller must get istart border from previous column
* GetContinuousBCBorderWidth will not overwrite aBorder.IStart
* see nsTablePainter about continuous borders
*/
void GetContinuousBCBorderWidth(mozilla::WritingMode aWM,
mozilla::LogicalMargin& aBorder);
/**
* Set full border widths before collapsing with cell borders
* @param aForSide - side to set; only accepts bstart and bend
*/
void SetContinuousBCBorderWidth(mozilla::LogicalSide aForSide,
BCPixelSize aPixelValue);
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart));
}
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) override;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
protected:
explicit nsTableColGroupFrame(nsStyleContext* aContext);
void InsertColsReflow(int32_t aColIndex,
const nsFrameList::Slice& aCols);
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const override;
// data members
int32_t mColCount;
// the starting column index this col group represents. Must be >= 0.
int32_t mStartColIndex;
// border width in pixels
BCPixelSize mBStartContBorderWidth;
BCPixelSize mBEndContBorderWidth;
};
inline nsTableColGroupFrame::nsTableColGroupFrame(nsStyleContext *aContext)
: nsContainerFrame(aContext), mColCount(0), mStartColIndex(0)
{
SetColType(eColGroupContent);
}
inline int32_t nsTableColGroupFrame::GetStartColumnIndex()
{
return mStartColIndex;
}
inline void nsTableColGroupFrame::SetStartColumnIndex (int32_t aIndex)
{
mStartColIndex = aIndex;
}
inline int32_t nsTableColGroupFrame::GetColCount() const
{
return mColCount;
}
inline nsFrameList& nsTableColGroupFrame::GetWritableChildList()
{
return mFrames;
}
#endif