merge autoland to mozilla-central. r=merge a=merge

MozReview-Commit-ID: LgWYsYPnUAb
This commit is contained in:
Sebastian Hengst 2017-07-31 11:09:41 +02:00
commit 827b0ca5dc
149 changed files with 12065 additions and 25687 deletions

View File

@ -1109,9 +1109,8 @@ HTMLTableAccessible::IsProbablyLayoutTable()
if (HasDescendant(NS_LITERAL_STRING("embed")) ||
HasDescendant(NS_LITERAL_STRING("object")) ||
HasDescendant(NS_LITERAL_STRING("applet")) ||
HasDescendant(NS_LITERAL_STRING("iframe"))) {
RETURN_LAYOUT_ANSWER(true, "Has no borders, and has iframe, object, applet or iframe, typical of advertisements");
RETURN_LAYOUT_ANSWER(true, "Has no borders, and has iframe, object, or iframe, typical of advertisements");
}
RETURN_LAYOUT_ANSWER(false, "no layout factor strong enough, so will guess data");

View File

@ -78,7 +78,6 @@ function getSelection(window) {
//the page context doesn't apply.
const NON_PAGE_CONTEXT_ELTS = [
Ci.nsIDOMHTMLAnchorElement,
Ci.nsIDOMHTMLAppletElement,
Ci.nsIDOMHTMLAreaElement,
Ci.nsIDOMHTMLButtonElement,
Ci.nsIDOMHTMLCanvasElement,

View File

@ -869,8 +869,7 @@ nsContextMenu.prototype = {
}
}
} else if ((this.target instanceof HTMLEmbedElement ||
this.target instanceof HTMLObjectElement ||
this.target instanceof HTMLAppletElement) &&
this.target instanceof HTMLObjectElement) &&
this.target.displayedType == HTMLObjectElement.TYPE_NULL &&
this.target.pluginFallbackType == HTMLObjectElement.PLUGIN_CLICK_TO_PLAY) {
this.onCTPPlugin = true;

View File

@ -730,7 +730,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, unsigned int rel_type
// for the relocation.
for (ElfSegment *segment = elf->getSegmentByType(PT_LOAD); segment;
segment = elf->getSegmentByType(PT_LOAD, segment)) {
if (segment->getFlags() & PF_W == 0)
if ((segment->getFlags() & PF_W) == 0)
continue;
size_t ptr_size = Elf_Addr::size(elf->getClass());
size_t aligned_mem_end = (segment->getAddr() + segment->getMemSize() + ptr_size - 1) & ~(ptr_size - 1);

View File

@ -42,7 +42,6 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMHTMLHtmlElement.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLEmbedElement.h"
#include "nsIDOMHTMLDocument.h"
@ -1584,17 +1583,16 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
}
}
// always consume events for plugins and Java who may throw their
// own context menus but not for image objects. Document objects
// will never be targets or ancestors of targets, so that's OK.
// always consume events for plugins who may throw their own context menus
// but not for image objects. Document objects will never be targets or
// ancestors of targets, so that's OK.
nsCOMPtr<nsIDOMHTMLObjectElement> objectElement;
if (!(flags & nsIContextMenuListener::CONTEXT_IMAGE)) {
objectElement = do_QueryInterface(node);
}
nsCOMPtr<nsIDOMHTMLEmbedElement> embedElement(do_QueryInterface(node));
nsCOMPtr<nsIDOMHTMLAppletElement> appletElement(do_QueryInterface(node));
if (objectElement || embedElement || appletElement) {
if (objectElement || embedElement) {
return NS_OK;
}
}

View File

@ -489,11 +489,10 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
// If we have a frame the frame has already loaded the binding. And
// otherwise, don't do anything else here unless we're dealing with
// XUL or an HTML element that may have a plugin-related overlay
// (i.e. object, embed, or applet).
// (i.e. object or embed).
bool isXULorPluginElement = (IsXULElement() ||
IsHTMLElement(nsGkAtoms::object) ||
IsHTMLElement(nsGkAtoms::embed) ||
IsHTMLElement(nsGkAtoms::applet));
IsHTMLElement(nsGkAtoms::embed));
nsIPresShell* shell = aDocument->GetShell();
if (!shell || GetPrimaryFrame() || !isXULorPluginElement) {
*aResult = nullptr;

View File

@ -152,6 +152,67 @@ nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto
return NodeListBinding::Wrap(cx, this, aGivenProto);
}
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsEmptyContentList, nsBaseContentList, mRoot)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsEmptyContentList)
NS_INTERFACE_MAP_END_INHERITING(nsBaseContentList)
NS_IMPL_ADDREF_INHERITED(nsEmptyContentList, nsBaseContentList)
NS_IMPL_RELEASE_INHERITED(nsEmptyContentList, nsBaseContentList)
JSObject*
nsEmptyContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return NodeListBinding::Wrap(cx, this, aGivenProto);
}
NS_IMETHODIMP
nsEmptyContentList::GetLength(uint32_t* aLength)
{
*aLength = 0;
return NS_OK;
}
NS_IMETHODIMP
nsEmptyContentList::Item(uint32_t aIndex, nsIDOMNode** aReturn)
{
*aReturn = nullptr;
return NS_OK;
}
NS_IMETHODIMP
nsEmptyContentList::NamedItem(const nsAString& aName, nsIDOMNode** aReturn)
{
*aReturn = nullptr;
return NS_OK;
}
mozilla::dom::Element*
nsEmptyContentList::GetElementAt(uint32_t index)
{
return nullptr;
}
mozilla::dom::Element*
nsEmptyContentList::GetFirstNamedElement(const nsAString& aName, bool& aFound)
{
aFound = false;
return nullptr;
}
void
nsEmptyContentList::GetSupportedNames(nsTArray<nsString>& aNames)
{
}
nsIContent*
nsEmptyContentList::Item(uint32_t aIndex)
{
return nullptr;
}
// Hashtable for storing nsContentLists
static PLDHashTable* gContentListHashTable;

View File

@ -139,6 +139,52 @@ private:
nsCOMPtr<nsINode> mRoot;
};
// Used for returning lists that will always be empty, such as the applets list
// in HTML Documents
class nsEmptyContentList: public nsBaseContentList,
public nsIHTMLCollection
{
public:
explicit nsEmptyContentList(nsINode* aRoot) : nsBaseContentList(),
mRoot(aRoot)
{
}
// nsIDOMHTMLCollection
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsEmptyContentList,
nsBaseContentList)
NS_DECL_NSIDOMHTMLCOLLECTION
virtual nsINode* GetParentObject() override
{
return mRoot;
}
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
virtual JSObject* GetWrapperPreserveColorInternal() override
{
return nsWrapperCache::GetWrapperPreserveColor();
}
virtual void PreserveWrapperInternal(nsISupports* aScriptObjectHolder) override
{
nsWrapperCache::PreserveWrapper(aScriptObjectHolder);
}
virtual nsIContent* Item(uint32_t aIndex) override;
virtual mozilla::dom::Element* GetElementAt(uint32_t index) override;
virtual mozilla::dom::Element*
GetFirstNamedElement(const nsAString& aName, bool& aFound) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
protected:
virtual ~nsEmptyContentList() {}
private:
// This has to be a strong reference, the root might go away before the list.
nsCOMPtr<nsINode> mRoot;
};
/**
* Class that's used as the key to hash nsContentList implementations
* for fast retrieval

View File

@ -118,10 +118,9 @@ nsHTMLContentSerializer::SerializeHTMLAttributes(nsIContent* aContent,
(attrName == nsGkAtoms::src && namespaceID == kNameSpaceID_None))) {
// Make all links absolute when converting only the selection:
if (mFlags & nsIDocumentEncoder::OutputAbsoluteLinks) {
// Would be nice to handle OBJECT and APPLET tags,
// but that gets more complicated since we have to
// search the tag list for CODEBASE as well.
// For now, just leave them relative.
// Would be nice to handle OBJECT tags, but that gets more complicated
// since we have to search the tag list for CODEBASE as well. For now,
// just leave them relative.
nsCOMPtr<nsIURI> uri = aContent->GetBaseURI();
if (uri) {
nsAutoString absURI;

View File

@ -822,10 +822,10 @@ public:
* This method is called when the parser finishes creating the element's children,
* if any are present.
*
* NOTE: this is currently only called for textarea, select, applet, and
* object elements in the HTML content sink. If you want
* to call it on your element, modify the content sink of your
* choice to do so. This is an efficiency measure.
* NOTE: this is currently only called for textarea, select, and object
* elements in the HTML content sink. If you want to call it on your element,
* modify the content sink of your choice to do so. This is an efficiency
* measure.
*
* If you also need to determine whether the parser is the one creating your
* element (through createElement() or cloneNode() generally) then add a
@ -842,12 +842,14 @@ public:
}
/**
* For HTML textarea, select, applet, and object elements, returns
* true if all children have been added OR if the element was not
* created by the parser. Returns true for all other elements.
* For HTML textarea, select, and object elements, returns true if all
* children have been added OR if the element was not created by the parser.
* Returns true for all other elements.
*
* @returns false if the element was created by the parser and
* it is an HTML textarea, select, applet, or object
* it is an HTML textarea, select, or object
* element and not all children have been added.
*
* @returns true otherwise.
*/
virtual bool IsDoneAddingChildren()

View File

@ -3092,9 +3092,10 @@ protected:
// Tracking for images in the document.
RefPtr<mozilla::dom::ImageTracker> mImageTracker;
// The set of all object, embed, applet, video/audio elements or
// nsIObjectLoadingContent or nsIDocumentActivity for which this is the
// owner document. (They might not be in the document.)
// The set of all object, embed, video/audio elements or
// nsIObjectLoadingContent or nsIDocumentActivity for which this is the owner
// document. (They might not be in the document.)
//
// These are non-owning pointers, the elements are responsible for removing
// themselves when they go away.
nsAutoPtr<nsTHashtable<nsPtrHashKey<nsISupports> > > mActivityObservers;

View File

@ -6,7 +6,7 @@
/*
* A base class implementing nsIObjectLoadingContent for use by
* various content nodes that want to provide plugin/document/image
* loading functionality (eg <embed>, <object>, <applet>, etc).
* loading functionality (eg <embed>, <object>, etc).
*/
// Interface headers
@ -21,7 +21,6 @@
#include "nsIDOMCustomEvent.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIExternalProtocolHandler.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIObjectFrame.h"
@ -90,7 +89,7 @@
#include "mozilla/EventStates.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/dom/HTMLObjectElementBinding.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#include "mozilla/dom/HTMLEmbedElement.h"
#include "mozilla/dom/HTMLObjectElement.h"
#include "nsChannelClassifier.h"
@ -103,7 +102,6 @@
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
static const char *kPrefJavaMIME = "plugin.java.mime";
static const char *kPrefYoutubeRewrite = "plugins.rewrite_youtube_embeds";
static const char *kPrefBlockURIs = "browser.safebrowsing.blockedURIs.enabled";
static const char *kPrefFavorFallbackMode = "plugins.favorfallback.mode";
@ -123,13 +121,6 @@ GetObjectLog()
#define LOG(args) MOZ_LOG(GetObjectLog(), mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(GetObjectLog(), mozilla::LogLevel::Debug)
static bool
IsJavaMIME(const nsACString & aMIMEType)
{
return
nsPluginHost::GetSpecialType(aMIMEType) == nsPluginHost::eSpecialType_Java;
}
static bool
IsFlashMIME(const nsACString & aMIMEType)
{
@ -870,8 +861,7 @@ nsObjectLoadingContent::GetPluginParameters(nsTArray<MozPluginParameter>& aParam
}
void
nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
bool aIgnoreCodebase)
nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams)
{
nsCOMPtr<Element> ourElement =
do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
@ -899,16 +889,12 @@ nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
nsCOMPtr<nsIContent> parent = element->GetParent();
nsCOMPtr<nsIDOMHTMLObjectElement> domObject;
nsCOMPtr<nsIDOMHTMLAppletElement> domApplet;
while (!(domObject || domApplet) && parent) {
while (!domObject && parent) {
domObject = do_QueryInterface(parent);
domApplet = do_QueryInterface(parent);
parent = parent->GetParent();
}
if (domApplet) {
parent = do_QueryInterface(domApplet);
} else if (domObject) {
if (domObject) {
parent = do_QueryInterface(domObject);
} else {
continue;
@ -922,11 +908,6 @@ nsObjectLoadingContent::GetNestedParams(nsTArray<MozPluginParameter>& aParams,
param.mName.Trim(" \n\r\t\b", true, true, false);
param.mValue.Trim(" \n\r\t\b", true, true, false);
// ignore codebase param if it was already added in the attributes array.
if (aIgnoreCodebase && param.mName.EqualsIgnoreCase("codebase")) {
continue;
}
aParams.AppendElement(param);
}
}
@ -952,22 +933,11 @@ nsObjectLoadingContent::BuildParametersArray()
mCachedAttributes.AppendElement(param);
}
bool isJava = IsJavaMIME(mContentType);
nsCString codebase;
if (isJava) {
nsresult rv = mBaseURI->GetSpec(codebase);
NS_ENSURE_SUCCESS(rv, rv);
}
nsAdoptingCString wmodeOverride = Preferences::GetCString("plugins.force.wmode");
for (uint32_t i = 0; i < mCachedAttributes.Length(); i++) {
if (!wmodeOverride.IsEmpty() && mCachedAttributes[i].mName.EqualsIgnoreCase("wmode")) {
CopyASCIItoUTF16(wmodeOverride, mCachedAttributes[i].mValue);
wmodeOverride.Truncate();
} else if (!codebase.IsEmpty() && mCachedAttributes[i].mName.EqualsIgnoreCase("codebase")) {
CopyASCIItoUTF16(codebase, mCachedAttributes[i].mValue);
codebase.Truncate();
}
}
@ -978,13 +948,6 @@ nsObjectLoadingContent::BuildParametersArray()
mCachedAttributes.AppendElement(param);
}
if (!codebase.IsEmpty()) {
MozPluginParameter param;
param.mName = NS_LITERAL_STRING("codebase");
CopyASCIItoUTF16(codebase, param.mValue);
mCachedAttributes.AppendElement(param);
}
// Some plugins were never written to understand the "data" attribute of the OBJECT tag.
// Real and WMP will not play unless they find a "src" attribute, see bug 152334.
// Nav 4.x would simply replace the "data" with "src". Because some plugins correctly
@ -1000,7 +963,7 @@ nsObjectLoadingContent::BuildParametersArray()
}
}
GetNestedParams(mCachedParameters, isJava);
GetNestedParams(mCachedParameters);
return NS_OK;
}
@ -1386,46 +1349,6 @@ nsObjectLoadingContent::ObjectState() const
return NS_EVENT_STATE_LOADING;
}
// Returns false if mBaseURI is not acceptable for java applets.
bool
nsObjectLoadingContent::CheckJavaCodebase()
{
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
nsCOMPtr<nsIScriptSecurityManager> secMan =
nsContentUtils::GetSecurityManager();
nsCOMPtr<nsINetUtil> netutil = do_GetNetUtil();
NS_ASSERTION(thisContent && secMan && netutil, "expected interfaces");
// Note that mBaseURI is this tag's requested base URI, not the codebase of
// the document for security purposes
nsresult rv = secMan->CheckLoadURIWithPrincipal(thisContent->NodePrincipal(),
mBaseURI, 0);
if (NS_FAILED(rv)) {
LOG(("OBJLC [%p]: Java codebase check failed", this));
return false;
}
nsCOMPtr<nsIURI> principalBaseURI;
rv = thisContent->NodePrincipal()->GetURI(getter_AddRefs(principalBaseURI));
if (NS_FAILED(rv)) {
NS_NOTREACHED("Failed to URI from node principal?");
return false;
}
// We currently allow java's codebase to be non-same-origin, with
// the exception of URIs that represent local files
if (NS_URIIsLocalFile(mBaseURI) &&
nsScriptSecurityManager::GetStrictFileOriginPolicy() &&
!NS_RelaxStrictFileOriginPolicy(mBaseURI, principalBaseURI, true)) {
LOG(("OBJLC [%p]: Java failed RelaxStrictFileOriginPolicy for file URI",
this));
return false;
}
return true;
}
void
nsObjectLoadingContent::MaybeRewriteYoutubeEmbed(nsIURI* aURI, nsIURI* aBaseURI, nsIURI** aOutURI)
{
@ -1627,7 +1550,7 @@ nsObjectLoadingContent::CheckProcessPolicy(int16_t *aContentPolicy)
}
nsObjectLoadingContent::ParameterUpdateFlags
nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
nsObjectLoadingContent::UpdateObjectParameters()
{
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
@ -1642,7 +1565,6 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
nsCOMPtr<nsIURI> newURI;
nsCOMPtr<nsIURI> newBaseURI;
ObjectType newType;
bool isJava = false;
// Set if this state can't be used to load anything, forces eType_Null
bool stateInvalid = false;
// Indicates what parameters changed.
@ -1661,51 +1583,6 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
///
/// Initial MIME Type
///
if (aJavaURI || thisContent->NodeInfo()->Equals(nsGkAtoms::applet)) {
nsAdoptingCString javaMIME = Preferences::GetCString(kPrefJavaMIME);
newMime = javaMIME;
NS_ASSERTION(IsJavaMIME(newMime),
"plugin.mime.java should be recognized as java");
isJava = true;
} else {
nsAutoString rawTypeAttr;
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, rawTypeAttr);
if (!rawTypeAttr.IsEmpty()) {
typeAttr = rawTypeAttr;
CopyUTF16toUTF8(rawTypeAttr, newMime);
isJava = IsJavaMIME(newMime);
}
}
///
/// classID
///
if (caps & eSupportClassID) {
nsAutoString classIDAttr;
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::classid, classIDAttr);
if (!classIDAttr.IsEmpty()) {
// Our classid support is limited to 'java:' ids
nsAdoptingCString javaMIME = Preferences::GetCString(kPrefJavaMIME);
NS_ASSERTION(IsJavaMIME(javaMIME),
"plugin.mime.java should be recognized as java");
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
if (StringBeginsWith(classIDAttr, NS_LITERAL_STRING("java:")) &&
pluginHost &&
pluginHost->HavePluginForType(javaMIME)) {
newMime = javaMIME;
isJava = true;
} else {
// XXX(johns): Our de-facto behavior since forever was to refuse to load
// Objects who don't have a classid we support, regardless of other type
// or uri info leads to a valid plugin.
newMime.Truncate();
stateInvalid = true;
}
}
}
///
/// Codebase
///
@ -1713,34 +1590,8 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
nsAutoString codebaseStr;
nsCOMPtr<nsIURI> docBaseURI = thisContent->GetBaseURI();
bool hasCodebase = thisContent->HasAttr(kNameSpaceID_None, nsGkAtoms::codebase);
if (hasCodebase)
if (hasCodebase) {
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::codebase, codebaseStr);
// Java wants the codebase attribute even if it occurs in <param> tags
if (isJava) {
// Find all <param> tags that are nested beneath us, but not beneath another
// object/applet tag.
nsTArray<MozPluginParameter> params;
GetNestedParams(params, false);
for (uint32_t i = 0; i < params.Length(); i++) {
if (params[i].mName.EqualsIgnoreCase("codebase")) {
hasCodebase = true;
codebaseStr = params[i].mValue;
}
}
}
if (isJava && hasCodebase && codebaseStr.IsEmpty()) {
// Java treats codebase="" as "/"
codebaseStr.Assign('/');
// XXX(johns): This doesn't cover the case of "https:" which java would
// interpret as "https:///" but we interpret as this document's
// URI but with a changed scheme.
} else if (isJava && !hasCodebase) {
// Java expects a directory as the codebase, or else it will construct
// relative URIs incorrectly :(
codebaseStr.Assign('.');
}
if (!codebaseStr.IsEmpty()) {
@ -1757,6 +1608,13 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
}
}
nsAutoString rawTypeAttr;
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, rawTypeAttr);
if (!rawTypeAttr.IsEmpty()) {
typeAttr = rawTypeAttr;
CopyUTF16toUTF8(rawTypeAttr, newMime);
}
// If we failed to build a valid URI, use the document's base URI
if (!newBaseURI) {
newBaseURI = docBaseURI;
@ -1768,18 +1626,11 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
nsAutoString uriStr;
// Different elements keep this in various locations
if (isJava) {
// Applet tags and embed/object with explicit java MIMEs have src/data
// attributes that are not meant to be parsed as URIs or opened by the
// browser -- act as if they are null. (Setting these attributes triggers a
// force-load, so tracking the old value to determine if they have changed
// is not necessary.)
} else if (thisContent->NodeInfo()->Equals(nsGkAtoms::object)) {
if (thisContent->NodeInfo()->Equals(nsGkAtoms::object)) {
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::data, uriStr);
} else if (thisContent->NodeInfo()->Equals(nsGkAtoms::embed)) {
thisContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, uriStr);
} else {
// Applet tags should always have a java MIME type at this point
NS_NOTREACHED("Unrecognized plugin-loading tag");
}
@ -1814,9 +1665,6 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
(caps & eAllowPluginSkipChannel) &&
IsPluginEnabledByExtension(newURI, newMime)) {
LOG(("OBJLC [%p]: Using extension as type hint (%s)", this, newMime.get()));
if (!isJava && IsJavaMIME(newMime)) {
return UpdateObjectParameters(true);
}
}
///
@ -1930,15 +1778,6 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
}
} else {
newMime = channelType;
if (IsJavaMIME(newMime)) {
// Java does not load with a channel, and being java retroactively
// changes how we may have interpreted the codebase to construct this
// URI above. Because the behavior here is more or less undefined, play
// it safe and reject the load.
LOG(("OBJLC [%p]: Refusing to load with channel with java MIME",
this));
stateInvalid = true;
}
}
} else if (newChannel) {
LOG(("OBJLC [%p]: We failed to open a channel, marking invalid", this));
@ -2010,12 +1849,6 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
}
if (!URIEquals(mBaseURI, newBaseURI)) {
if (isJava) {
// Java bases its class loading on the base URI, so we consider the state
// to have changed if this changes. If the object is using a relative URI,
// mURI will have changed below regardless
retval = (ParameterUpdateFlags)(retval | eParamStateChanged);
}
LOG(("OBJLC [%p]: Object effective baseURI changed", this));
mBaseURI = newBaseURI;
}
@ -2210,9 +2043,6 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
if (mType != eType_Null) {
bool allowLoad = true;
if (IsJavaMIME(mContentType)) {
allowLoad = CheckJavaCodebase();
}
int16_t contentPolicy = nsIContentPolicy::ACCEPT;
// If mChannelLoaded is set we presumably already passed load policy
// If mType == eType_Loading then we call OpenChannel() which internally
@ -3110,8 +2940,7 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
// Do a depth-first traverse of node tree with the current element as root,
// looking for <embed> or <object> elements that might now need to load.
nsTArray<nsINodeList*> childNodes;
if ((thisContent->IsHTMLElement(nsGkAtoms::object) ||
thisContent->IsHTMLElement(nsGkAtoms::applet)) &&
if (thisContent->IsHTMLElement(nsGkAtoms::object) &&
(aType == eFallbackUnsupported ||
aType == eFallbackDisabled ||
aType == eFallbackBlocklisted ||
@ -3128,8 +2957,7 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
aType = eFallbackAlternate;
}
if (thisIsObject) {
if (child->IsHTMLElement(nsGkAtoms::embed)) {
HTMLSharedObjectElement* embed = static_cast<HTMLSharedObjectElement*>(child);
if (auto embed = HTMLEmbedElement::FromContent(child)) {
embed->StartObjectLoad(true, true);
skipChildDescendants = true;
} else if (auto object = HTMLObjectElement::FromContent(child)) {
@ -3942,11 +3770,6 @@ nsObjectLoadingContent::BlockEmbedOrObjectContentLoading()
{
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
if (!thisContent->IsHTMLElement(nsGkAtoms::embed) &&
!thisContent->IsHTMLElement(nsGkAtoms::object)) {
// Doesn't apply to other elements (i.e. <applet>)
return false;
}
// Traverse up the node tree to see if we have any ancestors that may block us
// from loading

View File

@ -7,7 +7,7 @@
/*
* A base class implementing nsIObjectLoadingContent for use by
* various content nodes that want to provide plugin/document/image
* loading functionality (eg <embed>, <object>, <applet>, etc).
* loading functionality (eg <embed>, <object>, etc).
*/
#ifndef NSOBJECTLOADINGCONTENT_H_
@ -262,8 +262,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent
* Begins loading the object when called
*
* Attributes of |this| QI'd to nsIContent will be inspected, depending on
* the node type. This function currently assumes it is a <applet>,
* <object>, or <embed> tag.
* the node type. This function currently assumes it is a <object> or
* <embed> tag.
*
* The instantiated plugin depends on:
* - The URI (<embed src>, <object data>)
@ -301,7 +301,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent
eSupportDocuments = 1u << 2, // Documents are supported
// (nsIDocumentLoaderFactory)
// This flag always includes SVG
eSupportClassID = 1u << 3, // The classid attribute is supported
eSupportClassID = 1u << 3, // The classid attribute is supported. No
// longer used.
// If possible to get a *plugin* type from the type attribute *or* file
// extension, we can use that type and begin loading the plugin before
@ -389,12 +390,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent
*
* @param aParameters The array containing pairs of name/value strings
* from nested <param> objects.
* @param aIgnoreCodebase Flag for ignoring the "codebase" param when
* building the array. This is useful when loading
* java.
*/
void GetNestedParams(nsTArray<mozilla::dom::MozPluginParameter>& aParameters,
bool aIgnoreCodebase);
void GetNestedParams(nsTArray<mozilla::dom::MozPluginParameter>& aParameters);
MOZ_MUST_USE nsresult BuildParametersArray();
@ -425,7 +422,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent
* - mContentType : The final content type, considering mChannel if
* mChannelLoaded is set
* - mBaseURI : The object's base URI, which may be set by the
* object (codebase attribute)
* object
* - mType : The type the object is determined to be based
* on the above
*
@ -436,13 +433,9 @@ class nsObjectLoadingContent : public nsImageLoadingContent
* NOTE This function does not perform security checks, only determining the
* requested type and parameters of the object.
*
* @param aJavaURI Specify that the URI will be consumed by java, which
* changes codebase parsing and URI construction. Used
* internally.
*
* @return Returns a bitmask of ParameterUpdateFlags values
*/
ParameterUpdateFlags UpdateObjectParameters(bool aJavaURI = false);
ParameterUpdateFlags UpdateObjectParameters();
/**
* Queue a CheckPluginStopEvent and track it in mPendingCheckPluginStopEvent
@ -501,11 +494,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent
*/
bool PreferFallback(bool aIsPluginClickToPlay);
/*
* Helper to check if mBaseURI can be used by java as a codebase
*/
bool CheckJavaCodebase();
/**
* Helper to check if our current URI passes policy
*
@ -672,12 +660,11 @@ class nsObjectLoadingContent : public nsImageLoadingContent
// a loaded type
nsCOMPtr<nsIURI> mURI;
// The original URI obtained from inspecting the element (codebase, and
// src/data). May differ from mURI due to redirects
// The original URI obtained from inspecting the element. May differ from
// mURI due to redirects
nsCOMPtr<nsIURI> mOriginalURI;
// The baseURI used for constructing mURI, and used by some plugins (java)
// as a root for other resource requests.
// The baseURI used for constructing mURI.
nsCOMPtr<nsIURI> mBaseURI;

View File

@ -42,9 +42,8 @@ const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x4;
/**
* This flag prevents content from instantiating plugins, whether using the
* embed element, the object element, the applet element, or through
* navigation of a nested browsing context, unless those plugins can be
* secured.
* embed element, the object element, or through navigation of a nested browsing
* context, unless those plugins can be secured.
*/
const unsigned long SANDBOXED_PLUGINS = 0x8;

View File

@ -299,7 +299,7 @@ nsXHTMLContentSerializer::SerializeAttributes(nsIContent* aContent,
(attrName == nsGkAtoms::src))) {
// Make all links absolute when converting only the selection:
if (mFlags & nsIDocumentEncoder::OutputAbsoluteLinks) {
// Would be nice to handle OBJECT and APPLET tags,
// Would be nice to handle OBJECT tags,
// but that gets more complicated since we have to
// search the tag list for CODEBASE as well.
// For now, just leave them relative.

View File

@ -262,7 +262,6 @@ support-files =
[test_anonymousContent_insert.html]
[test_anonymousContent_manipulate_content.html]
[test_anonymousContent_style_csp.html]
[test_applet_alternate_content.html]
[test_appname_override.html]
[test_async_setTimeout_stack.html]
[test_async_setTimeout_stack_across_globals.html]

View File

@ -1,42 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1200602
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1200602</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SpecialPowers.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1200602">Mozilla Bug 1200602</a>
<pre id="test">
<script type="application/javascript">
function test() {
"use strict";
const objLC = SpecialPowers.Ci.nsIObjectLoadingContent;
let obj = document.createElement("applet");
obj.appendChild(document.createTextNode("alternate content"));
document.body.appendChild(obj);
obj instanceof objLC;
obj = SpecialPowers.wrap(obj);
// We expect this tag to simply go to alternate content, not get a
// pluginProblem binding or fire any events.
ok(obj.displayedType == objLC.TYPE_NULL, "expected null type");
ok(obj.pluginFallbackType == objLC.PLUGIN_ALTERNATE,
"expected alternate fallback mode");
}
// Test all non-plugin types these tags can load to make sure none of them
// trigger plugin-specific fallbacks when loaded with no URI
test();
</script>
</pre>
</body>
</html>

View File

@ -45,10 +45,9 @@
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/HTMLObjectElement.h"
#include "mozilla/dom/HTMLObjectElementBinding.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#include "mozilla/dom/HTMLEmbedElement.h"
#include "mozilla/dom/HTMLElementBinding.h"
#include "mozilla/dom/HTMLEmbedElementBinding.h"
#include "mozilla/dom/HTMLAppletElementBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ResolveSystemBinding.h"
#include "mozilla/dom/WebIDLGlobalNameHash.h"
@ -2310,14 +2309,9 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg)
nsObjectLoadingContent* htmlobject;
nsresult rv = UNWRAP_OBJECT(HTMLObjectElement, &maybeObjLC, htmlobject);
if (NS_FAILED(rv)) {
rv = UnwrapObject<prototypes::id::HTMLEmbedElement,
HTMLSharedObjectElement>(&maybeObjLC, htmlobject);
rv = UNWRAP_OBJECT(HTMLEmbedElement, &maybeObjLC, htmlobject);
if (NS_FAILED(rv)) {
rv = UnwrapObject<prototypes::id::HTMLAppletElement,
HTMLSharedObjectElement>(&maybeObjLC, htmlobject);
if (NS_FAILED(rv)) {
htmlobject = nullptr;
}
htmlobject = nullptr;
}
}
if (htmlobject) {

View File

@ -397,10 +397,6 @@ DOMInterfaces = {
'nativeType': 'nsHistory'
},
'HTMLAppletElement': {
'nativeType': 'mozilla::dom::HTMLSharedObjectElement'
},
'HTMLBaseElement': {
'nativeType': 'mozilla::dom::HTMLSharedElement'
},
@ -428,10 +424,6 @@ DOMInterfaces = {
'nativeType': 'nsGenericHTMLElement',
},
'HTMLEmbedElement': {
'nativeType': 'mozilla::dom::HTMLSharedObjectElement'
},
'HTMLHeadElement': {
'nativeType': 'mozilla::dom::HTMLSharedElement'
},

View File

@ -712,8 +712,7 @@ class Descriptor(DescriptorProvider):
"""
return (self.interface.getExtendedAttribute("NeedResolve") and
self.interface.identifier.name not in ["HTMLObjectElement",
"HTMLEmbedElement",
"HTMLAppletElement"])
"HTMLEmbedElement"])
def needsXrayNamedDeleterHook(self):
return self.operations["NamedDeleter"] is not None

View File

@ -1571,8 +1571,7 @@ EventStateManager::FireContextClick()
allowedToDispatch = formCtrl->IsTextOrNumberControl(/*aExcludePassword*/ false) ||
formCtrl->ControlType() == NS_FORM_INPUT_FILE;
}
else if (mGestureDownContent->IsAnyOfHTMLElements(nsGkAtoms::applet,
nsGkAtoms::embed,
else if (mGestureDownContent->IsAnyOfHTMLElements(nsGkAtoms::embed,
nsGkAtoms::object,
nsGkAtoms::label)) {
allowedToDispatch = false;

View File

@ -70,7 +70,6 @@ static bool
IsAllNamedElement(nsIContent* aContent)
{
return aContent->IsAnyOfHTMLElements(nsGkAtoms::a,
nsGkAtoms::applet,
nsGkAtoms::button,
nsGkAtoms::embed,
nsGkAtoms::form,

View File

@ -0,0 +1,365 @@
/* -*- 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/. */
#include "mozilla/EventStates.h"
#include "mozilla/dom/HTMLEmbedElement.h"
#include "mozilla/dom/HTMLEmbedElementBinding.h"
#include "mozilla/dom/ElementInlines.h"
#include "nsIDocument.h"
#include "nsIPluginDocument.h"
#include "nsIDOMDocument.h"
#include "nsThreadUtils.h"
#include "nsIScriptError.h"
#include "nsIWidget.h"
#include "nsContentUtils.h"
#ifdef XP_MACOSX
#include "mozilla/EventDispatcher.h"
#include "mozilla/dom/Event.h"
#endif
#include "mozilla/dom/HTMLObjectElement.h"
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Embed)
namespace mozilla {
namespace dom {
HTMLEmbedElement::HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo)
{
RegisterActivityObserver();
SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
// By default we're in the loading state
AddStatesSilently(NS_EVENT_STATE_LOADING);
}
HTMLEmbedElement::~HTMLEmbedElement()
{
#ifdef XP_MACOSX
HTMLObjectElement::OnFocusBlurPlugin(this, false);
#endif
UnregisterActivityObserver();
DestroyImageLoadingContent();
}
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLEmbedElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLEmbedElement,
nsGenericHTMLElement)
nsObjectLoadingContent::Traverse(tmp, cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(HTMLEmbedElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLEmbedElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLEmbedElement)
NS_INTERFACE_TABLE_INHERITED(HTMLEmbedElement,
nsIRequestObserver,
nsIStreamListener,
nsIFrameLoaderOwner,
nsIObjectLoadingContent,
imgINotificationObserver,
nsIImageLoadingContent,
imgIOnloadBlocker,
nsIChannelEventSink)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLEmbedElement)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLEmbedElement)
#ifdef XP_MACOSX
NS_IMETHODIMP
HTMLEmbedElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
HTMLObjectElement::HandleFocusBlurPlugin(this, aVisitor.mEvent);
return NS_OK;
}
#endif // #ifdef XP_MACOSX
void
HTMLEmbedElement::AsyncEventRunning(AsyncEventDispatcher* aEvent)
{
nsImageLoadingContent::AsyncEventRunning(aEvent);
}
nsresult
HTMLEmbedElement::BindToTree(nsIDocument *aDocument,
nsIContent *aParent,
nsIContent *aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
rv = nsObjectLoadingContent::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
// Don't kick off load from being bound to a plugin document - the plugin
// document will call nsObjectLoadingContent::InitializeFromChannel() for the
// initial load.
nsCOMPtr<nsIPluginDocument> pluginDoc = do_QueryInterface(aDocument);
if (!pluginDoc) {
void (HTMLEmbedElement::*start)() = &HTMLEmbedElement::StartObjectLoad;
nsContentUtils::AddScriptRunner(NewRunnableMethod(
"dom::HTMLEmbedElement::BindToTree", this, start));
}
return NS_OK;
}
void
HTMLEmbedElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
#ifdef XP_MACOSX
// When a page is reloaded (when an nsIDocument's content is removed), the
// focused element isn't necessarily sent an eBlur event. See
// nsFocusManager::ContentRemoved(). This means that a widget may think it
// still contains a focused plugin when it doesn't -- which in turn can
// disable text input in the browser window. See bug 1137229.
HTMLObjectElement::OnFocusBlurPlugin(this, false);
#endif
nsObjectLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
nsresult
HTMLEmbedElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue,
bool aNotify)
{
if (aValue) {
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
}
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
aOldValue, aNotify);
}
nsresult
HTMLEmbedElement::OnAttrSetButNotChanged(int32_t aNamespaceID,
nsIAtom* aName,
const nsAttrValueOrString& aValue,
bool aNotify)
{
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName,
aValue, aNotify);
}
nsresult
HTMLEmbedElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
nsIAtom* aName,
bool aNotify)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aName == nsGkAtoms::src) {
// If aNotify is false, we are coming from the parser or some such place;
// we'll get bound after all the attributes have been set, so we'll do the
// object load from BindToTree.
// Skip the LoadObject call in that case.
// We also don't want to start loading the object when we're not yet in
// a document, just in case that the caller wants to set additional
// attributes before inserting the node into the document.
if (aNotify && IsInComposedDoc() &&
!BlockEmbedOrObjectContentLoading()) {
nsresult rv = LoadObject(aNotify, true);
NS_ENSURE_SUCCESS(rv, rv);
}
}
}
return NS_OK;
}
bool
HTMLEmbedElement::IsHTMLFocusable(bool aWithMouse,
bool *aIsFocusable,
int32_t *aTabIndex)
{
// Has plugin content: let the plugin decide what to do in terms of
// internal focus from mouse clicks
if (aTabIndex) {
*aTabIndex = TabIndex();
}
*aIsFocusable = true;
// Let the plugin decide, so override.
return true;
}
nsIContent::IMEState
HTMLEmbedElement::GetDesiredIMEState()
{
if (Type() == eType_Plugin) {
return IMEState(IMEState::PLUGIN);
}
return nsGenericHTMLElement::GetDesiredIMEState();
}
int32_t
HTMLEmbedElement::TabIndexDefault()
{
return -1;
}
bool
HTMLEmbedElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom *aAttribute,
const nsAString &aValue,
nsAttrValue &aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::align) {
return ParseAlignValue(aValue, aResult);
}
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
return true;
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
static void
MapAttributesIntoRuleBase(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
}
static void
MapAttributesIntoRuleExceptHidden(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes, aData);
}
void
HTMLEmbedElement::MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(bool)
HTMLEmbedElement::IsAttributeMapped(const nsIAtom *aAttribute) const
{
static const MappedAttributeEntry* const map[] = {
sCommonAttributeMap,
sImageMarginSizeAttributeMap,
sImageBorderAttributeMap,
sImageAlignAttributeMap,
};
return FindAttributeDependence(aAttribute, map);
}
nsMapRuleToAttributesFunc
HTMLEmbedElement::GetAttributeMappingFunction() const
{
return &MapAttributesIntoRuleExceptHidden;
}
void
HTMLEmbedElement::StartObjectLoad(bool aNotify, bool aForceLoad)
{
// BindToTree can call us asynchronously, and we may be removed from the tree
// in the interim
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
BlockEmbedOrObjectContentLoading()) {
return;
}
LoadObject(aNotify, aForceLoad);
SetIsNetworkCreated(false);
}
EventStates
HTMLEmbedElement::IntrinsicState() const
{
return nsGenericHTMLElement::IntrinsicState() | ObjectState();
}
uint32_t
HTMLEmbedElement::GetCapabilities() const
{
return eSupportPlugins | eAllowPluginSkipChannel | eSupportImages | eSupportDocuments;
}
void
HTMLEmbedElement::DestroyContent()
{
nsObjectLoadingContent::DestroyContent();
nsGenericHTMLElement::DestroyContent();
}
nsresult
HTMLEmbedElement::CopyInnerTo(Element* aDest, bool aPreallocateChildren)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest, aPreallocateChildren);
NS_ENSURE_SUCCESS(rv, rv);
if (aDest->OwnerDoc()->IsStaticDocument()) {
CreateStaticClone(static_cast<HTMLEmbedElement*>(aDest));
}
return rv;
}
JSObject*
HTMLEmbedElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
JSObject* obj;
obj = HTMLEmbedElementBinding::Wrap(aCx, this, aGivenProto);
if (!obj) {
return nullptr;
}
JS::Rooted<JSObject*> rootedObj(aCx, obj);
SetupProtoChain(aCx, rootedObj);
return rootedObj;
}
nsContentPolicyType
HTMLEmbedElement::GetContentPolicyType() const
{
return nsIContentPolicy::TYPE_INTERNAL_EMBED;
}
NS_IMPL_STRING_ATTR(HTMLEmbedElement, Align, align)
NS_IMPL_STRING_ATTR(HTMLEmbedElement, Width, width)
NS_IMPL_STRING_ATTR(HTMLEmbedElement, Height, height)
NS_IMPL_STRING_ATTR(HTMLEmbedElement, Name, name)
NS_IMPL_URI_ATTR(HTMLEmbedElement, Src, src)
NS_IMPL_STRING_ATTR(HTMLEmbedElement, Type, type)
} // namespace dom
} // namespace mozilla

View File

@ -4,32 +4,31 @@
* 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_HTMLSharedObjectElement_h
#define mozilla_dom_HTMLSharedObjectElement_h
#ifndef mozilla_dom_HTMLEmbedElement_h
#define mozilla_dom_HTMLEmbedElement_h
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsObjectLoadingContent.h"
#include "nsGkAtoms.h"
#include "nsError.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIDOMHTMLEmbedElement.h"
namespace mozilla {
namespace dom {
class HTMLSharedObjectElement final : public nsGenericHTMLElement
, public nsObjectLoadingContent
, public nsIDOMHTMLAppletElement
, public nsIDOMHTMLEmbedElement
class HTMLEmbedElement final : public nsGenericHTMLElement
, public nsObjectLoadingContent
, public nsIDOMHTMLEmbedElement
{
public:
explicit HTMLSharedObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
explicit HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
NS_DECL_NSIDOMHTMLEMBEDELEMENT
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLEmbedElement, embed)
virtual int32_t TabIndexDefault() override;
#ifdef XP_MACOSX
@ -37,21 +36,9 @@ public:
NS_IMETHOD PostHandleEvent(EventChainPostVisitor& aVisitor) override;
#endif
// nsIDOMHTMLAppletElement
NS_DECL_NSIDOMHTMLAPPLETELEMENT
// Can't use macro for nsIDOMHTMLEmbedElement because it has conflicts with
// NS_DECL_NSIDOMHTMLAPPLETELEMENT.
// EventTarget
virtual void AsyncEventRunning(AsyncEventDispatcher* aEvent) override;
// nsIDOMHTMLEmbedElement
NS_IMETHOD GetSrc(nsAString &aSrc) override;
NS_IMETHOD SetSrc(const nsAString &aSrc) override;
NS_IMETHOD GetType(nsAString &aType) override;
NS_IMETHOD SetType(const nsAString &aType) override;
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
nsIContent *aBindingParent,
bool aCompileEventHandlers) override;
@ -61,13 +48,10 @@ public:
virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex) override;
virtual IMEState GetDesiredIMEState() override;
virtual void DoneAddingChildren(bool aHaveNotified) override;
virtual bool IsDoneAddingChildren() override;
virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom *aAttribute,
const nsAString &aValue,
nsAttrValue &aResult) override;
nsIAtom *aAttribute,
const nsAString &aValue,
nsAttrValue &aResult) override;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom *aAttribute) const override;
virtual EventStates IntrinsicState() const override;
@ -83,10 +67,10 @@ public:
void StartObjectLoad() { StartObjectLoad(true, false); }
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLSharedObjectElement,
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLEmbedElement,
nsGenericHTMLElement)
// WebIDL API for <applet>
// WebIDL <embed> api
void GetAlign(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::align, aValue);
@ -95,35 +79,6 @@ public:
{
SetHTMLAttr(nsGkAtoms::align, aValue, aRv);
}
void GetAlt(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::alt, aValue);
}
void SetAlt(const nsAString& aValue, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::alt, aValue, aRv);
}
void GetArchive(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::archive, aValue);
}
void SetArchive(const nsAString& aValue, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::archive, aValue, aRv);
}
void GetCode(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::code, aValue);
}
void SetCode(const nsAString& aValue, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::code, aValue, aRv);
}
// XPCOM GetCodebase is ok; note that it's a URI attribute
void SetCodeBase(const nsAString& aValue, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::codebase, aValue, aRv);
}
void GetHeight(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::height, aValue);
@ -132,14 +87,6 @@ public:
{
SetHTMLAttr(nsGkAtoms::height, aValue, aRv);
}
uint32_t Hspace()
{
return GetUnsignedIntAttr(nsGkAtoms::hspace, 0);
}
void SetHspace(uint32_t aValue, ErrorResult& aRv)
{
SetUnsignedIntAttr(nsGkAtoms::hspace, aValue, 0, aRv);
}
void GetName(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::name, aValue);
@ -148,19 +95,6 @@ public:
{
SetHTMLAttr(nsGkAtoms::name, aValue, aRv);
}
// XPCOM GetObject is ok; note that it's a URI attribute with a weird base URI
void SetObject(const nsAString& aValue, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::object, aValue, aRv);
}
uint32_t Vspace()
{
return GetUnsignedIntAttr(nsGkAtoms::vspace, 0);
}
void SetVspace(uint32_t aValue, ErrorResult& aRv)
{
SetUnsignedIntAttr(nsGkAtoms::vspace, aValue, 0, aRv);
}
void GetWidth(DOMString& aValue)
{
GetHTMLAttr(nsGkAtoms::width, aValue);
@ -169,7 +103,6 @@ public:
{
SetHTMLAttr(nsGkAtoms::width, aValue, aRv);
}
// WebIDL <embed> api
// XPCOM GetSrc is ok; note that it's a URI attribute
void SetSrc(const nsAString& aValue, ErrorResult& aRv)
@ -184,10 +117,6 @@ public:
{
SetHTMLAttr(nsGkAtoms::type, aValue, aRv);
}
// width covered by <applet>
// height covered by <applet>
// align covered by <applet>
// name covered by <applet>
nsIDocument*
GetSVGDocument(nsIPrincipal& aSubjectPrincipal)
{
@ -212,21 +141,10 @@ protected:
bool aNotify) override;
private:
virtual ~HTMLSharedObjectElement();
nsIAtom *URIAttrName() const
{
return mNodeInfo->Equals(nsGkAtoms::applet) ?
nsGkAtoms::code :
nsGkAtoms::src;
}
~HTMLEmbedElement();
nsContentPolicyType GetContentPolicyType() const override;
// mIsDoneAddingChildren is only really used for <applet>. This boolean is
// always true for <embed>, per the documentation in nsIContent.h.
bool mIsDoneAddingChildren;
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
@ -247,4 +165,4 @@ private:
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLSharedObjectElement_h
#endif // mozilla_dom_HTMLEmbedElement_h

View File

@ -560,7 +560,7 @@ HTMLObjectElement::IntrinsicState() const
uint32_t
HTMLObjectElement::GetCapabilities() const
{
return nsObjectLoadingContent::GetCapabilities() | eSupportClassID;
return nsObjectLoadingContent::GetCapabilities();
}
void

View File

@ -1,421 +0,0 @@
/* -*- 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/. */
#include "mozilla/EventStates.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#include "mozilla/dom/HTMLEmbedElementBinding.h"
#include "mozilla/dom/HTMLAppletElementBinding.h"
#include "mozilla/dom/ElementInlines.h"
#include "nsIDocument.h"
#include "nsIPluginDocument.h"
#include "nsIDOMDocument.h"
#include "nsThreadUtils.h"
#include "nsIScriptError.h"
#include "nsIWidget.h"
#include "nsContentUtils.h"
#ifdef XP_MACOSX
#include "mozilla/EventDispatcher.h"
#include "mozilla/dom/Event.h"
#endif
#include "mozilla/dom/HTMLObjectElement.h"
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(SharedObject)
namespace mozilla {
namespace dom {
HTMLSharedObjectElement::HTMLSharedObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo),
mIsDoneAddingChildren(mNodeInfo->Equals(nsGkAtoms::embed) || !aFromParser)
{
RegisterActivityObserver();
SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
// By default we're in the loading state
AddStatesSilently(NS_EVENT_STATE_LOADING);
}
HTMLSharedObjectElement::~HTMLSharedObjectElement()
{
#ifdef XP_MACOSX
HTMLObjectElement::OnFocusBlurPlugin(this, false);
#endif
UnregisterActivityObserver();
DestroyImageLoadingContent();
}
bool
HTMLSharedObjectElement::IsDoneAddingChildren()
{
return mIsDoneAddingChildren;
}
void
HTMLSharedObjectElement::DoneAddingChildren(bool aHaveNotified)
{
if (!mIsDoneAddingChildren) {
mIsDoneAddingChildren = true;
// If we're already in a document, we need to trigger the load
// Otherwise, BindToTree takes care of that.
if (IsInComposedDoc()) {
StartObjectLoad(aHaveNotified, false);
}
}
}
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLSharedObjectElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLSharedObjectElement,
nsGenericHTMLElement)
nsObjectLoadingContent::Traverse(tmp, cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(HTMLSharedObjectElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLSharedObjectElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLSharedObjectElement)
NS_INTERFACE_TABLE_INHERITED(HTMLSharedObjectElement,
nsIRequestObserver,
nsIStreamListener,
nsIFrameLoaderOwner,
nsIObjectLoadingContent,
imgINotificationObserver,
nsIImageLoadingContent,
imgIOnloadBlocker,
nsIChannelEventSink)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLAppletElement, applet)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLEmbedElement, embed)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLSharedObjectElement)
#ifdef XP_MACOSX
NS_IMETHODIMP
HTMLSharedObjectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
HTMLObjectElement::HandleFocusBlurPlugin(this, aVisitor.mEvent);
return NS_OK;
}
#endif // #ifdef XP_MACOSX
void
HTMLSharedObjectElement::AsyncEventRunning(AsyncEventDispatcher* aEvent)
{
nsImageLoadingContent::AsyncEventRunning(aEvent);
}
nsresult
HTMLSharedObjectElement::BindToTree(nsIDocument *aDocument,
nsIContent *aParent,
nsIContent *aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
rv = nsObjectLoadingContent::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
// Don't kick off load from being bound to a plugin document - the plugin
// document will call nsObjectLoadingContent::InitializeFromChannel() for the
// initial load.
nsCOMPtr<nsIPluginDocument> pluginDoc = do_QueryInterface(aDocument);
// If we already have all the children, start the load.
if (mIsDoneAddingChildren && !pluginDoc) {
void (HTMLSharedObjectElement::*start)() =
&HTMLSharedObjectElement::StartObjectLoad;
nsContentUtils::AddScriptRunner(NewRunnableMethod(
"dom::HTMLSharedObjectElement::BindToTree", this, start));
}
return NS_OK;
}
void
HTMLSharedObjectElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
#ifdef XP_MACOSX
// When a page is reloaded (when an nsIDocument's content is removed), the
// focused element isn't necessarily sent an eBlur event. See
// nsFocusManager::ContentRemoved(). This means that a widget may think it
// still contains a focused plugin when it doesn't -- which in turn can
// disable text input in the browser window. See bug 1137229.
HTMLObjectElement::OnFocusBlurPlugin(this, false);
#endif
nsObjectLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
nsresult
HTMLSharedObjectElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue,
bool aNotify)
{
if (aValue) {
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
}
return nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue,
aOldValue, aNotify);
}
nsresult
HTMLSharedObjectElement::OnAttrSetButNotChanged(int32_t aNamespaceID,
nsIAtom* aName,
const nsAttrValueOrString& aValue,
bool aNotify)
{
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName,
aValue, aNotify);
}
nsresult
HTMLSharedObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
nsIAtom* aName,
bool aNotify)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aName == URIAttrName()) {
// If aNotify is false, we are coming from the parser or some such place;
// we'll get bound after all the attributes have been set, so we'll do the
// object load from BindToTree/DoneAddingChildren.
// Skip the LoadObject call in that case.
// We also don't want to start loading the object when we're not yet in
// a document, just in case that the caller wants to set additional
// attributes before inserting the node into the document.
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
!BlockEmbedOrObjectContentLoading()) {
nsresult rv = LoadObject(aNotify, true);
NS_ENSURE_SUCCESS(rv, rv);
}
}
}
return NS_OK;
}
bool
HTMLSharedObjectElement::IsHTMLFocusable(bool aWithMouse,
bool *aIsFocusable,
int32_t *aTabIndex)
{
if (mNodeInfo->Equals(nsGkAtoms::embed) || Type() == eType_Plugin) {
// Has plugin content: let the plugin decide what to do in terms of
// internal focus from mouse clicks
if (aTabIndex) {
*aTabIndex = TabIndex();
}
*aIsFocusable = true;
// Let the plugin decide, so override.
return true;
}
return nsGenericHTMLElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex);
}
nsIContent::IMEState
HTMLSharedObjectElement::GetDesiredIMEState()
{
if (Type() == eType_Plugin) {
return IMEState(IMEState::PLUGIN);
}
return nsGenericHTMLElement::GetDesiredIMEState();
}
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Align, align)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Alt, alt)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Archive, archive)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Code, code)
NS_IMPL_URI_ATTR(HTMLSharedObjectElement, CodeBase, codebase)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Height, height)
NS_IMPL_INT_ATTR(HTMLSharedObjectElement, Hspace, hspace)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Name, name)
NS_IMPL_URI_ATTR_WITH_BASE(HTMLSharedObjectElement, Object, object, codebase)
NS_IMPL_URI_ATTR(HTMLSharedObjectElement, Src, src)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Type, type)
NS_IMPL_INT_ATTR(HTMLSharedObjectElement, Vspace, vspace)
NS_IMPL_STRING_ATTR(HTMLSharedObjectElement, Width, width)
int32_t
HTMLSharedObjectElement::TabIndexDefault()
{
return -1;
}
bool
HTMLSharedObjectElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom *aAttribute,
const nsAString &aValue,
nsAttrValue &aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::align) {
return ParseAlignValue(aValue, aResult);
}
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
return true;
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
static void
MapAttributesIntoRuleBase(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
}
static void
MapAttributesIntoRuleExceptHidden(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes, aData);
}
void
HTMLSharedObjectElement::MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
GenericSpecifiedValues* aData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(bool)
HTMLSharedObjectElement::IsAttributeMapped(const nsIAtom *aAttribute) const
{
static const MappedAttributeEntry* const map[] = {
sCommonAttributeMap,
sImageMarginSizeAttributeMap,
sImageBorderAttributeMap,
sImageAlignAttributeMap,
};
return FindAttributeDependence(aAttribute, map);
}
nsMapRuleToAttributesFunc
HTMLSharedObjectElement::GetAttributeMappingFunction() const
{
if (mNodeInfo->Equals(nsGkAtoms::embed)) {
return &MapAttributesIntoRuleExceptHidden;
}
return &MapAttributesIntoRule;
}
void
HTMLSharedObjectElement::StartObjectLoad(bool aNotify, bool aForceLoad)
{
// BindToTree can call us asynchronously, and we may be removed from the tree
// in the interim
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
BlockEmbedOrObjectContentLoading()) {
return;
}
LoadObject(aNotify, aForceLoad);
SetIsNetworkCreated(false);
}
EventStates
HTMLSharedObjectElement::IntrinsicState() const
{
return nsGenericHTMLElement::IntrinsicState() | ObjectState();
}
uint32_t
HTMLSharedObjectElement::GetCapabilities() const
{
uint32_t capabilities = eSupportPlugins | eAllowPluginSkipChannel;
if (mNodeInfo->Equals(nsGkAtoms::embed)) {
capabilities |= eSupportImages | eSupportDocuments;
}
return capabilities;
}
void
HTMLSharedObjectElement::DestroyContent()
{
nsObjectLoadingContent::DestroyContent();
nsGenericHTMLElement::DestroyContent();
}
nsresult
HTMLSharedObjectElement::CopyInnerTo(Element* aDest, bool aPreallocateChildren)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest, aPreallocateChildren);
NS_ENSURE_SUCCESS(rv, rv);
if (aDest->OwnerDoc()->IsStaticDocument()) {
CreateStaticClone(static_cast<HTMLSharedObjectElement*>(aDest));
}
return rv;
}
JSObject*
HTMLSharedObjectElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
JSObject* obj;
if (mNodeInfo->Equals(nsGkAtoms::applet)) {
obj = HTMLAppletElementBinding::Wrap(aCx, this, aGivenProto);
} else {
MOZ_ASSERT(mNodeInfo->Equals(nsGkAtoms::embed));
obj = HTMLEmbedElementBinding::Wrap(aCx, this, aGivenProto);
}
if (!obj) {
return nullptr;
}
JS::Rooted<JSObject*> rootedObj(aCx, obj);
SetupProtoChain(aCx, rootedObj);
return rootedObj;
}
nsContentPolicyType
HTMLSharedObjectElement::GetContentPolicyType() const
{
if (mNodeInfo->Equals(nsGkAtoms::applet)) {
// We use TYPE_INTERNAL_OBJECT for applet too, since it is not exposed
// through RequestContext yet.
return nsIContentPolicy::TYPE_INTERNAL_OBJECT;
} else {
MOZ_ASSERT(mNodeInfo->Equals(nsGkAtoms::embed));
return nsIContentPolicy::TYPE_INTERNAL_EMBED;
}
}
} // namespace dom
} // namespace mozilla

View File

@ -60,6 +60,7 @@ EXPORTS.mozilla.dom += [
'HTMLDetailsElement.h',
'HTMLDialogElement.h',
'HTMLDivElement.h',
'HTMLEmbedElement.h',
'HTMLFieldSetElement.h',
'HTMLFontElement.h',
'HTMLFormControlsCollection.h',
@ -97,7 +98,6 @@ EXPORTS.mozilla.dom += [
'HTMLShadowElement.h',
'HTMLSharedElement.h',
'HTMLSharedListElement.h',
'HTMLSharedObjectElement.h',
'HTMLSourceElement.h',
'HTMLSpanElement.h',
'HTMLStyleElement.h',
@ -140,6 +140,7 @@ UNIFIED_SOURCES += [
'HTMLDialogElement.cpp',
'HTMLDivElement.cpp',
'HTMLElement.cpp',
'HTMLEmbedElement.cpp',
'HTMLFieldSetElement.cpp',
'HTMLFontElement.cpp',
'HTMLFormControlsCollection.cpp',
@ -177,7 +178,6 @@ UNIFIED_SOURCES += [
'HTMLShadowElement.cpp',
'HTMLSharedElement.cpp',
'HTMLSharedListElement.cpp',
'HTMLSharedObjectElement.cpp',
'HTMLSourceElement.cpp',
'HTMLSpanElement.cpp',
'HTMLStyleElement.cpp',

View File

@ -696,7 +696,6 @@ public:
{
return aTag == nsGkAtoms::img ||
aTag == nsGkAtoms::form ||
aTag == nsGkAtoms::applet ||
aTag == nsGkAtoms::embed ||
aTag == nsGkAtoms::object;
}
@ -709,8 +708,7 @@ public:
static inline bool
ShouldExposeIdAsHTMLDocumentProperty(Element* aElement)
{
if (aElement->IsAnyOfHTMLElements(nsGkAtoms::applet,
nsGkAtoms::embed,
if (aElement->IsAnyOfHTMLElements(nsGkAtoms::embed,
nsGkAtoms::object)) {
return true;
}
@ -1519,7 +1517,6 @@ NS_NewHTMLElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
NS_DECLARE_NS_NEW_HTML_ELEMENT(Shared)
NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedList)
NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedObject)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Anchor)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Area)
@ -1535,6 +1532,7 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(DataList)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Details)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Dialog)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Div)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Embed)
NS_DECLARE_NS_NEW_HTML_ELEMENT(FieldSet)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Font)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Form)

View File

@ -1187,7 +1187,7 @@ nsIHTMLCollection*
nsHTMLDocument::Applets()
{
if (!mApplets) {
mApplets = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::applet, nsGkAtoms::applet);
mApplets = new nsEmptyContentList(this);
}
return mApplets;
}

View File

@ -309,7 +309,7 @@ protected:
void *GenerateParserKey(void);
RefPtr<nsContentList> mImages;
RefPtr<nsContentList> mApplets;
RefPtr<nsEmptyContentList> mApplets;
RefPtr<nsContentList> mEmbeds;
RefPtr<nsContentList> mLinks;
RefPtr<nsContentList> mAnchors;

View File

@ -194,7 +194,6 @@ support-files =
[test_a_text.html]
[test_anchor_href_cache_invalidation.html]
[test_applet_attributes_reflection.html]
[test_base_attributes_reflection.html]
[test_bug100533.html]
[test_bug109445.html]
@ -612,3 +611,4 @@ support-files =
file_script_module.html
file_script_nomodule.html
[test_getElementsByName_after_mutation.html]
[test_bug1279218.html]

View File

@ -1,86 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for HTMLAppletElement attributes reflection</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="reflect.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for HTMLAppletElement attributes reflection **/
// .align (String)
reflectString({
element: document.createElement("applet"),
attribute: "align",
});
// .alt (String)
reflectString({
element: document.createElement("applet"),
attribute: "alt",
});
// .archive (String)
reflectString({
element: document.createElement("applet"),
attribute: "archive",
});
// .code (String)
reflectString({
element: document.createElement("applet"),
attribute: "code",
});
// .codeBase (URL)
reflectURL({
element: document.createElement("applet"),
attribute: "codeBase",
});
// .height (String)
reflectString({
element: document.createElement("applet"),
attribute: "height",
});
// .hspace (unsigned int)
reflectUnsignedInt({
element: document.createElement("applet"),
attribute: "hspace",
});
// .name (String)
reflectString({
element: document.createElement("applet"),
attribute: "name",
});
// .object (URL)
reflectURL({
element: document.createElement("applet"),
attribute: "object",
});
// .vspace (unsigned int)
reflectUnsignedInt({
element: document.createElement("applet"),
attribute: "vspace",
});
// .width (String)
reflectString({
element: document.createElement("applet"),
attribute: "width",
});
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Bug 1279218</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript">
function load() {
let applets = document.applets;
is(applets.length, 0, "Applet list length should be 0, even with applet tag in body");
SimpleTest.finish();
}
window.onload=load;
SimpleTest.waitForExplicitFinish();
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1279218">Mozilla Bug 1279218</a>
<applet id="applet-test"></applet>
</body>
</html>

View File

@ -79,7 +79,6 @@ objectIfaces2.push("nsIImageLoadingContent");
/* List copy/pasted from nsHTMLTagList.h, with the second field modified to the
correct classinfo (instead of the impl class) in the following cases:
applet
base
blockquote
dir
@ -99,7 +98,6 @@ HTML_TAG("a", "Anchor");
HTML_TAG("abbr", "");
HTML_TAG("acronym", "");
HTML_TAG("address", "");
HTML_TAG("applet", "Applet", [], objectIfaces);
HTML_TAG("area", "Area");
HTML_TAG("article", "");
HTML_TAG("aside", "");

View File

@ -22,7 +22,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=579079
<script class="testbody" type="text/javascript">
var img = document.img1;
var form = document.form1;
var applet = document.applet1;
var embed = document.embed1;
var object = document.object1;
$("foo").innerHTML = $("foo").innerHTML;
@ -30,8 +29,6 @@ isnot(document.img1, img);
ok(document.img1 instanceof HTMLImageElement);
isnot(document.form1, form);
ok(document.form1 instanceof HTMLFormElement);
isnot(document.applet1, applet);
ok(document.applet1 instanceof HTMLAppletElement);
isnot(document.embed1, embed);
ok(document.embed1 instanceof HTMLEmbedElement);
isnot(document.object1, object);

View File

@ -110,7 +110,7 @@ is(document.all.length, expectedLength, "grew correctly");
// Check which elements the 'name' attribute works on
var elementNames =
['applet','abbr','acronym','address','area','a','b','base',
['abbr','acronym','address','area','a','b','base',
'bgsound','big','blockquote','br','canvas','center','cite','code',
'col','colgroup','dd','del','dfn','dir','div','dir','dl','dt','em','embed',
'fieldset','font','form','frame','frameset','head','i','iframe','img',
@ -122,7 +122,7 @@ var elementNames =
'bdo','legend','listing','style','script','tbody','caption','meta',
'optgroup','button','span','strike','strong','td'].sort();
var hasName =
['applet','a','embed','form','iframe','img','input','object','textarea',
['a','embed','form','iframe','img','input','object','textarea',
'select','map','meta','button','frame','frameset'].sort();
elementNames.forEach(function (name) {

View File

@ -9,7 +9,6 @@ with Files("**"):
XPIDL_SOURCES += [
'nsIDOMHTMLAnchorElement.idl',
'nsIDOMHTMLAppletElement.idl',
'nsIDOMHTMLAreaElement.idl',
'nsIDOMHTMLBaseElement.idl',
'nsIDOMHTMLBodyElement.idl',

View File

@ -1,36 +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 nsIDOMHTMLAppletElement interface is the interface to a [X]HTML
* applet 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(0b7d12c9-4cd3-47db-99c6-0b5ff910446c)]
interface nsIDOMHTMLAppletElement : nsISupports
{
attribute DOMString align;
attribute DOMString alt;
attribute DOMString archive;
attribute DOMString code;
attribute DOMString codeBase;
attribute DOMString height;
// Modified in DOM Level 2:
attribute long hspace;
attribute DOMString name;
// Modified in DOM Level 2:
attribute DOMString object;
// Modified in DOM Level 2:
attribute long vspace;
attribute DOMString width;
};

View File

@ -392,7 +392,6 @@ MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
, INIT_CANONICAL(mLooping, aInit.mLooping)
, INIT_CANONICAL(mExplicitDuration, Maybe<double>())
, INIT_CANONICAL(mPlayState, PLAY_STATE_LOADING)
, INIT_CANONICAL(mNextState, PLAY_STATE_PAUSED)
, INIT_CANONICAL(mLogicallySeeking, false)
, INIT_CANONICAL(mSameOriginMedia, false)
, INIT_CANONICAL(mMediaPrincipalHandle, PRINCIPAL_HANDLE_NONE)

View File

@ -735,10 +735,8 @@ protected:
// OR on the main thread.
Canonical<PlayState> mPlayState;
// This can only be changed on the main thread while holding the decoder
// monitor. Thus, it can be safely read while holding the decoder monitor
// OR on the main thread.
Canonical<PlayState> mNextState;
// This can only be changed on the main thread.
PlayState mNextState = PLAY_STATE_PAUSED;
// True if the decoder is seeking.
Canonical<bool> mLogicallySeeking;
@ -788,7 +786,6 @@ public:
return &mExplicitDuration;
}
AbstractCanonical<PlayState>* CanonicalPlayState() { return &mPlayState; }
AbstractCanonical<PlayState>* CanonicalNextPlayState() { return &mNextState; }
AbstractCanonical<bool>* CanonicalLogicallySeeking()
{
return &mLogicallySeeking;

View File

@ -2673,7 +2673,6 @@ ShutdownState::Enter()
master->mBuffered.DisconnectIfConnected();
master->mExplicitDuration.DisconnectIfConnected();
master->mPlayState.DisconnectIfConnected();
master->mNextPlayState.DisconnectIfConnected();
master->mVolume.DisconnectIfConnected();
master->mPreservesPitch.DisconnectIfConnected();
master->mLooping.DisconnectIfConnected();
@ -2735,7 +2734,6 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
INIT_MIRROR(mBuffered, TimeIntervals()),
INIT_MIRROR(mExplicitDuration, Maybe<double>()),
INIT_MIRROR(mPlayState, MediaDecoder::PLAY_STATE_LOADING),
INIT_MIRROR(mNextPlayState, MediaDecoder::PLAY_STATE_PAUSED),
INIT_MIRROR(mVolume, 1.0),
INIT_MIRROR(mPreservesPitch, true),
INIT_MIRROR(mLooping, false),
@ -2782,7 +2780,6 @@ MediaDecoderStateMachine::InitializationTask(MediaDecoder* aDecoder)
mBuffered.Connect(mReader->CanonicalBuffered());
mExplicitDuration.Connect(aDecoder->CanonicalExplicitDuration());
mPlayState.Connect(aDecoder->CanonicalPlayState());
mNextPlayState.Connect(aDecoder->CanonicalNextPlayState());
mVolume.Connect(aDecoder->CanonicalVolume());
mPreservesPitch.Connect(aDecoder->CanonicalPreservesPitch());
mLooping.Connect(aDecoder->CanonicalLooping());

View File

@ -530,18 +530,6 @@ private:
// increasing.
Watchable<media::TimeUnit> mObservedDuration;
// Returns true if we're logically playing, that is, if the Play() has
// been called and Pause() has not or we have not yet reached the end
// of media. This is irrespective of the seeking state; if the owner
// calls Play() and then Seek(), we still count as logically playing.
// The decoder monitor must be held.
bool IsLogicallyPlaying()
{
MOZ_ASSERT(OnTaskQueue());
return mPlayState == MediaDecoder::PLAY_STATE_PLAYING
|| mNextPlayState == MediaDecoder::PLAY_STATE_PLAYING;
}
// Media Fragment end time.
media::TimeUnit mFragmentEndTime = media::TimeUnit::Invalid();
@ -685,9 +673,8 @@ private:
// The duration explicitly set by JS, mirrored from the main thread.
Mirror<Maybe<double>> mExplicitDuration;
// The current play state and next play state, mirrored from the main thread.
// The current play state, mirrored from the main thread.
Mirror<MediaDecoder::PlayState> mPlayState;
Mirror<MediaDecoder::PlayState> mNextPlayState;
// Volume of playback. 0.0 = muted. 1.0 = full volume.
Mirror<double> mVolume;

View File

@ -530,6 +530,8 @@ public:
void StopSharing();
void StopRawID(const nsString& removedDeviceID);
/**
* Called by one of our SourceListeners when one of its tracks has stopped.
* Schedules an event for the next stable state to update chrome.
@ -1728,6 +1730,8 @@ MediaManager::EnumerateRawDevices(uint64_t aWindowId,
if ((!fakeCams && hasVideo) || (!fakeMics && hasAudio)) {
RefPtr<MediaManager> manager = MediaManager_GetInstance();
realBackend = manager->GetBackend(aWindowId);
// We need to listen to this event even JS didn't listen to it.
realBackend->AddDeviceChangeCallback(manager);
}
auto result = MakeUnique<SourceSet>();
@ -2037,7 +2041,6 @@ int MediaManager::AddDeviceChangeCallback(DeviceChangeCallback* aCallback)
bool fakeDeviceChangeEventOn = mPrefs.mFakeDeviceChangeEventOn;
MediaManager::PostTask(NewTaskFrom([fakeDeviceChangeEventOn]() {
RefPtr<MediaManager> manager = MediaManager_GetInstance();
manager->GetBackend(0)->AddDeviceChangeCallback(manager);
if (fakeDeviceChangeEventOn)
manager->GetBackend(0)->SetFakeDeviceChangeEvents();
}));
@ -2045,11 +2048,61 @@ int MediaManager::AddDeviceChangeCallback(DeviceChangeCallback* aCallback)
return DeviceChangeCallback::AddDeviceChangeCallback(aCallback);
}
static void
StopRawIDCallback(MediaManager *aThis,
uint64_t aWindowID,
GetUserMediaWindowListener *aListener,
void *aData)
{
if (!aListener || !aData) {
return;
}
nsString* removedDeviceID = static_cast<nsString*>(aData);
aListener->StopRawID(*removedDeviceID);
}
void MediaManager::OnDeviceChange() {
RefPtr<MediaManager> self(this);
NS_DispatchToMainThread(media::NewRunnableFrom([self,this]() mutable {
NS_DispatchToMainThread(media::NewRunnableFrom([self]() mutable {
MOZ_ASSERT(NS_IsMainThread());
DeviceChangeCallback::OnDeviceChange();
self->DeviceChangeCallback::OnDeviceChange();
// On some Windows machine, if we call EnumertaeRawDevices immediately after receiving
// devicechange event, sometimes we would get outdated devices list.
PR_Sleep(PR_MillisecondsToInterval(100));
RefPtr<PledgeSourceSet> p = self->EnumerateRawDevices(0, MediaSourceEnum::Camera, MediaSourceEnum::Microphone, false);
p->Then([self](SourceSet*& aDevices) mutable {
UniquePtr<SourceSet> devices(aDevices);
nsTArray<nsString> deviceIDs;
for (auto& device : *devices) {
nsString id;
device->GetId(id);
id.ReplaceSubstring(NS_LITERAL_STRING("default: "), NS_LITERAL_STRING(""));
if (!deviceIDs.Contains(id)) {
deviceIDs.AppendElement(id);
}
}
for (auto& id : self->mDeviceIDs) {
if (!deviceIDs.Contains(id)) {
// Stop the coresponding SourceListener
nsGlobalWindow::WindowByIdTable* windowsById = nsGlobalWindow::GetWindowsTable();
if (windowsById) {
for (auto iter = windowsById->Iter(); !iter.Done(); iter.Next()) {
nsGlobalWindow* window = iter.Data();
if (window->IsInnerWindow()) {
self->IterateWindowListeners(window->AsInner(), StopRawIDCallback, &id);
}
}
}
}
}
self->mDeviceIDs = deviceIDs;
}, [](MediaStreamError*& reason) {});
return NS_OK;
}));
}
@ -2650,7 +2703,12 @@ MediaManager::EnumerateDevicesImpl(uint64_t aWindowId,
RefPtr<PledgeSourceSet> p = mgr->EnumerateRawDevices(aWindowId, aVideoType,
aAudioType, aFake);
p->Then([id, aWindowId, aOriginKey](SourceSet*& aDevices) mutable {
p->Then([id,
aWindowId,
aOriginKey,
aFake,
aVideoType,
aAudioType](SourceSet*& aDevices) mutable {
UniquePtr<SourceSet> devices(aDevices); // secondary result
// Only run if window is still on our active list.
@ -2658,6 +2716,21 @@ MediaManager::EnumerateDevicesImpl(uint64_t aWindowId,
if (!mgr) {
return NS_OK;
}
if (aVideoType == MediaSourceEnum::Camera &&
aAudioType == MediaSourceEnum::Microphone &&
!aFake) {
mgr->mDeviceIDs.Clear();
for (auto& device : *devices) {
nsString id;
device->GetId(id);
id.ReplaceSubstring(NS_LITERAL_STRING("default: "), NS_LITERAL_STRING(""));
if (!mgr->mDeviceIDs.Contains(id)) {
mgr->mDeviceIDs.AppendElement(id);
}
}
}
RefPtr<PledgeSourceSet> p = mgr->mOutstandingPledges.Remove(id);
if (!p || !mgr->IsWindowStillActive(aWindowId)) {
return NS_OK;
@ -2985,6 +3058,7 @@ MediaManager::Shutdown()
mActiveCallbacks.Clear();
mCallIds.Clear();
mPendingGUMRequest.Clear();
mDeviceIDs.Clear();
#ifdef MOZ_WEBRTC
StopWebRtcLog();
#endif
@ -3975,6 +4049,29 @@ GetUserMediaWindowListener::StopSharing()
}
}
void
GetUserMediaWindowListener::StopRawID(const nsString& removedDeviceID)
{
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread");
for (auto& source : mActiveListeners) {
if (source->GetAudioDevice()) {
nsString id;
source->GetAudioDevice()->GetRawId(id);
if (removedDeviceID.Equals(id)) {
source->Stop();
}
}
if (source->GetVideoDevice()) {
nsString id;
source->GetVideoDevice()->GetRawId(id);
if (removedDeviceID.Equals(id)) {
source->Stop();
}
}
}
}
void
GetUserMediaWindowListener::NotifySourceTrackStopped()
{

View File

@ -334,6 +334,7 @@ private:
media::CoatCheck<PledgeSourceSet> mOutstandingPledges;
media::CoatCheck<PledgeChar> mOutstandingCharPledges;
media::CoatCheck<PledgeVoid> mOutstandingVoidPledges;
nsTArray<nsString> mDeviceIDs;
public:
media::CoatCheck<media::Pledge<nsCString>> mGetPrincipalKeyPledges;
RefPtr<media::Parent<media::NonE10s>> mNonE10sParent;

View File

@ -253,14 +253,14 @@ HLSDemuxer::~HLSDemuxer()
{
HLS_DEBUG("HLSDemuxer", "~HLSDemuxer()");
mCallbackSupport->Detach();
if (mJavaCallbacks) {
HLSDemuxerCallbacksSupport::DisposeNative(mJavaCallbacks);
mJavaCallbacks = nullptr;
}
if (mHLSDemuxerWrapper) {
mHLSDemuxerWrapper->Destroy();
mHLSDemuxerWrapper = nullptr;
}
if (mJavaCallbacks) {
HLSDemuxerCallbacksSupport::DisposeNative(mJavaCallbacks);
mJavaCallbacks = nullptr;
}
mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
}

View File

@ -100,14 +100,14 @@ HLSResource::~HLSResource()
mCallbackSupport->Detach();
mCallbackSupport = nullptr;
}
if (mJavaCallbacks) {
HLSResourceCallbacksSupport::DisposeNative(mJavaCallbacks);
mJavaCallbacks = nullptr;
}
if (mHLSResourceWrapper) {
mHLSResourceWrapper->Destroy();
mHLSResourceWrapper = nullptr;
}
if (mJavaCallbacks) {
HLSResourceCallbacksSupport::DisposeNative(mJavaCallbacks);
mJavaCallbacks = nullptr;
}
}
} // namespace mozilla

View File

@ -479,7 +479,7 @@ private:
"ftyp", "moov", // init segment
"pdin", "free", "sidx", // optional prior moov box
"styp", "moof", "mdat", // media segment
"mfra", "skip", "meta", "meco", "ssix", "prft" // others.
"mfra", "skip", "meta", "meco", "ssix", "prft", // others.
"pssh", // optional with encrypted EME, though ignored.
"emsg", // ISO23009-1:2014 Section 5.10.3.3
"bloc", "uuid" // boxes accepted by chrome.

View File

@ -1694,7 +1694,8 @@ function MediaTestManager() {
this.finished(token);
};
// Default timeout to 180s for each test.
this.timers[token] = setTimeout(onTimeout, 180000);
// Call SimpleTest._originalSetTimeout() to bypass the flaky timeout checker.
this.timers[token] = SimpleTest._originalSetTimeout.call(window, onTimeout, 180000);
is(this.numTestsRunning, this.tokens.length,
"[started " + token + " t=" + elapsedTime(this.startTime) + "] Length of array should match number of running tests");

View File

@ -17,8 +17,7 @@ class nsNPAPIPluginInstance;
enum nsPluginTagType {
nsPluginTagType_Unknown,
nsPluginTagType_Embed,
nsPluginTagType_Object,
nsPluginTagType_Applet
nsPluginTagType_Object
};
%}

View File

@ -1090,18 +1090,6 @@ _releaseobject(NPObject* npobj)
return;
}
// THIS IS A KNOWN LEAK. SEE BUG 1221448.
// If releaseobject is called off the main thread and we have a valid pointer,
// we at least know it was created on the main thread (see _createobject
// implementation). However, forwarding the deletion back to the main thread
// without careful checking could cause bad memory management races. So, for
// now, we leak by warning and then just returning early. But it should fix
// java 7 crashes.
if (!NS_IsMainThread()) {
NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_releaseobject called from the wrong thread\n"));
return;
}
int32_t refCnt = PR_ATOMIC_DECREMENT((int32_t*)&npobj->referenceCount);
NS_LOG_RELEASE(npobj, refCnt, "BrowserNPObject");
@ -1292,88 +1280,6 @@ _getproperty(NPP npp, NPObject* npobj, NPIdentifier property,
if (!npobj->_class->getProperty(npobj, property, result))
return false;
// If a Java plugin tries to get the document.URL or document.documentURI
// property from us, don't pass back a value that Java won't be able to
// understand -- one that will make the URL(String) constructor throw a
// MalformedURL exception. Passing such a value causes Java Plugin2 to
// crash (to throw a RuntimeException in Plugin2Manager.getDocumentBase()).
// Also don't pass back a value that Java is likely to mishandle.
nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*) npp->ndata;
if (!inst)
return false;
nsNPAPIPlugin* plugin = inst->GetPlugin();
if (!plugin)
return false;
RefPtr<nsPluginHost> host = nsPluginHost::GetInst();
nsPluginTag* pluginTag = host->TagForPlugin(plugin);
if (!pluginTag->mIsJavaPlugin)
return true;
if (!NPVARIANT_IS_STRING(*result))
return true;
NPUTF8* propertyName = _utf8fromidentifier(property);
if (!propertyName)
return true;
bool notURL =
(PL_strcasecmp(propertyName, "URL") &&
PL_strcasecmp(propertyName, "documentURI"));
_memfree(propertyName);
if (notURL)
return true;
NPObject* window_obj = _getwindowobject(npp);
if (!window_obj)
return true;
NPVariant doc_v;
NPObject* document_obj = nullptr;
NPIdentifier doc_id = _getstringidentifier("document");
bool ok = npobj->_class->getProperty(window_obj, doc_id, &doc_v);
_releaseobject(window_obj);
if (ok) {
if (NPVARIANT_IS_OBJECT(doc_v)) {
document_obj = NPVARIANT_TO_OBJECT(doc_v);
} else {
_releasevariantvalue(&doc_v);
return true;
}
} else {
return true;
}
_releaseobject(document_obj);
if (document_obj != npobj)
return true;
NPString urlnp = NPVARIANT_TO_STRING(*result);
nsXPIDLCString url;
url.Assign(urlnp.UTF8Characters, urlnp.UTF8Length);
bool javaCompatible = false;
if (NS_FAILED(NS_CheckIsJavaCompatibleURLString(url, &javaCompatible)))
javaCompatible = false;
if (javaCompatible)
return true;
// If Java won't be able to interpret the original value of document.URL or
// document.documentURI, or is likely to mishandle it, pass back something
// that Java will understand but won't be able to use to access the network,
// and for which same-origin checks will always fail.
if (inst->mFakeURL.IsVoid()) {
// Abort (do an error return) if NS_MakeRandomInvalidURLString() fails.
if (NS_FAILED(NS_MakeRandomInvalidURLString(inst->mFakeURL))) {
_releasevariantvalue(result);
return false;
}
}
_releasevariantvalue(result);
char* fakeurl = (char *) _memalloc(inst->mFakeURL.Length() + 1);
strcpy(fakeurl, inst->mFakeURL);
STRINGZ_TO_NPVARIANT(fakeurl, *result);
return true;
}

View File

@ -141,7 +141,6 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
#ifdef MOZ_WIDGET_ANDROID
, mOnScreen(true)
#endif
, mHaveJavaC2PJSObjectQuirk(false)
, mCachedParamLength(0)
, mCachedParamNames(nullptr)
, mCachedParamValues(nullptr)
@ -418,8 +417,6 @@ nsNPAPIPluginInstance::Start()
GetMIMEType(&mimetype);
CheckJavaC2PJSObjectQuirk(quirkParamLength, mCachedParamNames, mCachedParamValues);
bool oldVal = mInPluginInitCall;
mInPluginInitCall = true;
@ -464,14 +461,8 @@ nsresult nsNPAPIPluginInstance::SetWindow(NPWindow* window)
return NS_OK;
#if MOZ_WIDGET_GTK
// bug 108347, flash plugin on linux doesn't like window->width <=
// 0, but Java needs wants this call.
if (window && window->type == NPWindowTypeWindow &&
(window->width <= 0 || window->height <= 0) &&
(nsPluginHost::GetSpecialType(nsDependentCString(mMIMEType)) !=
nsPluginHost::eSpecialType_Java)) {
return NS_OK;
}
// bug 108347, flash plugin on linux doesn't like window->width <= 0
return NS_OK;
#endif
if (!mPlugin || !mPlugin->GetLibrary())
@ -1044,10 +1035,6 @@ nsNPAPIPluginInstance::CSSZoomFactorChanged(float aCSSZoomFactor)
nsresult
nsNPAPIPluginInstance::GetJSObject(JSContext *cx, JSObject** outObject)
{
if (mHaveJavaC2PJSObjectQuirk) {
return NS_ERROR_FAILURE;
}
NPObject *npobj = nullptr;
nsresult rv = GetValueFromPlugin(NPPVpluginScriptableNPObject, &npobj);
if (NS_FAILED(rv) || !npobj)
@ -1599,96 +1586,6 @@ nsNPAPIPluginInstance::SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *c
}
}
static bool
GetJavaVersionFromMimetype(nsPluginTag* pluginTag, nsCString& version)
{
for (uint32_t i = 0; i < pluginTag->MimeTypes().Length(); ++i) {
nsCString type = pluginTag->MimeTypes()[i];
nsAutoCString jpi("application/x-java-applet;jpi-version=");
int32_t idx = type.Find(jpi, false, 0, -1);
if (idx != 0) {
continue;
}
type.Cut(0, jpi.Length());
if (type.IsEmpty()) {
continue;
}
type.ReplaceChar('_', '.');
version = type;
return true;
}
return false;
}
void
nsNPAPIPluginInstance::CheckJavaC2PJSObjectQuirk(uint16_t paramCount,
const char* const* paramNames,
const char* const* paramValues)
{
if (!mMIMEType || !mPlugin) {
return;
}
nsPluginTagType tagtype;
nsresult rv = GetTagType(&tagtype);
if (NS_FAILED(rv) ||
(tagtype != nsPluginTagType_Applet)) {
return;
}
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
if (!pluginHost) {
return;
}
nsPluginTag* pluginTag = pluginHost->TagForPlugin(mPlugin);
if (!pluginTag ||
!pluginTag->mIsJavaPlugin) {
return;
}
// check the params for "code" being present and non-empty
bool haveCodeParam = false;
bool isCodeParamEmpty = true;
for (uint16_t i = paramCount; i > 0; --i) {
if (PL_strcasecmp(paramNames[i - 1], "code") == 0) {
haveCodeParam = true;
if (strlen(paramValues[i - 1]) > 0) {
isCodeParamEmpty = false;
}
break;
}
}
// Due to the Java version being specified inconsistently across platforms
// check the version via the mimetype for choosing specific Java versions
nsCString javaVersion;
if (!GetJavaVersionFromMimetype(pluginTag, javaVersion)) {
return;
}
mozilla::Version version(javaVersion.get());
if (version >= "1.7.0.4") {
return;
}
if (!haveCodeParam && version >= "1.6.0.34" && version < "1.7") {
return;
}
if (haveCodeParam && !isCodeParamEmpty) {
return;
}
mHaveJavaC2PJSObjectQuirk = true;
}
double
nsNPAPIPluginInstance::GetContentsScaleFactor()
{

View File

@ -334,11 +334,6 @@ protected:
nsresult GetTagType(nsPluginTagType *result);
// check if this is a Java applet and affected by bug 750480
void CheckJavaC2PJSObjectQuirk(uint16_t paramCount,
const char* const* names,
const char* const* values);
nsresult CreateAudioChannelAgentIfNeeded();
// The structure used to communicate between the plugin instance and
@ -419,9 +414,6 @@ private:
nsIntSize mCurrentSize;
#endif
// is this instance Java and affected by bug 750480?
bool mHaveJavaC2PJSObjectQuirk;
static uint32_t gInUnsafePluginCalls;
// The arrays can only be released when the plugin instance is destroyed,

View File

@ -139,7 +139,6 @@ using mozilla::dom::FakePluginMimeEntry;
static const char *kPrefWhitelist = "plugin.allowed_types";
static const char *kPrefLoadInParentPrefix = "plugin.load_in_parent_process.";
static const char *kPrefDisableFullPage = "plugin.disable_full_page_plugin_for_types";
static const char *kPrefJavaMIME = "plugin.java.mime";
// How long we wait before unloading an idle plugin process.
// Defaults to 30 seconds.
@ -746,7 +745,6 @@ nsPluginHost::InstantiatePluginInstance(const nsACString& aMimeType, nsIURI* aUR
}
if (tagType != nsPluginTagType_Embed &&
tagType != nsPluginTagType_Applet &&
tagType != nsPluginTagType_Object) {
instanceOwner->Destroy();
return NS_ERROR_FAILURE;
@ -1816,20 +1814,6 @@ nsPluginHost::GetSpecialType(const nsACString & aMIMEType)
return eSpecialType_Flash;
}
// Java registers variants of its MIME with parameters, e.g.
// application/x-java-vm;version=1.3
const nsACString &noParam = Substring(aMIMEType, 0, aMIMEType.FindChar(';'));
// The java mime pref may well not be one of these,
// e.g. application/x-java-test used in the test suite
nsAdoptingCString javaMIME = Preferences::GetCString(kPrefJavaMIME);
if ((!javaMIME.IsEmpty() && noParam.LowerCaseEqualsASCII(javaMIME)) ||
noParam.LowerCaseEqualsASCII("application/x-java-vm") ||
noParam.LowerCaseEqualsASCII("application/x-java-applet") ||
noParam.LowerCaseEqualsASCII("application/x-java-bean")) {
return eSpecialType_Java;
}
return eSpecialType_None;
}
@ -1994,8 +1978,7 @@ ShouldAddPlugin(const nsPluginInfo& info, bool flashOnly)
}
if (info.fMimeTypeArray[i] &&
(!strcmp(info.fMimeTypeArray[i], "application/x-test") ||
!strcmp(info.fMimeTypeArray[i], "application/x-Second-Test") ||
!strcmp(info.fMimeTypeArray[i], "application/x-java-test"))) {
!strcmp(info.fMimeTypeArray[i], "application/x-Second-Test"))) {
return true;
}
}
@ -2379,7 +2362,6 @@ nsPluginHost::SetPluginsInContent(uint32_t aPluginEpoch,
nsTArray<nsCString>(tag.mimeTypes()),
nsTArray<nsCString>(tag.mimeDescriptions()),
nsTArray<nsCString>(tag.extensions()),
tag.isJavaPlugin(),
tag.isFlashPlugin(),
tag.supportsAsyncRender(),
tag.lastModifiedTime(),
@ -2625,7 +2607,6 @@ nsPluginHost::SendPluginsToContent()
tag->MimeTypes(),
tag->MimeDescriptions(),
tag->Extensions(),
tag->mIsJavaPlugin,
tag->mIsFlashPlugin,
tag->mSupportsAsyncRender,
tag->FileName(),
@ -3962,8 +3943,7 @@ nsPluginHost::CanUsePluginForMIMEType(const nsACString& aMIMEType)
MimeTypeIsAllowedForFakePlugin(NS_ConvertUTF8toUTF16(aMIMEType)) ||
aMIMEType.LowerCaseEqualsLiteral("application/x-test") ||
aMIMEType.LowerCaseEqualsLiteral("application/x-second-test") ||
aMIMEType.LowerCaseEqualsLiteral("application/x-third-test") ||
aMIMEType.LowerCaseEqualsLiteral("application/x-java-test")) {
aMIMEType.LowerCaseEqualsLiteral("application/x-third-test")) {
return true;
}

View File

@ -206,10 +206,7 @@ public:
// Needed to whitelist for async init support
eSpecialType_Test,
// Informs some decisions about OOP and quirks
eSpecialType_Flash,
// Binds to the <applet> tag, has various special
// rules around opening channels, codebase, ...
eSpecialType_Java
eSpecialType_Flash
};
static SpecialType GetSpecialType(const nsACString & aMIMEType);

View File

@ -37,7 +37,6 @@ using mozilla::DefaultXDisplay;
#include "nsIDocShellTreeOwner.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIAppShell.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIObjectLoadingContent.h"
#include "nsObjectLoadingContent.h"
#include "nsAttrName.h"
@ -1305,9 +1304,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetTagType(nsPluginTagType *result)
*result = nsPluginTagType_Unknown;
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
if (content->IsHTMLElement(nsGkAtoms::applet))
*result = nsPluginTagType_Applet;
else if (content->IsHTMLElement(nsGkAtoms::embed))
if (content->IsHTMLElement(nsGkAtoms::embed))
*result = nsPluginTagType_Embed;
else if (content->IsHTMLElement(nsGkAtoms::object))
*result = nsPluginTagType_Object;

View File

@ -79,7 +79,7 @@ public:
/**
* Get the type of the HTML tag that was used ot instantiate this
* plugin. Currently supported tags are EMBED, OBJECT and APPLET.
* plugin. Currently supported tags are EMBED or OBJECT.
*/
NS_IMETHOD GetTagType(nsPluginTagType *aResult);

View File

@ -230,7 +230,6 @@ nsPluginTag::nsPluginTag(nsPluginInfo* aPluginInfo,
mContentProcessRunningCount(0),
mHadLocalInstance(false),
mLibrary(nullptr),
mIsJavaPlugin(false),
mIsFlashPlugin(false),
mSupportsAsyncRender(false),
mFullPath(aPluginInfo->fFullPath),
@ -266,7 +265,6 @@ nsPluginTag::nsPluginTag(const char* aName,
mContentProcessRunningCount(0),
mHadLocalInstance(false),
mLibrary(nullptr),
mIsJavaPlugin(false),
mIsFlashPlugin(false),
mSupportsAsyncRender(false),
mFullPath(aFullPath),
@ -293,7 +291,6 @@ nsPluginTag::nsPluginTag(uint32_t aId,
nsTArray<nsCString> aMimeTypes,
nsTArray<nsCString> aMimeDescriptions,
nsTArray<nsCString> aExtensions,
bool aIsJavaPlugin,
bool aIsFlashPlugin,
bool aSupportsAsyncRender,
int64_t aLastModifiedTime,
@ -305,7 +302,6 @@ nsPluginTag::nsPluginTag(uint32_t aId,
mId(aId),
mContentProcessRunningCount(0),
mLibrary(nullptr),
mIsJavaPlugin(aIsJavaPlugin),
mIsFlashPlugin(aIsFlashPlugin),
mSupportsAsyncRender(aSupportsAsyncRender),
mLastModifiedTime(aLastModifiedTime),
@ -350,9 +346,6 @@ void nsPluginTag::InitMime(const char* const* aMimeTypes,
// Look for certain special plugins.
switch (nsPluginHost::GetSpecialType(mimeType)) {
case nsPluginHost::eSpecialType_Java:
mIsJavaPlugin = true;
break;
case nsPluginHost::eSpecialType_Flash:
// VLC sometimes claims to implement the Flash MIME type, and we want
// to allow users to control that separately from Adobe Flash.
@ -688,11 +681,6 @@ nsPluginTag::GetNiceFileName()
return mNiceFileName;
}
if (mIsJavaPlugin) {
mNiceFileName.AssignLiteral("java");
return mNiceFileName;
}
mNiceFileName = MakeNiceFileName(mFileName);
return mNiceFileName;
}

View File

@ -130,7 +130,6 @@ public:
nsTArray<nsCString> aMimeTypes,
nsTArray<nsCString> aMimeDescriptions,
nsTArray<nsCString> aExtensions,
bool aIsJavaPlugin,
bool aIsFlashPlugin,
bool aSupportsAsyncRender,
int64_t aLastModifiedTime,
@ -168,7 +167,6 @@ public:
PRLibrary *mLibrary;
RefPtr<nsNPAPIPlugin> mPlugin;
bool mIsJavaPlugin;
bool mIsFlashPlugin;
bool mSupportsAsyncRender;
nsCString mFullPath; // UTF-8

View File

@ -16,7 +16,6 @@ struct PluginTag
nsCString[] mimeTypes;
nsCString[] mimeDescriptions;
nsCString[] extensions;
bool isJavaPlugin;
bool isFlashPlugin;
bool supportsAsyncRender; // flash specific
nsCString filename;

View File

@ -1,87 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Helper for test_bug738396.html</title>
<meta charset="utf-8">
</head>
<body>
<!-- Test that the plugin sees "good" in each of these cases -->
<div id="codebasevis">
<applet codebase="good" codebase="bad" ></applet>
<applet codebase="bad">
<param name="codebase" value="good">
</applet>
<applet codebase="bad">
<param name="codebase" value="stillbad">
<param name="codebase" value="good">
</applet>
<applet>
<param name="codebase" value="good">
</applet>
<object type="application/x-java-test" codebase="good" codebase="bad"></object>
<object type="application/x-java-test" codebase="bad">
<param name="codebase" value="good">
</object>
<object type="application/x-java-test" codebase="bad">
<param name="codebase" value="stillbad">
<param name="codebase" value="good">
</object>
<object type="application/x-java-test">
<param name="codebase" value="good">
</object>
<embed type="application/x-java-test" codebase="good" codebase="bad">
</div>
<div id="blockedcodebase">
<!-- Test that none of these are allowed to load -->
<applet codebase="file:///" codebase="notused"></applet>
<applet codebase="notused">
<param name="codebase" value="file:///">
</applet>
<applet codebase="notused">
<param name="codebase" value="notused">
<param name="codebase" value="file:///">
</applet>
<applet>
<param name="codebase" value="file:///">
</applet>
<object type="application/x-java-test" codebase="file:///" codebase="notused"></object>
<object type="application/x-java-test" codebase="notused">
<param name="codebase" value="file:///">
</object>
<object type="application/x-java-test" codebase="notused">
<param name="codebase" value="notused">
<param name="codebase" value="file:///">
</object>
<object type="application/x-java-test">
<param name="codebase" value="file:///">
</object>
<embed type="application/x-java-test" codebase="file:///" codebase="notused">
</div>
<div id="nocodebase">
<applet></applet>
<object type="application/x-java-test"></object>
<embed type="application/x-java-test">
</div>
<div id="emptycodebase">
<applet codebase=""></applet>
<object type="application/x-java-test" codebase=""></object>
<embed type="application/x-java-test" codebase="">
</div>
</body>
</html>

View File

@ -9,7 +9,6 @@ support-files =
1028200-subpageB1.html
1028200-subpageC.html
file_authident.js
file_bug738396.html
file_bug771202.html
file_bug863792.html
file_bug1245545.js
@ -47,7 +46,6 @@ skip-if = !crashreporter
[test_bug532208.html]
[test_bug539565-1.html]
[test_bug539565-2.html]
[test_bug738396.html]
[test_bug771202.html]
[test_bug777098.html]
[test_bug784131.html]

View File

@ -1,88 +0,0 @@
<!doctype html>
<html>
<head>
<title>Test for Bug 738396</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED,
"Java Test Plug-in");
SpecialPowers.pushPrefEnv({ "set": [
['plugin.java.mime', 'application/x-java-test']
] }, loadFrame);
SimpleTest.waitForExplicitFinish();
function loadFrame() {
var iframe = document.createElement("iframe");
iframe.src = "./file_bug738396.html";
iframe.addEventListener("load", function() {
runTest(iframe.contentDocument);
});
document.body.appendChild(iframe);
}
function runTest(doc) {
// Check that the canonicalized version of the codebase 'good' was passed
// to the plugin in all cases
var a = doc.createElement('a');
a.href = "good";
var goodCodebase = a.href;
var codebasevis = doc.getElementById("codebasevis")
.querySelectorAll("applet, object, embed");
for (var elem of codebasevis) {
var codebase = null;
try {
codebase = elem.getJavaCodebase();
} catch (e) {}
is(codebase, goodCodebase,
"Check that the test plugin sees the proper codebase");
}
// Check that none of the applets in blockedcodebase were allowed to spawn
var blockedcodebase = doc.getElementById("blockedcodebase")
.querySelectorAll("applet, object, embed");
for (var elem of blockedcodebase) {
var spawned = false;
try {
elem.getObjectValue();
spawned = true;
} catch (e) {}
ok(!spawned, "Plugin should not be allowed to spawn");
}
// With no codebase, the codebase should resolve to "."
a.href = ".";
goodCodebase = a.href;
var nocodebase = doc.getElementById("nocodebase")
.querySelectorAll("applet, object, embed");
for (var elem of nocodebase) {
var codebase = null;
try {
codebase = elem.getJavaCodebase();
} catch (e) {}
is(codebase, goodCodebase, "Codebase should resolve to '.'");
}
// With empty codebase, the codebase should resolve to "/"
a.href = "/";
goodCodebase = a.href;
var nocodebase = doc.getElementById("emptycodebase")
.querySelectorAll("applet, object, embed");
for (var elem of nocodebase) {
var codebase = null;
try {
codebase = elem.getJavaCodebase();
} catch (e) {}
is(codebase, goodCodebase, "Codebase should resolve to '/'");
}
SimpleTest.finish();
}
</script>
</body>
</html>

View File

@ -14,7 +14,7 @@
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_DISABLED, "Second Test Plug-in");
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Java Test Plug-in");
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Shockwave Flash");
function findPlugin(pluginName) {
for (var i = 0; i < navigator.plugins.length; i++) {
@ -48,19 +48,19 @@
ok(navigator.plugins["Test Plug-in"], "Should have queried a plugin named 'Test Plug-in'");
ok(!navigator.plugins["Second Test Plug-in"], "Should NOT have queried a disabled plugin named 'Second Test Plug-in'");
ok(navigator.plugins["Java Test Plug-in"], "Should have queried a click-to-play plugin named 'Java Test Plug-in'");
ok(navigator.plugins["Shockwave Flash"], "Should have queried a click-to-play plugin named 'Shockwave Flash'");
ok(findPlugin("Test Plug-in"), "Should have found a plugin named 'Test Plug-in'");
ok(!findPlugin("Second Test Plug-in"), "Should NOT found a disabled plugin named 'Second Test Plug-in'");
ok(findPlugin("Java Test Plug-in"), "Should have found a click-to-play plugin named 'Java Test Plug-in'");
ok(findPlugin("Shockwave Flash"), "Should have found a click-to-play plugin named 'Shockwave Flash'");
ok(navigator.mimeTypes["application/x-test"], "Should have queried a MIME type named 'application/x-test'");
ok(!navigator.mimeTypes["application/x-second-test"], "Should NOT have queried a disabled type named 'application/x-second-test'");
ok(navigator.mimeTypes["application/x-java-test"], "Should have queried a click-to-play MIME type named 'application/x-java-test'");
ok(navigator.mimeTypes["application/x-shockwave-flash-test"], "Should have queried a click-to-play MIME type named 'application/x-shockwave-flash-test'");
ok(findMimeType("application/x-test"), "Should have found a MIME type named 'application/x-test'");
ok(!findMimeType("application/x-second-test"), "Should NOT have found a disabled MIME type named 'application/x-second-test'");
ok(findMimeType("application/x-java-test"), "Should have found a click-to-play MIME type named 'application/x-java-test'");
ok(findMimeType("application/x-shockwave-flash-test"), "Should have found a click-to-play MIME type named 'application/x-shockwave-flash-test'");
SimpleTest.finish();
}
@ -68,6 +68,6 @@
<object id="plugin" type="application/x-test" width=200 height=200></object>
<object id="disabledPlugin" type="application/x-second-test" width=200 height=200></object>
<object id="clickToPlayPlugin" type="application/x-java-test" width=200 height=200></object>
<object id="clickToPlayPlugin" type="application/x-shockwave-flash-test" width=200 height=200></object>
</body>
</html>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>libnptestjava.dylib</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.JavaTestPlugin</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BRPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0.0</string>
<key>CFBundleSignature</key>
<string>JAVATEST</string>
<key>CFBundleVersion</key>
<string>1.0.0.0</string>
<key>WebPluginName</key>
<string>Java Test Plug-in</string>
<key>WebPluginDescription</key>
<string>Dummy Java plug-in for testing purposes.</string>
<key>WebPluginMIMETypes</key>
<dict>
<key>application/x-java-test</key>
<dict>
<key>WebPluginExtensions</key>
<array>
<string>tstjava</string>
</array>
<key>WebPluginTypeDescription</key>
<string>Dummy java type</string>
</dict>
</dict>
</dict>
</plist>

View File

@ -1,11 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
SharedLibrary('nptestjava')
relative_path = 'javaplugin'
cocoa_name = 'JavaTest'
include('../testplugin.mozbuild')

View File

@ -1,7 +0,0 @@
LIBRARY NPJAVATEST
EXPORTS
NP_GetEntryPoints @1
NP_Initialize @2
NP_Shutdown @3
NP_GetMIMEDescription @4

View File

@ -1,42 +0,0 @@
#include<winver.h>
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "mozilla.org"
VALUE "FileDescription", L"Dummy Java plug-in for testing purposes."
VALUE "FileExtents", "tstjava"
VALUE "FileOpenName", "Dummy java test type"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "nptestjava"
VALUE "MIMEType", "application/x-java-test"
VALUE "OriginalFilename", "nptestjava.dll"
VALUE "ProductName", "Java Test Plug-in"
VALUE "ProductVersion", "1.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

View File

@ -1,7 +0,0 @@
/* 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/. */
const char *sPluginName = "Java Test Plug-in";
const char *sPluginDescription = "Dummy Java plug-in for testing purposes.";
const char *sMimeDescription = "application/x-java-test:tstjava:Dummy java type";

View File

@ -4,7 +4,7 @@
# 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/.
DIRS += ['secondplugin', 'javaplugin', 'thirdplugin', 'flashplugin']
DIRS += ['secondplugin', 'thirdplugin', 'flashplugin']
SharedLibrary('nptest')

View File

@ -1,25 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Helper for Test Bug 908933</title>
<meta charset="utf-8">
</head>
<body>
<object type="application/x-java-test" codebase="test1"></object>
<object classid="java:test2" codebase="./test2"></object>
<object data="test3" classid="java:test3" codebase="./test3"></object>
<applet codebase="test4"></applet>
<embed src="test5.class" codebase="test5" type="application/x-java-test">
<embed type="application/x-java-test" codebase="test6">
<embed src="test7.class">
<embed src="test8.class" codebase="test8">
</body>
</html>

View File

@ -85,7 +85,6 @@ support-files =
file_policyuri_regression_from_multipolicy.html
file_policyuri_regression_from_multipolicy.html^headers^
file_policyuri_regression_from_multipolicy_policy
file_shouldprocess.html
file_nonce_source.html
file_nonce_source.html^headers^
file_bug941404.html
@ -274,9 +273,6 @@ skip-if = toolkit == 'android'
[test_blocked_uri_in_reports.html]
[test_service_worker.html]
[test_child-src_worker.html]
[test_shouldprocess.html]
# Fennec platform does not support Java applet plugin
skip-if = toolkit == 'android' #investigate in bug 1250814
[test_child-src_worker_data.html]
[test_child-src_worker-redirect.html]
[test_child-src_iframe.html]

View File

@ -1,98 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=908933
-->
<head>
<title>Test Bug 908933</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<script class="testbody" type="text/javascript">
/*
* Description of the test:
* We load variations of 'objects' and make sure all the
* resource loads are correctly blocked by CSP.
* For all the testing we use a CSP with "object-src 'none'"
* so that all the loads are either blocked by
* shouldProcess or shouldLoad.
*/
const POLICY = "default-src http://mochi.test:8888; object-src 'none'";
const TESTFILE = "tests/dom/security/test/csp/file_shouldprocess.html";
SimpleTest.waitForExplicitFinish();
var tests = [
// Note that the files listed below don't actually exist.
// Since loading of them should be blocked by shouldProcess, we don't
// really need these files.
// blocked by shouldProcess
"http://mochi.test:8888/tests/dom/security/test/csp/test1",
"http://mochi.test:8888/tests/dom/security/test/csp/test2",
"http://mochi.test:8888/tests/dom/security/test/csp/test3",
"http://mochi.test:8888/tests/dom/security/test/csp/test4",
"http://mochi.test:8888/tests/dom/security/test/csp/test5",
"http://mochi.test:8888/tests/dom/security/test/csp/test6",
// blocked by shouldLoad
"http://mochi.test:8888/tests/dom/security/test/csp/test7.class",
"http://mochi.test:8888/tests/dom/security/test/csp/test8.class",
];
function checkResults(aURI) {
var index = tests.indexOf(aURI);
if (index > -1) {
tests.splice(index, 1);
ok(true, "ShouldLoad or ShouldProcess blocks TYPE_OBJECT with uri: " + aURI + "!");
}
else {
ok(false, "ShouldLoad or ShouldProcess incorreclty blocks TYPE_OBJECT with uri: " + aURI + "!");
}
if (tests.length == 0) {
window.examiner.remove();
SimpleTest.finish();
}
}
// used to watch that shouldProcess blocks TYPE_OBJECT
function examiner() {
SpecialPowers.addObserver(this, "csp-on-violate-policy");
}
examiner.prototype = {
observe: function(subject, topic, data) {
if (topic === "csp-on-violate-policy") {
var asciiSpec =
SpecialPowers.getPrivilegedProps(SpecialPowers.do_QueryInterface(subject, "nsIURI"), "asciiSpec");
checkResults(asciiSpec);
}
},
remove: function() {
SpecialPowers.removeObserver(this, "csp-on-violate-policy");
}
}
window.examiner = new examiner();
function loadFrame() {
var src = "file_testserver.sjs";
// append the file that should be served
src += "?file=" + escape(TESTFILE);
// append the CSP that should be used to serve the file
src += "&csp=" + escape(POLICY);
var iframe = document.createElement("iframe");
iframe.src = src;
document.body.appendChild(iframe);
}
SpecialPowers.pushPrefEnv(
{ "set": [['plugin.java.mime', 'application/x-java-test']] },
loadFrame);
</script>
</pre>
</body>
</html>

View File

@ -15,7 +15,7 @@ function testInDocument(doc, documentID) {
HTML_TAG("abbr", "Span")
HTML_TAG("acronym", "Span")
HTML_TAG("address", "Span")
HTML_TAG("applet", "SharedObject")
HTML_TAG("applet", "Unknown")
HTML_TAG("area", "Area")
HTML_TAG("b", "Span")
HTML_TAG("base", "Shared")
@ -42,7 +42,7 @@ function testInDocument(doc, documentID) {
HTML_TAG("dl", "SharedList")
HTML_TAG("dt", "Span")
HTML_TAG("em", "Span")
HTML_TAG("embed", "SharedObject")
HTML_TAG("embed", "Embed")
HTML_TAG("fieldset", "FieldSet")
HTML_TAG("font", "Font")
HTML_TAG("form", "Form")

View File

@ -35,7 +35,7 @@ HTML_TAG("a", "Anchor")
HTML_TAG("abbr", "Span")
HTML_TAG("acronym", "Span")
HTML_TAG("address", "Span")
HTML_TAG("applet", "SharedObject")
HTML_TAG("applet", "Unknown")
HTML_TAG("area", "Area")
HTML_TAG("b", "Span")
HTML_TAG("base", "Shared")
@ -62,7 +62,7 @@ HTML_TAG("div", "Div")
HTML_TAG("dl", "SharedList")
HTML_TAG("dt", "Span")
HTML_TAG("em", "Span")
HTML_TAG("embed", "SharedObject")
HTML_TAG("embed", "Embed")
HTML_TAG("fieldset", "FieldSet")
HTML_TAG("font", "Font")
HTML_TAG("form", "Form")

View File

@ -207,7 +207,6 @@ support-files =
files/xhtml1-frameset.dtd
files/xhtml1-strict.dtd
files/xhtml1-transitional.dtd
files/applets/org/w3c/domts/DOMTSApplet.class
[test_HTMLAnchorElement01.html]
[test_HTMLAnchorElement02.html]
@ -223,17 +222,6 @@ support-files =
[test_HTMLAnchorElement12.html]
[test_HTMLAnchorElement13.html]
[test_HTMLAnchorElement14.html]
[test_HTMLAppletElement01.html]
[test_HTMLAppletElement02.html]
[test_HTMLAppletElement03.html]
[test_HTMLAppletElement04.html]
[test_HTMLAppletElement05.html]
[test_HTMLAppletElement06.html]
[test_HTMLAppletElement07.html]
[test_HTMLAppletElement08.html]
[test_HTMLAppletElement09.html]
[test_HTMLAppletElement10.html]
[test_HTMLAppletElement11.html]
[test_HTMLAreaElement01.html]
[test_HTMLAreaElement02.html]
[test_HTMLAreaElement03.html]
@ -280,7 +268,6 @@ support-files =
[test_HTMLDocument04.html]
[test_HTMLDocument05.html]
[test_HTMLDocument07.html]
[test_HTMLDocument08.html]
[test_HTMLDocument09.html]
[test_HTMLDocument10.html]
[test_HTMLDocument11.html]

View File

@ -1,137 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement01</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement01'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The align attribute specifies the alignment of the object(Vertically
or Horizontally) with respect to its surrounding text.
Retrieve the align attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8049912
*/
function HTMLAppletElement01() {
var success;
if(checkInitialization(builder, "HTMLAppletElement01") != null) return;
var nodeList;
var testNode;
var valign;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
valign = testNode.align;
assertEquals("alignLink","bottom".toLowerCase(),valign.toLowerCase());
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement01</h2>
<p>&lt;test name='HTMLAppletElement01' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement01&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The align attribute specifies the alignment of the object(Vertically
or Horizontally) with respect to its surrounding text.
Retrieve the align attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8049912">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8049912</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='valign' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;align interface='HTMLAppletElement' obj='testNode' var='valign'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='valign' expected='"bottom"' <a id="alignLink">id='alignLink'</a> ignoreCase='true'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement02</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement02'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The alt attribute specifies the alternate text for user agents not
rendering the normal context of this element.
Retrieve the alt attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-58610064
*/
function HTMLAppletElement02() {
var success;
if(checkInitialization(builder, "HTMLAppletElement02") != null) return;
var nodeList;
var testNode;
var valt;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
valt = testNode.alt;
assertEquals("altLink","Applet Number 1",valt);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement02</h2>
<p>&lt;test name='HTMLAppletElement02' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement02&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The alt attribute specifies the alternate text for user agents not
rendering the normal context of this element.
Retrieve the alt attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-58610064">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-58610064</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='valt' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;alt interface='HTMLAppletElement' obj='testNode' var='valt'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='valt' expected='"Applet Number 1"' <a id="altLink">id='altLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement03</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement03'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The archive attribute specifies a comma-seperated archive list.
Retrieve the archive attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-14476360
*/
function HTMLAppletElement03() {
var success;
if(checkInitialization(builder, "HTMLAppletElement03") != null) return;
var nodeList;
var testNode;
var varchive;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
varchive = testNode.archive;
assertEquals("archiveLink","",varchive);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement03</h2>
<p>&lt;test name='HTMLAppletElement03' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement03&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The archive attribute specifies a comma-seperated archive list.
Retrieve the archive attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-14476360">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-14476360</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='varchive' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;archive interface='HTMLAppletElement' obj='testNode' var='varchive'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='varchive' expected='""' <a id="archiveLink">id='archiveLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement04</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement04'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The code attribute specifies the applet class file.
Retrieve the code attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-61509645
*/
function HTMLAppletElement04() {
var success;
if(checkInitialization(builder, "HTMLAppletElement04") != null) return;
var nodeList;
var testNode;
var vcode;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vcode = testNode.code;
assertEquals("codeLink","org/w3c/domts/DOMTSApplet.class",vcode);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement04</h2>
<p>&lt;test name='HTMLAppletElement04' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement04&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The code attribute specifies the applet class file.
Retrieve the code attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-61509645">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-61509645</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vcode' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;code interface='HTMLAppletElement' obj='testNode' var='vcode'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vcode' expected='"org/w3c/domts/DOMTSApplet.class"' <a id="codeLink">id='codeLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,136 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement05</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement05'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The codeBase attribute specifies an optional base URI for the applet.
Retrieve the codeBase attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-6581160
*/
function HTMLAppletElement05() {
var success;
if(checkInitialization(builder, "HTMLAppletElement05") != null) return;
var nodeList;
var testNode;
var vcodebase;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vcodebase = testNode.codeBase;
// mozilla returns full URI here
// assertEquals("codebase","applets",vcodebase);
todo_is(vcodebase,"applets","codebase");
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement05</h2>
<p>&lt;test name='HTMLAppletElement05' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement05&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The codeBase attribute specifies an optional base URI for the applet.
Retrieve the codeBase attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-6581160">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-6581160</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vcodebase' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;codeBase interface='HTMLAppletElement' obj='testNode' var='vcodebase'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vcodebase' expected='"applets"' <a id="codebase">id='codebase'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement06</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement06'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The height attribute overrides the height.
Retrieve the height attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-90184867
*/
function HTMLAppletElement06() {
var success;
if(checkInitialization(builder, "HTMLAppletElement06") != null) return;
var nodeList;
var testNode;
var vheight;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vheight = testNode.height;
assertEquals("heightLink","306",vheight);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement06</h2>
<p>&lt;test name='HTMLAppletElement06' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement06&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The height attribute overrides the height.
Retrieve the height attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-90184867">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-90184867</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vheight' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;height interface='HTMLAppletElement' obj='testNode' var='vheight'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vheight' expected='"306"' <a id="heightLink">id='heightLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement07</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement07'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The hspace attribute specifies the horizontal space to the left
and right of this image, applet, or object.
Retrieve the hspace attribute and examine it's value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-1567197
*/
function HTMLAppletElement07() {
var success;
if(checkInitialization(builder, "HTMLAppletElement07") != null) return;
var nodeList;
var testNode;
var vhspace;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vhspace = testNode.hspace;
assertEquals("hspaceLink",0,vhspace);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement07</h2>
<p>&lt;test name='HTMLAppletElement07' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-2 dom2.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement07&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The hspace attribute specifies the horizontal space to the left
and right of this image, applet, or object.
Retrieve the hspace attribute and examine it's value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2001-12-03&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-1567197">http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-1567197</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vhspace' type='int'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hspace interface='HTMLAppletElement' obj='testNode' var='vhspace'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vhspace' expected='0' <a id="hspaceLink">id='hspaceLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement08</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement08'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The name attribute specifies the name of the applet.
Retrieve the name attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-39843695
*/
function HTMLAppletElement08() {
var success;
if(checkInitialization(builder, "HTMLAppletElement08") != null) return;
var nodeList;
var testNode;
var vname;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vname = testNode.name;
assertEquals("nameLink","applet1",vname);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement08</h2>
<p>&lt;test name='HTMLAppletElement08' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement08&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The name attribute specifies the name of the applet.
Retrieve the name attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-39843695">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-39843695</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vname' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name interface='HTMLAppletElement' obj='testNode' var='vname'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vname' expected='"applet1"' <a id="nameLink">id='nameLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement09</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement09'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The vspace attribute specifies the vertical space above and below
this image, applet or object.
Retrieve the vspace attribute and examine it's value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-22637173
*/
function HTMLAppletElement09() {
var success;
if(checkInitialization(builder, "HTMLAppletElement09") != null) return;
var nodeList;
var testNode;
var vvspace;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vvspace = testNode.vspace;
assertEquals("vspaceLink",0,vvspace);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement09</h2>
<p>&lt;test name='HTMLAppletElement09' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-2 dom2.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement09&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The vspace attribute specifies the vertical space above and below
this image, applet or object.
Retrieve the vspace attribute and examine it's value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2001-12-03&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-22637173">http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-22637173</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vvspace' type='int'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;vspace interface='HTMLAppletElement' obj='testNode' var='vvspace'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vvspace' expected='0' <a id="vspaceLink">id='vspaceLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement10</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement10'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The width attribute overrides the regular width.
Retrieve the width attribute and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-16526327
*/
function HTMLAppletElement10() {
var success;
if(checkInitialization(builder, "HTMLAppletElement10") != null) return;
var nodeList;
var testNode;
var vwidth;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vwidth = testNode.width;
assertEquals("widthLink","301",vwidth);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement10</h2>
<p>&lt;test name='HTMLAppletElement10' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement10&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The width attribute overrides the regular width.
Retrieve the width attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Mary Brady&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-02-22&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-16526327">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-16526327</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vwidth' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;width interface='HTMLAppletElement' obj='testNode' var='vwidth'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vwidth' expected='"301"' <a id="widthLink">id='widthLink'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet.html"></iframe>
<br>
</body>
</html>

View File

@ -1,138 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement11</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLAppletElement11'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "applet2");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The object attribute specifies the serialized applet file.
Retrieve the object attribute and examine its value.
* @author NIST
* @author Rick Rivello
* @author Curt Arnold
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-93681523
*/
function HTMLAppletElement11() {
var success;
if(checkInitialization(builder, "HTMLAppletElement11") != null) return;
var nodeList;
var testNode;
var vobject;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "applet2");
nodeList = doc.getElementsByTagName("applet");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vobject = testNode.object;
// mozilla returns full uri here
// asertEquals("object","DOMTSApplet.dat",vobject);
todo_is(vobject, "DOMTSApplet.dat", "object");
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLAppletElement11</h2>
<p>&lt;test name='HTMLAppletElement11' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLAppletElement11&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The object attribute specifies the serialized applet file.
Retrieve the object attribute and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Rick Rivello&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Curt Arnold&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-07-19&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-93681523">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-93681523</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vobject' type='DOMString'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='applet2' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"applet"'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertSize collection='nodeList' size='1' <a id="Asize">id='Asize'</a>/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;item interface='NodeList' obj='nodeList' var='testNode' index='0'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;object interface='HTMLAppletElement' obj='testNode' var='vobject'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vobject' expected='"DOMTSApplet.dat"' <a id="object">id='object'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/applet2.html"></iframe>
<br>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLDocument08</title>
<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script>
<script src="DOMTestCase.js" type="text/javascript"></script>
<script type="text/javascript">
// expose test function names
function exposeTestFunctionNames()
{
return ['HTMLDocument08'];
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "document-with-applet");
if (docsLoaded == 1) {
setUpPage = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPage = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
runJSUnitTests();
SimpleTest.finish();
}
}
/**
*
The applets attribute returns a collection of all OBJECT elements that
include applets abd APPLET elements in a document.
Retrieve the applets attribute from the document and examine its value.
* @author NIST
* @author Rick Rivello
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-85113862
*/
function HTMLDocument08() {
var success;
if(checkInitialization(builder, "HTMLDocument08") != null) return;
var nodeList;
var testNode;
var vapplets;
var vlength;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "document-with-applet");
vapplets = doc.applets;
vlength = vapplets.length;
assertEquals("length",2,vlength);
}
</script>
</head>
<body>
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLDocument08</h2>
<p>&lt;test name='HTMLDocument08' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLDocument08&lt;/title&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;NIST&lt;/creator&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
The applets attribute returns a collection of all OBJECT elements that
include applets abd APPLET elements in a document.
Retrieve the applets attribute from the document and examine its value.
&lt;/description&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;contributor&gt;Rick Rivello&lt;/contributor&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2002-04-30&lt;/date&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-85113862">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-85113862</a>'/&gt;
<br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='nodeList' type='NodeList'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='testNode' type='Node'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vapplets' type='HTMLCollection'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='vlength' type='int'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;load var='doc' href='document' willBeModified='false'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;applets interface='HTMLDocument' obj='doc' var='vapplets'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;length interface='HTMLCollection' obj='vapplets' var='vlength'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='vlength' expected='4' <a id="length">id='length'</a> ignoreCase='false'/&gt;<br>&lt;/test&gt;<br>
</p>
<p>
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
</p>
<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a>
for more details.</p>
<iframe name="doc" src="files/document-with-applet.html"></iframe>
<br>
</body>
</html>

View File

@ -396,8 +396,6 @@ var interfaceNamesInGlobalScope =
"HTMLAllCollection",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLAnchorElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLAppletElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLAreaElement",
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -8,7 +8,6 @@
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLSharedElement.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#include "mozilla/dom/TabParent.h"
#include "nsComponentManagerUtils.h"
#include "nsContentUtils.h"
@ -21,7 +20,6 @@
#include "nsIDOMComment.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMHTMLBaseElement.h"
#include "nsIDOMHTMLCollection.h"
@ -541,42 +539,6 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
return OnWalkAttribute(aNode, "data");
}
nsCOMPtr<nsIDOMHTMLAppletElement> nodeAsApplet = do_QueryInterface(aNode);
if (nodeAsApplet) {
// For an applet, relative URIs are resolved relative to the
// codebase (which is resolved relative to the base URI).
nsCOMPtr<nsIURI> oldBase = mCurrentBaseURI;
nsAutoString codebase;
rv = nodeAsApplet->GetCodeBase(codebase);
NS_ENSURE_SUCCESS(rv, rv);
if (!codebase.IsEmpty()) {
nsCOMPtr<nsIURI> baseURI;
rv = NS_NewURI(getter_AddRefs(baseURI), codebase,
mParent->GetCharacterSet(), mCurrentBaseURI);
NS_ENSURE_SUCCESS(rv, rv);
if (baseURI) {
mCurrentBaseURI = baseURI;
// Must restore this before returning (or ENSURE'ing).
}
}
// We only store 'code' locally if there is no 'archive',
// otherwise we assume the archive file(s) contains it (bug 430283).
nsAutoCString archiveAttr;
rv = ExtractAttribute(aNode, "archive", "", archiveAttr);
if (NS_SUCCEEDED(rv)) {
if (!archiveAttr.IsEmpty()) {
rv = OnWalkURI(archiveAttr);
} else {
rv = OnWalkAttribute(aNode, "core");
}
}
// restore the base URI we really want to have
mCurrentBaseURI = oldBase;
return rv;
}
nsCOMPtr<nsIDOMHTMLLinkElement> nodeAsLink = do_QueryInterface(aNode);
if (nodeAsLink) {
// Test if the link has a rel value indicating it to be a stylesheet
@ -1116,38 +1078,6 @@ PersistNodeFixup::FixupNode(nsIDOMNode *aNodeIn,
return rv;
}
nsCOMPtr<nsIDOMHTMLAppletElement> nodeAsApplet = do_QueryInterface(aNodeIn);
if (nodeAsApplet) {
rv = GetNodeToFixup(aNodeIn, aNodeOut);
if (NS_SUCCEEDED(rv) && *aNodeOut) {
nsCOMPtr<nsIDOMHTMLAppletElement> newApplet =
do_QueryInterface(*aNodeOut);
// For an applet, relative URIs are resolved relative to the
// codebase (which is resolved relative to the base URI).
nsCOMPtr<nsIURI> oldBase = mCurrentBaseURI;
nsAutoString codebase;
nodeAsApplet->GetCodeBase(codebase);
if (!codebase.IsEmpty()) {
nsCOMPtr<nsIURI> baseURI;
NS_NewURI(getter_AddRefs(baseURI), codebase,
mParent->GetCharacterSet(), mCurrentBaseURI);
if (baseURI) {
mCurrentBaseURI = baseURI;
}
}
// Unset the codebase too, since we'll correctly relativize the
// code and archive paths.
IgnoredErrorResult ignored;
static_cast<dom::HTMLSharedObjectElement*>(newApplet.get())->
RemoveAttribute(NS_LITERAL_STRING("codebase"), ignored);
FixupAttribute(*aNodeOut, "code");
FixupAttribute(*aNodeOut, "archive");
// restore the base URI we really want to have
mCurrentBaseURI = oldBase;
}
return rv;
}
nsCOMPtr<nsIDOMHTMLLinkElement> nodeAsLink = do_QueryInterface(aNodeIn);
if (nodeAsLink) {
rv = GetNodeToFixup(aNodeIn, aNodeOut);

View File

@ -61,7 +61,6 @@
#include "nsIMIMEInfo.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLSharedElement.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
#include "mozilla/Printf.h"
using namespace mozilla;

View File

@ -1,43 +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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
*
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
[NeedResolve, UnsafeInPrerendering]
interface HTMLAppletElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString align;
[Pure, SetterThrows]
attribute DOMString alt;
[Pure, SetterThrows]
attribute DOMString archive;
[Pure, SetterThrows]
attribute DOMString code;
[Pure, SetterThrows]
attribute DOMString codeBase;
[Pure, SetterThrows]
attribute DOMString height;
[Pure, SetterThrows]
attribute unsigned long hspace;
[Pure, SetterThrows]
attribute DOMString name;
[Pure, SetterThrows]
attribute DOMString _object;
[Pure, SetterThrows]
attribute unsigned long vspace;
[Pure, SetterThrows]
attribute DOMString width;
};
HTMLAppletElement implements MozImageLoadingContent;
HTMLAppletElement implements MozFrameLoaderOwner;
HTMLAppletElement implements MozObjectLoadingContent;

View File

@ -554,7 +554,6 @@ WEBIDL_FILES = [
'History.webidl',
'HTMLAllCollection.webidl',
'HTMLAnchorElement.webidl',
'HTMLAppletElement.webidl',
'HTMLAreaElement.webidl',
'HTMLAudioElement.webidl',
'HTMLBaseElement.webidl',

View File

@ -538,8 +538,7 @@ nsXMLContentSink::CloseElement(nsIContent* aContent)
nodeInfo->NameAtom() == nsGkAtoms::textarea ||
nodeInfo->NameAtom() == nsGkAtoms::video ||
nodeInfo->NameAtom() == nsGkAtoms::audio ||
nodeInfo->NameAtom() == nsGkAtoms::object ||
nodeInfo->NameAtom() == nsGkAtoms::applet))
nodeInfo->NameAtom() == nsGkAtoms::object))
|| nodeInfo->NameAtom() == nsGkAtoms::title
) {
aContent->DoneAddingChildren(HaveNotifiedForCurrentContent());
@ -1560,8 +1559,7 @@ nsXMLContentSink::IsMonolithicContainer(mozilla::dom::NodeInfo* aNodeInfo)
return ((aNodeInfo->NamespaceID() == kNameSpaceID_XHTML &&
(aNodeInfo->NameAtom() == nsGkAtoms::tr ||
aNodeInfo->NameAtom() == nsGkAtoms::select ||
aNodeInfo->NameAtom() == nsGkAtoms::object ||
aNodeInfo->NameAtom() == nsGkAtoms::applet)) ||
aNodeInfo->NameAtom() == nsGkAtoms::object)) ||
(aNodeInfo->NamespaceID() == kNameSpaceID_MathML &&
(aNodeInfo->NameAtom() == nsGkAtoms::math))
);

View File

@ -288,7 +288,6 @@ txMozillaXMLOutput::endElement()
// Handle elements that are different when parser-created
if (element->IsAnyOfHTMLElements(nsGkAtoms::title,
nsGkAtoms::object,
nsGkAtoms::applet,
nsGkAtoms::select,
nsGkAtoms::textarea) ||
element->IsSVGElement(nsGkAtoms::title)) {

View File

@ -327,10 +327,13 @@ HTMLEditor::DeleteRefToAnonymousNode(nsIContent* aContent,
// Remove reference from the parent element.
auto nac = static_cast<mozilla::ManualNAC*>(
parentContent->GetProperty(nsGkAtoms::manualNACProperty));
MOZ_ASSERT(nac);
nac->RemoveElement(aContent);
if (nac->IsEmpty()) {
parentContent->DeleteProperty(nsGkAtoms::manualNACProperty);
// nsIDocument::AdoptNode might remove all properties before destroying
// editor. So we have to consider that NAC could be already removed.
if (nac) {
nac->RemoveElement(aContent);
if (nac->IsEmpty()) {
parentContent->DeleteProperty(nsGkAtoms::manualNACProperty);
}
}
aContent->UnbindFromTree();

View File

@ -594,6 +594,10 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(acronym, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
ELEM(address, true, true, GROUP_BLOCK,
GROUP_INLINE_ELEMENT | GROUP_P),
// While applet is no longer a valid tag, removing it here breaks the editor
// (compiles, but causes many tests to fail in odd ways). This list is tracked
// against the main HTML Tag list, so any changes will require more than just
// removing entries.
ELEM(applet, true, true, GROUP_SPECIAL | GROUP_BLOCK,
GROUP_FLOW_ELEMENT | GROUP_OBJECT_CONTENT),
ELEM(area, false, false, GROUP_MAP_CONTENT, GROUP_NONE),

View File

@ -0,0 +1,26 @@
<html>
<head>
<script type="application/javascript">
let table = document.createElement('table');
document.documentElement.appendChild(table);
let tr = document.createElement('tr');
table.appendChild(tr);
let input = document.createElement('input');
document.documentElement.appendChild(input);
let img = document.createElement('img');
input.appendChild(img);
img.contentEditable = 'true'
tr.appendChild(img);
img.offsetParent;
// Since table's cell is selected by the following, it will show
// object resizer that is anonymous element.
window.getSelection().selectAllChildren(tr);
// Document.adoptNode will remove anonymous element of object resizer
// and it shouldn't cause crash
document.implementation.createDocument('', '').adoptNode(table);
</script>
</head>
</html>

View File

@ -78,3 +78,4 @@ load 1348851.html
load 1350772.html
load 1366176.html
load 1375131.html
load 1383755.html

View File

@ -166,11 +166,17 @@ skip-if = toolkit == 'android' # bug 1309431
[test_bug787432.html]
[test_bug790475.html]
[test_bug795418.html]
subsuite = clipboard
[test_bug795418-2.html]
subsuite = clipboard
[test_bug795418-3.html]
subsuite = clipboard
[test_bug795418-4.html]
subsuite = clipboard
[test_bug795418-5.html]
subsuite = clipboard
[test_bug795418-6.html]
subsuite = clipboard
[test_bug795785.html]
[test_bug796839.html]
[test_bug830600.html]

View File

@ -1443,10 +1443,21 @@ DrawTargetSkia::DrawGlyphs(ScaledFont* aFont,
paint.mPaint.setSubpixelText(useSubpixelText);
std::vector<uint16_t> indices;
std::vector<SkPoint> offsets;
indices.resize(aBuffer.mNumGlyphs);
offsets.resize(aBuffer.mNumGlyphs);
const uint32_t heapSize = 64;
uint16_t indicesOnStack[heapSize];
SkPoint offsetsOnStack[heapSize];
std::vector<uint16_t> indicesOnHeap;
std::vector<SkPoint> offsetsOnHeap;
uint16_t* indices = indicesOnStack;
SkPoint* offsets = offsetsOnStack;
if (aBuffer.mNumGlyphs > heapSize) {
// Heap allocation/ deallocation is slow, use it only if we need a
// bigger(>heapSize) buffer.
indicesOnHeap.resize(aBuffer.mNumGlyphs);
offsetsOnHeap.resize(aBuffer.mNumGlyphs);
indices = (uint16_t*)&indicesOnHeap.front();
offsets = (SkPoint*)&offsetsOnHeap.front();
}
for (unsigned int i = 0; i < aBuffer.mNumGlyphs; i++) {
indices[i] = aBuffer.mGlyphs[i].mIndex;
@ -1454,7 +1465,7 @@ DrawTargetSkia::DrawGlyphs(ScaledFont* aFont,
offsets[i].fY = SkFloatToScalar(aBuffer.mGlyphs[i].mPosition.y);
}
mCanvas->drawPosText(&indices.front(), aBuffer.mNumGlyphs*2, &offsets.front(), paint.mPaint);
mCanvas->drawPosText(indices, aBuffer.mNumGlyphs*2, offsets, paint.mPaint);
}
void

Some files were not shown because too many files have changed in this diff Show More