mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
parent
b73f500c04
commit
6ee3f46900
11 changed files with 162 additions and 2 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#define mozilla_dom_HTMLFormSubmission_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLDialogElement.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsNCRFallbackEncoderWrapper.h"
|
||||
|
|
@ -121,6 +122,8 @@ public:
|
|||
return mOriginatingElement.get();
|
||||
}
|
||||
|
||||
virtual DialogFormSubmission* GetAsDialogSubmission() { return nullptr; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Can only be constructed by subclasses.
|
||||
|
|
@ -168,6 +171,50 @@ private:
|
|||
nsNCRFallbackEncoderWrapper mEncoder;
|
||||
};
|
||||
|
||||
|
||||
class DialogFormSubmission final : public HTMLFormSubmission {
|
||||
public:
|
||||
DialogFormSubmission(nsAString& aResult,
|
||||
const nsACString& aCharset, Element* aSubmitter,
|
||||
HTMLDialogElement* aDialogElement)
|
||||
: HTMLFormSubmission(aCharset, aSubmitter)
|
||||
, mDialogElement(aDialogElement)
|
||||
, mReturnValue(aResult) {
|
||||
}
|
||||
|
||||
nsresult AddNameValuePair(const nsAString& aName,
|
||||
const nsAString& aValue) override {
|
||||
MOZ_CRASH("This method should not be called");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult AddNameBlobOrNullPair(const nsAString& aName, Blob* aBlob) override {
|
||||
MOZ_CRASH("This method should not be called");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult AddNameDirectoryPair(const nsAString& aName,
|
||||
Directory* aDirectory) override {
|
||||
MOZ_CRASH("This method should not be called");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult GetEncodedSubmission(nsIURI* aURI, nsIInputStream** aPostDataStream) override {
|
||||
MOZ_CRASH("This method should not be called");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DialogFormSubmission* GetAsDialogSubmission() override { return this; }
|
||||
|
||||
HTMLDialogElement* DialogElement() { return mDialogElement; }
|
||||
|
||||
nsString& ReturnValue() { return mReturnValue; }
|
||||
|
||||
private:
|
||||
const RefPtr<HTMLDialogElement> mDialogElement;
|
||||
nsString mReturnValue;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle multipart/form-data encoding, which does files as well as normal
|
||||
* inputs. This always does POST.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue