Skip to content

Commit

Permalink
Bug 1518442 - Part 2: Implement Event-based form participation; r=sma…
Browse files Browse the repository at this point in the history
…ug,edgar

For Event-based form participation specification PR:
whatwg/html#4239

Differential Revision: https://phabricator.services.mozilla.com/D43986

UltraBlame original commit: 1ac7b20bb1d8c5528211fdba0246f7659bff3a7c
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent 9ab6504 commit e440ea6
Show file tree
Hide file tree
Showing 6 changed files with 886 additions and 314 deletions.
283 changes: 240 additions & 43 deletions dom/base/FormData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ FormData
nsISupports
*
aOwner
NotNull
<
const
Encoding
*
>
aEncoding
Element
*
aOriginatingElement
)
:
HTMLFormSubmission
Expand All @@ -204,15 +214,55 @@ nullptr
EmptyString
(
)
UTF_8_ENCODING
nullptr
aEncoding
aOriginatingElement
)
mOwner
(
aOwner
)
{
}
FormData
:
:
FormData
(
const
FormData
&
aFormData
)
:
HTMLFormSubmission
(
aFormData
.
mActionURL
aFormData
.
mTarget
aFormData
.
mEncoding
aFormData
.
mOriginatingElement
)
{
mOwner
=
aFormData
.
mOwner
;
mFormData
=
aFormData
.
mFormData
;
}
namespace
{
already_AddRefed
Expand Down Expand Up @@ -1907,11 +1957,80 @@ Value
(
)
.
WalkFormElements
ConstructEntryList
(
formData
)
;
if
(
NS_WARN_IF
(
aRv
.
Failed
(
)
)
)
{
return
nullptr
;
}
/
/
Step
9
.
Return
a
shallow
clone
of
entry
list
.
/
/
https
:
/
/
html
.
spec
.
whatwg
.
org
/
multipage
/
form
-
control
-
infrastructure
.
html
#
constructing
-
form
-
data
-
set
formData
=
formData
-
>
Clone
(
)
;
}
return
formData
Expand Down Expand Up @@ -1998,9 +2117,114 @@ UTF_8_ENCODING
nullptr
)
;
nsresult
rv
=
CopySubmissionDataTo
(
&
fs
)
;
NS_ENSURE_SUCCESS
(
rv
rv
)
;
fs
.
GetContentType
(
aContentTypeWithCharset
)
;
aCharset
.
Truncate
(
)
;
*
aContentLength
=
0
;
NS_ADDREF
(
*
aBody
=
fs
.
GetSubmissionBody
(
aContentLength
)
)
;
return
NS_OK
;
}
already_AddRefed
<
FormData
>
FormData
:
:
Clone
(
)
{
RefPtr
<
FormData
>
formData
=
new
FormData
(
*
this
)
;
return
formData
.
forget
(
)
;
}
nsresult
FormData
:
:
CopySubmissionDataTo
(
HTMLFormSubmission
*
aFormSubmission
)
const
{
MOZ_ASSERT
(
aFormSubmission
"
Must
have
FormSubmission
!
"
)
;
for
(
uint32_t
size_t
i
=
0
Expand Down Expand Up @@ -2042,8 +2266,9 @@ IsUSVString
)
)
;
fs
.
aFormSubmission
-
>
AddNameBlobOrNullPair
(
mFormData
Expand Down Expand Up @@ -2071,8 +2296,9 @@ IsUSVString
)
)
{
fs
.
aFormSubmission
-
>
AddNameValuePair
(
mFormData
Expand Down Expand Up @@ -2109,8 +2335,9 @@ IsBlob
)
)
{
fs
.
aFormSubmission
-
>
AddNameBlobOrNullPair
(
mFormData
Expand Down Expand Up @@ -2148,8 +2375,9 @@ IsDirectory
)
)
;
fs
.
aFormSubmission
-
>
AddNameDirectoryPair
(
mFormData
Expand All @@ -2172,37 +2400,6 @@ GetAsDirectory
;
}
}
fs
.
GetContentType
(
aContentTypeWithCharset
)
;
aCharset
.
Truncate
(
)
;
*
aContentLength
=
0
;
NS_ADDREF
(
*
aBody
=
fs
.
GetSubmissionBody
(
aContentLength
)
)
;
return
NS_OK
;
Expand Down
Loading

0 comments on commit e440ea6

Please sign in to comment.