2013-07-09 15:25:27 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 nsColorControlFrame_h___
|
|
|
|
#define nsColorControlFrame_h___
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2013-10-22 08:29:20 -07:00
|
|
|
#include "nsHTMLButtonControlFrame.h"
|
2013-07-09 15:25:27 -07:00
|
|
|
#include "nsIAnonymousContentCreator.h"
|
|
|
|
|
2013-10-22 08:29:20 -07:00
|
|
|
typedef nsHTMLButtonControlFrame nsColorControlFrameSuper;
|
|
|
|
|
2013-07-09 15:25:27 -07:00
|
|
|
// Class which implements the input type=color
|
|
|
|
|
2013-10-22 08:29:20 -07:00
|
|
|
class nsColorControlFrame MOZ_FINAL : public nsColorControlFrameSuper,
|
2013-07-09 15:25:27 -07:00
|
|
|
public nsIAnonymousContentCreator
|
|
|
|
{
|
2013-12-02 20:49:03 -08:00
|
|
|
typedef mozilla::dom::Element Element;
|
|
|
|
|
2013-07-09 15:25:27 -07:00
|
|
|
public:
|
|
|
|
friend nsIFrame* NS_NewColorControlFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
|
|
|
|
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
|
|
|
|
2014-02-28 11:52:42 -08:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsColorControlFrame)
|
2013-07-09 15:25:27 -07:00
|
|
|
NS_DECL_QUERYFRAME
|
2014-02-28 11:52:42 -08:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2013-07-09 15:25:27 -07:00
|
|
|
|
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
|
|
|
|
2014-01-05 15:31:14 -08:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
2013-07-09 15:25:27 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
|
|
|
virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
|
|
|
|
virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
|
|
|
|
uint32_t aFilter) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// nsIFrame
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 00:36:33 -08:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2013-07-09 15:25:27 -07:00
|
|
|
virtual bool IsLeaf() const MOZ_OVERRIDE { return true; }
|
|
|
|
virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
|
|
|
|
|
2013-12-02 20:49:03 -08:00
|
|
|
virtual Element* GetPseudoElement(nsCSSPseudoElements::Type aType) MOZ_OVERRIDE;
|
2013-12-02 15:57:50 -08:00
|
|
|
|
2014-02-28 11:52:42 -08:00
|
|
|
// Refresh the color swatch, using associated input's value
|
|
|
|
nsresult UpdateColor();
|
|
|
|
|
2013-07-09 15:25:27 -07:00
|
|
|
private:
|
|
|
|
nsColorControlFrame(nsStyleContext* aContext);
|
|
|
|
|
2013-12-02 20:49:03 -08:00
|
|
|
nsCOMPtr<Element> mColorContent;
|
2013-07-09 15:25:27 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // nsColorControlFrame_h___
|