selected text's background color is hardly to see

RESOLVED WORKSFORME

Status

()

P4
minor
RESOLVED WORKSFORME
2 years ago
2 years ago

People

(Reporter: evilsign, Unassigned)

Tracking

({testcase})

45 Branch
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

297.93 KB, image/png
Details
(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160404012304

Steps to reproduce:

just open any website which is not defined *::-moz-selection css style.


Actual results:

1. select any length of text. 
2. there is not background color,  and the color of selected text is slightly deeper.


Expected results:

the selected text has a background color and the text's color is reversed .

Updated

2 years ago
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Can you give an example URL where the problem occurs?
Please upload a screenshot of the selected text
(use the "Add an attachment" link on this bug report)
Thanks.
Flags: needinfo?(evilsign)
(Reporter)

Comment 2

2 years ago
Created attachment 8739982 [details]
p.png

This is the test page:
http://www.hacksign.cn/test.html
What I've done is:
1. open this page.
2. right click mouse -> select all
3. take a screen shot.
As you can see,
first & last line is displayed as css defined.
but second line seems like 'un-selected'.
Flags: needinfo?(evilsign)
Thanks.  That test page works fine for me using FF45 and Nightly builds on Linux -
the middle line renders white text on a blue background.
(I'm testing official Mozilla builds though, not distro builds)

What's the normal text selection colors you see on other pages?
If you're using a distro build, can you try the official Mozilla build please?
https://www.mozilla.org/firefox/
Does the problem also occur in a fresh profile?
Flags: needinfo?(evilsign)
Keywords: testcase
(Reporter)

Comment 4

2 years ago
(In reply to Mats Palmgren (:mats) from comment #3)
> Thanks.  That test page works fine for me using FF45 and Nightly builds on
> Linux -
> the middle line renders white text on a blue background.
> (I'm testing official Mozilla builds though, not distro builds)
> 
> What's the normal text selection colors you see on other pages?
> If you're using a distro build, can you try the official Mozilla build
> please?
> https://www.mozilla.org/firefox/
> Does the problem also occur in a fresh profile?

I've downloaded the lastest version from this url: 
https://download.mozilla.org/?product=firefox-45.0.2-SSL&os=linux64&lang=zh-CN
I've tested with a new profile.
And the problem still exists.

the normal text selection on other page is exactly like the second line of the attached screenshot:no background color and the text is slightly bolded with original color(if the page does not defined -moz-selection css style).

It seems like firefox did not get the gtk setting of selected_bg_color and selected_fg_color.
Flags: needinfo?(evilsign)
OK, thanks.  So it seems to be some gtk theme integration issue.
BTW, what is your gtk setting of selected_bg_color and selected_fg_color?
and what is the name of the theme?
Severity: normal → minor
Component: CSS Parsing and Computation → Widget: Gtk
Flags: needinfo?(evilsign)
Priority: -- → P4
(Reporter)

Comment 6

2 years ago
(In reply to Mats Palmgren (:mats) from comment #5)
> OK, thanks.  So it seems to be some gtk theme integration issue.
> BTW, what is your gtk setting of selected_bg_color and selected_fg_color?
> and what is the name of the theme?

this is the theme I use:
https://github.com/Hacksign/configs/tree/master/usr/share/themes/TraditionalOk

selected_bg_color & selected_fg_color is(gtk-3.0) :
@define-color theme_selected_bg_color #1894ff;
@define-color theme_selected_fg_color #ffffff;

BTW:
the selected text & background is normal in 'gtk3-demo' application .
it is white text color with blue background.
Flags: needinfo?(evilsign)
Firefox 45.0.2 uses GTK2.  How does selected text look in gtk-demo?

Have you seen expected behavior with this theme in previous Firefox versions?
(Reporter)

Comment 8

2 years ago
(In reply to Karl Tomlinson (ni?:karlt) from comment #7)
> Firefox 45.0.2 uses GTK2.  How does selected text look in gtk-demo?
> 
> Have you seen expected behavior with this theme in previous Firefox versions?

gtk-demo & gtk3-demo has same behavior:
selected text is white, and selected background is blue.
in thunderbird,everything is normal.

no, I have never seen expected behavior with this theme in previous Firefox versions.
because I've just update my gtk to gtk 3.20.3. the old theme I use is broken with gtk 3.20.
firefox also has this problem with gtk 3.20 & old theme.
(Reporter)

Comment 9

2 years ago
It seems that, firefox not only use gtk2.0's gtkrc style defination, but also use gtk3.0's css style defination.
If I put this line in gtk3.0's .css file:
scrollbar {
    ....
    -GtkRange-slider-width: 20;
    ....
}

scrollbar of firefox will change its width.
But if I try to control the width of scrollbar like this:
scrollbar.vertical slider{
    min-width: 20px;
}
this will be no effect on firefox.
but this affected gtk3-demo's vertical scrollbar size.

as this document said:
https://developer.gnome.org/gtk3/stable/GtkRange.html#GtkRange--s-slider-width
-GtkRange-slider-width is deprecated.
I was assuming that Firefox 45.0.2 was Mozilla's build.  Some distributions have been building Firefox against GTK3 (which is not the default configuration).
Issues from non-default configurations should usually be reported with the distribution, but Firefox 46 will use GTK3 by default.

GTK 3.20 has been designed to break applications and themes that were not designed specifically with 3.20 in mind.  It's one of those GTK releases that no distribution should ship.  Bug 1230955 covers adding support for 3.20 to address comment 9.
(Reporter)

Comment 11

2 years ago
(In reply to Karl Tomlinson (ni?:karlt) from comment #10)
> I was assuming that Firefox 45.0.2 was Mozilla's build.  Some distributions
> have been building Firefox against GTK3 (which is not the default
> configuration).
> Issues from non-default configurations should usually be reported with the
> distribution, but Firefox 46 will use GTK3 by default.
> 
> GTK 3.20 has been designed to break applications and themes that were not
> designed specifically with 3.20 in mind.  It's one of those GTK releases
> that no distribution should ship.  Bug 1230955 covers adding support for
> 3.20 to address comment 9.

well, I've tested nightly build 48.0a1.
the selected text & background problem is fixed.
but there still have some problem of scrollbar slider. color of the slider is gone, it is just as same as background color.
I will report as soon as firefox 46 appears in my distribution's repository.
Thanks for your help ~
(In reply to evilsign from comment #11)
> well, I've tested nightly build 48.0a1.
> the selected text & background problem is fixed.

Thanks for testing.  It sounds like the selected text problem may have been because 45.0 was not yet ready for use with GTK3.  Feel free to reopen if the problem exists in 46.  Bug 1230955 is for the slider with 3.20.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.