mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 1389650 - Remove nsIDOMHTMLAnchorElement; r=bz
Removes the XPCOM interface for nsIDOMHTMLAnchorElement, replacing it with binding class usage. MozReview-Commit-ID: 7v0bKlY7Fax
This commit is contained in:
parent
6b7c6911ae
commit
e2ace7d91f
@ -12,10 +12,7 @@
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMHTMLHtmlElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLLinkElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
#include "nsIDOMCSSValue.h"
|
||||
@ -27,7 +24,13 @@
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
#include "imgRequestProxy.h"
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
#include "mozilla/dom/HTMLAreaElement.h"
|
||||
#include "mozilla/dom/HTMLLinkElement.h"
|
||||
|
||||
using mozilla::dom::HTMLAnchorElement;
|
||||
using mozilla::dom::HTMLAreaElement;
|
||||
using mozilla::dom::HTMLLinkElement;
|
||||
using mozilla::dom::Element;
|
||||
using mozilla::ErrorResult;
|
||||
|
||||
@ -63,30 +66,24 @@ nsContextMenuInfo::GetAssociatedLink(nsAString& aHRef)
|
||||
NS_ENSURE_STATE(mAssociatedLink);
|
||||
aHRef.Truncate(0);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> content(do_QueryInterface(mAssociatedLink));
|
||||
nsAutoString localName;
|
||||
if (content) {
|
||||
content->GetLocalName(localName);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMElement> linkContent;
|
||||
ToLowerCase(localName);
|
||||
if (localName.EqualsLiteral("a") ||
|
||||
localName.EqualsLiteral("area") ||
|
||||
localName.EqualsLiteral("link")) {
|
||||
bool hasAttr;
|
||||
content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mAssociatedLink));
|
||||
nsCOMPtr<nsIContent> linkContent;
|
||||
if (content &&
|
||||
content->IsAnyOfHTMLElements(nsGkAtoms::a,
|
||||
nsGkAtoms::area,
|
||||
nsGkAtoms::link)) {
|
||||
bool hasAttr = content->HasAttr(kNameSpaceID_None, nsGkAtoms::href);
|
||||
if (hasAttr) {
|
||||
linkContent = content;
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(linkContent));
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContent(linkContent);
|
||||
if (anchor) {
|
||||
anchor->GetHref(aHRef);
|
||||
} else {
|
||||
nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(linkContent));
|
||||
RefPtr<HTMLAreaElement> area = HTMLAreaElement::FromContent(linkContent);
|
||||
if (area) {
|
||||
area->GetHref(aHRef);
|
||||
} else {
|
||||
nsCOMPtr<nsIDOMHTMLLinkElement> link(do_QueryInterface(linkContent));
|
||||
RefPtr<HTMLLinkElement> link = HTMLLinkElement::FromContent(linkContent);
|
||||
if (link) {
|
||||
link->GetHref(aHRef);
|
||||
}
|
||||
@ -101,15 +98,12 @@ nsContextMenuInfo::GetAssociatedLink(nsAString& aHRef)
|
||||
if (!content) {
|
||||
break;
|
||||
}
|
||||
content->GetLocalName(localName);
|
||||
ToLowerCase(localName);
|
||||
if (localName.EqualsLiteral("a")) {
|
||||
if (content->IsHTMLElement(nsGkAtoms::a)) {
|
||||
bool hasAttr;
|
||||
content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
|
||||
hasAttr = content->HasAttr(kNameSpaceID_None, nsGkAtoms::href);
|
||||
if (hasAttr) {
|
||||
linkContent = content;
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(
|
||||
do_QueryInterface(linkContent));
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContent(linkContent);
|
||||
if (anchor) {
|
||||
anchor->GetHref(aHRef);
|
||||
}
|
||||
|
@ -135,7 +135,6 @@
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsIController.h"
|
||||
#include "nsPICommandUpdater.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIWebBrowserChrome3.h"
|
||||
#include "nsITabChild.h"
|
||||
#include "nsISiteSecurityService.h"
|
||||
@ -14423,7 +14422,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
||||
|
||||
// If this is an anchor element, grab its type property to use as a hint
|
||||
nsAutoString typeHint;
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(aContent));
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContent(aContent);
|
||||
if (anchor) {
|
||||
anchor->GetType(typeHint);
|
||||
NS_ConvertUTF16toUTF8 utf8Hint(typeHint);
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsITransferable.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsXPCOM.h"
|
||||
@ -57,6 +56,7 @@
|
||||
#include "TabParent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/HTMLAreaElement.h"
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
#include "nsVariant.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
@ -474,9 +474,7 @@ DragDataProducer::Produce(DataTransfer* aDataTransfer,
|
||||
draggedNode = mTarget;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLAreaElement> area; // client-side image map
|
||||
nsCOMPtr<nsIImageLoadingContent> image;
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> link;
|
||||
|
||||
nsCOMPtr<nsIContent> selectedImageOrLinkNode;
|
||||
GetDraggableSelectionData(selection, mSelectionTargetNode,
|
||||
@ -501,19 +499,16 @@ DragDataProducer::Produce(DataTransfer* aDataTransfer,
|
||||
*aCanDrag = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
area = do_QueryInterface(draggedNode);
|
||||
image = do_QueryInterface(draggedNode);
|
||||
link = do_QueryInterface(draggedNode);
|
||||
}
|
||||
|
||||
{
|
||||
// set for linked images, and links
|
||||
nsCOMPtr<nsIContent> linkNode;
|
||||
|
||||
if (area) {
|
||||
RefPtr<HTMLAreaElement> areaElem = HTMLAreaElement::FromContentOrNull(draggedNode);
|
||||
if (areaElem) {
|
||||
// use the alt text (or, if missing, the href) as the title
|
||||
HTMLAreaElement* areaElem = static_cast<HTMLAreaElement*>(area.get());
|
||||
areaElem->GetAttribute(NS_LITERAL_STRING("alt"), mTitleString);
|
||||
if (mTitleString.IsEmpty()) {
|
||||
// this can be a relative link
|
||||
@ -638,9 +633,9 @@ DragDataProducer::Produce(DataTransfer* aDataTransfer,
|
||||
nodeToSerialize = do_QueryInterface(draggedNode);
|
||||
}
|
||||
dragNode = nodeToSerialize;
|
||||
} else if (link) {
|
||||
} else if (draggedNode && draggedNode->IsHTMLElement(nsGkAtoms::a)) {
|
||||
// set linkNode. The code below will handle this
|
||||
linkNode = do_QueryInterface(link); // XXX test this
|
||||
linkNode = do_QueryInterface(draggedNode); // XXX test this
|
||||
GetNodeString(draggedNode, mTitleString);
|
||||
} else if (parentLink) {
|
||||
// parentLink will always be null if there's selected content
|
||||
|
@ -58,10 +58,13 @@ HTMLAnchorElement::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
|
||||
nsGenericHTMLElement::IsInteractiveHTMLContent(aIgnoreTabindex);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLAnchorElement,
|
||||
nsGenericHTMLElement,
|
||||
nsIDOMHTMLAnchorElement,
|
||||
Link)
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLAnchorElement)
|
||||
NS_INTERFACE_TABLE_INHERITED(HTMLAnchorElement,
|
||||
Link)
|
||||
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLAnchorElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLAnchorElement, Element)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLAnchorElement)
|
||||
|
||||
@ -83,17 +86,6 @@ HTMLAnchorElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
return HTMLAnchorElementBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Charset, charset)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Coords, coords)
|
||||
NS_IMPL_URI_ATTR(HTMLAnchorElement, Href, href)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Hreflang, hreflang)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Name, name)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Rel, rel)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Rev, rev)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Shape, shape)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Type, type)
|
||||
NS_IMPL_STRING_ATTR(HTMLAnchorElement, Download, download)
|
||||
|
||||
int32_t
|
||||
HTMLAnchorElement::TabIndexDefault()
|
||||
{
|
||||
@ -268,19 +260,12 @@ HTMLAnchorElement::GetLinkTarget(nsAString& aTarget)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
HTMLAnchorElement::GetTarget(nsAString& aValue)
|
||||
{
|
||||
if (!GetAttr(kNameSpaceID_None, nsGkAtoms::target, aValue)) {
|
||||
GetBaseTarget(aValue);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLAnchorElement::SetTarget(const nsAString& aValue)
|
||||
{
|
||||
return SetAttr(kNameSpaceID_None, nsGkAtoms::target, aValue, true);
|
||||
}
|
||||
|
||||
nsDOMTokenList*
|
||||
@ -292,64 +277,26 @@ HTMLAnchorElement::RelList()
|
||||
return mRelList;
|
||||
}
|
||||
|
||||
#define IMPL_URI_PART(_part) \
|
||||
NS_IMETHODIMP \
|
||||
HTMLAnchorElement::Get##_part(nsAString& a##_part) \
|
||||
{ \
|
||||
Link::Get##_part(a##_part); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
HTMLAnchorElement::Set##_part(const nsAString& a##_part) \
|
||||
{ \
|
||||
Link::Set##_part(a##_part); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
IMPL_URI_PART(Protocol)
|
||||
IMPL_URI_PART(Host)
|
||||
IMPL_URI_PART(Hostname)
|
||||
IMPL_URI_PART(Pathname)
|
||||
IMPL_URI_PART(Search)
|
||||
IMPL_URI_PART(Port)
|
||||
IMPL_URI_PART(Hash)
|
||||
|
||||
#undef IMPL_URI_PART
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLAnchorElement::GetText(nsAString& aText)
|
||||
void
|
||||
HTMLAnchorElement::GetText(nsAString& aText, mozilla::ErrorResult& aRv)
|
||||
{
|
||||
if(!nsContentUtils::GetNodeTextContent(this, true, aText, fallible)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
if (NS_WARN_IF(!nsContentUtils::GetNodeTextContent(this, true, aText, fallible))) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLAnchorElement::SetText(const nsAString& aText)
|
||||
void
|
||||
HTMLAnchorElement::SetText(const nsAString& aText, ErrorResult& aRv)
|
||||
{
|
||||
return nsContentUtils::SetNodeTextContent(this, aText, false);
|
||||
aRv = nsContentUtils::SetNodeTextContent(this, aText, false);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
HTMLAnchorElement::ToString(nsAString& aSource)
|
||||
{
|
||||
return GetHref(aSource);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLAnchorElement::GetPing(nsAString& aValue)
|
||||
{
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLAnchorElement::SetPing(const nsAString& aValue)
|
||||
{
|
||||
return SetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue, true);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIURI>
|
||||
HTMLAnchorElement::GetHrefURI() const
|
||||
{
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/Link.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -19,7 +18,6 @@ class EventChainPreVisitor;
|
||||
namespace dom {
|
||||
|
||||
class HTMLAnchorElement final : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLAnchorElement,
|
||||
public Link
|
||||
{
|
||||
public:
|
||||
@ -39,15 +37,15 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLAnchorElement,
|
||||
nsGenericHTMLElement)
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLAnchorElement, a);
|
||||
|
||||
virtual int32_t TabIndexDefault() override;
|
||||
virtual bool Draggable() const override;
|
||||
|
||||
// Element
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override;
|
||||
|
||||
// nsIDOMHTMLAnchorElement
|
||||
NS_DECL_NSIDOMHTMLANCHORELEMENT
|
||||
|
||||
// DOM memory reporter participant
|
||||
NS_DECL_ADDSIZEOFEXCLUDINGTHIS
|
||||
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
@ -84,12 +82,15 @@ public:
|
||||
|
||||
// WebIDL API
|
||||
|
||||
// The XPCOM GetHref is OK for us
|
||||
void GetHref(nsAString& aValue)
|
||||
{
|
||||
GetURIAttr(nsGkAtoms::href, nullptr, aValue);
|
||||
}
|
||||
void SetHref(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::href, aValue, rv);
|
||||
}
|
||||
// The XPCOM GetTarget is OK for us
|
||||
void GetTarget(nsAString& aValue);
|
||||
void SetTarget(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::target, aValue, rv);
|
||||
@ -102,7 +103,10 @@ public:
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::download, aValue, rv);
|
||||
}
|
||||
// The XPCOM GetPing is OK for us
|
||||
void GetPing(DOMString& aValue)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::ping, aValue);
|
||||
}
|
||||
void SetPing(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::ping, aValue, rv);
|
||||
@ -119,9 +123,9 @@ public:
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::referrerpolicy, aValue, rv);
|
||||
}
|
||||
void GetReferrerPolicy(nsAString& aReferrer)
|
||||
void GetReferrerPolicy(DOMString& aPolicy)
|
||||
{
|
||||
GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aReferrer);
|
||||
GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aPolicy);
|
||||
}
|
||||
nsDOMTokenList* RelList();
|
||||
void GetHreflang(DOMString& aValue)
|
||||
@ -132,6 +136,11 @@ public:
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::hreflang, aValue, rv);
|
||||
}
|
||||
// Needed for docshell
|
||||
void GetType(nsAString& aValue)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::type, aValue);
|
||||
}
|
||||
void GetType(DOMString& aValue)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::type, aValue);
|
||||
@ -140,11 +149,8 @@ public:
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::type, aValue, rv);
|
||||
}
|
||||
// The XPCOM GetText is OK for us
|
||||
void SetText(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
{
|
||||
rv = SetText(aValue);
|
||||
}
|
||||
void GetText(nsAString& aValue, mozilla::ErrorResult& rv);
|
||||
void SetText(const nsAString& aValue, mozilla::ErrorResult& rv);
|
||||
|
||||
// Link::GetOrigin is OK for us
|
||||
|
||||
@ -175,7 +181,6 @@ public:
|
||||
// Link::Link::GetHash is OK for us
|
||||
// Link::Link::SetHash is OK for us
|
||||
|
||||
// The XPCOM URI decomposition attributes are fine for us
|
||||
void GetCoords(DOMString& aValue)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::coords, aValue);
|
||||
@ -220,6 +225,7 @@ public:
|
||||
{
|
||||
GetHref(aResult);
|
||||
}
|
||||
void ToString(nsAString& aSource);
|
||||
|
||||
virtual void NodeInfoChanged(nsIDocument* aOldDoc) final override
|
||||
{
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
// nsIDOMHTMLAreaElement
|
||||
NS_DECL_NSIDOMHTMLAREAELEMENT
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLAreaElement, area);
|
||||
|
||||
virtual nsresult GetEventTargetParent(
|
||||
EventChainPreVisitor& aVisitor) override;
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
// nsIDOMHTMLLinkElement
|
||||
NS_DECL_NSIDOMHTMLLINKELEMENT
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLLinkElement, link);
|
||||
NS_DECL_ADDSIZEOFEXCLUDINGTHIS
|
||||
|
||||
void LinkAdded();
|
||||
|
@ -8,7 +8,6 @@ with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "DOM")
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMHTMLAnchorElement.idl',
|
||||
'nsIDOMHTMLAreaElement.idl',
|
||||
'nsIDOMHTMLBaseElement.idl',
|
||||
'nsIDOMHTMLButtonElement.idl',
|
||||
|
@ -1,55 +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 nsIDOMHTMLAnchorElement interface is the interface to a [X]HTML
|
||||
* a element.
|
||||
*
|
||||
* This interface is trying to follow the DOM Level 2 HTML specification:
|
||||
* http://www.w3.org/TR/DOM-Level-2-HTML/
|
||||
*
|
||||
* with changes from the work-in-progress WHATWG HTML specification:
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
|
||||
[uuid(339c01c8-2d41-4626-b231-eec63f0241b6)]
|
||||
interface nsIDOMHTMLAnchorElement : nsISupports
|
||||
{
|
||||
attribute DOMString href;
|
||||
attribute DOMString target;
|
||||
|
||||
attribute DOMString ping;
|
||||
attribute DOMString download;
|
||||
|
||||
attribute DOMString rel;
|
||||
attribute DOMString hreflang;
|
||||
attribute DOMString type;
|
||||
|
||||
/**
|
||||
* An alias for the textContent attribute.
|
||||
*/
|
||||
[Null(Stringify)]
|
||||
attribute DOMString text;
|
||||
|
||||
// URL decomposition IDL attributes
|
||||
attribute DOMString protocol;
|
||||
attribute DOMString host;
|
||||
attribute DOMString hostname;
|
||||
attribute DOMString port;
|
||||
attribute DOMString pathname;
|
||||
attribute DOMString search;
|
||||
attribute DOMString hash;
|
||||
|
||||
|
||||
attribute DOMString charset;
|
||||
attribute DOMString coords;
|
||||
attribute DOMString name;
|
||||
attribute DOMString rev;
|
||||
attribute DOMString shape;
|
||||
|
||||
DOMString toString();
|
||||
};
|
@ -6,6 +6,7 @@
|
||||
#include "WebBrowserPersistLocalDocument.h"
|
||||
#include "WebBrowserPersistDocumentParent.h"
|
||||
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/HTMLObjectElement.h"
|
||||
#include "mozilla/dom/HTMLSharedElement.h"
|
||||
@ -20,7 +21,6 @@
|
||||
#include "nsIDOMAttr.h"
|
||||
#include "nsIDOMComment.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLBaseElement.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
@ -941,7 +941,7 @@ PersistNodeFixup::FixupNode(nsIDOMNode *aNodeIn,
|
||||
}
|
||||
|
||||
// Fix up href and file links in the elements
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> nodeAsAnchor = do_QueryInterface(aNodeIn);
|
||||
RefPtr<dom::HTMLAnchorElement> nodeAsAnchor = dom::HTMLAnchorElement::FromContent(content);
|
||||
if (nodeAsAnchor) {
|
||||
rv = GetNodeToFixup(aNodeIn, aNodeOut);
|
||||
if (NS_SUCCEEDED(rv) && *aNodeOut) {
|
||||
|
@ -31,7 +31,7 @@ interface HTMLAnchorElement : HTMLElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString type;
|
||||
|
||||
[CEReactions, SetterThrows]
|
||||
[CEReactions, Throws]
|
||||
attribute DOMString text;
|
||||
};
|
||||
|
||||
|
@ -18,11 +18,11 @@
|
||||
#include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::a, etc.
|
||||
#include "nsHTMLTags.h"
|
||||
#include "nsIAtom.h" // for nsIAtom
|
||||
#include "nsIDOMHTMLAnchorElement.h" // for nsIDOMHTMLAnchorElement
|
||||
#include "nsIDOMNode.h" // for nsIDOMNode
|
||||
#include "nsNameSpaceManager.h" // for kNameSpaceID_None
|
||||
#include "nsLiteralString.h" // for NS_LITERAL_STRING
|
||||
#include "nsString.h" // for nsAutoString
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -336,14 +336,18 @@ HTMLEditUtils::IsLink(nsINode* aNode)
|
||||
{
|
||||
MOZ_ASSERT(aNode);
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor = do_QueryInterface(aNode);
|
||||
if (anchor) {
|
||||
nsAutoString tmpText;
|
||||
if (NS_SUCCEEDED(anchor->GetHref(tmpText)) && !tmpText.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
if (!aNode->IsContent()) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContentOrNull(aNode->AsContent());
|
||||
if (!anchor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoString tmpText;
|
||||
anchor->GetHref(tmpText);
|
||||
return !tmpText.IsEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "nsIDocumentInlines.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsILinkHandler.h"
|
||||
@ -2594,19 +2593,21 @@ HTMLEditor::InsertLinkAroundSelection(nsIDOMElement* aAnchorElement)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Be sure we were given an anchor element
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor = do_QueryInterface(aAnchorElement);
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aAnchorElement);
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContentOrNull(content);
|
||||
if (!anchor) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString href;
|
||||
nsresult rv = anchor->GetHref(href);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
anchor->GetHref(href);
|
||||
if (href.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
AutoPlaceholderBatch beginBatching(this);
|
||||
|
||||
// Set all attributes found on the supplied anchor element
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLFrameElement.h"
|
||||
#include "nsIDOMHTMLIFrameElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include <algorithm>
|
||||
#ifdef ACCESSIBILITY
|
||||
@ -81,6 +80,7 @@
|
||||
|
||||
#include "mozilla/dom/Link.h"
|
||||
#include "SVGImageContext.h"
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -1993,7 +1993,7 @@ nsImageFrame::GetAnchorHREFTargetAndNode(nsIURI** aHref, nsString& aTarget,
|
||||
}
|
||||
status = (*aHref != nullptr);
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(content));
|
||||
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContent(content);
|
||||
if (anchor) {
|
||||
anchor->GetTarget(aTarget);
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
|
||||
#include "nsILayoutHistoryState.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "mozilla/ReflowInput.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLLinkElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "nsIDOMFormData.h"
|
||||
#include "nsIDOMGeoPositionError.h"
|
||||
#include "nsIDOMHistory.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLBaseElement.h"
|
||||
#include "nsIDOMHTMLButtonElement.h"
|
||||
@ -321,7 +320,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
|
||||
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIFrameLoader, FrameLoader),
|
||||
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMGeoPositionError, PositionError),
|
||||
DEFINE_SHIM(History),
|
||||
DEFINE_SHIM(HTMLAnchorElement),
|
||||
DEFINE_SHIM(HTMLAreaElement),
|
||||
DEFINE_SHIM(HTMLBaseElement),
|
||||
DEFINE_SHIM(HTMLButtonElement),
|
||||
|
Loading…
x
Reference in New Issue
Block a user