2012-01-20 09:02:48 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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/. */
|
|
|
|
|
2013-02-27 07:38:32 -08:00
|
|
|
#ifndef nsGenericHTMLFrameElement_h
|
|
|
|
#define nsGenericHTMLFrameElement_h
|
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-02-17 17:19:52 -08:00
|
|
|
#include "nsElementFrameLoaderOwner.h"
|
2012-01-20 09:02:48 -08:00
|
|
|
#include "nsGenericHTMLElement.h"
|
2012-06-06 00:40:02 -07:00
|
|
|
#include "nsIFrameLoader.h"
|
2012-03-04 08:02:00 -08:00
|
|
|
#include "nsIMozBrowserFrame.h"
|
2014-11-17 22:49:39 -08:00
|
|
|
#include "nsIDOMEventListener.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
|
|
|
|
#include "nsFrameLoader.h"
|
2012-06-06 00:40:02 -07:00
|
|
|
|
2013-02-26 09:02:32 -08:00
|
|
|
class nsXULElement;
|
|
|
|
|
2012-01-20 09:02:48 -08:00
|
|
|
/**
|
|
|
|
* A helper class for frame elements
|
|
|
|
*/
|
|
|
|
class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
2014-02-17 17:19:52 -08:00
|
|
|
public nsElementFrameLoaderOwner,
|
2012-03-28 11:36:04 -07:00
|
|
|
public nsIMozBrowserFrame
|
2012-01-20 09:02:48 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-06-19 19:01:40 -07:00
|
|
|
nsGenericHTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
2012-01-20 09:02:48 -08:00
|
|
|
mozilla::dom::FromParser aFromParser)
|
|
|
|
: nsGenericHTMLElement(aNodeInfo)
|
2014-02-17 17:19:52 -08:00
|
|
|
, nsElementFrameLoaderOwner(aFromParser)
|
2012-01-20 09:02:48 -08:00
|
|
|
{
|
|
|
|
}
|
2012-01-26 15:03:22 -08:00
|
|
|
|
2013-08-07 13:23:08 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-01-20 09:02:48 -08:00
|
|
|
NS_DECL_NSIDOMMOZBROWSERFRAME
|
2012-03-04 08:02:00 -08:00
|
|
|
NS_DECL_NSIMOZBROWSERFRAME
|
2012-01-20 09:02:48 -08:00
|
|
|
|
|
|
|
// nsIContent
|
2013-05-29 13:43:41 -07:00
|
|
|
virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) MOZ_OVERRIDE;
|
2012-01-20 09:02:48 -08:00
|
|
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
2013-05-29 13:43:41 -07:00
|
|
|
bool aCompileEventHandlers) MOZ_OVERRIDE;
|
2012-01-20 09:02:48 -08:00
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2013-05-29 13:43:41 -07:00
|
|
|
bool aNullParent = true) MOZ_OVERRIDE;
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2012-01-20 09:02:48 -08:00
|
|
|
const nsAString& aValue, bool aNotify)
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
2012-01-20 09:02:48 -08:00
|
|
|
}
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2012-01-20 09:02:48 -08:00
|
|
|
nsIAtom* aPrefix, const nsAString& aValue,
|
2013-03-14 22:38:27 -07:00
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
2014-01-11 20:05:49 -08:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
const nsAttrValue* aValue,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
2013-05-29 13:43:41 -07:00
|
|
|
virtual void DestroyContent() MOZ_OVERRIDE;
|
2012-01-20 09:02:48 -08:00
|
|
|
|
2012-11-14 14:10:08 -08:00
|
|
|
nsresult CopyInnerTo(mozilla::dom::Element* aDest);
|
2012-01-20 09:02:48 -08:00
|
|
|
|
2012-10-06 00:19:51 -07:00
|
|
|
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
|
2012-01-20 09:02:48 -08:00
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsGenericHTMLFrameElement,
|
|
|
|
nsGenericHTMLElement)
|
|
|
|
|
2013-11-19 14:21:16 -08:00
|
|
|
static bool BrowserFramesEnabled();
|
2014-01-11 20:05:49 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper method to map a HTML 'scrolling' attribute value to a nsIScrollable
|
|
|
|
* enum value. scrolling="no" (and its synonyms) maps to
|
|
|
|
* nsIScrollable::Scrollbar_Never, and anything else (including nullptr) maps
|
|
|
|
* to nsIScrollable::Scrollbar_Auto.
|
|
|
|
* @param aValue the attribute value to map or nullptr
|
|
|
|
* @return nsIScrollable::Scrollbar_Never or nsIScrollable::Scrollbar_Auto
|
|
|
|
*/
|
|
|
|
static int32_t MapScrollingAttribute(const nsAttrValue* aValue);
|
|
|
|
|
2012-01-20 09:02:48 -08:00
|
|
|
protected:
|
2014-07-08 14:23:16 -07:00
|
|
|
virtual ~nsGenericHTMLFrameElement() {}
|
|
|
|
|
2014-02-17 17:19:52 -08:00
|
|
|
virtual mozilla::dom::Element* ThisFrameElement() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
2014-08-19 07:14:08 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
void GetManifestURLByType(nsIAtom *aAppType, nsAString& aOut);
|
2012-01-20 09:02:48 -08:00
|
|
|
};
|
2013-02-27 07:38:32 -08:00
|
|
|
|
|
|
|
#endif // nsGenericHTMLFrameElement_h
|