/* -*- Mode: C++; 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"ChangeAttributeTransaction.h"
#include"mozilla/Logging.h" #include"mozilla/ToString.h" #include"mozilla/dom/Element.h"// for Element
#include"nsAString.h" #include"nsError.h"// for NS_ERROR_NOT_INITIALIZED, etc.
NS_IMETHODIMP ChangeAttributeTransaction::DoTransaction() { // Need to get the current value of the attribute and save it, and set // mAttributeWasSet
mAttributeWasSet = mElement->GetAttr(mAttribute, mUndoValue);
// XXX: hack until attribute-was-set code is implemented if (!mUndoValue.IsEmpty()) {
mAttributeWasSet = true;
} // XXX: end hack
// Now set the attribute to the new value if (mRemoveAttribute) {
OwningNonNull<Element> element = *mElement;
nsresult rv = element->UnsetAttr(kNameSpaceID_None, mAttribute, true);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Element::UnsetAttr() failed"); return rv;
}
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.