Bug 893117: Remove nsIDOMHTMLProgressElement r=peterv

This commit is contained in:
David Zbarsky 2013-08-01 15:24:22 -07:00
Родитель 11ddcf9986
Коммит 8423ce77eb
6 изменённых файлов: 12 добавлений и 98 удалений

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

@ -31,11 +31,8 @@ NS_IMPL_ADDREF_INHERITED(HTMLProgressElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLProgressElement, Element)
NS_INTERFACE_TABLE_HEAD(HTMLProgressElement)
NS_INTERFACE_MAP_BEGIN(HTMLProgressElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLProgressElement,
nsIDOMHTMLProgressElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLProgressElement)
@ -67,13 +64,6 @@ HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
aValue, aResult);
}
NS_IMETHODIMP
HTMLProgressElement::GetValue(double* aValue)
{
*aValue = Value();
return NS_OK;
}
double
HTMLProgressElement::Value() const
{
@ -86,21 +76,6 @@ HTMLProgressElement::Value() const
return std::min(attrValue->GetDoubleValue(), Max());
}
NS_IMETHODIMP
HTMLProgressElement::SetValue(double aValue)
{
ErrorResult rv;
SetValue(aValue, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLProgressElement::GetMax(double* aValue)
{
*aValue = Max();
return NS_OK;
}
double
HTMLProgressElement::Max() const
{
@ -113,21 +88,6 @@ HTMLProgressElement::Max() const
return attrMax->GetDoubleValue();
}
NS_IMETHODIMP
HTMLProgressElement::SetMax(double aValue)
{
ErrorResult rv;
SetMax(aValue, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLProgressElement::GetPosition(double* aPosition)
{
*aPosition = Position();
return NS_OK;
}
double
HTMLProgressElement::Position() const
{

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

@ -7,7 +7,6 @@
#define mozilla_dom_HTMLProgressElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsGenericHTMLElement.h"
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
@ -18,7 +17,7 @@ namespace mozilla {
namespace dom {
class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLProgressElement
public nsIDOMHTMLElement
{
public:
HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -36,9 +35,6 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLProgressElement
NS_DECL_NSIDOMHTMLPROGRESSELEMENT
nsEventStates IntrinsicState() const MOZ_OVERRIDE;
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;

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

@ -55,7 +55,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLParagraphElement.idl',
'nsIDOMHTMLParamElement.idl',
'nsIDOMHTMLPreElement.idl',
'nsIDOMHTMLProgressElement.idl',
'nsIDOMHTMLQuoteElement.idl',
'nsIDOMHTMLScriptElement.idl',
'nsIDOMHTMLSelectElement.idl',

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

@ -1,29 +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 nsIDOMHTMLProgressElement interface is the interface to a HTML
* <progress> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#the-progress-element
*
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(4b4bec16-c65f-4a08-97d1-dff624efdca4)]
interface nsIDOMHTMLProgressElement : nsIDOMHTMLElement
{
attribute double value;
attribute double max;
readonly attribute double position;
/**
* The labels attribute will be done with bug 567740.
*/
//readonly attribute NodeList labels;
};

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

@ -5,7 +5,6 @@
#include "nsProgressFrame.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsIContent.h"
#include "nsPresContext.h"
#include "nsGkAtoms.h"
@ -20,9 +19,11 @@
#include "nsContentList.h"
#include "nsFontMetrics.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLProgressElement.h"
#include "nsContentList.h"
#include <algorithm>
using namespace mozilla::dom;
nsIFrame*
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
@ -157,10 +158,7 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
nscoord xoffset = aReflowState.mComputedBorderPadding.left;
nscoord yoffset = aReflowState.mComputedBorderPadding.top;
double position;
nsCOMPtr<nsIDOMHTMLProgressElement> progressElement =
do_QueryInterface(mContent);
progressElement->GetPosition(&position);
double position = static_cast<HTMLProgressElement*>(mContent)->Position();
// Force the bar's size to match the current progress.
// When indeterminate, the progress' size will be 100%.

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

@ -14,7 +14,6 @@
#include "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsIDOMXULMenuListElement.h"
#include "nsThemeConstants.h"
#include "nsIComponentManager.h"
@ -26,9 +25,12 @@
#include "nsCSSRendering.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/HTMLProgressElement.h"
#include "nsIDocumentInlines.h"
#include <algorithm>
using namespace mozilla::dom;
nsNativeTheme::nsNativeTheme()
: mAnimatedContentTimeout(UINT32_MAX)
{
@ -150,14 +152,8 @@ nsNativeTheme::GetProgressValue(nsIFrame* aFrame)
{
// When we are using the HTML progress element,
// we can get the value from the IDL property.
if (aFrame) {
nsCOMPtr<nsIDOMHTMLProgressElement> progress =
do_QueryInterface(aFrame->GetContent());
if (progress) {
double value;
progress->GetValue(&value);
return value;
}
if (aFrame && aFrame->GetContent()->IsHTML(nsGkAtoms::progress)) {
return static_cast<HTMLProgressElement*>(aFrame->GetContent())->Value();
}
return (double)nsNativeTheme::CheckIntAttr(aFrame, nsGkAtoms::value, 0);
@ -169,14 +165,8 @@ nsNativeTheme::GetProgressMaxValue(nsIFrame* aFrame)
{
// When we are using the HTML progress element,
// we can get the max from the IDL property.
if (aFrame) {
nsCOMPtr<nsIDOMHTMLProgressElement> progress =
do_QueryInterface(aFrame->GetContent());
if (progress) {
double max;
progress->GetMax(&max);
return max;
}
if (aFrame && aFrame->GetContent()->IsHTML(nsGkAtoms::progress)) {
return static_cast<HTMLProgressElement*>(aFrame->GetContent())->Max();
}
return (double)std::max(nsNativeTheme::CheckIntAttr(aFrame, nsGkAtoms::max, 100), 1);