/* -*- 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/dom/BindContext.h" #include"mozilla/dom/Document.h" #include"mozilla/dom/HTMLObjectElement.h" #include"mozilla/dom/HTMLObjectElementBinding.h" #include"mozilla/dom/ElementInlines.h" #include"mozilla/dom/WindowProxyHolder.h" #include"nsAttrValueInlines.h" #include"nsGkAtoms.h" #include"nsError.h" #include"nsIContentInlines.h" #include"nsIWidget.h" #include"nsContentUtils.h" #ifdef XP_MACOSX # include "mozilla/EventDispatcher.h" # include "mozilla/dom/Event.h" # include "nsFocusManager.h" #endif
// If we're already in a document, we need to trigger the load // Otherwise, BindToTree takes care of that. if (IsInComposedDoc()) {
StartObjectLoad(aHaveNotified, false);
}
}
// If we already have all the children, start the load. if (IsInComposedDoc() && mIsDoneAddingChildren) { void (HTMLObjectElement::*start)() = &HTMLObjectElement::StartObjectLoad;
nsContentUtils::AddScriptRunner(
NewRunnableMethod("dom::HTMLObjectElement::BindToTree", this, start));
}
void HTMLObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
nsAtom* aName, bool aNotify) { // 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 (aNamespaceID != kNameSpaceID_None || aName != nsGkAtoms::data ||
!aNotify || !IsInComposedDoc() || !mIsDoneAddingChildren ||
BlockEmbedOrObjectContentLoading()) { return;
}
// This method doesn't call nsGenericHTMLFormControlElement intentionally. // TODO: It should probably be changed when bug 597242 will be fixed. if (IsEditingHost() || Type() == ObjectType::Document) { if (aTabIndex) {
*aTabIndex = isFocusable ? attrVal->GetIntegerValue() : 0;
}
*aIsFocusable = true; returnfalse;
}
// TODO: this should probably be managed directly by IsHTMLFocusable. // See bug 597242. if (aTabIndex && isFocusable) {
*aTabIndex = attrVal->GetIntegerValue();
*aIsFocusable = true;
}
void HTMLObjectElement::StartObjectLoad(bool aNotify, bool aForce) { // BindToTree can call us asynchronously, and we may be removed from the tree // in the interim if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
BlockEmbedOrObjectContentLoading()) { return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.