Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 755994 - CSS text-shadow is incorrectly rendered for selected RTL text
: CSS text-shadow is incorrectly rendered for selected RTL text
: regression
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: Simon Montagu :smontagu
Depends on:
Blocks: 692752
  Show dependency treegraph
Reported: 2012-05-16 20:34 PDT by tsdodo
Modified: 2012-05-18 13:33 PDT (History)
6 users (show)
smontagu: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (6.00 KB, patch)
2012-05-17 04:05 PDT, Simon Montagu :smontagu
roc: review+
Details | Diff | Splinter Review
Reftests (4.01 KB, patch)
2012-05-17 04:07 PDT, Simon Montagu :smontagu
no flags Details | Diff | Splinter Review
Corrected reftests (4.07 KB, patch)
2012-05-17 04:12 PDT, Simon Montagu :smontagu
roc: review+
Details | Diff | Splinter Review
Testcase (478 bytes, text/html)
2012-05-17 20:45 PDT, Simon Montagu :smontagu
no flags Details

Description tsdodo 2012-05-16 20:34:36 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
Build ID: 20120420145725

Steps to reproduce:

I selected right-to-left text with a text-shadow CSS rule.

Actual results:

The shadow disappeared on each line on which a selection was active except for a tiny area on the right-most side.

Expected results:

The shadow should have rendered as it would in selecting left-to-right text.
Comment 1 Simon Montagu :smontagu 2012-05-17 04:05:16 PDT
Created attachment 624697 [details] [diff] [review]

This is essentially a one-line patch: for RTL we need to calculate the left edge of the selection as xoffset - width in the call to PaintOneShadow, just as we do in the call to FillClippedRect a few lines above.

In practice it's a bit more complicated: to get at the width for the calculation, I've had to pull the call to MeasureText out of PaintOneShadow to the callers. Measuring the text only once when there are multiple shadows should also be a modest performance win.
Comment 2 Simon Montagu :smontagu 2012-05-17 04:07:45 PDT
Created attachment 624699 [details] [diff] [review]

These are just copies of the existing text-shadow-selected-1* tests with RTL text.
Comment 3 Simon Montagu :smontagu 2012-05-17 04:12:16 PDT
Created attachment 624700 [details] [diff] [review]
Corrected reftests

Updated reftests using <bdo> -- using Hebrew has font issues.
Comment 4 Simon Montagu :smontagu 2012-05-17 04:16:37 PDT
This is a regression from the range -- presumably bug 692752.
Comment 6 Simon Montagu :smontagu 2012-05-17 20:45:10 PDT
Created attachment 625000 [details]

Note You need to log in before you can comment on or make changes to this bug.