2012-01-20 21:02:48 +04: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 19:38:32 +04:00
|
|
|
#ifndef nsGenericHTMLFrameElement_h
|
|
|
|
#define nsGenericHTMLFrameElement_h
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-02-18 05:19:52 +04:00
|
|
|
#include "nsElementFrameLoaderOwner.h"
|
2012-01-20 21:02:48 +04:00
|
|
|
#include "nsGenericHTMLElement.h"
|
2012-06-06 11:40:02 +04:00
|
|
|
#include "nsIFrameLoader.h"
|
2012-03-04 20:02:00 +04:00
|
|
|
#include "nsIMozBrowserFrame.h"
|
2014-11-18 09:49:39 +03:00
|
|
|
#include "nsIDOMEventListener.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
|
|
|
|
#include "nsFrameLoader.h"
|
2012-06-06 11:40:02 +04:00
|
|
|
|
2013-02-26 21:02:32 +04:00
|
|
|
class nsXULElement;
|
|
|
|
|
2012-01-20 21:02:48 +04:00
|
|
|
/**
|
|
|
|
* A helper class for frame elements
|
|
|
|
*/
|
|
|
|
class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
|
2014-02-18 05:19:52 +04:00
|
|
|
public nsElementFrameLoaderOwner,
|
2012-03-28 22:36:04 +04:00
|
|
|
public nsIMozBrowserFrame
|
2012-01-20 21:02:48 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-06-20 06:01:40 +04:00
|
|
|
nsGenericHTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
2012-01-20 21:02:48 +04:00
|
|
|
mozilla::dom::FromParser aFromParser)
|
|
|
|
: nsGenericHTMLElement(aNodeInfo)
|
2014-02-18 05:19:52 +04:00
|
|
|
, nsElementFrameLoaderOwner(aFromParser)
|
2012-01-20 21:02:48 +04:00
|
|
|
{
|
|
|
|
}
|
2012-01-27 03:03:22 +04:00
|
|
|
|
2013-08-08 00:23:08 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-01-20 21:02:48 +04:00
|
|
|
NS_DECL_NSIDOMMOZBROWSERFRAME
|
2012-03-04 20:02:00 +04:00
|
|
|
NS_DECL_NSIMOZBROWSERFRAME
|
2012-01-20 21:02:48 +04:00
|
|
|
|
|
|
|
// nsIContent
|
2013-05-30 00:43:41 +04:00
|
|
|
virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) MOZ_OVERRIDE;
|
2012-01-20 21:02:48 +04:00
|
|
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
2013-05-30 00:43:41 +04:00
|
|
|
bool aCompileEventHandlers) MOZ_OVERRIDE;
|
2012-01-20 21:02:48 +04:00
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2013-05-30 00:43:41 +04:00
|
|
|
bool aNullParent = true) MOZ_OVERRIDE;
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2012-01-20 21:02:48 +04:00
|
|
|
const nsAString& aValue, bool aNotify)
|
|
|
|
{
|
2012-07-30 18:20:58 +04:00
|
|
|
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
2012-01-20 21:02:48 +04:00
|
|
|
}
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2012-01-20 21:02:48 +04:00
|
|
|
nsIAtom* aPrefix, const nsAString& aValue,
|
2013-03-15 09:38:27 +04:00
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
2014-01-12 08:05:49 +04:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
const nsAttrValue* aValue,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
2013-05-30 00:43:41 +04:00
|
|
|
virtual void DestroyContent() MOZ_OVERRIDE;
|
2012-01-20 21:02:48 +04:00
|
|
|
|
2012-11-15 02:10:08 +04:00
|
|
|
nsresult CopyInnerTo(mozilla::dom::Element* aDest);
|
2012-01-20 21:02:48 +04:00
|
|
|
|
2012-10-06 11:19:51 +04:00
|
|
|
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
|
2012-01-20 21:02:48 +04:00
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsGenericHTMLFrameElement,
|
|
|
|
nsGenericHTMLElement)
|
|
|
|
|
2013-11-20 02:21:16 +04:00
|
|
|
static bool BrowserFramesEnabled();
|
2014-01-12 08:05:49 +04: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 21:02:48 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~nsGenericHTMLFrameElement() {}
|
|
|
|
|
2014-02-18 05:19:52 +04:00
|
|
|
virtual mozilla::dom::Element* ThisFrameElement() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
2014-08-19 18:14:08 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
void GetManifestURLByType(nsIAtom *aAppType, nsAString& aOut);
|
2012-01-20 21:02:48 +04:00
|
|
|
};
|
2013-02-27 19:38:32 +04:00
|
|
|
|
|
|
|
#endif // nsGenericHTMLFrameElement_h
|