mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
bug 824940 - convert HTMLTitleElement to webidl r=bz
This commit is contained in:
parent
ecfa30aa02
commit
1776beab14
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "mozilla/dom/HTMLTitleElement.h"
|
#include "mozilla/dom/HTMLTitleElement.h"
|
||||||
|
|
||||||
|
#include "mozilla/dom/HTMLTitleElementBinding.h"
|
||||||
|
#include "mozilla/ErrorResult.h"
|
||||||
#include "nsStyleConsts.h"
|
#include "nsStyleConsts.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
@ -18,6 +20,7 @@ namespace dom {
|
|||||||
HTMLTitleElement::HTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
HTMLTitleElement::HTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||||
: nsGenericHTMLElement(aNodeInfo)
|
: nsGenericHTMLElement(aNodeInfo)
|
||||||
{
|
{
|
||||||
|
SetIsDOMBinding();
|
||||||
AddMutationObserver(this);
|
AddMutationObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +52,12 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTitleElement)
|
|||||||
|
|
||||||
NS_IMPL_ELEMENT_CLONE(HTMLTitleElement)
|
NS_IMPL_ELEMENT_CLONE(HTMLTitleElement)
|
||||||
|
|
||||||
|
JSObject*
|
||||||
|
HTMLTitleElement::WrapNode(JSContext* cx, JSObject* scope, bool* triedToWrap)
|
||||||
|
{
|
||||||
|
return HTMLTitleElementBinding::Wrap(cx, scope, this, triedToWrap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
HTMLTitleElement::GetText(nsAString& aTitle)
|
HTMLTitleElement::GetText(nsAString& aTitle)
|
||||||
|
@ -6,11 +6,14 @@
|
|||||||
#ifndef mozilla_dom_HTMLTITLEElement_h_
|
#ifndef mozilla_dom_HTMLTITLEElement_h_
|
||||||
#define mozilla_dom_HTMLTITLEElement_h_
|
#define mozilla_dom_HTMLTITLEElement_h_
|
||||||
|
|
||||||
|
#include "mozilla/Attributes.h"
|
||||||
#include "nsIDOMHTMLTitleElement.h"
|
#include "nsIDOMHTMLTitleElement.h"
|
||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
#include "nsStubMutationObserver.h"
|
#include "nsStubMutationObserver.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
class ErrorResult;
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class HTMLTitleElement : public nsGenericHTMLElement,
|
class HTMLTitleElement : public nsGenericHTMLElement,
|
||||||
@ -39,6 +42,13 @@ public:
|
|||||||
// nsIDOMHTMLTitleElement
|
// nsIDOMHTMLTitleElement
|
||||||
NS_DECL_NSIDOMHTMLTITLEELEMENT
|
NS_DECL_NSIDOMHTMLTITLEELEMENT
|
||||||
|
|
||||||
|
//HTMLTitleElement
|
||||||
|
//The xpcom GetTextContent() never fails so we just use that.
|
||||||
|
void SetText(const nsAString& aText, ErrorResult& aError)
|
||||||
|
{
|
||||||
|
aError = SetText(aText);
|
||||||
|
}
|
||||||
|
|
||||||
// nsIMutationObserver
|
// nsIMutationObserver
|
||||||
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
||||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
||||||
@ -59,6 +69,12 @@ public:
|
|||||||
virtual nsXPCClassInfo* GetClassInfo();
|
virtual nsXPCClassInfo* GetClassInfo();
|
||||||
|
|
||||||
virtual nsIDOMNode* AsDOMNode() { return this; }
|
virtual nsIDOMNode* AsDOMNode() { return this; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual JSObject* WrapNode(JSContext* cx, JSObject* scope, bool* triedToWrap)
|
||||||
|
MOZ_OVERRIDE MOZ_FINAL;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SendTitleChangeEvent(bool aBound);
|
void SendTitleChangeEvent(bool aBound);
|
||||||
};
|
};
|
||||||
|
13
dom/webidl/HTMLTitleElement.webidl
Normal file
13
dom/webidl/HTMLTitleElement.webidl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/* -*- Mode: IDL; 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/.
|
||||||
|
*
|
||||||
|
* The origin of this IDL file is
|
||||||
|
* http://www.whatwg.org/specs/web-apps/current-work/#the-title-element
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface HTMLTitleElement : HTMLElement {
|
||||||
|
[SetterThrows]
|
||||||
|
attribute DOMString text;
|
||||||
|
};
|
@ -61,6 +61,7 @@ webidl_files = \
|
|||||||
HTMLLabelElement.webidl \
|
HTMLLabelElement.webidl \
|
||||||
HTMLOptionsCollection.webidl \
|
HTMLOptionsCollection.webidl \
|
||||||
HTMLPropertiesCollection.webidl \
|
HTMLPropertiesCollection.webidl \
|
||||||
|
HTMLTitleElement.webidl \
|
||||||
ImageData.webidl \
|
ImageData.webidl \
|
||||||
Location.webidl \
|
Location.webidl \
|
||||||
MutationObserver.webidl \
|
MutationObserver.webidl \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user