Files
palemoon27/dom/html/HTMLLinkElement.h
roytam1 304ef93493 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1256545: avoid compiler warning for pointer truncation when checking low bits r=bwc (d16c97ba81)
- Bug 1255655 - Const-ify and shrink octet_weight. r=hurley. (d5b4c89e87)
- Bug 1216837: add explicit error checks for packet length in srtp r=mcmanus rs=jesup (ce11d6694e)
- Bug 1248565 - Let child processes have its own MOZ_LOG_FILE. r=erahm (a242c8fa08)
- Bug 1256558 - Change MUST_CONVERT to avoid C4311 in VS2015; r=khuey (81b1f997f6)
- Bug 580313 - Use deque instead of manual queue im nsPrefetchService. r=smaug (023e0115e8)
- Bug 580313 - New resource hints for link. r=smaug (3c7949ab9a)
- Bug 1253593 - Fix applicationCache.onchecking notification on e10s. r=jduell (debb998b9d)
- Bug 1234177 - check to see if mFunctions.append returned error. r=bholley (0dc9d44233)
- Bug 1183754, part 1 - Get rid of aligned spacing for XPCWrappedNative fields. r=bholley (dfb09ad1a4)
- Bug 1183754, part 2 - Remove clearing of the next chunk. r=bholley (78e8c4d7cb)
- Bug 1183754, part 3 - Use a UniquePtr for XPCWrappedNativeChunk::mNextChunk. r=bholley (26d816ff0c)
- Bug 1183754, part 4 - Eliminate XPCWrappedNativeTearOffChunk. r=bholley (0f50e6c9ff)
- Bug 1252154: Delay allocation metadata collection for inline typed objects. r=sfink (9f3cea8d76)
- Bug 1250195: In TypedObject.from, decide that the input is typed only if it's an array type; r=pnkfelix (2ceb08c793)
- Bug 1250842 - Fix initialization of script source object when modules are compiled off main thread r=shu (ca3f9b900e)
- Bug 1257053 - Only make use of error stashing (via PossibleError) when it is necessary; r=jorendorff (f3744899c4)
- Bug 1253847 - Do not count the skipped EOL inside template literal. r=jorendorff (f63926bb2d)
- Bug 1221378: Don't collect allocation metadata when lazily creating standard prototypes. r=fitzgen (667e752baf)
- Bug 1249469 - Allow any script to execute when resolving constructors. (r=jimb) (474fae3645)
- Bug 1221378: SpiderMonkey: Assert against re-entrant constructor resolution. r=fitzgen (15619325de)
- Bug 1249469 - Followup: missing #include on a CLOSED TREE. (3c62bbbb31)
- Bug 1248412 - inlineIsTypedArrayHelper: Check for TypedArray and Proxy classes when we allow wrapped TypedArray. r=Waldo (1bcaba804b)
- Bug 1250307 - Add the by: "bucket" breakdown option; r=jimb (8ca32dc781)
- Bug 1221378: Add JSCLASS_DELAY_METADATA_CALLBACK flag to UnboxedPlainObject. r=jandem (7e0eb0be01)
- Bug 1064543 - Don't emit FilterTypeSet if it wouldn't remove any types. r=h4writer (d1a1a4e127)
- Bug 1242462 - Add a newline when calling TypeSet::print from a debugger. r=jandem (2e4c07aaf3)
- Bug 1247140 - Use mozilla::BinarySearch{,If} for more manual binary searches in SpiderMonkey. r=jandem (b948fe7f60)
- Bug 1249193 - Fix Debugger.Frame.this to work correctly if we're still in the script's prologue. r=shu (0f17a78c1a)
- Bug 1249193 part 2 - Fix DebugScopeProxy to return correct this-value if we're still in the prologue. r=shu (5e17bdb2c9)
- Bug 1187450 - avoid leaking cstr in SPSProfiler::allocProfileString. r=jorendorff (96964744b2)
- Bug 1251790 - Add help for "interface objects", r=terrence (9a5d8cc3fa)
- Bug 944164 - Implement proper redirection with ref counted underlying files, r=terrence (f4182fff75)
- Bug 1248352 - Allow shell option parsing code to handle help text containing blank lines r=jandem (d7f2814665)
- Bug 1249954 - Handle OOM in SingleStepCallback. r=terrence (460f323729)
- Bug 1257223 - Fix os.file.redirect(null), r=jonco (2ca40fd839)
2024-03-29 09:08:19 +08:00

185 lines
6.0 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_HTMLLinkElement_h
#define mozilla_dom_HTMLLinkElement_h
#include "mozilla/Attributes.h"
#include "mozilla/dom/Link.h"
#include "ImportManager.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsStyleLinkElement.h"
namespace mozilla {
class EventChainPostVisitor;
class EventChainPreVisitor;
namespace dom {
class HTMLLinkElement final : public nsGenericHTMLElement,
public nsIDOMHTMLLinkElement,
public nsStyleLinkElement,
public Link
{
public:
explicit HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// CC
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLLinkElement,
nsGenericHTMLElement)
// nsIDOMHTMLLinkElement
NS_DECL_NSIDOMHTMLLINKELEMENT
// DOM memory reporter participant
NS_DECL_SIZEOF_EXCLUDING_THIS
void LinkAdded();
void LinkRemoved();
void UpdateImport();
// nsIDOMEventTarget
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override;
virtual nsresult PostHandleEvent(
EventChainPostVisitor& aVisitor) override;
// nsINode
virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const override;
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
// nsIContent
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers) override;
virtual void UnbindFromTree(bool aDeep = true,
bool aNullParent = true) override;
virtual nsresult BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsAttrValueOrString* aValue,
bool aNotify) override;
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
const nsAttrValue* aValue,
bool aNotify) override;
virtual bool IsLink(nsIURI** aURI) const override;
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
// Element
virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult) override;
virtual void GetLinkTarget(nsAString& aTarget) override;
virtual EventStates IntrinsicState() const override;
void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
virtual void OnDNSPrefetchDeferred() override;
virtual void OnDNSPrefetchRequested() override;
virtual bool HasDeferredDNSPrefetchRequest() override;
// WebIDL
bool Disabled();
void SetDisabled(bool aDisabled);
// XPCOM GetHref is fine.
void SetHref(const nsAString& aHref, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::href, aHref, aRv);
}
void GetCrossOrigin(nsAString& aResult)
{
// Null for both missing and invalid defaults is ok, since we
// always parse to an enum value, so we don't need an invalid
// default, and we _want_ the missing default to be null.
GetEnumAttr(nsGkAtoms::crossorigin, nullptr, aResult);
}
void SetCrossOrigin(const nsAString& aCrossOrigin, ErrorResult& aError)
{
SetOrRemoveNullableStringAttr(nsGkAtoms::crossorigin, aCrossOrigin, aError);
}
// XPCOM GetRel is fine.
void SetRel(const nsAString& aRel, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::rel, aRel, aRv);
}
nsDOMTokenList* RelList();
// XPCOM GetMedia is fine.
void SetMedia(const nsAString& aMedia, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::media, aMedia, aRv);
}
// XPCOM GetHreflang is fine.
void SetHreflang(const nsAString& aHreflang, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::hreflang, aHreflang, aRv);
}
nsDOMTokenList* Sizes()
{
return GetTokenList(nsGkAtoms::sizes);
}
// XPCOM GetType is fine.
void SetType(const nsAString& aType, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::type, aType, aRv);
}
// XPCOM GetCharset is fine.
void SetCharset(const nsAString& aCharset, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::charset, aCharset, aRv);
}
// XPCOM GetRev is fine.
void SetRev(const nsAString& aRev, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::rev, aRev, aRv);
}
// XPCOM GetTarget is fine.
void SetTarget(const nsAString& aTarget, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::target, aTarget, aRv);
}
void GetIntegrity(nsAString& aIntegrity) const
{
GetHTMLAttr(nsGkAtoms::integrity, aIntegrity);
}
void SetIntegrity(const nsAString& aIntegrity, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::integrity, aIntegrity, aRv);
}
already_AddRefed<nsIDocument> GetImport();
already_AddRefed<ImportLoader> GetImportLoader()
{
return RefPtr<ImportLoader>(mImportLoader).forget();
}
virtual CORSMode GetCORSMode() const override;
protected:
virtual ~HTMLLinkElement();
// nsStyleLinkElement
virtual already_AddRefed<nsIURI> GetStyleSheetURL(bool* aIsInline) override;
virtual void GetStyleSheetInfo(nsAString& aTitle,
nsAString& aType,
nsAString& aMedia,
bool* aIsScoped,
bool* aIsAlternate) override;
protected:
// nsGenericHTMLElement
virtual void GetItemValueText(DOMString& text) override;
virtual void SetItemValueText(const nsAString& text) override;
RefPtr<nsDOMTokenList > mRelList;
private:
RefPtr<ImportLoader> mImportLoader;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLLinkElement_h