Bug 893117: Remove nsIDOMHTMLOutputElement r=bz

This commit is contained in:
David Zbarsky 2013-07-30 14:55:11 -07:00
Родитель 67c8079b37
Коммит 4d1aa06dec
4 изменённых файлов: 29 добавлений и 113 удалений

Просмотреть файл

@ -53,8 +53,7 @@ NS_IMPL_RELEASE_INHERITED(HTMLOutputElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
NS_INTERFACE_TABLE_INHERITED3(HTMLOutputElement,
nsIDOMHTMLOutputElement,
NS_INTERFACE_TABLE_INHERITED2(HTMLOutputElement,
nsIMutationObserver,
nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
@ -62,20 +61,12 @@ NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLOutputElement)
NS_IMPL_STRING_ATTR(HTMLOutputElement, Name, name)
// nsIConstraintValidation
NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLOutputElement)
NS_IMETHODIMP
void
HTMLOutputElement::SetCustomValidity(const nsAString& aError)
{
nsIConstraintValidation::SetCustomValidity(aError);
UpdateState(true);
return NS_OK;
}
NS_IMETHODIMP
@ -149,49 +140,20 @@ HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
return rv;
}
NS_IMETHODIMP
HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLFormElement::GetForm(aForm);
}
NS_IMETHODIMP
HTMLOutputElement::GetType(nsAString& aType)
{
aType.AssignLiteral("output");
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::GetValue(nsAString& aValue)
{
nsContentUtils::GetNodeTextContent(this, true, aValue);
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::SetValue(const nsAString& aValue)
void
HTMLOutputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
{
mValueModeFlag = eModeValue;
return nsContentUtils::SetNodeTextContent(this, aValue, true);
aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
}
NS_IMETHODIMP
HTMLOutputElement::GetDefaultValue(nsAString& aDefaultValue)
{
aDefaultValue = mDefaultValue;
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue)
void
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
{
mDefaultValue = aDefaultValue;
if (mValueModeFlag == eModeDefault) {
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
aRv = nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
return NS_OK;
}
nsDOMSettableTokenList*
@ -203,13 +165,6 @@ HTMLOutputElement::HtmlFor()
return mTokenList;
}
NS_IMETHODIMP
HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
{
NS_ADDREF(*aResult = HtmlFor());
return NS_OK;
}
void HTMLOutputElement::DescendantsChanged()
{
if (mValueModeFlag == eModeDefault) {

Просмотреть файл

@ -8,7 +8,6 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLOutputElement.h"
#include "nsStubMutationObserver.h"
#include "nsIConstraintValidation.h"
@ -16,7 +15,7 @@ namespace mozilla {
namespace dom {
class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
public nsIDOMHTMLOutputElement,
public nsIDOMHTMLElement,
public nsStubMutationObserver,
public nsIConstraintValidation
{
@ -38,9 +37,6 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLOutputElement
NS_DECL_NSIDOMHTMLOUTPUTELEMENT
// nsIFormControl
NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
NS_IMETHOD Reset() MOZ_OVERRIDE;
@ -79,31 +75,40 @@ public:
// WebIDL
nsDOMSettableTokenList* HtmlFor();
// nsGenericHTMLFormElement::GetForm is fine.
using nsGenericHTMLFormElement::GetForm;
// XPCOM GetName is fine.
void GetName(nsAString& aName)
{
GetHTMLAttr(nsGkAtoms::name, aName);
}
void SetName(const nsAString& aName, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::name, aName, aRv);
}
// XPCOM GetType is fine.
// XPCOM GetDefaultValue is fine.
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
void GetType(nsAString& aType)
{
aRv = SetDefaultValue(aDefaultValue);
aType.AssignLiteral("output");
}
// XPCOM GetValue is fine.
void SetValue(const nsAString& aValue, ErrorResult& aRv)
void GetDefaultValue(nsAString& aDefaultValue)
{
aRv = SetValue(aValue);
aDefaultValue = mDefaultValue;
}
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv);
void GetValue(nsAString& aValue)
{
nsContentUtils::GetNodeTextContent(this, true, aValue);
}
void SetValue(const nsAString& aValue, ErrorResult& aRv);
// nsIConstraintValidation::WillValidate is fine.
// nsIConstraintValidation::Validity() is fine.
// nsIConstraintValidation::GetValidationMessage() is fine.
// nsIConstraintValidation::CheckValidity() is fine.
using nsIConstraintValidation::CheckValidity;
// nsIConstraintValidation::SetCustomValidity() is fine.
void SetCustomValidity(const nsAString& aError);
protected:
enum ValueModeFlag {

Просмотреть файл

@ -50,7 +50,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLOptGroupElement.idl',
'nsIDOMHTMLOptionElement.idl',
'nsIDOMHTMLOptionsCollection.idl',
'nsIDOMHTMLOutputElement.idl',
'nsIDOMHTMLParagraphElement.idl',
'nsIDOMHTMLParamElement.idl',
'nsIDOMHTMLPreElement.idl',

Просмотреть файл

@ -1,43 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLOutputElement interface is the interface to a HTML
* <output> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
*
* @status UNDER_DEVELOPMENT
*/
interface nsIDOMValidityState;
[scriptable, uuid(c4bff576-90b5-44b0-8278-bf4e3010b09a)]
interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
{
// DOMSettableTokenList
readonly attribute nsISupports htmlFor;
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString name;
readonly attribute DOMString type;
attribute DOMString defaultValue;
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute nsIDOMValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(in DOMString error);
/**
* The labels IDL attribute will be added with bug 556743.
*/
//readonly attribute nsIDOMNodeList labels;
};