Remove ellipseString function and use text-overflow:ellipsis instead
Categories
(Toolkit :: Printing, enhancement, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | affected |
People
(Reporter: jaws, Unassigned)
Details
(Keywords: good-first-bug)
Attachments
(2 obsolete files)
This function adds "..." (three periods, not even the proper Unicode ellipsis character). This function should be deleted and we should use text-overflow:ellipsis in place of it.
Comment 1•6 years ago
|
||
Hi,
I'd like to start working on this bug (it would be my first bug). Could I get assigned?
Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Adam Czyzewski from comment #1)
Hi,
I'd like to start working on this bug (it would be my first bug). Could I get assigned?
Hi Adam, it would be great for you to work on this. Please let me know if you have any questions. You can follow the steps here to get your local build set up: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
Since this bug doesn't involved changing any C++ you can use an artifact build (still follow the instructions above) to make your build time much shorter: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds
Reporter | ||
Comment 3•6 years ago
|
||
Hi Adam, have you been able to make progress on this bug? Do you have any questions for me?
Comment 4•6 years ago
|
||
Hi, thanks for checking up with me.
So far I set up my build and plan to solve the bug on the weekend. Everything seems straightforward for now :)
Comment 5•6 years ago
|
||
I've started working on the bug, but I'm not sure what the desired behaviour should be.
Right now the ellipseString method is used to modify docTitle and docURLStr (https://searchfox.org/mozilla-central/rev/00c0d068ece99717bea7475f7dc07e61f7f35984/toolkit/components/printing/content/printProgress.js#100). Before any modification thought, it performs a few checks (for empty string, for length of the string).
Also, we can add "..." before the docURL string, by setting "doFront" parameter to true. Do we want to preserve that?
Other than that, is using text-overflow:ellipsis in the css file what you have in mind?
Updated•6 years ago
|
Reporter | ||
Comment 6•6 years ago
|
||
(In reply to Adam Czyzewski from comment #5)
I've started working on the bug, but I'm not sure what the desired behaviour should be.
Right now the ellipseString method is used to modify docTitle and docURLStr (https://searchfox.org/mozilla-central/rev/00c0d068ece99717bea7475f7dc07e61f7f35984/toolkit/components/printing/content/printProgress.js#100). Before any modification thought, it performs a few checks (for empty string, for length of the string).
Also, we can add "..." before the docURL string, by setting "doFront" parameter to true. Do we want to preserve that?
Other than that, is using text-overflow:ellipsis in the css file what you have in mind?
Yeah, text-overflow:ellipsis in the CSS file is what I had in mind. We should try to preserve the doFront behavior for now. This article shows a way that we can use text-overflow:ellipsis with direction
to place the ellipsis at the front of a string, https://davidwalsh.name/css-ellipsis-left
When changing the direction as the above hack describes, we'll also need to take care to apply it in the reverse for RTL strings.
You can use the https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-locale-dir(rtl) pseudo-class to check if the locale is in RTL. For example,
#docTitle,
#docURLStr {
/* Standard CSS ellipsis */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 200px;
/* Beginning of string */
direction: rtl;
text-align: left;
}
#docTitle:-moz-locale-dir(rtl),
#docURLStr:-moz-locale-dir(rtl) {
direction: ltr;
text-align: right;
}
I see you have unassigned the bug. Sorry for the delayed response, yesterday was a holiday for us in the US. Does this help you enough to pick the bug back up?
Comment 7•6 years ago
|
||
No worries! I've sent a bug patch for another bug, so for now I'll wait for the feedback. I unassigned the bug, so that in the meantime the bug can be picked by somebody if they want to fix it!
Reporter | ||
Comment 9•6 years ago
|
||
(In reply to young.oh from comment #8)
Hi, I'd would like to take this bug and try to fix it
Great, please let me know of any questions you may have. I'll follow up with you in a couple days to see where you have gotten.
Comment 10•6 years ago
|
||
(In reply to [away 2/21-2/26] Jared Wein [:jaws] (Regression Engineering Owner for 65) (please needinfo? me) from comment #6)
(In reply to Adam Czyzewski from comment #5)
I've started working on the bug, but I'm not sure what the desired behaviour should be.
Right now the ellipseString method is used to modify docTitle and docURLStr (https://searchfox.org/mozilla-central/rev/00c0d068ece99717bea7475f7dc07e61f7f35984/toolkit/components/printing/content/printProgress.js#100). Before any modification thought, it performs a few checks (for empty string, for length of the string).
Also, we can add "..." before the docURL string, by setting "doFront" parameter to true. Do we want to preserve that?
Other than that, is using text-overflow:ellipsis in the css file what you have in mind?
Yeah, text-overflow:ellipsis in the CSS file is what I had in mind. We should try to preserve the doFront behavior for now. This article shows a way that we can use text-overflow:ellipsis with
direction
to place the ellipsis at the front of a string, https://davidwalsh.name/css-ellipsis-leftWhen changing the direction as the above hack describes, we'll also need to take care to apply it in the reverse for RTL strings.
You can use the https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-locale-dir(rtl) pseudo-class to check if the locale is in RTL. For example,
#docTitle, #docURLStr { /* Standard CSS ellipsis */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 200px; /* Beginning of string */ direction: rtl; text-align: left; } #docTitle:-moz-locale-dir(rtl), #docURLStr:-moz-locale-dir(rtl) { direction: ltr; text-align: right; }
I see you have unassigned the bug. Sorry for the delayed response, yesterday was a holiday for us in the US. Does this help you enough to pick the bug back up?
Hi, I finished setting up firefox build and briefly went through the code. I found https://searchfox.org/mozilla-central/source/toolkit/components/printing/content/simplifyMode.css in the same directory, Can you confirm if this is where the above CSS styles should go?
Reporter | ||
Comment 11•6 years ago
|
||
That file is only used to simplify the page before printing, and that stylesheet is applied to the page directly, so it wouldn't work here to apply it to the dialogs. You should create a new stylesheet and add references to it from printPreviewProgress.xul and printProgress.xul.
Comment 12•6 years ago
|
||
Ok.. now I'm having a little trouble preserving doFront
behaviour... There is an element dialog.title
which is assigned either docTitle
or docURL
as its value. And doFront
occurs only when docURL
has length greater than 64. I'm thinking of styling dialog.title
dynamically in js only in that specific case.
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
I think I somehow figured it out. Please review the patch!
Comment 15•6 years ago
|
||
Hi,here is the revised patch.
Reporter | ||
Comment 16•6 years ago
|
||
(In reply to young.oh from comment #15)
Created attachment 9048066 [details] [diff] [review]
1527109.patchHi,here is the revised patch.
Please resubmit this through phabricator as you did the first version of this patch.
Updated•6 years ago
|
Comment 17•6 years ago
|
||
Resubmitted it again with phabricator!
Comment 18•6 years ago
|
||
I made the change to both jar.mn and xul files, however I still could observe the long string length > 64 is not getting ellipsed. I expected to see dots at the end of the string but the whole string appears in the title label. I checked that CSS on #dialog.title does work by applying some random text color. I attempted the solution (CSS display property) on StackOverflow, direct styling in xul, and none of them worked. I'm suspecting <label /> element does not work with text-overflow and other props. Can you provide further guidance on this? Thanks
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Hi! I would like to work on this.
Comment 20•5 years ago
|
||
I would like to work on this if it's available, thanks.
Reporter | ||
Comment 21•5 years ago
|
||
(In reply to Obayagbona Uwagbae Alexander from comment #20)
I would like to work on this if it's available, thanks.
Hi, you may work on this but I will wait to assign it until a patch has been attached.
Comment 22•5 years ago
|
||
Okay, no problem.
Do I have to do this using CSS? If I find a way to implement it using JS, can I do that?
Updated•5 years ago
|
Comment 24•4 years ago
|
||
Hi Sonia,
Our printing UI is going through some changes right now, so I'm going to redirect this question to someone on the team working on that to see if this bug still makes sense to work on. If the answer is "yes", then I can mentor you on this.
Reporter | ||
Updated•4 years ago
|
Comment 25•3 years ago
|
||
Is this bug fixed, it looks so...
If not, may I work on it?
thanks,
Kian
Comment 26•3 years ago
|
||
Hi, I am an outreachy applicant. Is this project open?
Can I work on this?
Comment 27•3 years ago
|
||
This code was removed in bug 1745452 so no need to update it
Description
•