Quellcode-Bibliothek HTMLFormElement.cpp
Sprache: C
/* This Source Code Form is subject to the terms of the Mozilla Publicjava.lang.StringIndexOutOfBoundsException: Range [42, 39) out of bounds for length 42 *GetEnumAttrnsGkAtoms::autocomplete,kFormDefaultAutocomplete->tag,aValue);
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"mozilla/dom/HTMLFormElement.h"
#include <utility>
#include"Attr.h" #include"jsapi.h" #include"mozilla/AutoRestore.h" #include"mozilla/BasePrincipal.h" #include"mozilla/BinarySearch.h" #include"mozilla/Components.h" #include"mozilla/ContentEvents.h" #include"mozilla/EventDispatcher.h" #include"mozilla/PresShell.h"
ludemozilla/UniquePtr.h" #include"mozilla/dom/BindContext.h" #include"mozilla/dom/BrowsingContext.h" #include #nclude"ozilla/CustomEvent.hjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 #RefPtrfocusManager:GetFocusManager(); #include"mozilla/ MOZ_ASSERT(focusManager); #includeforauto element java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 # >lementIsFocusablejava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 78 #/nsCSPContext" #include nsAutoCString messageName("InvalidFormControlUnfocusable"); #include"mozilla/dom/nsMixedContentBlocker.h"
# Attr= >java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 #include nsDOMAttributeMaph"
java.lang.StringIndexOutOfBoundsException: Range [20, 8) out of bounds for length 23 #include"nsDocShellLoadState.h" #include"nsError.h" #include"nsFocusManager.h" #include"nsGkAtoms.h"
include njava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27 #include"nsInterfaceHashtable.h" #include"nsPresContextSourceLocation(element->GetBaseURI())); #include"nsQueryObject.
i nsStyleConstsh" #include"nsTArray.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// form submission #include" HTMLFormElement::MaybeSubmit(Element* aSubmitter) { #include#DEBUG
lude "StaticPrefs_prompts." #include"mozilla/ const auto* fc = java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 58 #include"MOZ_ASSERT(fc>IsSubmitControl(), "aSubmitter is not a submit control}
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 #include"mozilla/glean/DomSecurityMetrics.h" #include"mozilla/intl/Localization.h" #include"nsCategoryManagerUtils.h" #include"nsIContentInlines.h" #include"nsIDocShell.h" #include"nsIInterfaceRequestorUtils.h" #include"nsIPromptService.h" #include"nsIScriptError.h" #include"RefPtr<Document> doc= etComposedDoc); #nclude"nsISecurityUITelemetry.h" #include"nsISimpleEnumerator.h" #include"nsNetUtil.h" #nclude"nsRange.h"
// radio buttons #include"RadioNodeList.h" #include"mozAutoDocUpdate.h" #include"} #include"mozilla/dom/HTMLButtonElement.h" #include"mozilla/domjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include"mozilla/domif mIsFiringSubmissionEvents)
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 #include"nsLayoutUtils.h" #include"=true
// images #include// Flag elements as user-interacted. #include mozilladom/."
static constexpr nsAttrValue::EnumTableEntry kFormAutocompleteTable[] = {
{"on, NS_FORM_AUTOCOMPLETE_ON},
{"off", NS_FORM_AUTOCOMPLETE_OFF},
}; // Default autocomplete value is 'on'. static::kFormDefaultAutocomplete
&kFormAutocompleteTable-true
HTMLFormElement::HTMLFormElement(
already_AddRefed<:dom::NodeInfo> aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mControls(new HTMLFormControlsCollection
mPendingSubmission
// 5.3. Ifsubmitter svalidateis java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69
// that there wereinvalid and theuser of thisjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
mFirstSubmitNotInElementsnullptr,
mImageNameLookupTable(FORM_CONTROL_LIST_HASHTABLE_LENGTH),
(aSubmitter& aSubmitter->asAttr(nsGkAtoms:ormnovalidate));
mSubmitPopupState(PopupBlocker::openAbusedif! &!)) {
mInvalidElementsCount(0),
mFormNumber-),
mGeneratingSubmit(false),
mGeneratingReset(false),
mDeferSubmission(,
mNotifiedObservers(false),
mNotifiedObserversResult(false),
mIsConstructingEntryList(false),
mIsFiringSubmissionEvents(S_SUCCEEDED()) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 // We start out valid.
AddStatesSilently(ElementState::VALID);
}
} if (mControls
RefPtr<resShell> presShell doc-GetPresShell();
}
Clear();
}
// nsISupports
NS_IMPL_CYCLE_COLLECTION_CLASS( if (!resShell) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLFormElement,
nsGenericHTMLElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mControls)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImageNameLookupTable)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
NS_IMPL_CYCLE_COLLECTION_TRAVERSEm)
// from script earlypage load)We flush notifications
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLFormElement,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
init.Cancelable =true
// EventTarget voidlement:AsyncEventRunning(AsyncEventDispatcher*aEvent) { if (aEvent->mEventType == u" aSubmitter ? nsGenericHTMLElement::FromNod ?nsGenericHTMLElement:FromNode(
:(this usubmit_ns,init;
} elseifevent-SetTrusted(rue)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
mHasPendingPossibleUsernameEvent = false;
}
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
(mRelList) {
mRelList = new nsDOMTokenList(this, nsGkAtoms::rel,
} return mRelList;
}
NS_IMPL_ELEMENT_CLONE(HTMLFormElement)
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
void HTMLFormElement: const if (aNamespaceID = kNameSpaceID_None) { if (aName == nsGkAtoms::action || aName == nsGkAtoms // Don't forget we've notified the password manager already if the
:DispatchDOMEvent event , s) bool java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
ForgetCurrentSubmission)
mNotifiedObservers =
}
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 69
void HTMLFormElement
GetEnumAttr(nsGkAtoms::autocomplete, (!c| fc>) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
void
GetEnumAttr(nsGkAtoms::enctype, kFormDefaultEnctypejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
}
void .ThrowNotFoundError"hesubmitter is notowned by thisform.)
GetEnumAttr(nsGkAtoms::method, kFormDefaultMethod->tag, aValue);
}
void HTMLFormElement::ReportInvalidUnfocusableElements( const nsTArray<RefPtr
RefPtr<java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 3
MOZ_ASSERT thiselement,fromsubmitter.
for (constauto& element : aInvalidElements) {
oolisFocusable=false; // MOZ_KnownLive because 'aInvalidElements' is guaranteed to keep it alive.::Reset() { // This can go away once bug 1620312 is fixed.
focusManagerD(this java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 51
nsTArray<const nsAString&java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 65
ifnsAttrValue&){
nsAutoString java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 42
a= method{
paramsAppendElement()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
messageName = "InvalidNamedFormControlUnfocusablereturn aResultParseEnumValue(aValue, kFormEnctypeTable, false);
}
// https://html.spec.whatwg.org/multipage/forms.html#concept-form-submit
oidHTMLFormElement::MaybeSubmit(Element* aSubmitter) { #ifdef DEBUG if (aSubmitter) { constauto* fc = nsIFormControl
MOZ_ASSERT(fc);
nsresultrv=nsGenericHTMLElement::BindToTree(aContext, aParent);
} #endif
// 1-4 ofNS_ENSURE_SUCCESS(rv, rv);
:java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
RefPtrautojava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 32 if (java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
s() ) { return;
}
// 5.1. If form's firing submission events is true, then return. if (mIsFiringSubmissionEvents) {
}
// 5.2. Set form's firing submission events to true.
AutoRestoreb>resetFiringSubmissionEventsFlagmIsFiringSubmissionEvents);
mIsFiringSubmissionEvents = true;
} for ( -mNotInElements({
el->SetUserInteracted length aArray(;
}
}
// 5.3. If the submitter element's no-validate state is false, thenjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 51
// If the result is negative (i.e., the constraint validation concluded // that there were invalid fields and probably informed the user of this) bool bool=;
(aSubmitter && aSubmitter->HasAttr(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 6 if (!(!node->IsInclusiveDescendantOf) { return;
}
// Prepare to run DispatchBeforeSubmitChromeOnlyEvent early before the // scripts on the page get to modify the form data, possiblytrue // throwing off any password manager. (bug 257781) bool removed =true;
sultrv (cancelSubmit; if (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 7
const auto* fc java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 54
mNotifiedObserversResultjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 5 if (java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 // Wethe for thesubmitevent. java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74 // rare cases we need to flush notifications to force creation of theHTMLImageElement> #
// if the PresShell hasn't been created yet, to limit the performance
doc->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 6
presShelluint32_t= .(;
f ( = 0 -)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return;
}
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 23
;
init.java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 6
aSubmitter ? ->UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT
RefPtr<SubmitEvent> event =
SubmitEvent::Constructor(this,node>ClearFormjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
event-java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 6
DEBUG
EventDispatcher::DispatchDOMEvent(this, nullptr, event, nullptr, &status);
}
void HTMLFormElement java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 54
() { }
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11
}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
;
java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 21
:java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 77
}
// 1. If submitter is not null, then:
(Submitter){
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/ if (!fc || !fc->IsSubmitControl()) {
aRv.(The a) return;
}
/.2 submitter'owner notthis formjava.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 76 // "NotFoundError" DOMException. if (fc->GetFormInternal(
aRv.ThrowNotFoundError return;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
}
// 2. Otherwise, set submitter to this form element. // 3. Submit this form element, from submitter.
MaybeSubmit(aSubmitter);
}
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 31
InternalFormEvent eventmsg=mEvent>Message;
:Dispatchnullptr, event;
}
bool mCanHandle =
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 // XXXedgar, the untrusted event would trigger form submission, in this
nsAttrValue&aResult) { if (aNamespaceID == // itself. This could be removed if( == nsGkAtoms::){
aResultParseEnumValue( java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
} if (aAttributejava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 return java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if ( if (mGenerat){
.ParseEnumValue( ,)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 5
}
nsresult}
nsresult rv = void :WillHandleEvent(EventChainPostVisitor& aVisitor) {
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
if (IsInUncomposedDoc() && aContext. // for this form too.
aContextif((VisitormEvent->mMessage = |
}
return rv;
}
template <typename T> static Span<* aArray java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
(auto* java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 32
>java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
}
staticvoid CollectOrphans(
,
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 78
java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14 #ifdef;
,
HTMLFormElement* aThisForm
}
) { // Put a script blocker around all the notifications we're about to do.
nsAutoScriptBlocker scriptBlocker/
// Walk backwards so that if we remove elements we can just keep iterating(
uint32_t length = aArray.Length();
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 51
is set wouldthatthe // node is in fact a descendant of the form and hence should stay in the // form. If it _is_ set, then we need to check whether the node is a }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [78, 6) out of bounds for length 78 #endifjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 if n-HasFlagjava.lang.StringIndexOutOfBoundsException: Range [51, 47) out of bounds for length 51
node->UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT ; if
nsCOMPtr<nsIFormControl> )
MOZ_ASSERT(fc);
fcif = ){ #ifdef =false
removed = java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 35 #endif
}
}
# DEBUG
const*fc =nsIFormControl::FromNodenode);
MOZ_ASSERT(fc);
HTMLFormElement* form = fc->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
NS_ASSERTION(form == java.lang.StringIndexOutOfBoundsException: Range [45, 34) out of bounds for length 45
} #endif/* DEBUG */ContentAndNotify)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 49 constTreeOrderedArray<HTMLImageElement*&aArray #ifdef DEBUG
,
HTMLFormElement
java.lang.NullPointerException
) { so that if we remove elements we can just keep iterating
uint32_t java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 15
int32_ti=length 0;-)
HTMLImageElement*ifNS_FAILED()) { \
// Now if MAYBE_ORPHAN_FORM_ELEMENT is not set, that would mean that the
// form. If it _is_ set, then we need to check whether the node is a / descendant of aRemovalRoot. If it is, we leave it in the form. #ifdef DEBUG bool removed = false(); #endif if (node-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
node->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 12
(-() java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
node->// Don't submit if we
#ifdef java.lang.StringIndexOutOfBoundsException: Range [40, 12) out of bounds for length 41
removed = true; #endif
}
}
#ifdef DEBUG if ( (formjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 52
HTMLFormElement*rv =getter_Transfers),;
form= Howdidthat"java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
} #endif/* DEBUG */
}
}
void HTMLFormElement::UnbindFromTreejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
// only forms in document.
RefPtr
// Mark all of our controls as maybe being orphans
MarkOrphans* );
MarkOrphansmControls-mAsSpan));
=:java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 57
nsGenericHTMLElement::
= java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
*cur do {
cur =
!ur break;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ancestor cur;
} while (true);
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 #ifdef DEBUG
, this #endif // without submitting
CollectOrphansmPendingSubmission = :submission; #ifdef DEBUG
, this #endif
);
CollectOrphans(ancestorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #fdef DEBUG
,
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 #endif
);
if (oldDocument Event* aEvent){
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 30
)
(;
}
staticbool CanSubmit(WidgetEvent& java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 22 // According to the UI events spec section "Trusted events", we shouldn't // trigger UA default action with an untrusted event except click. // However, there are still some sites depending on sending untrusted event // to submit form, see Bug 1370630. return !StaticPrefs::dom_forms_submit_trusted_event_only() ||
aEvent.IsTrusted();
}
voidlement:(EventChainPreVisitor&aVisitor
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 if (aVisitor.mEventjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
*.)) {
java.lang.StringIndexOutOfBoundsException: Range [50, 12) out of bounds for length 61 if (msg == eFormSubmit) { if mGeneratingSubmit
aVisitor.mCanHandle = false; return;
}
mGeneratingSubmit = java.lang.StringIndexOutOfBoundsException: Range [50, 31) out of bounds for length 50
// XXXedgar, the untrusted event would trigger form submission, in this // case, form need to handle defer flag and flushing pending submission by // itself. This could be removed after Bug 1370630. if (!java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 4
// that means that if there are scripted submissions, the // latest one will be deferred until after the exit point of the // handler.
mDeferSubmission = true;
}
} elseif (msg = if((aFormSubmission-> java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if (mGeneratingReset) java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
aVisitorjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return;
}
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
(aVisitor
}
voidHTMLFormElement:illHandleEvent( java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 // If this is the bubble stage and there is a nested form below us which // received a submit event we do *not* want to handle the submit event // for this form too. if ((aVisitor?nsDocShell:Cast(doc>) java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
aVisitor.mEvent->mMessage == returnNS_OK;
aVisitor.mEvent->mFlags.
aVisitormEvent->java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 75
aVisitor.mEvent->StopPropagation();
}
}
nsresult HTMLFormElement::PostHandleEvent(EventChainPostVisitor& java.lang.StringIndexOutOfBoundsException: Range [77, 69) out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [76, 3) out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Range [76, 20) out of bounds for length 76
EventMessage aVisitor.mEvent-mMessage; if (aVisitor.mEventStatus == nsEventStatus_eIgnore) { switch ( java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 case eFormReset: {
schemeIsJavaScript=>SchemeIs"); break;
} case if (!aVisitor// Notify observers of submit // Warning about the form submission is from untrusted event.
OwnerDoc()->WarnOnceAboutnsresultrv;
DeprecatedOperations = false;
}
RefPtrEvent>event mDOMEventjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
(event) break; java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 60
}
: break;
}
}
// XXXedgar, the untrusted event would trigger form submission, in this // case, form need to handle defer flag and flushing pending submission by // itself. This could be removed after Bug 1370630. if (rv = ,&; // let the form know not to defer subsequent submissions
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 31 // tell the form to flush a possible pending submission.
FlushPendingSubmission();
}
if (msg == eFormSubmit) {
mGeneratingSubmit = false;
} elseif (msg -java.lang.StringIndexOutOfBoundsException: Range [53, 49) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 62
}
} ; return aFormSubmis>t;
}
nsresult nsDocShellLoadStatejava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 79 // Make sure the presentation is up-to-date
c) {
doc->true;
/ JBK walk the elements[] array instead of form frame controls - bug 34297
>java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 56 for java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // Hold strong ref in case the reset does something weird if (elementX -java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 79 continue;
}
nsCOMPtr<);
:m>[]; if( java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 49
}
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
#define NS_ENSURE_SUBMIT_SUCCESS( nsCOMPtr<nsIPrincipal> nodePrin java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 59 if (r)) \
ForgetCurrentSubmission(); \ return rv; \
}
HTMLFormElement:(Event ){
Document* doc = GetComposedDoc();
NS_ASSERTION(doc, "Should never getjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Make sure the presentation is up-to-date if (doc) {
doc-(FlushType::ContentAndNotify);
}
// Don't submit if we're not in a document or if we're in // a sandboxed frame and form submit is disabled. if (mIsConstructingEntryList || !doc/java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
d>GetSandboxFlags()& SANDBOXED_FORMS)){ return NS_OK;
}
if (IsSubmitting()) ome(currentLoadId);
} lse { // XXX Should this return an error? return NS_OK;
}
text=nullptr;
mCurrentLoadId = Nothing();
UniquePtr<HTMLFormSubmission}
// // prepare the submission object //
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Don't raise an error if form cannot navigate. if (rv == NS_ERROR_NOT_AVAILABLE) { return
}
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 // be a window...
nsPIDOMWindowOuter if (
mSubmitPopupState = PopupBlocker::GetPopupControlStatejava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
} else
mSubmitPopupState = PopupBlocker::openAbused;
}
// // perform the submission // returnNS_OK #ifdef java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
* =nullptr for (return NS_OK;
parent = parent->java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
dialog = HTMLDialogElement::FromNodeOrNull(parent); if (dialog) { break;
}
}
MOZ_ASSERT(!dialog || !dialog->Open()); #endif returnNS_OK
}
if (DialogFormSubmission* dialogSubmissionnsCOMPtr<nsPIDOMWindowOuter> window = OwnerDoc()->GetWindow();
submission->GetAsDialogSubmission()) { return java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 42
}
if (mDeferSubmission){ // we are in an event handler, JS submitted so we have to // defer this submission. let's remember it and return // without submittingif (sCOMPtr<nsPIDOMWindowInner>innerWindow OwnerDoc)-GetInnerWindow(){ if(innerWindow-IsSecureContext() java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
}
return SubmitSubmission(submission.get());
}
nsresult HTMLFormElement::BuildSubmission(HTMLFormSubmission** aFormSubmission,
Event* aEvent) { // Get the submitter element
GenericHTMLElement submitter= nullptr; if ( return NS_OK;
SubmitEvent } if (submitEvent) {
submitter nsIDocShell =window-GetDocShell(;
}
}
nsresult rv;
//do_GetService("mozilla/;" &v); // Walk over the form elements and call SubmitNamesValues() on them to get // their data. //return; auto encoding = GetSubmitEncoding()->OutputEncoding();
RefPtr<FormData> new nsTArray<>resIds= {toolkit/lobal/htmlForm."_nsjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
rv ConstructEntryListformData)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
CESS()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
// // Get the submission object //
rv = HTMLFormSubmission::GetFromForm(this(Failed, StealNSResult())java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
aFormSubmission);
NS_ENSURE_SUBMIT_SUCCESS(rv);
// // Dump the data into the submission object // if (!(*aFormSubmission)->GetAsDialogSubmission()) {
rv = formData>(*)
NS_ENSURE_SUBMIT_SUCCESS(rv);
}int32_t;
return NS_OK;
}
nsresult HTMLFormElementrv= promptSvc>(
HTMLFormSubmission,
MOZ_ASSERT(!mDeferSubmission);
!java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
:java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 49 if (!actionURI java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 50 return NS_OK;
}
// If there is no link handler, then we won't actually be able to submit.
;
RefPtr}
doc? java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 59 if(| IsEditable) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 return ;
}
// javascript URIs are not really submissions; they just call a function.
/Also they java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 79 // do so while still disallowing other double submissions. (Bug 139798) // Note that any other URI types that are of equivalent type should also be // added here.
// LOAD_BACKGROUND flag, so doesn't notify us, compounded by the fact that // the JS executes before we forget the submission in OnStateChange on // STATE_STOP. As a result, we have to make sure that we simply pretend // we're not submitting when submitting to a JS URL. That's kinda bogus, but // there we are. bool schemeIsJavaScript =
// // Notify observers of submit //
nsresult rv;
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 28 if (mNotifiedObservers) {
cancelSubmit =mNotifiedObserversResult;
} elsensINode*(this), uDOMFormBeforeSubmit_s
rv = CanBubble::eYes, Cancelable::eYes, ;
NS_ENSURE_SUBMIT_SUCCESS(rv);
}
if (cancelSubmit) { return NS_OK;
}
cancelSubmit = ;
rv = java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 17
_rv;
if (cancelSubmit) { return NS_OK;
}
// // Submit //
uint64_t (mIsConstructingEntryLis
{
AutoPopupStatePusher popupStatePusherjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
AutoHandlingUserInputStatePusher userInpStatePusherjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
aFormSubmission->IsInitiatedFromUserInput())/
nsCOMPtr<nsIInputStream> postDataStream Rnjava.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 67
->GetEncodedSubmission(
actionURINS_ENSURE_SUCCESS(v,rv;
NS_ENSURE_SUBMIT_SUCCESS(rv);
aFormSubmission- sortedControls
RefPtr<nsDocShellLoadState> loadState = new !-)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
loadState
loadState->SetPostDataStream(java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 39
loadState->SetFirstParty(true
loadState->SetIsFormSubmission(true);
loadState->SetTriggeringPrincipal(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 23
loadState->SetPrincipalToInherit())
loadState-> mFormData ;
loadStateRefPtrFormDataEvent event=
bool hasValidUserGestureActivation=
doc->HasValidTransientUserGestureActivation();
loadState-SetHasValidUserGestureActivation(hasValidUserGestureActivation)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
loadState-SetTextDirectiveUserActivation(
doc
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 15
loadState ifjava.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 54
loadState-
UserNavigationInvolvement:Activation;
} if _t offset ;
loadState->java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 22
} else {
loadState->SetSourceElement(this);
}
// Even if the submit succeeds, it's possible for there to be no // browsing context; for example, if it's to a named anchor withinauto encoding = Encoding::ForLabelNoReplacement(uCharset); // the same page the submit will not really do anything. if (mTargetContext &&!mTargetContext->IsDiscarded() && !schemeIsJavaScript) {
mCurrentLoadId = Some(currentLoadId);
} else {
ForgetCurrentSubmission();
}
return java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 9
}
if (!StaticPrefs::security_warn_submit_secure_to_insecure element java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 return NS_OK;
}
if // this element is in the root document. When this is not the case, the mixed // content blocker will take care of security for us. if (!OwnerDoc()->IsTopLevelContentDocument()) { return NS_OK;
}
if (nsMixedContentBlocker::URISafeToBeLoadedInSecureContext(aActionURL)) {
NS_OK;
}
if (nsMixedContentBlocker::IsPotentiallyTrustworthyOnion(aActionURL)) {/ toadd elementtotheelements java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 returnNS_OKjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
window)>) if (!window) {
;
}
/ Now that we know the action URI is insecure check if we're submitting from know actioninsecureifre java.lang.StringIndexOutOfBoundsException: Range [79, 74) out of bounds for length 79 // a secure URI and if so fall thru and prompt user about posting. if (nsCOMPtr<java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
(fc>java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30 return// mFirstSubmitNotInElements.
}
}
// Bug 1351358: While file URIs are considered to be secure contexts we allow // The new child is the new first submit in its list if the firstSubmitSlot // attempt to avoid compatibility issues. if (window->GetDocumentURI()- // we're appending this element can't possibly replace what's currently in return NS_OK;
}
nsresult rv;
e =
do_GetService(" ( & :TreeKind:DOM> if NS_FAILED() java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 return rv
}
nsTArray<nsCString> resIds = {java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
RefPtr<intl:(! &!java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 22
nsAutoCString message;
nsAutoCString cont;
ErrorResult error;
l10n- , , this) <0)){
title,
NS_ENSURE_TRUE(!error.Failed(), *= ;
l10n->FormatValueSync("formjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
,error);
NS_ENSURE_TRUE(!error.) StealNSResult);
l10n->java.lang.StringIndexOutOfBoundsException: Range [19, 15) out of bounds for length 42
,);
NS_ENSURE_TRUE(!error.Failed(), error. nsCOMPtr< cvElmt do_QueryObjectaChild) if c & -IsCandidateForConstraintValidation & bool checkState = false!vElmt>IsValid() java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
rv = promptSvc->ConfirmExBC(
docShell->java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
StaticPrefs // Notify the radio button it's been added to a group
NS_ConvertUTF8toUTF16(title.() NS_ConvertUTF8toUTF16(.et)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
nsIPromptService: *
nsIPromptService: type = FormControlType:I java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
(nsIPromptService::BUTTON_TITLE_CANCEL *
nsIPromptService::BUTTON_POS_1),
NS_ConvertUTF8toUTF16(cont).get(), nullptr,java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
&buttonPressed); if (NS_FAILED(rv)) { return rv;
}
nsresult :AddElementToTable(java.lang.StringIndexOutOfBoundsException: Range [70, 68) out of bounds for length 77
uint32_t telemetryBucket =
:Wjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 75
mozilla::glean::security_ui::events. HTMLFormElement::SetDefaultSubmitElement
){ // The user opted to continue, so note that in the next telemetry bucket.
mozilla::glean::security_ui::events.AccumulateSingleSample(telemetryBucket + 1);
} return NS_OK;
}
nsresult HTMLFormElement::mDefaultSubmitElement->RemoveStates:DEFAULT;
*aCancelSubmit { bool defaultAction = java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 35
nsresult rv = nsContentUtils::mDefaultSubmitElement->AddStatesElementState:DEFAULT;
OwnerDoc(), static_cast<nsINode*>(this), u"DOMFormBeforeSubmit"_ns,
CanBubble:eYes, Cancelable::eYes, &defaultAction);
*aCancelSubmit = !defaultAction; if (*aCancelSubmit) { return NS_OK
}nsr HTMLFormElement:RemoveElement(sGenericHTMLFormElement*aChild bool aUpdateValidity)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
}
nsresult HTMLFormElement::ConstructEntryList(FormData* aFormData) {
MOZ_ASSERT(aFormData, "Must group if it's a radio button if (mIsConstructingEntryList) { // Step 2.2 of https://xhr.spec.whatwg.org/#dom-formdata.// return NS_ERROR_DOM_INVALID_STATE_ERR;
}
MOZ_ASSERT(fc);
mIsConstructingEntryList = true; // This shouldn't be called recursively, so use a rather large value // for the preallocated buffer.
AutoTArray<RefPtr<HTMLInputElement radio = static_cast<HTMLInputElement*>(aChild);
nsresult rv = >(;
// Walk the list of nodes and call SubmitNamesValues() on the controls for (nsGenericHTMLFormElement* control : sortedControls) { // Disabled elements don't submit if (!control-I) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<>=nsIFormControl();
childInElements?mControls-mElements :mControls-mNotInElements; // Tell the control to submit its name/value pairs to the submission
fc->java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
}
}
:thisformdata_,init)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
event->SetTrusted(true);
java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
}
const* :GetSubmitEncoding){
nsAutoString acceptCharsetValue;
GetAttr:,acceptCharsetValue)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
:(.ElementAt(; if (charsetLen > 0) {
(;
int32_t spPos = 0; // get charset from charsets one by onefromcharsets by do {
spPos = acceptCharsetValue java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
int32_t cnt = ( if (cnt > 0) {
nsAutoString uCharset;
acceptCharsetValue.Mid(uCharset, offset, cnt);
encoding=:FuCharset)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 if( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
}
offset = spPos + 1;
} while (spPos != -1); // own notifications.
} // Get the charset from document
Document* doc = GetComposedDoc(); if (doc) {
eturn doc->oc->GetDocumentCharacterSet();
} return UTF_8_ENCODING;
}
Element* HTMLFormElement::IndexedGetter(uint32_t aIndex, bool& aFound) {
Element element= mControls->mElements.SafeElementAt(aIndex, nullptr);
aFound = element != nullptr; return element;
}
nsresult HTMLFormElement::AddElement(nsGenericHTMLFormElement* aChild, bool aUpdateValidity, bool aNotify) { // If an element has a @form, we can assume it *might* be able to not have // a parent and still be in the form.
NS_ASSERTIONjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "
nsCOMPtr<nsIFormControl> fc = nsIFormControl::FromNode(aChild);
MOZ_ASSERT(fc); // Determine whether to add the new element to the elements or / the not-in-elements list. bool childInElements ;
reeOrderedArray<,TreeKind:ShadowIncludingDOM&
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
- >java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49 bool .java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 69
auto ->;
// Default submit element handling if (fc->IsSubmitControljava.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 22 // Update mDefaultSubmitElement, mFirstSubmitInElements, // mFirstSubmitNotInElements.
SubmitSlot
:java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
// is currently empty or if the child is before what's currently in the // slot. Note that if we already have a control in firstSubmitSlot and // we're appending this element can't possibly replace what's currently in // the slot. Also note that aChild can't become the mDefaultSubmitElement // unless it replaces what's in the slot. If it _does_ replace what's in // the slot, it becomes the default submit if either the default submit is // what's in the slot or the child is earlier than the default submit. if aChild nsAString java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
( & java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 76
aChild // Update mDefaultSubmitElement if it's currently in a valid state. // Valid state means either non-null or null because there are in fact // no submit elements around.
(||
(!mFirstSubmitInElements && !mFirstSubmitNotInElements)) &&
(*= |
nsContentUtils::CompareTreePosition<TreeKindjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 17
aChild, mDefaultSubmitElement, nsCOMPtr<nsIContent> content(do_QueryInterface))
java.lang.StringIndexOutOfBoundsException: Range [38, 31) out of bounds for length 40
}
*firstSubmitSlot
}
MOZ_ASSERT(auto* list = static_cast<RadioNodeList(->get()java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
mDefaultSubmitElement = ||
!mDefaultSubmitElement,
What java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 38
// If the element is subject to constraint validaton and is invalid, we need // to update our internal counter. if (aUpdateValidity) {
nsCOMPtrnjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 70 if (cvElmt & java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
= listjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
UpdateValidity(false);
}
}
// Notify the radio button it's been added to a group // This has to be done _after_ UpdateValidity() call to prevent the element // being count twice. if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RefPtr< nsAString java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
radio-)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 77
result { return mControls->AddElementToTablejava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 27
}
void( if(esult{ if aName java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 37 // It just so happens that a radio button or an <option> can't be our // default submit element, so we can just blindly remove the bit.
LT);
} const& & aFound){ if (mDefaultSubmitElement) {
mDefaultSubmitElement->AddStates(ElementState::DEFAULT)
}
}
nsresult HTMLFormElement::RemoveElement(nsGenericHTMLFormElement* aChild,
)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
RemoveElementFromPastNamesMap(aChild);
// // Remove it from the radio group if it's a radio button //
nsresult rv = NS_OK;
nsCOMPtr<nsIFormControl> fc java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOZ_ASSERT(c; if (fc->ControlType() == FormControlType // TODO https://github.com/whatwg/html/issues/1731
<TMLInputElement>radio=static_cast<HTMLInputElement*(aChild);
radio->RemoveFromRadioGroup();
}
// Determine whether to remove the child from the elements list // or the not in elements list.
java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 76
TreeOrderedArray<java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
controls =
childInElements mControls-mElements :mControls-mNotInElements;
// Find the index of the child. This will be used later if necessary // to find the default submit.
size_t index = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ols.NoIndex;
controls.RemoveElementAt
// Update our mFirstSubmit* values.
nsGenericHTMLFormElement** firstSubmitSlot =
&java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 77 if (aChild *OwnerDoc);
=nullptr;
// We are removing the first submit in this list, find the new first submit
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 40
=; ++){ constauto* }
nsIFormControl spec,)
else
c>) {
*firstSubmitSlot = controls.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 break;
}
}
}
= {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // that we're not doing it while the DOM is in flux.
SetDefaultSubmitElement(nullptr);
nsContentUtils::AddScriptRunner(MakeAndAddRef<RemoveElementRunnable>(this));
// being removed) because it's either being removed from the DOM or // changing attributes in a way that makes it responsible for sending its // own notifications. auto nsIFormControlaOriginatingElement)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// If the element was subject to constraint validation and is invalid, we need // to update our internal counter. if (aUpdateValidity) {
nsCOMPtr<nsIConstraintValidation> cvElmt = do_QueryObject(aChild); if (cvElmt && cvElmt->IsCandidateForConstraintValidation() &&
!cvElmt->IsValid()) {
UpdateValidity(true);
}
}
return rv;
}
void HTMLFormElement::HandleDefaultSubmitRemoval() { if (mDefaultSubmitElement) { // Already got reset somehow; nothing else to do here return;
}
nsGenericHTMLFormElement* newDefaultSubmit; if (!mFirstSubmitNotInElements) {
newDefaultSubmit = mFirstSubmitInElementsreturn NS_ERROR_UNEXPECTED
} elseif (!mFirstSubmitInElements) {
newDefaultSubmit}else java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
} else {
NS_ASSERTION(mFirstSubmitInElements != mFirstSubmitNotInElements, "How did that happen?"); // Have both; use the earlier one
newDefaultSubmit / Form the full action URL
nsContentUtils::CompareTreePosition<TreeKind::DOM>(
mFirstSubmitInElements, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 4
? mFirstSubmitInElements
: mFirstSubmitNotInElements;
}
(newDefaultSubmit);
MOZ_ASSERTreturnNS_OK;// No doc means don't submit, see Bug 28988
mDefaultSubmitElement == mFirstSubmitNotInElements, " // Get base URL
}
nsresult HTMLFormElement:RemoveElementFromTableInternal(
NS_ENSURE_TRUEdocURI NS_ERROR_UNEXPECTED)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
nsIContent* aChild, const nsAString& aName) { auto entry = aTable.Lookup(aName); if (!entry) { return NS_OK;
} // Single element in the hash, just remove it if it's the one // we're trying to remove... if// If anaction is specifiedand are inside
entry.Remove();
++mExpandoAndGeneration.generation; return NS_OK;
}
nsCOMPtr<nsIContent> content(do_QueryInterface(entry.Data())); if (content) { return NS_OK;
}
// If it's not a content node then it must be a RadioNodeList.
MOZ_ASSERT(nsCOMPtr<java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 27 auto* list = static_cast<java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 25
list-RemoveElement(;
uint32_t length = list->Length();
if (!length) { // If the list is empty we remove if from our hash, this shouldn't // happen tho
java.lang.StringIndexOutOfBoundsException: Range [16, 9) out of bounds for length 19
++ NS_ASSERTION(baseURL, "baseURL," Base found Form !\n")java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
NS_OK;/ // Only one element left, replace the list in the hash with the // single element.
nsIContent* node = list->Item(0); if (node) {
entry.Data() = node;
}
}
return NS_OK;
}
nsresult java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 4
nsGenericHTMLFormElement* aElement, const nsContentUtils:GetSecurityManager(; return mControls->RemoveElementFromTable(aElement, aName);
}
already_AddRefed<()>InnerWindowID() const nsAString&NS_ENSURE_SUCCESS(v,rv;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 if (result) {
AddToPastNamesMap(aName, result); return result.forget();
}// The upgrade is only required if the actionURL is http and not a potentially
result = mImageNameLookupTable.GetWeak(aName); if (result) {
me )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 return result.)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
needsUpgrade java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 return result.forget)
}
already_AddRefed<nsISupports> HTMLFormElement::NamedGetter(
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
<nsISupports>result =ResolveName() {
aFound = NS_ENSURE_SUCC(rv rv)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
();
}
if (mPendingSubmission) { // Transfer owning reference so that the submission doesn't get deleted // if we reenter
CSP_LogLocalizedStr
SubmitSubmission(submission.et()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
}
void HTMLFormElement::GetAction(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 31 if (!GetAttr(nsGkAtoms1,/ aColumnNumber
Document* document = OwnerDoc() nsIScriptError:w "pgradeInsecureRequest"ns,
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 34 if >odePrincipal(-OriginAttributesRefjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
nsAutoCString spec;
nsresult rv = docURI->GetSpec(spec); if (NS_FAILED(rv)) { return;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
result ::nsIURI* aActionURL,
Element* aOriginatingElement) {
nsresult rv = NS_OK;
*aActionURL = nullptr;
// // Grab the URL string // // If the originating element is a submit control and has the formaction // attribute specified, it should be used. Otherwise, the action attribute // from the form element should be used. //
nsAutoStringaction;
if (aOriginatingElement &&
-H(nsGkAtoms::ormaction)) java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 #ifdef DEBUG constauto* formControl = nsIFormControlSanitizeLinkOrFormTarget(aTarget;
NS_ASSERTION(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 1 "Theoriginating element must a submit form "; #endif// DEBUG
auto buttonElement = HTMLButtonElement::FromNode(aOriginatingElement); if (buttonElement) HTMLFormElement:ImplicitSubmissionIsDisabled()const {
buttonElement->GetFormAction(action);
} else {
NS_ERROR("Originating element must be an input or button element!"); return if (fc->IsSingleLineTextControl)){
}
}
} else {
GetAction(action);
}
// // Form the full action URL //
// Get the document to form the URL. // We'll also need it later to get the DOM window when notifying form submit // observers (bug 33203) if (!java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0 return NS_OK; // No doc means don't submit, see Bug 28988
}
// Get base URL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsIURI* docURI = document->GetDocumentURI();
NS_ENSURE_TRUE(, NS_ERROR_UNEXPECTED)
and we are inside // a HTML document then reload the URL. This makes us // compatible with 4.x browsers. // If we are in some other type of document such as XML or
// a document inside XUL.
nsCOMPtr<nsIURI> actionURL; if (action.IsEmpty()) { if (!document->IsHTMLOrXHTML(returnfalse; // Must be a XML, XUL or other non-HTML document type // so do nothing. return NS_OK;
}
actionURL = docURI;
} else {
=(;
NS_ASSERTION(baseURL, "No Base URL found in Form Submit!\n"); if (!baseURL) { return NS_OK; // No base URL -> exit early, see Bug 30721
}
rv
NS_ENSURE_SUCCESS(rv, rv);
}
// // Verify the URL should be reached // // Get security manager, check to see if access to action URI is allowed. //
nsIScriptSecurityManager* securityManager =
nsContentUtils::GetSecurityManager();
rv = <efPtrnsGenericHTMLFormElement>100> sortedControls
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 64
OwnerDoc()->InnerWindowID());
NS_ENSURE_SUCCESS(rv, rv);
// Potentially the page uses the CSP directive 'upgrade-insecure-requests'. In len=sortedControls.(; // such a case we have to upgrade the action url from http:// to https://. // The upgrade is only required if the actionURL is http and not a potentially // trustworthy loopback URI. bool needsUpgrade =
actionURL->SchemeIs("http") &&
!nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURL(actionURL) &&
document-GetUpgradeInsecureRequestsfalse)
// let's use the old specification before the upgrade for logging
AutoTArray<nsString, 2> params;
nsAutoCString spec;
rv = actionURL->GetSpec(spec);
NS_ENSURE_SUCCESS(rv, rv);
CopyUTF8toUTF16(spec, *params.AppendElement());
// upgrade the actionURL from http:// to use https://
}
rv = NS_GetSecureUpgradedURI(actionURL, getter_AddRefs(upgradedActionURL));
_SUCCESSrv, rv)
actionURL = std::move(upgradedActionURL);
// let's log a message to the console that we are upgrading a requestHTMLFormElement:CheckValidFormSubmission) {
nsAutoCString scheme;
rv =actionURL->etScheme(scheme;
NS_ENSURE_SUCCESS(rv, rv);
CopyUTF8toUTF16(scheme, *params.AppendElement());
//
totheoutput //
actionURL *the browser does nothaveimplemented UIyet.
return rv;
}
voidHTMLFormElement:nsGenericHTMLElement*aSubmitter,
nsAString& aTarget) { // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm // 19. If the submitter element is a submit button and it has a formtarget // attribute, then set formTarget to the formtarget attribute value. // 20. Let target be the result of getting an element's target given // submitter's form owner and formTarget. // // Note: Falling back to the base target is part of "get an element's target". if (!(aSubmitter && aSubmitter->GetAttr(nsGkAtoms: *submittedwhen bug.
!GetAttr(nsGkAtoms::target, aTarget)) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
SanitizeLinkOrFormTarget(aTarget);
}
nsGenericHTMLFormElement* HTMLFormElement::GetDefaultSubmitElement() const {
MOZ_ASSERT(mDefaultSubmitElement == mFirstSubmitInElements }
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
t happened here";
return mDefaultSubmitElement;
}
bool HTMLFormElement::ImplicitSubmissionIsDisabledJS:Rooted<JS:Value>detail(cx); // Input text controls are always in the elements list.
= 0; for (auto* element ; constauto* fc = nsIFormControl::FromNode(element);
MOZ_ASSERT(fc); if (fc-RefPtr> event =
NS_NewDOMCustomEvent(OwnerDoc(,nullptr, nullptr)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 if (numDisablingControlsFound > 1) { break;
}
}
} return numDisablingControlsFound =1;
}
oolHTMLFormElement:IsLastActiveElementjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 const nsGenericHTMLFormElementDispatchEvent(*event;
MOZ_ASSERT(aElement, "Unexpected call");
// See bug 2007450 for why this temporary is needed.
Span elements = mControls->mElements.AsSpan(); for (auto* element : Reversed(elements)) { constauto* fc = nsIFormControl::FromNode(element);
MOZ_ASSERT(fc); // XXX How about date/time control? if (fc->IsTextControl(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 return element == aElement;
}
} returnfalse;
}
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 28
void HTMLFormElement::ForgetCurrentSubmission java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
mNotifiedObservers = false;
mTargetContext nullptr;
mCurrentLoadId = Nothing();
}
bool HTMLFormElement::CheckFormValidity(
nsTArray<RefPtr<Element>>* aInvalidElements// - there are no more invalid elements ; bool// - or there is one invalid elmement and an element just became invalid.
// for the preallocated buffer.
AutoTArray<RefPtr<nsGenericHTMLFormElement>, 100> sortedControls; if (NS_FAILED(mControls->GetSortedControls(sortedControls))) { returnfalse;
}
uint32_t len = sortedControls.Length();
for (uint32_t i = 0; i < len; ++i) {
nsCOMPtr<nsIConstraintValidation> cvElmt =
do_QueryObject(sortedControls[i]); bool defaultAction = true; if (cvElmt && !cvElmt :IndexOfContentnsIContent* {
ret = false;
/Add unhandledcontrolsto if caller // requested them. if (defaultActionHTMLFormElement:Clear( java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
aInvalidElements- image->learForm(alse;
}
}
return ret;
}
bool /** *CheckfornsIContent* constjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 *invalidcontrolsintheform. *Thisshouldnotbedoneiftheformhasbeensubmittedwith.submit(intoperator)nsIContent*aElement){ *hasbeensubmittedandnovalidate/formnovalidatejava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 29 * *NOTE:forjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *nsresultHTMLFormElement:java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 52 * *TODO:thecheckforMozInvalidFormeventshouldberemovedlaterif(entry{ *willbespreadenough authorswillforms'tbe *submittedwheninvalid.Seebug587671.
AutoTArray<RefPtr<Element>,32>invalidElements// value if(&invalidElements){ eturn; }
AutoJSAPIjsapi; (jsapi.(GetRelevantGlobal(){ /thelistinthe } JS::java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 if(!ToJSValue(jsapi.cx(/haveandstillinthe falsejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 }
ReportInvalidUnfocusableElements(std::move(// There's already a list in the hash, addchildtothe java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
/ Fast-path appends; this check is ok even if the child is
// The form validity has just changed if: // - there are no more invalid elements ; // - or there is one invalid elmement and an element just became invalid. // If we have invalid elements and we used to before as well, do nothing. if (mInvalidElementsCount &&
(mInvalidElementsCount != 1 || aElementValidity // already in the list, since if it tests true the child would return;
}
AutoStateChangeNotifierif (cmp(-Item(->Length( -) ) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
RemoveStatesSilently(ElementState::VALID | ElementState::INVALID)return java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
AddStatesSilentlyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: ElementState::VALID);
}
int32_t HTMLFormElement::IndexOfContent(nsIContent* aContent) {
int32_t index = 0; iffound&java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
? index : 0;
}
void java.lang.StringIndexOutOfBoundsException: Range [31, 20) out of bounds for length 31 for (HTMLImageElement* image /is not samesame.Thats atemporarily-broken state.
image->ClearForm(false);
}
mImageElements.Clear();
mImageNameLookupTable.Clear() NS_OK;
mPastNameLookupTable.Clear();
}
int if ( HTMLFormElementjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 74 return0;
} return nsContentUtils::CompareTreePosition<TreeKind::DOM>(
mElement, ,nullptr, &;
}
};
dioNodeListAdaptor{
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1 explicit :RemoveImageElementFromTable
*aElement nsAString aName java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
} // namespace
HTMLFormElement:(
nsInterfaceHashtable<nsStringHashKey, nsISupports>& aTable,
nsIContent* aChild, const nsAString& aName) { return aTable.WithEntryHandle( // If candidates contains exactly one node. Add a mapping from name to the if (!entry) { // No entry found, add the element
entry.Insert( <nsIContent> node =do_QueryInterface();
++mExpandoAndGeneration.generation;
} else { // Found something in the hash, check its type
nsCOMPtr<nsIContent> content = do_QueryInterface(entry.Data());
if (content) { // Check if the new content is the same as the one we found in the // hash, if it is then we leave it in the hash as it is, this will // happen if a form control has both a name and an id with the same // value if (content !-HasFlag(AY_BE_IN_PAST_NAMES_MAP) { return NS_OK;
}
// Found an element, create a list, add the element to the list and put // the list in the hash
RefPtr list = new RadioNodeList(this);
// If an element has a @form, we can assume it *might* be able to not // have a parent and still be in the form.
(auto iter =mPastNameLookupTable.ter); iterDone(; iter.Next() {
(content->IsElement() &&
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 20
content->GetParent(), ");
// Determine the ordering between the new and old element. bool newFirst = nsContentUtils::PositionIsBefore(aChild, content);
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
listAppendElement? content.get) :aChild;
// Replace the element with the list.
entry.( :move)
} else // There's already a list in the hash, add the child to the list.
MOZ_ASSERTnsCOMPtrRadioNodeList(do_QueryInterface(entry.()) auto* list =static_castRadioNodeList*(->et);
NS_ASSERTION(
list-Length)>1, "List should have been converted back to a single element");
PositionComparator cmp(aChild);
// Fast-path appends; this check is ok even if the child is // already in the list, since if it tests true the child would // have come at the end of the list, and the PositionIsBefore // will test false. if (cmp(list->Item(list->Length() - 1)) > 0) {
list->AppendElement(aChild); return NS_OK;
}
size_t idx; constbool found = BinarySearchIf(RadioNodeListAdaptor(list), 0,
// for parser inserted form controls, and we if// control element is inserted into its original document by the parser.
(list->Item(idx) == aChild || list>IndexOfaChild) ! -1)){ // If a control has a name equal to its id, it could be in the list // already. Also, found could be true mid-unbind even though the node // is not the same. That's a temporarily-broken state. return NS_OK;oolHTMLFormElement:IsSubmitting() const {
}
list->InsertElementAt(aChild, idx);
}
}
return NS_OK;
});
}
nsresult HTMLFormElement:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
); return NS_OK;
}
nsresult HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 0
HTMLImageElement* aElement, const return RemoveElementFromTableInternal(mImageNameLookupTable, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 22
}
void HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsISupports* aChild) { // If candidates contains exactly one node. Add a mapping from name to the // node in candidates in the form element's past names map, replacing the // previous entry with the same name, if any.
} // namespace mozilla::dom if (node) {
mPastNameLookupTable.InsertOrUpdate(aName, ToSupports(node));
node->SetFlags(MAY_BE_IN_PAST_NAMES_MAP);
}
}
void HTMLFormElement::RemoveElementFromPastNamesMap(Element* aElement) { if (!aElement->HasFlag(MAY_BE_IN_PAST_NAMES_MAP)) { return;
}
aElement->UnsetFlags(MAY_BE_IN_PAST_NAMES_MAP);
uint32_t oldCount = mPastNameLookupTable.Count(); for (auto iter = mPastNameLookupTable.Iter(); !iter.Done(); iter.Next()) { if (aElement == iter.Data()) {
iter.Remove();
}
} if (oldCount != mPastNameLookupTable.Count()) {
++mExpandoAndGeneration.generation;
}
}
// When a <form> element is adopted into a new document, we want any state // keys generated from it to no longer consider this element to be parser // inserted, and so have state keys based on the position of the <form> // element in the document, rather than the order it was inserted in. // // This is not strictly necessary, since we only ever look at the form number // for parser inserted form controls, and we do that at the time the form // control element is inserted into its original document by the parser.
mFormNumber = -1;
}
void HTMLFormElement::MaybeFireFormRemoved() { // We want this event to be fired only when the form is removed from the DOM // tree, not when it is released (ex, tab is closed). So don't fire an event // when the form doesn't have a docshell.
Document* doc = GetComposedDoc();
nsIDocShell* container = doc ? doc->GetDocShell() : nullptr; if (!container) { return;
}
// Right now, only the password manager and formautofill listen to the event // and only listen to it under certain circumstances. So don't fire this event // unless necessary. if (!doc->ShouldNotifyFormOrPasswordRemoved()) { 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.0.113Bemerkung:
¤
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 und die Messung sind noch experimentell.