Describe the bug
Labels can be passed a class. If this class gives the label a different font size, it renders outside the bounds of the block.
To Reproduce
Steps to reproduce the behavior:
{
"type": "example_text_class",
"message0": "%1",
"args0": [
{
"type": "field_label",
"name": "NAME",
"text": "default",
"class": "custom-text-class"
}
],
"colour": 230,
},
{
"type": "example_text_class_image",
"message0": "%2 %1",
"args0": [
{
"type": "field_image",
"src": "https://www.gstatic.com/codesite/ph/images/star_on.gif",
"width": 50,
"height": 50,
"alt": "*",
"flipRtl": false
},
{
"type": "field_label",
"name": "NAME",
"text": "default",
"class": "custom-text-class"
}
],
"colour": 230,
},
.custom-text-class {
fill: black; /* for visibility*/
font-size: 50px;
}
<xml>
<block type="example_text_class"/>
<block type="example_text_class_image" y="50"/>
</xml>
Expected behavior
I expect the top of the text to be aligned with the top of the block (as that seems to be the current official behavior). The block should encapsulate all of the text.
Screenshots

Desktop (please complete the following information):
(I believe this is not browser specific)
Stack Traces
N/A
Additional context
I think the problem is probably caused by this line being a constant (since size_.height is constant).
The y attribute is also set by the abstract field class here, and then overriden by the above line.
I know all of the field sizing stuff is a little iffy atm, I just think this is an important test case.
@samelhusseini since I know you're looking at labels.
Yup
Fixed.
From my testing I think this still occures. This issue is for classes that are applied directly to the label field.
Sorry I meant to close the other one :)
Most helpful comment
Sorry I meant to close the other one :)