mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
[Bug 879998] Remove some dead code in content/ r=Ms2ger, emk
This commit is contained in:
parent
52786066c5
commit
109e1728e5
@ -632,17 +632,6 @@ public:
|
||||
*/
|
||||
virtual bool IsLink(nsIURI** aURI) const = 0;
|
||||
|
||||
/**
|
||||
* Get the cached state of the link. If the state is unknown,
|
||||
* return eLinkState_Unknown.
|
||||
*
|
||||
* @return The cached link state of the link.
|
||||
*/
|
||||
virtual nsLinkState GetLinkState() const
|
||||
{
|
||||
return eLinkState_NotLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the full href URI (fully resolved and canonicalized,
|
||||
* since it's an nsIURI object) for link elements.
|
||||
|
@ -43,14 +43,6 @@ Link::ElementHasHref() const
|
||||
|| (!mElement->IsHTML() && mElement->HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)));
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
Link::GetLinkState() const
|
||||
{
|
||||
NS_ASSERTION(mRegistered,
|
||||
"Getting the link state of an unregistered Link!");
|
||||
return nsLinkState(mLinkState);
|
||||
}
|
||||
|
||||
void
|
||||
Link::SetLinkState(nsLinkState aState)
|
||||
{
|
||||
|
@ -32,7 +32,6 @@ public:
|
||||
* aElement is the element pointer corresponding to this link.
|
||||
*/
|
||||
Link(Element* aElement);
|
||||
nsLinkState GetLinkState() const;
|
||||
virtual void SetLinkState(nsLinkState aState);
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINK_IID)
|
||||
|
||||
/**
|
||||
* GetLinkState/SetLinkState/GetHrefURI were moved to nsIContent.
|
||||
* SetLinkState/GetHrefURI were moved to nsIContent.
|
||||
* @see nsIContent
|
||||
*/
|
||||
|
||||
|
@ -330,12 +330,6 @@ HTMLAnchorElement::SetPing(const nsAString& aValue)
|
||||
return SetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue, true);
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
HTMLAnchorElement::GetLinkState() const
|
||||
{
|
||||
return Link::GetLinkState();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
HTMLAnchorElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -70,7 +70,6 @@ public:
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
virtual nsLinkState GetLinkState() const MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
||||
|
||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
|
@ -219,12 +219,6 @@ HTMLAreaElement::SetPing(const nsAString& aValue)
|
||||
return SetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue, true);
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
HTMLAreaElement::GetLinkState() const
|
||||
{
|
||||
return Link::GetLinkState();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
HTMLAreaElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -57,7 +57,6 @@ public:
|
||||
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
virtual nsLinkState GetLinkState() const MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
|
@ -318,12 +318,6 @@ HTMLLinkElement::GetLinkTarget(nsAString& aTarget)
|
||||
}
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
HTMLLinkElement::GetLinkState() const
|
||||
{
|
||||
return Link::GetLinkState();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
HTMLLinkElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -79,7 +79,6 @@ public:
|
||||
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
bool aNotify) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual nsLinkState GetLinkState() const MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
||||
|
||||
// Element
|
||||
|
@ -938,12 +938,6 @@ nsMathMLElement::GetLinkTarget(nsAString& aTarget)
|
||||
}
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
nsMathMLElement::GetLinkState() const
|
||||
{
|
||||
return Link::GetLinkState();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
nsMathMLElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -86,7 +86,6 @@ public:
|
||||
bool aWithMouse = false) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
virtual nsLinkState GetLinkState() const MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, bool aNotify)
|
||||
|
@ -134,12 +134,6 @@ SVGAElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
SVGAElementBase::UnbindFromTree(aDeep, aNullParent);
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
SVGAElement::GetLinkState() const
|
||||
{
|
||||
return Link::GetLinkState();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
SVGAElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
virtual bool IsFocusable(int32_t *aTabIndex = nullptr, bool aWithMouse = false) MOZ_OVERRIDE;
|
||||
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
||||
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
||||
virtual nsLinkState GetLinkState() const MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
||||
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
|
||||
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
|
@ -136,18 +136,6 @@ XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsDependentSubstring XMLUtils::getLocalPart(const nsAString& src)
|
||||
{
|
||||
// Anything after ':' is the local part of the name
|
||||
int32_t idx = src.FindChar(':');
|
||||
if (idx == kNotFound) {
|
||||
return Substring(src, 0, src.Length());
|
||||
}
|
||||
|
||||
NS_ASSERTION(idx > 0, "This QName looks invalid.");
|
||||
return Substring(src, idx + 1, src.Length() - (idx + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given string has only whitespace characters
|
||||
*/
|
||||
|
@ -87,7 +87,6 @@ public:
|
||||
int32_t* aNameSpaceID);
|
||||
static nsresult splitQName(const nsAString& aName, nsIAtom** aPrefix,
|
||||
nsIAtom** aLocalName);
|
||||
static const nsDependentSubstring getLocalPart(const nsAString& src);
|
||||
|
||||
/*
|
||||
* Returns true if the given character is whitespace.
|
||||
|
@ -14,44 +14,6 @@ static const char* labelsEncodings[][3] = {
|
||||
#include "labelsencodings.properties.h"
|
||||
};
|
||||
|
||||
uint32_t
|
||||
EncodingUtils::IdentifyDataOffset(const char* aData,
|
||||
const uint32_t aLength,
|
||||
nsACString& aRetval)
|
||||
{
|
||||
// Truncating to pre-clear return value in case of failure.
|
||||
aRetval.Truncate();
|
||||
|
||||
// Minimum bytes in input stream data that represents
|
||||
// the Byte Order Mark is 2. Max is 3.
|
||||
if (aLength < 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aData[0] == '\xFF' && aData[1] == '\xFE') {
|
||||
aRetval.AssignLiteral("UTF-16LE");
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (aData[0] == '\xFE' && aData[1] == '\xFF') {
|
||||
aRetval.AssignLiteral("UTF-16BE");
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Checking utf-8 byte order mark.
|
||||
// Minimum bytes in input stream data that represents
|
||||
// the Byte Order Mark for utf-8 is 3.
|
||||
if (aLength < 3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aData[0] == '\xEF' && aData[1] == '\xBB' && aData[2] == '\xBF') {
|
||||
aRetval.AssignLiteral("UTF-8");
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
EncodingUtils::FindEncodingForLabel(const nsACString& aLabel,
|
||||
nsACString& aOutEncoding)
|
||||
|
@ -15,23 +15,6 @@ class EncodingUtils
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Implements decode algorithm's step 1 & 2 from Encoding spec.
|
||||
* http://encoding.spec.whatwg.org/#decode
|
||||
* The returned name may not be lowercased due to compatibility with
|
||||
* our internal implementations.
|
||||
*
|
||||
* @param aData, incoming byte stream of data.
|
||||
* @param aLength, incoming byte stream length.
|
||||
* @param aRetval, outgoing encoding corresponding to valid data
|
||||
* byte order mark.
|
||||
* @return offset after the BOM bytes in byte stream
|
||||
* where the actual data starts.
|
||||
*/
|
||||
static uint32_t IdentifyDataOffset(const char* aData,
|
||||
const uint32_t aLength,
|
||||
nsACString& aRetval);
|
||||
|
||||
/**
|
||||
* Implements get an encoding algorithm from Encoding spec.
|
||||
* http://encoding.spec.whatwg.org/#concept-encoding-get
|
||||
|
@ -88,13 +88,6 @@ Link::ElementHasHref() const
|
||||
return false; // suppress compiler warning
|
||||
}
|
||||
|
||||
nsLinkState
|
||||
Link::GetLinkState() const
|
||||
{
|
||||
NS_NOTREACHED("Unexpected call to Link::GetLinkState");
|
||||
return eLinkState_NotLink; // suppress compiler warning
|
||||
}
|
||||
|
||||
void
|
||||
Link::SetLinkState(nsLinkState aState)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user