/* -*- 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/. */
class EventChainPostVisitor; class EventChainPreVisitor; class PresState;
namespace dom {
class FormData;
class HTMLTextAreaElement final : public TextControlElement, public nsStubMutationObserver, public ConstraintValidation { public: using ConstraintValidation::GetValidationMessage; using ValueSetterOption = TextControlState::ValueSetterOption; using ValueSetterOptions = TextControlState::ValueSetterOptions;
/** * Called when an attribute is about to be changed
*/ void BeforeSetAttr(int32_t aNameSpaceID, nsAtom* aName, const nsAttrValue* aValue, bool aNotify) override;
nsCOMPtr<nsIControllers> mControllers; /** https://html.spec.whatwg.org/#user-interacted */ bool mUserInteracted = false; /** Whether or not the value has changed since its default value was given. */ bool mValueChanged = false; /** Whether or not the last change to the value was made interactively by the
* user. */ bool mLastValueChangeWasInteractive = false; /** Whether or not we are already handling select event. */ bool mHandlingSelect = false; /** Whether or not we are done adding children (always true if not
created by a parser */ bool mDoneAddingChildren; /** Whether state restoration should be inhibited in DoneAddingChildren. */ bool mInhibitStateRestoration; /** Whether our disabled state has changed from the default **/ bool mDisabledChanged = false; bool mIsPreviewEnabled = false;
/** The state of the text editor (selection controller and the editor) **/
TextControlState* mState;
MOZ_CAN_RUN_SCRIPT void SelectAll(); /** * Get the value, whether it is from the content or the frame. * @param aValue the value [out] * @param aIgnoreWrap whether to ignore the wrap attribute when getting the * value. If this is true, linebreaks will not be inserted even if * wrap=hard.
*/ void GetValueInternal(nsAString& aValue, bool aIgnoreWrap) const;
/** * Setting the value. * * @param aValue String to set. * @param aOptions See TextControlState::ValueSetterOption.
*/
MOZ_CAN_RUN_SCRIPT nsresult
SetValueInternal(const nsAString& aValue, const ValueSetterOptions& aOptions);
/** * Common method to call from the various mutation observer methods. * aContent is a content node that's either the one that changed or its * parent; we should only respond to the change if aContent is non-anonymous.
*/ void ContentChanged(nsIContent* aContent);
/** * Get the mutable state of the element.
*/ bool IsMutable() const;
/** * Returns whether the current value is the empty string. * * @return whether the current value is the empty string.
*/ bool IsValueEmpty() const { return State().HasState(ElementState::VALUE_EMPTY);
}
/** * A helper to get the current selection range. Will throw on the ErrorResult * if we have no editor state.
*/ void GetSelectionRange(uint32_t* aSelectionStart, uint32_t* aSelectionEnd,
ErrorResult& aRv);
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.