Bug 1801138 - Ensure empty label values don't collapse. r=dao

Add a zwsp character to ensure they're not considered an empty line.

Differential Revision: https://phabricator.services.mozilla.com/D162301
This commit is contained in:
Emilio Cobos Álvarez 2022-11-19 20:38:55 +00:00
parent 5637f65d5d
commit 4f69b540a6
2 changed files with 18 additions and 3 deletions

View File

@ -65,9 +65,20 @@
this.finalCheck = function setValue_finalCheck()
{
var tree =
let tree =
{ LABEL: [] };
if (aValue != kNoValue) {
const expectChild = (() => {
if (aValue === kNoValue) {
return false;
}
if (aValue === "") {
return this.labelNode.nodeName == "label";
}
return true;
})();
if (expectChild) {
tree.LABEL.push({ STATICTEXT: [ ] });
}
testAccessibleTree(aID, tree);
@ -119,7 +130,7 @@
gQueue.push(new setValue("label", "shiroka strana", kRecreated));
gQueue.push(new setValue("label", "?<>!+_", kTextChanged, "shiroka strana"));
gQueue.push(new setValue("label", "", kTextRemoved, "?<>!+_"));
gQueue.push(new setValue("label", "", kRecreated));
gQueue.push(new setValue("label", kNoValue, kRecreated));
gQueue.push(new setValue("descr", "hello world", kRecreated));

View File

@ -167,6 +167,10 @@ description[value]::before {
display: block;
}
label[value=""]::before {
content: "\200B"; /* zwsp */
}
label[value][crop]::before,
description[value][crop]::before {
min-width: 0;