summaryrefslogtreecommitdiff
path: root/layout/xul
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-02-03 11:16:04 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-02-03 22:44:04 +0800
commit1a2a779aaf55739181befc02965e08690fedbf7a (patch)
treeff6bb6be61571881ddf5f7502fe5fa917a6329dd /layout/xul
parentdc14e5a906ba3116d397538a5c8aa342779f798f (diff)
downloaduxp-1a2a779aaf55739181befc02965e08690fedbf7a.tar.gz
Issue #2104 - Part 2: Indicate if a label was cropped via the "_is_cropped" attribute
Diffstat (limited to 'layout/xul')
-rw-r--r--layout/xul/nsTextBoxFrame.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/layout/xul/nsTextBoxFrame.cpp b/layout/xul/nsTextBoxFrame.cpp
index 4c420f9323..755668d806 100644
--- a/layout/xul/nsTextBoxFrame.cpp
+++ b/layout/xul/nsTextBoxFrame.cpp
@@ -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);
}