Bug 1415670 Part 1: Add a negativeNumber property to GridLine in webidl.
MozReview-Commit-ID: E3IycnsN6Ep
--- a/dom/grid/GridLine.cpp
+++ b/dom/grid/GridLine.cpp
@@ -65,16 +65,22 @@ GridLine::Type() const
}
uint32_t
GridLine::Number() const
{
return mNumber;
}
+int32_t
+GridLine::NegativeNumber() const
+{
+ return 0;
+}
+
void
GridLine::SetLineValues(const nsTArray<nsString>& aNames,
double aStart,
double aBreadth,
uint32_t aNumber,
GridDeclaration aType)
{
mNames = aNames;
--- a/dom/grid/GridLine.h
+++ b/dom/grid/GridLine.h
@@ -37,16 +37,17 @@ public:
{
return mParent;
}
double Start() const;
double Breadth() const;
GridDeclaration Type() const;
uint32_t Number() const;
+ int32_t NegativeNumber() const;
void SetLineValues(const nsTArray<nsString>& aNames,
double aStart,
double aBreadth,
uint32_t aNumber,
GridDeclaration aType);
protected:
--- a/dom/webidl/Grid.webidl
+++ b/dom/webidl/Grid.webidl
@@ -66,19 +66,33 @@ interface GridLine
* properties.
* https://drafts.csswg.org/css-grid/#gutters
*/
readonly attribute double breadth;
readonly attribute GridDeclaration type;
/**
- * Number is the 1-indexed index of the line in flow order.
+ * Number is the 1-indexed index of the line in flow order. The
+ * first explicit line has number 1, and numbers increment by 1 for
+ * each line after that. Lines before the first explicit line
+ * have number 0, which is not a valid addressable line number, and
+ * should be filtered out by callers.
*/
readonly attribute unsigned long number;
+
+ /**
+ * NegativeNumber is the 1-indexed index of the line in reverse
+ * flow order. The last explicit line has negativeNumber -1, and
+ * negativeNumbers decrement by 1 for each line before that.
+ * Lines after the last explicit line have negativeNumber 0, which
+ * is not a valid addressable line number, and should be filtered
+ * out by callers.
+ */
+ readonly attribute long negativeNumber;
};
[ChromeOnly]
interface GridTracks
{
readonly attribute unsigned long length;
/**