author | Martin Stransky <stransky@redhat.com> |
Mon, 07 Jan 2019 14:43:31 +0000 | |
changeset 452724 | f4fc0e5c9d4a8fcc6e93cff2cde0362ac04b8016 |
parent 452723 | 4b9c119d25c32828cf82027ab26a4a6175058dff |
child 452725 | 43c43fa35d2a9f4cd07548723cd3a9cdf66bf73d |
push id | 35328 |
push user | ncsoregi@mozilla.com |
push date | Mon, 07 Jan 2019 21:46:20 +0000 |
treeherder | mozilla-central@14d8f03b496c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jhorak |
bugs | 1516101 |
milestone | 66.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -266,31 +266,38 @@ class SelectionStyleProvider final { nsAutoCString style(":selected{"); // FYI: LookAndFeel always returns selection colors of GtkTextView. nscolor selectionForegroundColor; if (NS_SUCCEEDED( LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForeground, &selectionForegroundColor))) { double alpha = static_cast<double>(NS_GET_A(selectionForegroundColor)) / 0xFF; - style.AppendPrintf("color:rgba(%u,%u,%u,%f);", + style.AppendPrintf("color:rgba(%u,%u,%u,", NS_GET_R(selectionForegroundColor), NS_GET_G(selectionForegroundColor), - NS_GET_B(selectionForegroundColor), alpha); + NS_GET_B(selectionForegroundColor)); + // We can't use AppendPrintf here, because it does locale-specific + // formatting of floating-point values. + style.AppendFloat(alpha); + style.AppendPrintf(");"); + } nscolor selectionBackgroundColor; if (NS_SUCCEEDED( LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectBackground, &selectionBackgroundColor))) { double alpha = static_cast<double>(NS_GET_A(selectionBackgroundColor)) / 0xFF; - style.AppendPrintf("background-color:rgba(%u,%u,%u,%f);", + style.AppendPrintf("background-color:rgba(%u,%u,%u,", NS_GET_R(selectionBackgroundColor), NS_GET_G(selectionBackgroundColor), - NS_GET_B(selectionBackgroundColor), alpha); + NS_GET_B(selectionBackgroundColor)); + style.AppendFloat(alpha); + style.AppendPrintf(");"); } style.AppendLiteral("}"); gtk_css_provider_load_from_data(mProvider, style.get(), -1, nullptr); } private: static SelectionStyleProvider* sInstance; static bool sHasShutDown;