summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableCellFrame.h
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2020-01-29 11:14:34 +0200
committerwin7-7 <win7-7@users.noreply.github.com>2020-01-29 11:14:34 +0200
commitfd26b84536a851abf72cef32bdf35bd82031eb90 (patch)
tree5d83ba6fdbad5af1794675a304bb97b0dc41bcc3 /layout/tables/nsTableCellFrame.h
parent54fbb5c75c2e09104387fb1c1fff86d46aa9c5d1 (diff)
downloadUXP-fd26b84536a851abf72cef32bdf35bd82031eb90.tar
UXP-fd26b84536a851abf72cef32bdf35bd82031eb90.tar.gz
UXP-fd26b84536a851abf72cef32bdf35bd82031eb90.tar.lz
UXP-fd26b84536a851abf72cef32bdf35bd82031eb90.tar.xz
UXP-fd26b84536a851abf72cef32bdf35bd82031eb90.zip
Issue #1355 - Speed up the traversal of a table row frame's child cells
Speed up getting the first cellframe in a row and the next cellframe after the given one
Diffstat (limited to 'layout/tables/nsTableCellFrame.h')
-rw-r--r--layout/tables/nsTableCellFrame.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h
index 5f87c5f6d..d8debe993 100644
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -215,7 +215,17 @@ public:
bool HasPctOverBSize();
void SetHasPctOverBSize(bool aValue);
- nsTableCellFrame* GetNextCell() const;
+ nsTableCellFrame* GetNextCell() const
+ {
+ nsIFrame* sibling = GetNextSibling();
+#ifdef DEBUG
+ if (sibling) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(sibling);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(sibling);
+ }
virtual LogicalMargin GetBorderWidth(WritingMode aWM) const;
@@ -350,4 +360,17 @@ private:
BCPixelSize mIStartBorder;
};
+// Implemented here because that's a sane-ish way to make the includes work out.
+inline nsTableCellFrame* nsTableRowFrame::GetFirstCell() const
+{
+ nsIFrame* firstChild = mFrames.FirstChild();
+#ifdef DEBUG
+ if (firstChild) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(firstChild);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(firstChild);
+}
+
#endif