mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 22:38:41 +09:00
Issue #2104 - Part 2: Indicate if a label was cropped via the "_is_cropped" attribute
This commit is contained in:
parent
60c344a56b
commit
4c9665a4ae
2 changed files with 8 additions and 0 deletions
|
|
@ -629,6 +629,10 @@ nsTextBoxFrame::CalculateTitleForWidth(nsRenderingContext& aRenderingContext,
|
|||
{
|
||||
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
|
||||
|
||||
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::_is_cropped)) {
|
||||
mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::_is_cropped, true);
|
||||
}
|
||||
|
||||
if (mTitle.IsEmpty()) {
|
||||
mCroppedTitle.Truncate();
|
||||
return 0;
|
||||
|
|
@ -831,6 +835,9 @@ nsTextBoxFrame::CalculateTitleForWidth(nsRenderingContext& aRenderingContext,
|
|||
break;
|
||||
}
|
||||
|
||||
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::_is_cropped,
|
||||
NS_LITERAL_STRING("true"), true);
|
||||
|
||||
return nsLayoutUtils::AppUnitWidthOfStringBidi(mCroppedTitle, this, *fm,
|
||||
aRenderingContext);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue