No issue - Escape < and > in element attribute values.

Per spec, extend escaping of attribute value characters to include
`<` and `>`. We already did this for text fragments, and it makes sense
to apply the same to attribute values. We are at parity with mainstream
that default-escape attribute values this way in current releases.
This commit is contained in:
Moonchild 2025-06-19 12:55:54 +02:00 committed by roytam1
commit 3c2c7ce1e2

View file

@ -9359,6 +9359,12 @@ private:
case 0x00A0:
aOut.AppendLiteral("&nbsp;");
break;
case '<':
aOut.AppendLiteral("&lt;");
break;
case '>':
aOut.AppendLiteral("&gt;");
break;
default:
aOut.Append(*c);
break;
@ -9500,6 +9506,12 @@ AppendEncodedAttributeValue(nsAutoString* aValue, StringBuilder& aBuilder)
case 0x00A0:
extraSpaceNeeded += ArrayLength("&nbsp;") - 2;
break;
case '<':
extraSpaceNeeded += ArrayLength("&lt;") - 2;
break;
case '>':
extraSpaceNeeded += ArrayLength("&gt;") - 2;
break;
default:
break;
}