2014-02-27 11:45:29 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code is subject to the terms of the Mozilla Public License
|
|
|
|
* version 2.0 (the "License"). You can obtain a copy of the License at
|
|
|
|
* http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-05-13 01:16:05 +04:00
|
|
|
/* rendering object for CSS "display: grid | inline-grid" */
|
2014-02-27 11:45:29 +04:00
|
|
|
|
|
|
|
#ifndef nsGridContainerFrame_h___
|
|
|
|
#define nsGridContainerFrame_h___
|
|
|
|
|
|
|
|
#include "nsContainerFrame.h"
|
2015-01-15 00:59:59 +03:00
|
|
|
#include "nsHashKeys.h"
|
|
|
|
#include "nsTHashtable.h"
|
2014-02-27 11:45:29 +04:00
|
|
|
|
2014-05-13 01:16:05 +04:00
|
|
|
/**
|
|
|
|
* Factory function.
|
|
|
|
* @return a newly allocated nsGridContainerFrame (infallible)
|
|
|
|
*/
|
2014-05-25 02:20:40 +04:00
|
|
|
nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
2014-02-27 11:45:29 +04:00
|
|
|
|
2014-05-13 01:16:05 +04:00
|
|
|
class nsGridContainerFrame MOZ_FINAL : public nsContainerFrame
|
|
|
|
{
|
|
|
|
public:
|
2014-02-27 11:45:29 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsGridContainerFrame)
|
|
|
|
NS_DECL_QUERYFRAME
|
|
|
|
|
|
|
|
// nsIFrame overrides
|
2014-05-13 04:47:54 +04:00
|
|
|
void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2014-02-27 11:45:29 +04:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2014-05-13 01:16:05 +04:00
|
|
|
|
2014-02-27 11:45:29 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
2014-05-25 02:20:40 +04:00
|
|
|
friend nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsGridContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
2014-05-20 03:57:00 +04:00
|
|
|
|
2015-01-15 00:59:59 +03:00
|
|
|
/**
|
|
|
|
* XXX temporary - move the ImplicitNamedAreas stuff to the style system.
|
|
|
|
* The implicit area names that come from x-start .. x-end lines in
|
|
|
|
* grid-template-columns / grid-template-rows are stored in this frame
|
|
|
|
* property when needed, as a ImplicitNamedAreas* value.
|
|
|
|
*/
|
2015-02-05 02:22:27 +03:00
|
|
|
NS_DECLARE_FRAME_PROPERTY(ImplicitNamedAreasProperty,
|
|
|
|
DeleteValue<ImplicitNamedAreas>)
|
2015-01-15 00:59:59 +03:00
|
|
|
void InitImplicitNamedAreas(const nsStylePosition* aStyle);
|
|
|
|
void AddImplicitNamedAreas(const nsTArray<nsTArray<nsString>>& aLineNameLists);
|
|
|
|
typedef nsTHashtable<nsStringHashKey> ImplicitNamedAreas;
|
|
|
|
ImplicitNamedAreas* GetImplicitNamedAreas() const {
|
|
|
|
return static_cast<ImplicitNamedAreas*>(Properties().Get(ImplicitNamedAreasProperty()));
|
|
|
|
}
|
|
|
|
|
2014-05-20 03:57:00 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
void SanityCheckAnonymousGridItems() const;
|
|
|
|
#endif // DEBUG
|
2014-02-27 11:45:29 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsGridContainerFrame_h___ */
|