diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index 75c031afac..af25f97e1c 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -39,6 +39,7 @@ GK_ATOM(_moz_resizing, "_moz_resizing") GK_ATOM(mozallowfullscreen, "mozallowfullscreen") GK_ATOM(moztype, "_moz-type") GK_ATOM(mozdirty, "_moz_dirty") +GK_ATOM(_is_cropped, "_is_cropped") GK_ATOM(mozdisallowselectionprint, "mozdisallowselectionprint") GK_ATOM(mozdonotsend, "moz-do-not-send") GK_ATOM(mozeditorbogusnode, "_moz_editor_bogus_node") 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); }