Page MenuHomePhabricator

Support flipping mutiple values under a text-shadow or border-shadow rule
Open, MediumPublic

Description

As of T47677 and https://github.com/cssjanus/cssjanus/pull/44, CSSjanus supports flipping shadows. However, if a rule declares multiple shadows, it flips only the first shadow.

Demo test case

@MatmaRex@github.com wrote on 20 Jun 2018:

CSSJanus only supports flipping one text-shadow or border-shadow, while the CSS syntax allows multiple.

Input:

* {
 text-shadow: red 99px -1px 1px, blue 99px 2px 1px;
}

Expected output:

* {
 text-shadow: red -99px -1px 1px, blue -99px 2px 1px;
}

Actual output:

* {
 text-shadow: red -99px -1px 1px, blue 99px 2px 1px;
}
Original task description on 3 Feb 2014:

It flipped the y-offset for some reason:

ltr: text-shadow: #333333 0px -1px 1px, #FFFFFF 0px 2px 1px;
rtl: text-shadow: #333333 0px 1px 1px, #FFFFFF 0px 2px 1px;

That was weird. Now of course in that case it needn't flip at all and I can just tell it not to, but this still ain't proper behaviour.

Details

Reference
bz60805

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:51 AM
bzimport set Reference to bz60805.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

It flipped the y-offset for some reason:

ltr: text-shadow: #333333 0px -1px 1px, #FFFFFF 0px 2px 1px;
rtl: text-shadow: #333333 0px 1px 1px, #FFFFFF 0px 2px 1px;

When you say "it flipped," what is "it"?

Is this a ResourceLoader bug?

See the numbers in the rule? The -1 became a 1. It flipped.

Is resourceloader what flips the interface for rtl languages?

(In reply to comment #2)

See the numbers in the rule? The -1 became a 1. It flipped.

Yes, the CSS changed (flipped), but what changed it? Where did you see this? What were you doing when this happened? Are there exact steps to reproduce?

I don't know; where does mw flip the interface css for rtl languages?

I was juggling ostriches on the moon at the time. I suppose to reproduce it you would have to go to the moon and juggle ostriches, then. Oh, and put something like what I pasted above in a file that gets flipped, probably. Unless it really was the ostriches what did it? Now there's a thought.

(In reply to comment #0)

ltr: text-shadow: #333333 0px -1px 1px, #FFFFFF 0px 2px 1px;
rtl: text-shadow: #333333 0px 1px 1px, #FFFFFF 0px 2px 1px;

There are two shadows defined here, and ResourceLoader (or actually CSSJanus) only supports flipping the first one in a rule right now. :(

I added the half-baked feature in I97ee7431 to fix bug 45677.

(Rephrasing the summary and moving to a better component.)

Ah, thanks. That explains it (and why this seemed so familiar, d'oh).

Krinkle claimed this task.

I can't reproduce this in the latest version of CSSJanus.

https://cssjanus.github.io/#input/.foo%20%7B%0A%20text-shadow%3A%20%23333333%200px%20-1px%201px%2C%20%23FFFFFF%200px%202px%201px%3B%0A%7D

Also verified with MediaWiki that this rule is not flipped.

Krinkle raised the priority of this task from Low to Medium.
Krinkle set Security to None.
Krinkle removed a subscriber: wikibugs-l-list.

@matmarex Can you make sure this is reported in the CSSJanus issue tracker, and link it from the task description?

Imarlier subscribed.

If this issue still exists, it should be reported to the CSSJanus issue tracker.

If this issue still exists, it should be reported to the CSSJanus issue tracker.

...and https://www.mediawiki.org/wiki/Upstream_projects says that is https://github.com/cssjanus/cssjanus/issues

Krinkle renamed this task from CSSJanus only supports flipping one text-shadow or border-shadow in RTL languages while the CSS syntax allows multiple to Support flipping mutiple values under a text-shadow or border-shadow rule.Mar 28 2023, 3:08 AM
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)
Krinkle moved this task from Backlog to Accepted Enhancement on the CSSJanus board.
Krinkle removed subscribers: Imarlier, TrevorParscal.