Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Depends on D178164 Differential Revision: https://phabricator.services.mozilla.com/D178278
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "mozilla/StaticPrefs_layout.h"
|
||||
#include "mozilla/StaticPrefs_accessibility.h"
|
||||
|
||||
#include "mozilla/dom/FormData.h"
|
||||
#include "nscore.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
@@ -2824,6 +2825,23 @@ bool nsGenericHTMLFormControlElement::IsAutocapitalizeInheriting() const {
|
||||
type == FormControlType::Select || type == FormControlType::Textarea;
|
||||
}
|
||||
|
||||
nsresult nsGenericHTMLFormControlElement::SubmitDirnameDir(
|
||||
FormData* aFormData) {
|
||||
// Submit dirname=dir if element has non-empty dirname attribute
|
||||
if (HasAttr(kNameSpaceID_None, nsGkAtoms::dirname)) {
|
||||
nsAutoString dirname;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::dirname, dirname);
|
||||
if (!dirname.IsEmpty()) {
|
||||
const Directionality eDir = GetDirectionality();
|
||||
MOZ_ASSERT(eDir == eDir_RTL || eDir == eDir_LTR,
|
||||
"The directionality of an element is either ltr or rtl");
|
||||
const nsString dir = eDir == eDir_LTR ? u"ltr"_ns : u"rtl"_ns;
|
||||
return aFormData->AddNameValuePair(dirname, dir);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static const nsAttrValue::EnumTable kPopoverTargetActionTable[] = {
|
||||
|
||||
Reference in New Issue
Block a user