2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
1998-07-11 04:08:08 +04:00
|
|
|
#ifndef CellData_h__
|
|
|
|
#define CellData_h__
|
|
|
|
|
1999-10-09 03:42:13 +04:00
|
|
|
#include "nsISupports.h"
|
2017-06-17 03:49:09 +03:00
|
|
|
#include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
|
2002-02-19 18:48:28 +03:00
|
|
|
#include "nsCoord.h"
|
2011-06-24 21:41:16 +04:00
|
|
|
#include "mozilla/gfx/Types.h"
|
2015-06-27 21:16:03 +03:00
|
|
|
#include "mozilla/WritingModes.h"
|
2013-07-30 18:25:31 +04:00
|
|
|
#include <stdint.h>
|
1999-10-09 03:42:13 +04:00
|
|
|
|
1998-07-11 04:08:08 +04:00
|
|
|
class nsTableCellFrame;
|
2006-01-14 00:08:17 +03:00
|
|
|
class nsCellMap;
|
|
|
|
class BCCellData;
|
1998-07-11 04:08:08 +04:00
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
/**
|
2000-01-13 08:29:38 +03:00
|
|
|
* Data stored by nsCellMap to rationalize rowspan and colspan cells.
|
1998-07-11 04:08:08 +04:00
|
|
|
*/
|
|
|
|
class CellData {
|
|
|
|
public:
|
2010-04-27 20:15:01 +04:00
|
|
|
/** Initialize the mOrigCell pointer
|
|
|
|
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
|
|
|
*/
|
2002-02-19 18:48:28 +03:00
|
|
|
void Init(nsTableCellFrame* aCellFrame);
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** does a cell originate from here
|
|
|
|
* @return is true if a cell corresponds to this cellmap entry
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsOrig() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the celldata valid
|
2010-04-27 20:15:01 +04:00
|
|
|
* @return is true if no cell originates and the cell is not spanned by
|
2003-01-19 18:15:22 +03:00
|
|
|
* a row- or colspan. mBits are 0 in this case and mOrigCell is
|
2012-07-30 18:20:58 +04:00
|
|
|
* nullptr
|
2003-01-19 18:15:22 +03:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsDead() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the entry spanned by row- or a colspan
|
|
|
|
* @return is true if the entry is spanned by a row- or colspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsSpan() const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by rowspan
|
|
|
|
* @return is true if the entry is spanned by a rowspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsRowSpan() const;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by a zero rowspan
|
2010-04-27 20:15:01 +04:00
|
|
|
* zero rowspans span all cells starting from the originating cell down to
|
2003-01-19 18:15:22 +03:00
|
|
|
* the end of the rowgroup or a cell originating in the same column
|
|
|
|
* @return is true if the entry is spanned by a zero rowspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsZeroRowSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** mark the current entry as spanned by a zero rowspan
|
|
|
|
* @param aIsZero if true mark the entry as covered by a zero rowspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetZeroRowSpan(bool aIsZero);
|
2003-01-19 18:15:22 +03:00
|
|
|
|
2018-11-28 01:08:11 +03:00
|
|
|
/** get the distance from the current entry to the corresponding origin of the
|
|
|
|
* rowspan
|
|
|
|
* @return containing the distance in the column to the originating cell
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t GetRowSpanOffset() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
2018-12-21 06:07:05 +03:00
|
|
|
/** set the distance from the current entry to the corresponding origin of
|
|
|
|
* the rowspan
|
2018-11-28 01:08:11 +03:00
|
|
|
* @param the distance in the column to the originating cell
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void SetRowSpanOffset(uint32_t aSpan);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by colspan
|
|
|
|
* @return is true if the entry is spanned by a colspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsColSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
2018-12-21 06:07:05 +03:00
|
|
|
/** get the distance from the current entry to the corresponding origin of
|
|
|
|
* the colspan
|
2018-11-28 01:08:11 +03:00
|
|
|
* @return containing the distance in the row to the originating cell
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t GetColSpanOffset() const;
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** set the distance from the current entry to the corresponding origin of the
|
|
|
|
* colspan
|
|
|
|
* @param the distance in the column to the originating cell
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void SetColSpanOffset(uint32_t aSpan);
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by a row- and a colspan
|
|
|
|
* @return is true if the entry is spanned by a row- and a colspan
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsOverlap() const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** mark the current entry as spanned by a row- and a colspan
|
2018-12-21 06:07:05 +03:00
|
|
|
* @param aOverlap if true mark the entry as covered by a row- and
|
|
|
|
* a colspan
|
2003-01-19 18:15:22 +03:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetOverlap(bool aOverlap);
|
2010-04-27 20:15:01 +04:00
|
|
|
|
|
|
|
/** get the table cell frame for this entry
|
2012-07-30 18:20:58 +04:00
|
|
|
* @return a pointer to the cellframe, this will be nullptr when the entry
|
2003-01-19 18:15:22 +03:00
|
|
|
* is only a spanned entry
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
nsTableCellFrame* GetCellFrame() const;
|
|
|
|
|
2006-01-14 00:08:17 +03:00
|
|
|
private:
|
|
|
|
friend class nsCellMap;
|
|
|
|
friend class BCCellData;
|
|
|
|
|
2018-12-05 21:44:03 +03:00
|
|
|
/**
|
|
|
|
* Implemented in nsCellMap.cpp
|
|
|
|
*
|
2010-04-27 20:15:01 +04:00
|
|
|
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
2006-01-14 00:08:17 +03:00
|
|
|
*/
|
2018-12-05 21:44:03 +03:00
|
|
|
explicit CellData(nsTableCellFrame* aOrigCell);
|
2006-01-14 00:08:17 +03:00
|
|
|
|
|
|
|
~CellData(); // implemented in nsCellMap.cpp
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
protected:
|
|
|
|
// this union relies on the assumption that an object (not primitive type)
|
2010-04-27 20:15:01 +04:00
|
|
|
// does not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in
|
2000-01-13 08:29:38 +03:00
|
|
|
// effect and the data does not represent a span. If mSpan is 1, then mBits is
|
|
|
|
// in effect and the data represents a span. mBits must match the size of
|
2013-04-10 20:56:22 +04:00
|
|
|
// mOrigCell on both 32- and 64-bit platforms.
|
2000-01-13 08:29:38 +03:00
|
|
|
union {
|
|
|
|
nsTableCellFrame* mOrigCell;
|
2013-04-10 20:56:22 +04:00
|
|
|
uintptr_t mBits;
|
2000-01-13 08:29:38 +03:00
|
|
|
};
|
1998-07-11 04:08:08 +04:00
|
|
|
};
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
// Border Collapsing Cell Data
|
2010-04-27 20:15:01 +04:00
|
|
|
enum BCBorderOwner {
|
2002-02-19 18:48:28 +03:00
|
|
|
eTableOwner = 0,
|
2010-04-27 20:15:01 +04:00
|
|
|
eColGroupOwner = 1,
|
|
|
|
eAjaColGroupOwner = 2, // col group to the left
|
2002-02-19 18:48:28 +03:00
|
|
|
eColOwner = 3,
|
|
|
|
eAjaColOwner = 4, // col to the left
|
2010-04-27 20:15:01 +04:00
|
|
|
eRowGroupOwner = 5,
|
2002-02-19 18:48:28 +03:00
|
|
|
eAjaRowGroupOwner = 6, // row group above
|
2010-04-27 20:15:01 +04:00
|
|
|
eRowOwner = 7,
|
2002-02-19 18:48:28 +03:00
|
|
|
eAjaRowOwner = 8, // row above
|
|
|
|
eCellOwner = 9,
|
2002-02-20 16:48:50 +03:00
|
|
|
eAjaCellOwner = 10 // cell to the top or to the left
|
2002-02-19 18:48:28 +03:00
|
|
|
};
|
|
|
|
|
2017-09-13 02:48:00 +03:00
|
|
|
// BCPixelSize is in device pixels.
|
2012-08-22 19:56:38 +04:00
|
|
|
typedef uint16_t BCPixelSize;
|
2005-04-07 22:04:38 +04:00
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
// These are the max sizes that are stored. If they are exceeded, then the max
|
|
|
|
// is stored and the actual value is computed when needed.
|
2012-10-20 06:01:43 +04:00
|
|
|
#define MAX_BORDER_WIDTH nscoord((1u << (sizeof(BCPixelSize) * 8)) - 1)
|
2005-04-07 22:04:38 +04:00
|
|
|
|
2015-05-04 10:09:25 +03:00
|
|
|
// The half of border on inline/block-axis start side
|
|
|
|
static inline BCPixelSize BC_BORDER_START_HALF(BCPixelSize px) {
|
|
|
|
return px - px / 2;
|
|
|
|
}
|
|
|
|
// The half of border on inline/block-axis end side
|
|
|
|
static inline BCPixelSize BC_BORDER_END_HALF(BCPixelSize px) { return px / 2; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-09-10 22:55:05 +03:00
|
|
|
static inline nscoord BC_BORDER_START_HALF_COORD(int32_t d2a, BCPixelSize px) {
|
|
|
|
return BC_BORDER_START_HALF(px) * d2a;
|
|
|
|
}
|
|
|
|
static inline nscoord BC_BORDER_END_HALF_COORD(int32_t d2a, BCPixelSize px) {
|
|
|
|
return BC_BORDER_END_HALF(px) * d2a;
|
|
|
|
}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
// BCData stores the bstart and istart border info and the corner connecting the
|
|
|
|
// two.
|
2002-02-19 18:48:28 +03:00
|
|
|
class BCData {
|
|
|
|
public:
|
|
|
|
BCData();
|
|
|
|
|
|
|
|
~BCData();
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
nscoord GetIStartEdge(BCBorderOwner& aOwner, bool& aStart) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
void SetIStartEdge(BCBorderOwner aOwner, nscoord aSize, bool aStart);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
nscoord GetBStartEdge(BCBorderOwner& aOwner, bool& aStart) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
void SetBStartEdge(BCBorderOwner aOwner, nscoord aSize, bool aStart);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
BCPixelSize GetCorner(mozilla::LogicalSide& aCornerOwner, bool& aBevel) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
void SetCorner(BCPixelSize aSubSize, mozilla::LogicalSide aOwner,
|
|
|
|
bool aBevel);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2017-10-09 03:06:00 +03:00
|
|
|
inline bool IsIStartStart() const { return (bool)mIStartStart; }
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2017-10-09 03:06:00 +03:00
|
|
|
inline void SetIStartStart(bool aValue) { mIStartStart = aValue; }
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2017-10-09 03:06:00 +03:00
|
|
|
inline bool IsBStartStart() const { return (bool)mBStartStart; }
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2017-10-09 03:06:00 +03:00
|
|
|
inline void SetBStartStart(bool aValue) { mBStartStart = aValue; }
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
protected:
|
2015-06-27 21:16:03 +03:00
|
|
|
BCPixelSize mIStartSize; // size in pixels of iStart border
|
|
|
|
BCPixelSize mBStartSize; // size in pixels of bStart border
|
2005-04-07 22:04:38 +04:00
|
|
|
BCPixelSize mCornerSubSize; // size of the largest border not in the
|
|
|
|
// dominant plane (for example, if corner is
|
2015-06-27 21:16:03 +03:00
|
|
|
// owned by the segment to its bStart or bEnd,
|
2005-04-07 22:04:38 +04:00
|
|
|
// then the size is the max of the border
|
2015-06-27 21:16:03 +03:00
|
|
|
// sizes of the segments to its iStart or iEnd.
|
|
|
|
unsigned mIStartOwner : 4; // owner of iStart border
|
|
|
|
unsigned mBStartOwner : 4; // owner of bStart border
|
|
|
|
unsigned mIStartStart : 1; // set if this is the start of a block-dir border
|
|
|
|
// segment
|
|
|
|
unsigned mBStartStart : 1; // set if this is the start of an inline-dir
|
|
|
|
// border segment
|
|
|
|
unsigned mCornerSide : 2; // LogicalSide of the owner of the bStart-iStart
|
|
|
|
// corner relative to the corner
|
2002-02-19 18:48:28 +03:00
|
|
|
unsigned mCornerBevel : 1; // is the corner beveled (only two segments,
|
|
|
|
// perpendicular, not dashed or dotted).
|
|
|
|
};
|
|
|
|
|
|
|
|
// BCCellData entries replace CellData entries in the cell map if the border
|
2010-04-27 20:15:01 +04:00
|
|
|
// collapsing model is in effect. BCData for a row and col entry contains the
|
|
|
|
// left and top borders of cell at that row and col and the corner connecting
|
2002-02-19 18:48:28 +03:00
|
|
|
// the two. The right borders of the cells in the last col and the bottom
|
|
|
|
// borders of the last row are stored in separate BCData entries in the cell
|
|
|
|
// map.
|
|
|
|
class BCCellData : public CellData {
|
|
|
|
public:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit BCCellData(nsTableCellFrame* aOrigCell);
|
2002-02-19 18:48:28 +03:00
|
|
|
~BCCellData();
|
|
|
|
|
|
|
|
BCData mData;
|
|
|
|
};
|
|
|
|
|
2011-09-26 08:52:33 +04:00
|
|
|
// The layout of a celldata is as follows. The top 10 bits are the colspan
|
|
|
|
// offset (which is enough to represent our allowed values 1-1000 for colspan).
|
2016-01-27 19:02:12 +03:00
|
|
|
// Then there are two bits of flags.
|
|
|
|
// XXXmats Then one unused bit that we should decide how to use in bug 862624.
|
|
|
|
// Then 16 bits of rowspan offset (which
|
2011-09-26 08:52:33 +04:00
|
|
|
// lets us represent numbers up to 65535. Then another 3 bits of flags.
|
|
|
|
|
|
|
|
// num bits to shift right to get right aligned col span
|
|
|
|
#define COL_SPAN_SHIFT 22
|
|
|
|
// num bits to shift right to get right aligned row span
|
|
|
|
#define ROW_SPAN_SHIFT 3
|
|
|
|
|
|
|
|
// the col offset to the data containing the original cell.
|
|
|
|
#define COL_SPAN_OFFSET (0x3FF << COL_SPAN_SHIFT)
|
|
|
|
// the row offset to the data containing the original cell
|
|
|
|
#define ROW_SPAN_OFFSET (0xFFFF << ROW_SPAN_SHIFT)
|
|
|
|
|
|
|
|
// And the flags
|
2010-04-27 20:15:01 +04:00
|
|
|
#define SPAN 0x00000001 // there a row or col span
|
2000-01-13 08:29:38 +03:00
|
|
|
#define ROW_SPAN 0x00000002 // there is a row span
|
|
|
|
#define ROW_SPAN_0 0x00000004 // the row span is 0
|
2016-01-27 19:02:12 +03:00
|
|
|
#define COL_SPAN (1 << (COL_SPAN_SHIFT - 2)) // there is a col span
|
2011-09-26 08:52:33 +04:00
|
|
|
#define OVERLAP \
|
|
|
|
(1 << (COL_SPAN_SHIFT - 1)) // there is a row span and
|
|
|
|
// col span but not by
|
|
|
|
// same cell
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
inline nsTableCellFrame* CellData::GetCellFrame() const {
|
|
|
|
if (SPAN != (SPAN & mBits)) {
|
|
|
|
return mOrigCell;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
return nullptr;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
inline void CellData::Init(nsTableCellFrame* aCellFrame) {
|
2002-02-19 18:48:28 +03:00
|
|
|
mOrigCell = aCellFrame;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsOrig() const {
|
2012-07-30 18:20:58 +04:00
|
|
|
return ((nullptr != mOrigCell) && (SPAN != (SPAN & mBits)));
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsDead() const { return (0 == mBits); }
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsSpan() const { return (SPAN == (SPAN & mBits)); }
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsRowSpan() const {
|
2010-04-27 20:15:01 +04:00
|
|
|
return (SPAN == (SPAN & mBits)) && (ROW_SPAN == (ROW_SPAN & mBits));
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsZeroRowSpan() const {
|
2000-01-13 08:29:38 +03:00
|
|
|
return (SPAN == (SPAN & mBits)) && (ROW_SPAN == (ROW_SPAN & mBits)) &&
|
|
|
|
(ROW_SPAN_0 == (ROW_SPAN_0 & mBits));
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline void CellData::SetZeroRowSpan(bool aIsZeroSpan) {
|
2000-01-13 08:29:38 +03:00
|
|
|
if (SPAN == (SPAN & mBits)) {
|
|
|
|
if (aIsZeroSpan) {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits |= ROW_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
} else {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits &= ~ROW_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline uint32_t CellData::GetRowSpanOffset() const {
|
2000-01-13 08:29:38 +03:00
|
|
|
if ((SPAN == (SPAN & mBits)) && ((ROW_SPAN == (ROW_SPAN & mBits)))) {
|
2012-08-22 19:56:38 +04:00
|
|
|
return (uint32_t)((mBits & ROW_SPAN_OFFSET) >> ROW_SPAN_SHIFT);
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline void CellData::SetRowSpanOffset(uint32_t aSpan) {
|
2000-01-13 08:29:38 +03:00
|
|
|
mBits &= ~ROW_SPAN_OFFSET;
|
|
|
|
mBits |= (aSpan << ROW_SPAN_SHIFT);
|
|
|
|
mBits |= SPAN;
|
|
|
|
mBits |= ROW_SPAN;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsColSpan() const {
|
2010-04-27 20:15:01 +04:00
|
|
|
return (SPAN == (SPAN & mBits)) && (COL_SPAN == (COL_SPAN & mBits));
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline uint32_t CellData::GetColSpanOffset() const {
|
2000-01-13 08:29:38 +03:00
|
|
|
if ((SPAN == (SPAN & mBits)) && ((COL_SPAN == (COL_SPAN & mBits)))) {
|
2012-08-22 19:56:38 +04:00
|
|
|
return (uint32_t)((mBits & COL_SPAN_OFFSET) >> COL_SPAN_SHIFT);
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline void CellData::SetColSpanOffset(uint32_t aSpan) {
|
2000-01-13 08:29:38 +03:00
|
|
|
mBits &= ~COL_SPAN_OFFSET;
|
|
|
|
mBits |= (aSpan << COL_SPAN_SHIFT);
|
|
|
|
|
|
|
|
mBits |= SPAN;
|
|
|
|
mBits |= COL_SPAN;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline bool CellData::IsOverlap() const {
|
2000-01-13 08:29:38 +03:00
|
|
|
return (SPAN == (SPAN & mBits)) && (OVERLAP == (OVERLAP & mBits));
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
inline void CellData::SetOverlap(bool aOverlap) {
|
2000-01-13 08:29:38 +03:00
|
|
|
if (SPAN == (SPAN & mBits)) {
|
|
|
|
if (aOverlap) {
|
|
|
|
mBits |= OVERLAP;
|
|
|
|
} else {
|
|
|
|
mBits &= ~OVERLAP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
inline BCData::BCData() {
|
2015-06-27 21:16:03 +03:00
|
|
|
mIStartOwner = mBStartOwner = eCellOwner;
|
2017-10-09 03:06:00 +03:00
|
|
|
SetBStartStart(true);
|
|
|
|
SetIStartStart(true);
|
2015-06-27 21:16:03 +03:00
|
|
|
mIStartSize = mCornerSubSize = mBStartSize = 0;
|
|
|
|
mCornerSide = mozilla::eLogicalSideBStart;
|
2011-10-17 18:59:28 +04:00
|
|
|
mCornerBevel = false;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2020-03-17 12:38:32 +03:00
|
|
|
inline BCData::~BCData() = default;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline nscoord BCData::GetIStartEdge(BCBorderOwner& aOwner,
|
|
|
|
bool& aStart) const {
|
|
|
|
aOwner = (BCBorderOwner)mIStartOwner;
|
2017-10-09 03:06:00 +03:00
|
|
|
aStart = IsIStartStart();
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
return (nscoord)mIStartSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline void BCData::SetIStartEdge(BCBorderOwner aOwner, nscoord aSize,
|
|
|
|
bool aStart) {
|
|
|
|
mIStartOwner = aOwner;
|
|
|
|
mIStartSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
|
2017-10-09 03:06:00 +03:00
|
|
|
SetIStartStart(aStart);
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline nscoord BCData::GetBStartEdge(BCBorderOwner& aOwner,
|
|
|
|
bool& aStart) const {
|
|
|
|
aOwner = (BCBorderOwner)mBStartOwner;
|
2017-10-09 03:06:00 +03:00
|
|
|
aStart = IsBStartStart();
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
return (nscoord)mBStartSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline void BCData::SetBStartEdge(BCBorderOwner aOwner, nscoord aSize,
|
|
|
|
bool aStart) {
|
|
|
|
mBStartOwner = aOwner;
|
|
|
|
mBStartSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
|
2017-10-09 03:06:00 +03:00
|
|
|
SetBStartStart(aStart);
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline BCPixelSize BCData::GetCorner(mozilla::LogicalSide& aOwnerSide,
|
|
|
|
bool& aBevel) const {
|
|
|
|
aOwnerSide = mozilla::LogicalSide(mCornerSide);
|
2011-09-29 10:19:26 +04:00
|
|
|
aBevel = (bool)mCornerBevel;
|
2005-04-07 22:04:38 +04:00
|
|
|
return mCornerSubSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
inline void BCData::SetCorner(BCPixelSize aSubSize,
|
|
|
|
mozilla::LogicalSide aOwnerSide, bool aBevel) {
|
2005-04-07 22:04:38 +04:00
|
|
|
mCornerSubSize = aSubSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
mCornerSide = aOwnerSide;
|
|
|
|
mCornerBevel = aBevel;
|
|
|
|
}
|
|
|
|
|
1998-07-11 04:08:08 +04:00
|
|
|
#endif
|