Bug 893117: Remove nsIDOMHTMLProgressElement r=peterv

This commit is contained in:
David Zbarsky 2013-07-31 23:12:38 -07:00
Родитель d2f7764079
Коммит d52c9a362c
6 изменённых файлов: 12 добавлений и 98 удалений

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

@ -31,11 +31,8 @@ NS_IMPL_ADDREF_INHERITED(HTMLProgressElement, Element)
NS_IMPL_RELEASE_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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLProgressElement,
nsIDOMHTMLProgressElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLProgressElement) NS_IMPL_ELEMENT_CLONE(HTMLProgressElement)
@ -67,13 +64,6 @@ HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
aValue, aResult); aValue, aResult);
} }
NS_IMETHODIMP
HTMLProgressElement::GetValue(double* aValue)
{
*aValue = Value();
return NS_OK;
}
double double
HTMLProgressElement::Value() const HTMLProgressElement::Value() const
{ {
@ -86,21 +76,6 @@ HTMLProgressElement::Value() const
return std::min(attrValue->GetDoubleValue(), Max()); 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 double
HTMLProgressElement::Max() const HTMLProgressElement::Max() const
{ {
@ -113,21 +88,6 @@ HTMLProgressElement::Max() const
return attrMax->GetDoubleValue(); 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 double
HTMLProgressElement::Position() const HTMLProgressElement::Position() const
{ {

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

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

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

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

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

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