Bug 1415670 Part 1: Add a negativeNumber property to GridLine in webidl. draft
authorBrad Werth <bwerth@mozilla.com>
Wed, 08 Nov 2017 13:25:16 -0800
changeset 707902 d426b41b25040ee6fe28719e2bf91b9023d48946
parent 707503 b4cef8d1dff06a1ec2b9bb17211c0c3c7f5b76fa
child 707903 6c530e38bea4f57197990de1d721fc777eceb1d8
push id92240
push userbwerth@mozilla.com
push dateTue, 05 Dec 2017 22:58:46 +0000
bugs1415670
milestone59.0a1
Bug 1415670 Part 1: Add a negativeNumber property to GridLine in webidl. MozReview-Commit-ID: E3IycnsN6Ep
dom/grid/GridLine.cpp
dom/grid/GridLine.h
dom/webidl/Grid.webidl
--- 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;
 
   /**