зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
179992eeca
Коммит
7368ed48d3
|
@ -1059,8 +1059,7 @@ const VariationsCircle = props => {
|
||||||
checked: activeTheme === null || activeTheme === void 0 ? void 0 : activeTheme.includes(id),
|
checked: activeTheme === null || activeTheme === void 0 ? void 0 : activeTheme.includes(id),
|
||||||
name: "variationSelect",
|
name: "variationSelect",
|
||||||
className: "sr-only input",
|
className: "sr-only input",
|
||||||
onClick: setVariation,
|
onClick: setVariation
|
||||||
"data-l10n-attrs": "aria-description"
|
|
||||||
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__["Localized"], {
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__["Localized"], {
|
||||||
text: label
|
text: label
|
||||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||||
|
@ -1172,7 +1171,6 @@ function Colorways(props) {
|
||||||
checked: colorwayId === id,
|
checked: colorwayId === id,
|
||||||
className: "sr-only input",
|
className: "sr-only input",
|
||||||
onClick: handleColorwayClick,
|
onClick: handleColorwayClick,
|
||||||
"data-l10n-attrs": "aria-description",
|
|
||||||
"data-l10n-args": JSON.stringify({
|
"data-l10n-args": JSON.stringify({
|
||||||
colorwayName: label
|
colorwayName: label
|
||||||
}),
|
}),
|
||||||
|
@ -1233,8 +1231,7 @@ const Themes = props => {
|
||||||
name: "theme",
|
name: "theme",
|
||||||
checked: theme === props.activeTheme,
|
checked: theme === props.activeTheme,
|
||||||
className: "sr-only input",
|
className: "sr-only input",
|
||||||
onClick: props.handleAction,
|
onClick: props.handleAction
|
||||||
"data-l10n-attrs": "aria-description"
|
|
||||||
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||||
className: `icon ${theme === props.activeTheme ? " selected" : ""} ${theme}`
|
className: `icon ${theme === props.activeTheme ? " selected" : ""} ${theme}`
|
||||||
}), label && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__["Localized"], {
|
}), 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"
|
name="variationSelect"
|
||||||
className="sr-only input"
|
className="sr-only input"
|
||||||
onClick={setVariation}
|
onClick={setVariation}
|
||||||
data-l10n-attrs="aria-description"
|
|
||||||
/>
|
/>
|
||||||
</Localized>
|
</Localized>
|
||||||
<Localized text={label}>
|
<Localized text={label}>
|
||||||
|
@ -174,7 +173,6 @@ export function Colorways(props) {
|
||||||
checked={colorwayId === id}
|
checked={colorwayId === id}
|
||||||
className="sr-only input"
|
className="sr-only input"
|
||||||
onClick={handleColorwayClick}
|
onClick={handleColorwayClick}
|
||||||
data-l10n-attrs="aria-description"
|
|
||||||
data-l10n-args={JSON.stringify({
|
data-l10n-args={JSON.stringify({
|
||||||
colorwayName: label,
|
colorwayName: label,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -30,7 +30,6 @@ export const Themes = props => {
|
||||||
checked={theme === props.activeTheme}
|
checked={theme === props.activeTheme}
|
||||||
className="sr-only input"
|
className="sr-only input"
|
||||||
onClick={props.handleAction}
|
onClick={props.handleAction}
|
||||||
data-l10n-attrs="aria-description"
|
|
||||||
/>
|
/>
|
||||||
</Localized>
|
</Localized>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -40,7 +40,8 @@ static bool IsAttrNameLocalizable(
|
||||||
if (nameSpace == kNameSpaceID_XHTML) {
|
if (nameSpace == kNameSpaceID_XHTML) {
|
||||||
// Is it a globally safe attribute?
|
// Is it a globally safe attribute?
|
||||||
if (aAttrName == nsGkAtoms::title || aAttrName == nsGkAtoms::aria_label ||
|
if (aAttrName == nsGkAtoms::title || aAttrName == nsGkAtoms::aria_label ||
|
||||||
aAttrName == nsGkAtoms::aria_valuetext) {
|
aAttrName == nsGkAtoms::aria_valuetext ||
|
||||||
|
aAttrName == nsGkAtoms::aria_description) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче