This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1289200 - Adds GridAreas to grid css dev tools API. r=bz, mats
- Loading branch information
Showing
17 changed files
with
556 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */ | ||
/* 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/. */ | ||
|
||
#include "GridArea.h" | ||
#include "mozilla/dom/GridBinding.h" | ||
#include "Grid.h" | ||
|
||
namespace mozilla { | ||
namespace dom { | ||
|
||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridArea, mParent) | ||
NS_IMPL_CYCLE_COLLECTING_ADDREF(GridArea) | ||
NS_IMPL_CYCLE_COLLECTING_RELEASE(GridArea) | ||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridArea) | ||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY | ||
NS_INTERFACE_MAP_ENTRY(nsISupports) | ||
NS_INTERFACE_MAP_END | ||
|
||
GridArea::GridArea(Grid* aParent, | ||
const nsString& aName, | ||
GridDeclaration aType, | ||
uint32_t aRowStart, | ||
uint32_t aRowEnd, | ||
uint32_t aColumnStart, | ||
uint32_t aColumnEnd) | ||
: mParent(aParent) | ||
, mName(aName) | ||
, mType(aType) | ||
, mRowStart(aRowStart) | ||
, mRowEnd(aRowEnd) | ||
, mColumnStart(aColumnStart) | ||
, mColumnEnd(aColumnEnd) | ||
{ | ||
} | ||
|
||
GridArea::~GridArea() | ||
{ | ||
} | ||
|
||
JSObject* | ||
GridArea::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) | ||
{ | ||
return GridAreaBinding::Wrap(aCx, this, aGivenProto); | ||
} | ||
|
||
void | ||
GridArea::GetName(nsString& aName) const | ||
{ | ||
aName = mName; | ||
} | ||
|
||
GridDeclaration | ||
GridArea::Type() const | ||
{ | ||
return mType; | ||
} | ||
|
||
uint32_t | ||
GridArea::RowStart() const | ||
{ | ||
return mRowStart; | ||
} | ||
|
||
uint32_t | ||
GridArea::RowEnd() const | ||
{ | ||
return mRowEnd; | ||
} | ||
|
||
uint32_t | ||
GridArea::ColumnStart() const | ||
{ | ||
return mColumnStart; | ||
} | ||
|
||
uint32_t | ||
GridArea::ColumnEnd() const | ||
{ | ||
return mColumnEnd; | ||
} | ||
|
||
} // namespace dom | ||
} // namespace mozilla |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */ | ||
/* 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/. */ | ||
|
||
#ifndef mozilla_dom_GridArea_h | ||
#define mozilla_dom_GridArea_h | ||
|
||
#include "mozilla/dom/GridBinding.h" | ||
#include "nsWrapperCache.h" | ||
|
||
namespace mozilla { | ||
namespace dom { | ||
|
||
class Grid; | ||
|
||
class GridArea : public nsISupports | ||
, public nsWrapperCache | ||
{ | ||
public: | ||
explicit GridArea(Grid *aParent, | ||
const nsString& aName, | ||
GridDeclaration aType, | ||
uint32_t aRowStart, | ||
uint32_t aRowEnd, | ||
uint32_t aColumnStart, | ||
uint32_t aColumnEnd); | ||
|
||
protected: | ||
virtual ~GridArea(); | ||
|
||
public: | ||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS | ||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridArea) | ||
|
||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; | ||
Grid* GetParentObject() | ||
{ | ||
return mParent; | ||
} | ||
|
||
void GetName(nsString& aName) const; | ||
GridDeclaration Type() const; | ||
uint32_t RowStart() const; | ||
uint32_t RowEnd() const; | ||
uint32_t ColumnStart() const; | ||
uint32_t ColumnEnd() const; | ||
|
||
protected: | ||
RefPtr<Grid> mParent; | ||
const nsString mName; | ||
const GridDeclaration mType; | ||
const uint32_t mRowStart; | ||
const uint32_t mRowEnd; | ||
const uint32_t mColumnStart; | ||
const uint32_t mColumnEnd; | ||
}; | ||
|
||
} // namespace dom | ||
} // namespace mozilla | ||
|
||
#endif /* mozilla_dom_GridTrack_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.