diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2020-02-16 16:06:53 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:45:15 +0200 |
commit | c9fd86cb784b81ab30461b773667b7251347fae6 (patch) | |
tree | 2b11c58b75866de08e091d27ea1d4ec289c20873 /layout/tables/nsTableCellFrame.h | |
parent | 550d634ff522b0fa1a586f8d85692cff361dca17 (diff) | |
download | UXP-c9fd86cb784b81ab30461b773667b7251347fae6.tar UXP-c9fd86cb784b81ab30461b773667b7251347fae6.tar.gz UXP-c9fd86cb784b81ab30461b773667b7251347fae6.tar.lz UXP-c9fd86cb784b81ab30461b773667b7251347fae6.tar.xz UXP-c9fd86cb784b81ab30461b773667b7251347fae6.zip |
Issue #1355 - Make nsTableCellFrame::GetColIndex/GetRowIndex faster
We can devirtualize it, remove some branches.
Diffstat (limited to 'layout/tables/nsTableCellFrame.h')
-rw-r--r-- | layout/tables/nsTableCellFrame.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index ea527b3c5..f626a45b0 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -183,7 +183,10 @@ public: NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) override; /** return the mapped cell's row index (starting at 0 for the first row) */ - virtual nsresult GetRowIndex(int32_t &aRowIndex) const override; + uint32_t RowIndex() const + { + return static_cast<nsTableRowFrame*>(GetParent())->GetRowIndex(); + } /** * return the cell's specified col span. this is what was specified in the @@ -194,7 +197,16 @@ public: int32_t GetColSpan(); /** return the cell's column index (starting at 0 for the first column) */ - virtual nsresult GetColIndex(int32_t &aColIndex) const override; + uint32_t ColIndex() const + { + // NOTE: We copy this from previous continuations, and we don't ever have + // dynamic updates when tables split, so our mColIndex always matches our + // first continuation's. + MOZ_ASSERT(static_cast<nsTableCellFrame*>(FirstContinuation())->mColIndex == + mColIndex, + "mColIndex out of sync with first continuation"); + return mColIndex; + } void SetColIndex(int32_t aColIndex); /** return the available isize given to this frame during its last reflow */ @@ -246,9 +258,9 @@ public: virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) override; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override; virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); } - + bool ShouldPaintBordersAndBackgrounds() const; - + bool ShouldPaintBackground(nsDisplayListBuilder* aBuilder); protected: |