Bug 1759925 - Allow aria-description as a globally safe l10n attribute. r=Gijs

We had precedents for this and it is safe to allow it everywhere.

Depends on D141276

Differential Revision: https://phabricator.services.mozilla.com/D141277
This commit is contained in:
Emilio Cobos Álvarez 2022-03-16 23:03:49 +00:00
Родитель 179992eeca
Коммит 7368ed48d3
4 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -1059,8 +1059,7 @@ const VariationsCircle = props => {
checked: activeTheme === null || activeTheme === void 0 ? void 0 : activeTheme.includes(id),
name: "variationSelect",
className: "sr-only input",
onClick: setVariation,
"data-l10n-attrs": "aria-description"
onClick: setVariation
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__["Localized"], {
text: label
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
@ -1172,7 +1171,6 @@ function Colorways(props) {
checked: colorwayId === id,
className: "sr-only input",
onClick: handleColorwayClick,
"data-l10n-attrs": "aria-description",
"data-l10n-args": JSON.stringify({
colorwayName: label
}),
@ -1233,8 +1231,7 @@ const Themes = props => {
name: "theme",
checked: theme === props.activeTheme,
className: "sr-only input",
onClick: props.handleAction,
"data-l10n-attrs": "aria-description"
onClick: props.handleAction
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: `icon ${theme === props.activeTheme ? " selected" : ""} ${theme}`
}), label && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__["Localized"], {

Просмотреть файл

@ -41,7 +41,6 @@ export const VariationsCircle = props => {
name="variationSelect"
className="sr-only input"
onClick={setVariation}
data-l10n-attrs="aria-description"
/>
</Localized>
<Localized text={label}>
@ -174,7 +173,6 @@ export function Colorways(props) {
checked={colorwayId === id}
className="sr-only input"
onClick={handleColorwayClick}
data-l10n-attrs="aria-description"
data-l10n-args={JSON.stringify({
colorwayName: label,
})}

Просмотреть файл

@ -30,7 +30,6 @@ export const Themes = props => {
checked={theme === props.activeTheme}
className="sr-only input"
onClick={props.handleAction}
data-l10n-attrs="aria-description"
/>
</Localized>
<div

Просмотреть файл

@ -40,7 +40,8 @@ static bool IsAttrNameLocalizable(
if (nameSpace == kNameSpaceID_XHTML) {
// Is it a globally safe attribute?
if (aAttrName == nsGkAtoms::title || aAttrName == nsGkAtoms::aria_label ||
aAttrName == nsGkAtoms::aria_valuetext) {
aAttrName == nsGkAtoms::aria_valuetext ||
aAttrName == nsGkAtoms::aria_description) {
return true;
}