Closed Bug 1281457 Opened 9 years ago Closed 9 years ago

Word with "text-align: justify" moves as text selection changes

Categories

(Core :: DOM: Selection, defect)

36 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: matthew.bugzilla, Assigned: xidorn)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 Build ID: 20160604131506 Steps to reproduce: - Open https://www.bmw-warranty.co.uk/Comprehensive#/_ComprehensiveDetails - Start selecting text from the beginning of the second line of the paragraph underneath the bullet points, beginning "aware" - Extend the selection slowly to the right Actual results: The word "number" later in that line moves slightly left and right as the selection changes. Expected results: No words should move.
Component: Untriaged → Selection
Flags: needinfo?(matthew.bugzilla)
Product: Firefox → Core
I can reproduce it in safe mode and with a fresh profile.
Flags: needinfo?(matthew.bugzilla)
I could reproduce it in two different versions: Firefox Nightly 47 and Firefox Release version. [testday-20160624]
(In reply to Moin Shaikh from comment #3) > I could reproduce it in two different versions: Firefox Nightly 47 and > Firefox Release version. > > [testday-20160624] Sorry, I mean Firefox 48.0b3 not the Release version.
Ok, I'm able to reproduce it if I set back the resolution to 100%. The <p> has "text-align: justify". Regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=d380166816dd&tochange=cbe6afcae26c Regressed by bug: Xidorn Quan — Bug 1063857 - Improve selecting on justified characters. r=roc
Blocks: 1063857
Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Flags: needinfo?(bugzilla)
Keywords: regression
Summary: Word moves as text selection changes → Word with "text-align: justify" moves as text selection changes
Version: 47 Branch → 36 Branch
Thanks for this great reproducible example. I eventually see where the issue is. Patch's coming.
Assignee: nobody → bugzilla
Flags: needinfo?(bugzilla)
Before this change, SetupJustificationSpacing calls ComputeJustification to compute how justification gaps are assigned to characters, and store them in the PropertyProvider instance. When GetSpacing is called, those information would be used to compute actual spacings from justification before/after each character. The bug is that, GetSpacing did not take gaps before the given range into account when computing the spacing, which leads to unstable results when range varies because of ignorance of accumulated error. This patch changes it to eagerly computing the actual spacings inside SetupJustificationSpacing, so that GetSpacing just queries the result from mJustificationSpacings. Review commit: https://reviewboard.mozilla.org/r/60770/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/60770/
Attachment #8765335 - Flags: review?(jfkthame)
Attachment #8765335 - Flags: review?(jfkthame) → review+
Comment on attachment 8765335 [details] Bug 1281457 - Compute justification spacing eagerly in SetupJustificationSpacing. https://reviewboard.mozilla.org/r/60770/#review57718 I'm not currently seeing the bug here (on OS X; may depend on platform/font details?), but the patch seems fine; thanks for including the explanation in the commit message.
Since it depends on the natural width of the text piece, it should be font-dependent, and probably also platform-dependent. I can reproduce it on Windows, but not OS X, as well. And in most of cases, the effect is just too subtle to be noticed. I think I did see this issue before, but didn't find a stably-reproducible example, and didn't realize this is a regression from my change...
Pushed by xquan@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f99734930e68 Compute justification spacing eagerly in SetupJustificationSpacing. r=jfkthame
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: