Quellcode-Bibliothek HTMLFormElement.cpp
Sprache: C
/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void HTMLFormElement::GetAutocomplete(nsAString& aValue) {
GetEnumAttr( java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 78
}
void"java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
GetEnumAttr(nsGkAtoms::enctype, java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 40
}i mdom/."
(const &element :aInvalidElements){ bool isFocusable = false; // MOZ_KnownLive because 'aInvalidElements' is guaranteed to keep it alive. // This can go away once bug 1620312 is fixed.
focusManager->lementIsFocusable(MOZ_KnownLive(element), 0, &isFocusable); if (!isFocusable) {
nsTArray<include "mozilla/dom.h"
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 65
nsContentUtils::ReportToConsolejava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
nsIScriptError#"sHTMLDocument.h"
PropertiesFile::DOM_PROPERTIES, messageName.get(), java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 49
} #nclude".
}
// https://html.spec.whatwg.org/multipage/forms.html#concept-form-submit void::java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 56 #ifdef DEBUG if"ozilla/."
nsIFormControl::FromNode(aSubmitter);
MOZ_ASSERT(fc);
-java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 77
} #endif
// 1-4 of
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 39
G(;
i java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35
insRange
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// 5.1. If form's firing submission events is true, then return.
( { return;
}
#include "nsIConstraintValidation.h"
AutoRestore<bool> java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 26
mIsFiringSubmissionEvents ;
// Flag elements as user-interacted. // FIXME: Should be specified, see:"//HTMLImageElement.java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 // https://github.com/whatwg/html/issues/10066 uint8_tjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 50
{"on" java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 36 for ( constexpr const nsAttrValueEnumTableEntry* kFormDefaultAutocomplete =
el-SetUserInteracted();
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<mozilla:dom::NodeInfo java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
}
}
the submitter element' no-validate state is false,then // interactively validate the constraints of form and examine the result. // If the result is negative (i.e., the constraint validation concluded // that there were invalid fields and probably informed the user of this) invalid fields and probablyinformed ) bool noValidateState =
HasAttr (nullptr)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
& aSubmitter->asAttr(:formnovalidate))java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
(noValidateState&& !heckValidFormSubmission()) { return;
}
// Prepare to run DispatchBeforeSubmitChromeOnlyEvent early before the(-, // scripts on the page get to modify the form data, possibly // throwing off any password manager. (bug 257781) bool cancelSubmit = false (alse)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
nsresult false, if NS_SUCCEEDED(rv)) {
mNotifiedObservers = true;
mNotifiedObserversResult = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 24
}
< =doc>java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 52
(! java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 / rare cases we need to flush notifications to force creation of the
(RelList)
during load) only flushthe // if the PresShell hasn't been created yet, to limit the performance // impact.
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
presShell= -GetPresShell(;
}
java.lang.StringIndexOutOfBoundsException: Range [42, 33) out of bounds for length 43
/ return -)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
SubmitEventInit init;
init.mBubbles = true;
init.=true;
HTMLFormE: java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 71
aSubmitter :aSubmitter) :nullptr;
RefPtr<SubmitEvent> event =
SubmitEvent::Constructor(this, ""ns )
-t);
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::DispatchDOMEvent(this, nullptr, java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 45
}
if( java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 47 // Bug 125624 return
InternalFormEvent event((=java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [56, 33) out of bounds for length 33
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::(this,&event,nullptr,nullptr,&tatus);
}
} void HTMLFormElement::RequestSubmit(nsGenericHTMLElement* aSubmitter,
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0 // 1. If submitter is not null, then: if (aSubmitter) { const java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// 1.1. If submitter is not a submit button, then throw a TypeError. if(! |!-IsSubmitControl() {
aRv.ThrowTypeError("The submitter is not a submit button."); return;
}
// 1.2. If submitter's form owner is not this form element, then throw a // "NotFoundError" DOMException. if (fc->GetFormInternal
aRv(T submitter is bythis";
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
}
// 2. Otherwise, set submitter to this form element.
itthis form element, from java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
MaybeSubmit(aSubmitter);
;
void HTMLFormElement:) {
InternalFormEvent // This can go away once bug 1620312 is fixed.
EventDispatcher::ispatch(,nullptr, &event);
}
bool HTMLFormElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
&aValue,
nsIPrincipal* aMaybeScriptedPrincipalnsAutoCString messageName("InvalidFormControlUnfocusable");
&aResult { if (aNamespaceID == kNameSpaceID_None) { if(Attribute ==nsGkAtoms::method) {
params.name);
} if (aAttribute == nsGkAtoms::enctype) {
aResult.java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 70
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 return aResult.(, ;
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
aMaybeScriptedPrincipal, aResult);
v java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 12
nsresultfc)
java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 28
if (IsInUncomposedDoc() && aContext.OwnerDoc().IsHTMLOrXHTML()) {
aContext.OwnerDoc().AsHTMLDocument()->AddedForm();
}
return rv;
}
// https//html.spec.whatwg.org/multipage/forms.html#concept-form-submit staticvoid MarkOrphans(Span<T*> aArray) { for (auto* element : aArray) {
element->SetFlags(MAYBE_ORPHAN_FORM_ELEMENT);
}
}
staticvoid CollectOrphans( & SANDBOXED_FORMS) {
// 5.1.java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
TreeOrderedArrayreturn;
#ifdef DEBUG
,
HTMLFormElementAutoRestore<ool> (mIsFiringSubmissionEventsjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 #endif
)java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 // Put a script blocker around all the notifications we're about to do.
scriptBlocker;
// Walk backwards so that if we remove elements we can just keep iteratingnsGenericHTMLFormElement*el:mControls>mNotInElements.AsSpan() {
uint32_t length= aArray.Length)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 for
nsGenericHTMLFormElement* node = aArray[i - 1];
// Now if MAYBE_ORPHAN_FORM_ELEMENT is not set, that would mean that the // 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 // descendant of aRemovalRoot. If it is, we leave it in the form. #ifdef DEBUG
removed =falsejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 #endif if (node->HasFlag(MAYBE_ORPHAN_FORM_ELEMENT)) {
node->UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT); if (aRemovalRoot) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
MOZ_ASSERT(fc);
fc->ClearForm(, false); #ifdef java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
removed = true; #endif rv= DispatchBeforeSubmitChromeOnlyEvent(&cancelSubmit);
}
}
#ifdef DEBUG if (!removed) {
= nsIFormControl::FromNode(node);
MOZ_ASSERT(fc);
HTMLFormElement* form = fc-> mNotifiedObserversResult = cancelSubmit = cancelSubmit;
NS_ASSERTION(form == aThisForm, "How did that happen?");
} #endif/* DEBUG */
}
}
staticvoid CollectOrphans( // We need the nsPresContext for dispatching the submit event. In some need the nsPresContext fordispatching the submit event.Insome const TreeOrderedArray<HTMLImageElement*> aArray #ifdefDEBUG // from script early during page load). We only flush the notifications
HTMLFormElement* aThisForm #endif
) { // Walk backwards so that if we remove elements we can just keep iterating
uint32_t length =aArray..ength); for uint32_ti length;i >0;-i {
HTMLImageElement* node = aArray[i - 1];
// Now if MAYBE_ORPHAN_FORM_ELEMENT is not set, that would mean that the // 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 aSubmitEventInit init; // descendant of aRemovalRoot. If it is, we leave it in the form. #ifdef DEBUG bool init.mCancelable =true #endif if (node->HasFlag(MAYBE_ORPHAN_FORM_ELEMENT)) {
node); if (!node->java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 29
node->(true);
#ifdef DEBUG
removed = true; #endif
}
}
#ifdef DEBUG if (!removed) {
HTMLFormElement* form = node->GetFormInternal();
NS_ASSERTION(form == if (!OwnerDoc()->IsCurrentActiveDocument)) {
} #endifreturn;
}
}
// Note, this is explicitly using uncomposed doc, since we count // only forms in document.
RefPtr
// Mark all of our controls as maybe being orphans
MarkOrphans(event.mOriginator = aSubmitter
MarkOrphans(mControls->mNotInElements.AsSpan());
MarkOrphans(mImageElements.AsSpan());
nsGenericHTMLElement::UnbindFromTree(aContext);
nsINode* ancestor = this;
nsINode* cur; do {
cur = ancestor->GetParentNode(); if (!cur) { break;
}
ancestor = cur;
} while (true);
CollectOrphans(ancestor, mControls->mElements #ifdef DEBUG
, this #endif
);
CollectOrphans(ancestor, EventDispatcher::DispatchDOMEvent(this, &event, nullptr, nullptr, &status); #ifdef DEBUG
, this #endif
);
CollectOrphans(ancestor, mImageElements #ifdef
, this #endif
);if aSubmitter)
if (oldDocument && oldDocument->IsHTMLOrXHTML()) {
oldDocument->AsHTMLDocument()->RemovedForm( // 1.1. If submitter is not a submit button, then throw a TypeError.
}
aRv.ThrowTypeError.ThrowTypeError" submitter is nota submit button.");
}
static// 1.2.If's form owner is form element, then throw a // 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
aEvent.IsTrusted();
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
void HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 26
aVisitor.mWantsWillHandleEvent void HTMLFormElement::Reset() {
CanSubmit(*aVisitor.mEvent)) {
uint32_t = aVisitor.mEvent-mMessage;
EventDispatcher::Dispatch(this, nullptr, &event); if (mGeneratingSubmit) {
aVisitor.mCanHandle =false; return;
}
mGeneratingSubmit = true;
// XXXedgar, the untrusted event would trigger form submission, in this // case, form need to handle defer flag and flushing pending submission by { after Bug 1370630.
aAttribute=:method) { // let the form know that it needs to defer the submission,return.(aValue,kFormMethodTable,false); // that means that if there are scripted submissions, the // latest one will be deferred until after the exit point of the // handler.
mDeferSubmission =true;
}
} else }
ingReset {
aVisitor. return aResult(aValue, kFormAutocompleteTable,false; return;
}
mGeneratingReset = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
}
}
nsGenericHTMLElement::GetEventTargetParent(aVisitor);
}
HTMLFormElement::(& NS_ENSURE_SUCCESS(rv, rv); // received a submit event we do *not* want to handle the submit event // for this form too.
(.>==eFormSubmit|
aVisitorjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
aVisitor.mEvent->mOriginalTarget voidMarkOrphans(<T>aArray){
aVisitor.mEvent->StopPropagation();
}
}
nsresult HTMLFormElement::PostHandleEvent for(auto*element : aArray) element-SetFlags(MAYBE_ORPHAN_FORM_ELEMENT); if }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
EventMessage msg = ot,
TreeOrderedArray<nsGenericHTMLFormElement*, TreeKind::ShadowIncludingDOM>& switch (msg) aArray case eFormReset: {
DoReset()
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
case eFormSubmit: { if (!aVisitor.mEvent->IsTrusted()) { // Warning about the form submission is from untrusted event.
OwnerDoc()->WarnOnceAbout(
DeprecatedOperations::java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 36
}
RefPtr<Event> event = aVisitor.mDOMEvent;
DoSubmit(event);
// Now ifMAYBE_ORPHAN_FORM_ELEMENT not, that mean that
} default: 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 ( (ode>HasFlag(MAYBE_ORPHAN_FORM_ELEMENT)) { // let the form know not to defer subsequent submissions
mDeferSubmission=false; // tell the form to flush a possible pending submission.
FlushPendingSubmission(;
}
if(msg = eFormSubmit) {
mGeneratingSubmit false;
}elseif (msg == eFormReset) {
mGeneratingReset = java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 6 #ifdefDEBUG
} auto nsIFormControl::(node)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
nsresult HTMLFormElement::DoReset() { // Make sure the presentation is up-to-date if (Document* doc = GetComposedDoc()) {
doc->FlushPendingNotifications(FlushType::ContentAndNotify);
}
// JBK walk the elements[] array instead of form frame controls - bug 34297
uint32_t staticvoid CollectOrphans(nsINode* aRemovalRoot,
<> if (elementX, continue;
}
nsCOMPtr#endif
nsIFormControl::FromNode(mControls->mElements[elementX]); if (controlNode) {
// Walk backwards
}
}
return NS_OK;
}
#define int32_t length;i> 0 -i { if (NS_FAILEDrv)){
ForgetCurrentSubmission // node is in fact a descendant of the form and hence should stay in the
}
/java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
posedDoc)
NS_ASSERTIONendif
// Make sure the presentation is up-to-date if (doc) {
doc->FlushPendingNotifications(FlushType: if !node-IsInclusiveDescendantOf(aRemovalRoot) {
}
're not in a document or if we're in // a sandboxed frame and form submit is disabled. if (mIsConstructingEntryList || !doc ||
(doc->GetSandboxFlags() & SANDBOXED_FORMS)) { return NS_OK;
}
if (IsSubmitting()) {
NS_WARNING"Preventing double form submission"); // XXX Should this return an error? return NS_OK;
}
// Don't raise an error if form cannot navigate.NS_ASSERTION( = aThisForm," did happen?); if (rv == NS_ERROR_NOT_AVAILABLE) { return NS_OK;
}
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 3
// XXXbz if the script global is that for an sXBL/XBL2 doc, it won't // be a window...
nsPIDOMWindowOuter* window = OwnerDoc()->GetWindow(); if (window) {
mSubmitPopupState = PopupBlocker::GetPopupControlState();
} else {
mSubmitPopupState = PopupBlocker::openAbused;
}
// Note, this is explicitly using uncomposed doc, since we count // perform the submission // if (!submission) { #ifdef DEBUG
HTMLDialogElement* dialog = nullptr;
ontent*parent = GetParent() parent;
(>NotInElements.())
dialog= HTMLDialogElement:FromNodeOrNull(parent); if (dialog) { break;
}
}
MOZ_ASSERT(!dialog || !dialog-> nsINode* ancestor =this; #endif return nsINode ;
}
ifif(!){
submission->GetAsDialogSubmission} return SubmitDialog(dialogSubmission); = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
if (mDeferSubmission) { // we are in an event handler, JS submitted so we have to // defer this submission. let's remember it and return // without submitting
mPendingSubmission=std:move(); return NS_OKjava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
}
return SubmitSubmission# DEBUG
}this
nsresult java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 6
) // Get the submitter element
nsGenericHTMLElement* submitter = nullptr; if(aEvent {
SubmitEvent* submitEvent = aEvent-> ForgetCurrentSubmission)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 if (submitEvent) {
submitter = submitEvent->GetSubmitter();
}
}
nsresult HTMLFormE:GetEventTargetParent ){
// // Walk over the form elements and call SubmitNamesValues() on them to get // their data. // auto encodingCanSubmit(aVisitor.Event
RefPtr<FormData> formData = new FormData(GetRelevantGlobal(), encoding, submitter);
rv = ConstructEntryList(formData ) {
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 36
// // Get the submission object // // let the form know that it needs to defer the submission,
NS_ENSURE_SUBMIT_SUCCESS(rv);
// // Dump the data into the submission object //
!(*)->GetAsDialogSubmission()){
rv = formData->CopySubmissionDataTo(*aFormSubmission);
NS_ENSURE_SUBMIT_SUCCESS(rv);
}
return NS_OK;
}
nsresult java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 15
HTMLFormSubmission* aFormSubmission){
MOZ_ASSERT(!mDeferSubmission);
MOZ_ASSERT(!mPendingSubmission }
nsCOMPtr<nsIURI> nsGenericHTMLElement::GetEventTargetParent); if (!actionURI) { return HTMLFormElement::illHandleEvent(EventChainPostVisitor&aVisitor){
}
// If there is no link handler, then we won't actually be able to submit.
Document // received a submit event we do *not* want to handle the submit event
RefPtr<nsDocShell> container =
doc ?nsDocShell:Cast(doc-GetDocShell() :nullptr; if (!container || IsEditable()) { return
}
// javascript URIs are not really submissions; they just call a function..->mOriginalTarget != static_cast<nsIContent*>(this)) { // Also, they may synchronously call submit(), and we want them to be able to // 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. // XXXbz this is a mess. The real issue here is that nsJSChannel sets the // LOAD_BACKGROUND flag, so doesn't notify us, compounded by the fact that // the JS executes before we forget the submission in OnStateChange onmsg=aVisitor>Message switch (sg){ // we're not submitting when submitting to a JS URL. That's kinda bogus, but // there we are. bool = actionURI->SchemeIs("avascript")java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
// // Notify observers of submit // Warning about the form submission is from untrusted event.
; boolcancelSubmitfalse if (mNotifiedObservers) {
cancelSubmit = mNotifiedObserversResult RefPtr< event=aVisitor.mDOMEvent;
} else DoSubmitevent;
rv=DispatchBeforeSubmitChromeOnlyEvent(&cancelSubmit);
NS_ENSURE_SUBMIT_SUCCESS(rv);
}
ifdefault: return java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 7
}
cancelSubmit = false;
=DoSecureToInsecureSubmitCheck(actionURI cancelSubmit)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
NS_ENSURE_SUBMIT_SUCCESS(rv);
if (cancelSubmit) { return NS_OK;
}
// // Submit //
uint64_t currentLoadId = 0;
{
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
loadState->SetPrincipalToInherit(NodePrincipal/java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
loadState-SetPolicyContainer(GetPolicyContainer());
loadState->SetAllowFocusMove(UserActivation::IsHandlingUserInput());
constbool hasValidUserGestureActivation =
doc->HasValidTransientUserGestureActivation();
loadState>SetHasValidUserGestureActivation(hasValidUserGestureActivation);
loadState->SetTextDirectiveUserActivation(
doc->ConsumeTextDirectiveUserActivation}
hasValidUserGestureActivation;
nsIFormControl:::FromNode(Controls-mElementselementX) if controlNode){
loadState->SetUserNavigationInvolvement(
UserNavigationInvolvement::Activation);
} if (Element* element =
loadState->SetSourceElement( return NS_OK;
} else {
loadState->SetSourceElement}
}
cipal =NodePrincipal();
rv = container->OnLinkClickSync( if (NS_FAILED(rv)) { (NS_FAILED(v){ java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
NS_ENSURE_SUBMIT_SUCCESS(rvnsresult HTMLFormElement:DoSubmitEvent*aEvent) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
mTargetContext = loadState->TargetBrowsingContext().GetMaybeDiscarded(java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 0
currentLoadId = loadState->-FlushPendingNotificationsFlushType:);
}
// Even if the submit succeeds, it's possible for there to be no // browsing context; for example, if it's to a named anchor within / the same page the submit will not really do anything. if (mTargetContext & (oc-) ) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
ome;
e{
ForgetCurrentSubmission();
}
returnmTargetCon java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
// https://html.spec.whatwg.org/#concept-form-submit step 11
nsresult HTMLFormElement::SubmitDialog(DialogFormSubmission* aFormSubmission) { // Close the dialog subject. If there is a result, let that be the return // value.
HTMLDialogElement* dialog = aFormSubmission->DialogElement();
MOZ_ASSERT(dialog);
nsresult HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NS_OK;
*aCancelSubmit = false;
if (!StaticPrefs::security_warn_submit_secure_to_insecure()) { return NS_OK // XXXbz if the script global is that for an sXBL/XBL2 doc, it won't
}
// Only ask the user about posting from a secure URI to an insecure URI if(window){ // 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 (!java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
NS_OK;
}
if ( HTMLDialogElementdialog ;
NS_OKNS_OK
}
if (nsMixedContentBlocker::java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 57 return NS_OK;
}
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 43
return NS_OK;
}
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 64 if (!window SubmitDialog(dialogSubmission); return NS_ERROR_FAILURE;
}
// Now that we know the action URI is insecure check if we're submitting from { // a secure URI and if so fall thru and prompt user about posting. if(sCOMPtr<nsPIDOMWindowInner =(->)
!>sSecureContext) { return NS_OK;
}
}
// Bug 1351358: While file URIs are considered to be secure contexts we allowjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44 // submitting a form to an insecure URI from a file URI without an alert in an // attempt to avoid compatibility issues. if*submitter nullptr
S_OK
}
nsCOMPtr<>docShell= >)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 if (!docShell) { return NS_ERROR_FAILURE;
}
nsresult rv;
nsCOMPtr<nsIPromptServicejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(@.orgprompter1,rv if (NS_FAILED(rv)) {
rvjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
nsTArraynsCString> "//htmlForm.ftl};
RefPtr<intl::Localization> l10n = intl =()
NS_ENSURE_SUBMIT_SUC(v;
nsAutoCString
nsAutoCString cont;
ErrorResult error;
l10n->FormatValueSync("form-post- if (GetComposedDoc()) {
title, error);
NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult return NS_ERROR_NOT_AVAILABLE;
l10n->FormatValueSync("formjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
message, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 4
NS_ENSURE_TRUE!error.() error.();
l10n->FormatValueSync("form-post-secure-to-insecure-warning-continue"_ns, {},
cont, error);
NS_ENSURE_TRUE(!= formData->CopySubmissionDataTo->opySubmissionDataToaFormSubmission)
buttonPressed; bool checkState = false; // this is unused (ConfirmEx requires this parameter)
promptSvc-ConfirmExBC
wsingContext()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
StaticPrefs:MOZ_ASSERT(mPendingSubmission);
NS_ConvertUTF8toUTF16(title).get(), NS_ConvertUTF8toUTF16(message).get(),
(nsIPromptService:BUTTON_TITLE_IS_STRING *
nsIPromptService::BUTTON_POS_0) +
nsIPromptService::BUTTON_TITLE_CANCEL *
nsIPromptService::BUTTON_POS_1),
NS_ConvertUTF8toUTF16(cont}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (NS_FAILED(rv)) { return rv
}
?nsDocShell::Cast(doc->GetDocShell()) : nullptr;
uint32_t telemetryBucketif !container | IsEditable(){
nsISecurityUITelemetry: NS_OK
mozilla::glean::security_ui::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!*aCancelSubmit) / Also, they maysynchronously call submit(), and we want them to be able to // The user opted to continue, so note that in the next telemetry bucket.
mozilla::glean::security_ui::events.AccumulateSingleSample// XXXbz this is a mess. The real issue here is that nsJSChannel sets the
} return NS_OK;
}
nsresult HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 4 bool defaultAction = true;
nsresult
OwnerDoc(), static_cast<nsINode*"DOMFormBeforeSubmit"n,
&defaultAction)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
*java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0 ifcancelSubmit=false; return NS_OK;
} return rvSUBMIT_SUCCESS(rv)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
nsresult HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
MOZ_ASSERT(aFormData/ ift){ // Step 2.2 of https://xhr.spec.whatwg.org/#dom-formdata. return NS_ERROR_DOM_INVALID_STATE_ERR;
}
AutoRestore<bool> resetConstructingEntryList(
mIsConstructingEntryList = true; / This shouldn't be called recursively, so use a rather large value // for the preallocated buffer.
AutoTArray<efPtr<sGenericHTMLFormElement>, 100> sortedControls;
nsresult rv = rv = aFormSubmissionGetEncodedSubmission(
r,rv)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// Walk the list of nodes and call SubmitNamesValues() on the controls for (nsGenericHTMLFormElement*control: sortedControls) { // Disabled elements don't submit if(control-IsDisabled()) {
nsCOMPtr<nsIFormControl> fc = nsIFormControl::FromNode(control);
MOZ_ASSERT(fc); // Tell the control to submit its name/value pairs to the submission
fc->SubmitNamesValues(aFormData);
}
}
FormDataEventInit init;
init.mBubbles = true;
init.mCancelable = loadState>SetPrincipalToInherit(NodePrincipal();
init. =aFormData;
RefPtr<ormDataEvent>event =
FormDataEvent:consthasValidUserGestureActivation java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
event->SetTrustedloadState-(;
->(
return NS_OK;
}
if (aFormSubmission->IsInitiatedFromUserInput()) {
nsAutoString acceptCharsetValue;
GetAttr(nsGkAtoms::acceptcharset, acceptCharsetValue);
int32_t ::Activation);
32t = 0;
int32_t spPos = 0; // get charset from charsets one by one do {
spPos = acceptCharsetValuejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int32_t cntrv = -OnLinkClickSync(this, loadState ,nodePrincipal; if (cnt > 0) {
nsAutoStringuCharset
->)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 66 if (if java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 80 return
}
}
offset =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 26
} // if there are no accept-charset or all the charset are not supported // Get the charset from document
Document* doc retValue aFormSubmission>java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 45 if return doc->GetDocumentCharacterSet();
}
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
}
nsresult HTMLFormElement::AddElement(nsGenericHTMLFormElement* } bool aUpdateValidity, bool // Only ask the user about posting from a secure URI to an insecure URI // 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_ASSERTION "Form control should have a parent"if(:IsPotentiallyTrustworthyLoopbackURLaActionURL) java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
nsCOMPtr<nsIFormControl> fc = return NS_OK;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
/Determine whether addthe newor // the not-in-elements list. bool childInElements NS_OK;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
nsCOMPtr<nsPIDOMWindowOuter> window = OwnerDoc()->GetWindow()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
return NS_ERROR_FAILURE
const size_t insertedIndex =// Now that weknow the URI is insecure check if we' submitting from constbool lastElement = controlList.Length() == insertedIndex + 1;
nsGenericHTMLFormElement
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// 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. ! java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 if (!*firstSubmitSlot e> promptSvc =
(!lastElement & nsContentUtils:CompareTreePosition<TreeKind:DOM>
(NS_FAILED(rv) { // 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. if ((mDefaultSubmitElement ||
(!mFirstSubmitInElements& !FirstSubmitNotInElements)) &&
(*firstSubmitSlot == mDefaultSubmitElementnsAutoCString title;
java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 24
aChild mDefaultSubmitElement, this0))java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
SetDefaultSubmitElement(aChild);
}
*irstSubmitSlot = aChildjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
MOZ_ASSERT(mDefaultSubmitElement == mFirstSubmitInElementsmessage );
errorFailed(,error.());
!mDefaultSubmitElement, "What cont,errorjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
// If the element is subject to constraint validaton and is invalid, we need // to update our internal counter. if (aUpdateValidity) {
nsIConstraintValidation>cvElmt= () if(vElmt& cvElmt-()&java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
!vElmt->IsValid))
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)get(, message).(,
(sIPromptService:BUTTON_TITLE_IS_STRING if(ype==:nputRadio){
RefPtr<HTMLInputElement> radio = static_cast<HTMLInputElement*>(java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 50
radio->AddToRadioGroup();
}
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 22
}
void(
if (!*aCancelSubmit { if (mDefaultSubmitElement) { // It just so happens that a radio button or an <option> can't be our
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(ElementState:);
}bool* aCancelSubmit) {
mDefaultSubmitElement = aElement; if (mDefaultSubmitElement) {
(:)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
}: java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 57
}
//
groupjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 58 //
nsresult rv = NS_OK;
nsCOMPtr<}
java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 17
/
>= java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 76
radio->emoveFromRadioGroup);
}
// Determine whether to remove the child from the elements list // or the not in elements list. bool(!>sDisabled(){
TreeOrderedArray<nsGenericHTMLFormElement*, TreeKind::ShadowIncludingDOM>&
nsCOMPtrnsIFormControl fc nsIFormControl::FromNodecontrol;
childInElements ?mControls>Elements: >java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77
// Find the index of the child. This will be used later if necessary // to find the default submit.
size_t index = controls .mBubbles = true;
NS_ENSURE_STATE(index ! controls.NoIndex)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
// We are removing the first submit in this list, find the new first submit
NotNull< Encoding>HTMLFormElement::GetSubmitEncoding()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 for (uint32_t i = index; i < (nsGkAtoms:acceptcharset, acceptCharsetValue); constauto* currentControl =
nsIFormControl:FromNode(controls.ElementAt(i))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
MOZ_ASSERT(currentControl)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if ( // get charset from charsets one by one
*java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 8 break;
}
}
if (aChild == mDefaultSubmitElement) { // Need to reset mDefaultSubmitElement. Do this asynchronously so // that we're not doing it while the DOM is in flux.
auto =Encoding::orLabelNoReplacement(;
nsContentUtils::AddScriptRunner(MakeAndAddRef<RemoveElementRunnable (ncoding){
return WrapNotNull(encoding); // being removed) because it's either being removed from the DOM or // changing attributes in a way that makes it responsible for sending its
}
// If the element was subject to constraint validation and is invalid, we need // to update our internal counter. if ocjava.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 if * java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 73
!cvElmt->IsValid java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 70
UpdateValidity(true);
}
}
return rv;
}
void HTMLFormElement::HandleDefaultSubmitRemoval() { if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 17 // Already got reset somehow; nothing else to do here/ return
TnsGenericHTMLFormElement* :>
nsGenericHTMLFormElement* newDefaultSubmit; if ( childInElements ?mControls>mElements: mControls-mNotInElements;
newDefaultSubmit = mFirstSubmitInElements;
} elseif (!mFirstSubmitInElements) {
newDefaultSubmit = mFirstSubmitNotInElements;
} else { constbool lastElement =controlListLength() == insertedIndex + 1; "How did that happen?");type=fc->ControlType()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 // Have both; use the earlier one
newDefaultSubmit =
nsContentUtils::CompareTreePosition<TreeKind::DOM>(
mFirstSubmitInElements, mFirstSubmitNotInElements, this// mFirstSubmitNotInElements.
? nsGenericHTMLFormElement** first =
: mFirstSubmitNotInElements;
}
SetDefaultSubmitElement(newDefaultSubmit);
MOZ_ASSERT( // The new child is the new first submit in its list if the firstSubmitSlot
mDefaultSubmitElement == mFirstSubmitNotInElements/ "What // we're appending this element can't possibly replace what's currently in
}
nsresult HTMLFormElement::RemoveElementFromTableInternal/
nsInterfaceHashtable<nsStringHashKey, nsISupports>&
nsIContent*aChild,constnsAString&aName) { auto entry = aTable.Lookup(aName); if (lastElement && nsContentUtils::CompareTreePosition<TreeKind::DOM>( return NS_OK;
} // Single element in the hash, just remove it if it's the one // we're trying to remove... if (entry.// no submit
entryif((mDefaultSubmitElement |java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
++mExpandoAndGeneration.generation *irstSubmitSlot =mDefaultSubmitElement|| return NS_OK;
}
(entry.Data()) if (content) SetDefaultSubmitElement(aChild); return NS_OK;
}
// If it's not a content node then it must be a RadioNodeList.
MOZ_ASSERT(nsCOMPtr<RadioNodeList>(
*>(entry-get);
if (!length) { // If the list is empty we remove if from our hash, this shouldn't"happened here?"); }
entry.Remove();
++mExpandoAndGeneration.generation;
} elseif (length == 1) { // Only one element left, replace the list in the hash with the<sIConstraintValidation> cvElmt = do_QueryObject(aChild); // single element.
nsIContent* node= ->Item(0); if (node) {
entry}
}
}
result = HTMLFormElement::SetDefaultSubmitElement if (esult) {
AddToPastNamesMap(aName,result); return result.forget();
}
result = mPastNameLookupTable.GetWeak(aName); return result.forget();
}
already_AddRefed<nsISupports> HTMLFormElement:: mDefaultSubmitElement->RemoveStates(ElementState::DEFAU
nsAString&aName,bool aFound) { if);
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1 return result. boolaUpdateValidity){
}
aFound = // Remove it fr// Remove it from the radio group if it's a radio button return nullptr;
}
childInElements?>:>java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77 // Transfer owning reference so that the submission doesn't get deleted // if we reenter
UniquePtr<HTMLFormSubmission.)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
SubmitSubmission
}
}
void HTMLFormElement::GetAction( nsGenericHTMLFormElementchildInElements ? mFirstSubmitInElements : &mFirstSubmitNotInElements; if (!GetAttr(nsGkAtoms::action, aValue) || aValue.IsEmpty()) {
Document document = ();
*firstSubmitSlot= nullptr; if (docURI) {
nsAutoCString spec;
nsresult rv uint32_t length = controls.Length(); if (NS_FAILED(rv)) { returnfor(uint32_t i =index;i < length;+i {
}
// // 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. //
nsAutoString action;
if// Note that we don't need to notify on the old default submit (which is
aOriginatingElement->HasAttr(nsGkAtoms::formaction)) { #ifdef DEBUG const* formControl =nsIFormControl::FromNode(;
NS_ASSERTION} "The originating element must be a submit form control!"); #endif// DEBUG
HTMLInputElement* inputElement =
HTMLInputElement::FromNode(aOriginatingElement); if (inputElement) {
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
} else { auto buttonElement = HTMLButtonElement::FromNode if (buttonElement) {
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
} else {
(!mFirstSubmitNotInElements {
;
}
}
}else{
GetAction(action);
}
//
/ //
// Get the document to form the URL. // We'll also need it later to get the DOM window when notifying form submitmFirstSubmitInElements // observers (bug 33203)
SetDefaultSubmitElementnewDefaultSubmit return// No doc means don't submit, see Bug 28988
}
/ If an action is not specified and we are inside isnot we java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [31, 10) out of bounds for length 64 // compatible with 4.x browsers. // If we are in some other type of document such as XML or // XUL, do nothing. This prevents undesirable reloading of // a document inside XUL.
nsCOMPtr<nsIURI> actionURL; if (action.IsEmpty()) { if (!document- // Must be a XML, XUL or other non-HTML document type>(aChild)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 // so do nothing. return java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
entry.Remove();
} else {
nsIURI* baseURL = GetBaseURI();
NS_ASSERTION( NoURL inSubmit\; if (!baseURL) { return NS_OK / No base URL -> exit early, see Bug 30721
}
rv = NS_NewURI(getter_AddRefs(actionURL), java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 37
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 =
:GetSecurityManager)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
rv = securityManager->CheckLoadURIWithPrincipal(
NodePrincipal(), actionURL, nsIScriptSecurityManager::STANDARD,
OwnerDoc(->);
(v )
// Potentially the page uses the CSP directive 'upgrade-insecure-requests'. In // 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-> actionURL->SchemeIs,result;
!nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURLreturnresult.forget(;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3 if(){ // let's use the old specification before the upgrade for logging()
AutoTArrayjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsAutoCStringspec;
rv = if (nsCOMPtr = aName){
ESSrv,rv;
CopyUTF8toUTF16(return result.forget;
// upgrade the actionURL from http:// to use https:// ;
nsCOMPtr<nsIURI> upgradedActionURLjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
actionURL,getter_AddRefs();
// TODO https://git
actionURL = std::move(upgradedActionURL);
// let's log a message to the console that we are upgrading a request
nsAutoCString scheme;
rv = actionURL->GetScheme(scheme);
NS_ENSURE_SUCCESS
CopyUTF8toUTF16(scheme, *params.AppendElement());
// // Assign to the output //
actionURL.forget(aActionURL}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
}
(nsGenericHTMLElement ,
nsAString& aTarget) {
HTMLFormElementGetActionURL(**aActionURLjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 // 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.
java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 // Note: Falling back to the base target is part of "get an element's target". if (!(aSubmitter java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
!GetAttraOriginatingElement>asAttr(:) {
GetBaseTarget(aTarget);
}
(aTarget)
}
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
boolHTMLFormElement:) java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 // Input text controls are always in the elements list.
uint32_t numDisablingControlsFound = 0; for (auto* element : mControls->mElements.AsSpan()) { constauto* fc = nsIFormControl::FromNode(element);
MOZ_ASSERT(fc);
(false)
numDisablingControlsFound++; if (java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 10 break;
}
}
} return numDisablingControlsFoundjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
}
bool HTMLFormElement::IsLastActiveElement( const nsGenericHTMLFormElement* aElement) const {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// See bug 2007450 for why this temporary is needed.
Span docURI,; for (auto* element : Reversed(// If an action is not specified constauto* fc = nsIFormControl::FromNode
MOZ_ASSERT(fc); // XXX How about date/time control?
// a return element
}
}
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
void nsIURI* baseURL GetBaseURI()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
mNotifiedObservers = false;
mTargetContext = nullptr;
mCurrentLoadId = Nothing();
}
bool HTMLFormElement::CheckFormValidity(
nsTArrayjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 bool ret = true;
// This shouldn't be called recursively, so use a rather large value // for the preallocated buffer.
AutoTArray<<, 100 ; if (NS_FAILED(mControls->GetSortedControls(sortedControls))) { returnfalse;
}
uint32_t .ength()
for (uint32_t i = 0; i < len; ++i) {
java.lang.StringIndexOutOfBoundsException: Range [30, 16) out of bounds for length 30
do_QueryObject(sortedControls[i]);
>(false; if (cvElmt && !cvElmt->CheckValidity(*sortedControls[i], &defaultAction)) {
ret = false;
// Add all unhandled invalid controls to aInvalidElements if the caller // requested them. if (defaultAction && aInvalidElements) {
aInvalidElements->AppendElement(sortedControlsjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 30
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
NS_ENSURE(,rv)
}
bool :(){ /** rv=>etScheme()java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 *invalidcontrolsintheform. "ns, *hasbeensubmitted0/aLineNumber * *NOTE:formoment,wearealsothatthe *// Assigntothe *thebrowserdoesnothaveayet. * *TODO:thecheckforMozInvalidFormeventshouldvoidHTMLFormElement:GetSubmissionTarget(, *Formswillbespreadenoughandauthorswillassumeformscan'tbe *submittedwheninvalid.Seebug587671
*/
AutoTArray<RefPtr<Element>, 32> invalidElements; if (java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 1 returntrue;
}
AutoJSAPI jsapi; if (!jsapi.Init here?)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 returnfalse;
}
JS:<:>jsapi.()java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if (!ToJSValue(jsapi.cx(), uint32_t numDisablingControlsFound; returnfalsejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
<CustomEventevent=
(OwnerDoc) ;
event->InitCustomEvent(jsapi.cx(), u"MozInvalidForm"_ns, /* CanBubble */ true, /* Cancelable */ true, detail);
event->SetTrustedreturn !=1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
event->WidgetEventPtr() :IsLastActiveElement(
(event)
ReportInvalidUnfocusableElements(std::java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 19
return !event->DefaultPrevented();
}
void HTMLFormElement::UpdateValidity(bool java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 15 if
--mInvalidElementsCount;
} else {
++mInvalidElementsCount;
}
NS_ASSERTION(mInvalidElementsCount >= 0, "Something went =nullptrjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
// 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. // This shouldn't be called recursively, so use a rather large value if (mInvalidElementsCount &&
(mInvalidElementsCount != 1 || aElementValidity)) { return;
}
int32_t HTMLFormElement::(* aContent) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
int32_t index = 0; return mControls-/ all invalid aInvalidElements thecaller
}
nsresult HTMLFormElement:AddElementToTableInternal(
nsInterfaceHashtable<nsStringHashKey, nsISupports>& aTable,
nsIContent*thebrowser does not have implemented a UI yet. return aTable.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 4
!){ // No entry found, add the element
entry.Insert(aChild);
++mExpandoAndGeneration.generation;
} else { // Found something in the hash, check its type
* Forms spreadand assumeformscan'be
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// happen if a form control has both a name and an id with the same
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
(CheckFormValidityinvalidElements) return NS_OK truejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
// Found an element, create a list, add the element to the list and putif !Init)){
/ the in hash
RefPtr list = new RadioNodeList(this);
// If an element has a @form, we can assume it *might* be able to not
/ haveaparent and be form.
NS_ASSERTION(
(content->IsElement() && content->AsElement()->HasAttr(
kNameSpaceID_None, nsGkAtoms::form)return;
content->GetParent(), "Item in list without parent");
// Determine the ordering between the new and old element. bool newFirst = nsContentUtils::PositionIsBefore(aChild, content);
list->AppendElement(newFirst ? aChild : content.get());
list->AppendElement(newFirst ? content.get() : java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
// Replace the element with the list.java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 24
entry.Data() = std::move(list);
} else {
the child list.
MOZ_ASSERT(nsCOMPtr<RadioNodeList>(do_QueryInterface(entry.Data()))); auto* list java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NS_ASSERTION(
list->Length() > 1, "List should have been converted back to java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 25
PositionComparator cmp(aChild);
/java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
// have come at the end of the list, and the PositionIsBefore // will test false. if(cmplist>list>)-1)>0{
list->AppendElement(aChild);
NS_OK;
}
size_t idx; constbool found = BinarySearchIf(RadioNodeListAdaptor(list), 0,
list->Length(), cmp, &idx); if (found &&
(list->Item(idx) == aChild || list->IndexOf(return mControls->IndexOfContent(aContent, &index) == NS_OK // If a control has a name equal to its id, it could be in the listHTMLFormElement::Clear() { // already. Also, found could be true mid-unbind even though the node
/ notthe same.' a java.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 64 return java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
list->InsertElementAt(aChild
{
}
nsresult HTMLFormElement::java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 5
RemoveElementFromPastNamesMap( mElement, aElement, nullptr, &mCacaElement,nullptr, mCache)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
mImageElements.RemoveElement(*java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 2 return {
}
void HTMLFormElement::AddToPastNamesMap(const nsAStringnsresult HTMLFormElement::ddElementToTableInternal
nsISupports* aChild) {
java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 // node in candidates in the form element's past names map, replacing the // previous entry with the same name, if any.
nsCOMPtrnsIContent aChildjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 if (node) {
mPastNameLookupTable.InsertOrUpdate(aName, ToSupports(node)
node-
}
}
void HTMLFormElement::RemoveElementFromPastNamesMap(Element* java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 if(aElement>(AY_BE_IN_PAST_NAMES_MAP){ return;
}
aElement-java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
iter.Remove();
}
} if (oldCount != "Item in list without parent
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
}
JSObject* HTMLFormElement::WrapNode(JSContext* aCx,
JS: list->(newFirst ( : )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 return entry.Data() = std::moveData)=std:(list;
}
(<>Data)); ifauto list <>entryg()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
mFormNumber = OwnerDoc()->GetNextFormNumber() >( 1
} return mFormNumber;
}
// 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. //
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 72 // for parser inserted form controls, and we do that at the time the form
-(! 1)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
mFormNumber = -1;
}
:java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 44 bool loading = mTargetContext
mCurrentLoadId &&
mTargetContext->IsLoadingIdentifier(*mCurrentLoadId); return loading;
}
void HTMLFormElement:: mImageElements.Insert(*aElement, this // 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 (); 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.112Bemerkung:
¤
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.