Bug 1592389 - Rename Mozfield / Mozfieldtext to Field and Fieldtext r=emilio

Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility

Differential Revision: https://phabricator.services.mozilla.com/D50989

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sam Mauldin 2019-11-02 21:28:49 +00:00
Родитель 34a71cf8f2
Коммит 16993481ab
10 изменённых файлов: 33 добавлений и 29 удалений

Просмотреть файл

@ -4076,9 +4076,9 @@ void nsTextPaintStyle::InitCommonColors() {
mFrameBackgroundColor = NS_ComposeColors(defaultBgColor, bgColor);
mSystemFieldForegroundColor =
LookAndFeel::GetColor(LookAndFeel::ColorID::MozFieldtext);
LookAndFeel::GetColor(LookAndFeel::ColorID::Fieldtext);
mSystemFieldBackgroundColor =
LookAndFeel::GetColor(LookAndFeel::ColorID::MozField);
LookAndFeel::GetColor(LookAndFeel::ColorID::Field);
if (bgFrame->IsThemed()) {
// Assume a native widget has sufficient contrast always

Просмотреть файл

@ -119,6 +119,10 @@ pub enum SystemColor {
Buttonshadow,
Buttontext,
Captiontext,
#[parse(aliases = "-moz-field")]
Field,
#[parse(aliases = "-moz-fieldtext")]
Fieldtext,
Graytext,
Highlight,
Highlighttext,
@ -139,8 +143,6 @@ pub enum SystemColor {
Windowframe,
Windowtext,
MozButtondefault,
MozField,
MozFieldtext,
MozDialog,
MozDialogtext,
/// Used to highlight valid regions to drop something onto.

Просмотреть файл

@ -28,6 +28,8 @@ test_valid_value("color", "rgb(-2, 3, 4)", "rgb(0, 3, 4)");
test_valid_value("color", "rgb(100, 200, 300)", "rgb(100, 200, 255)");
test_valid_value("color", "rgb(20, 10, 0, -10)", "rgba(20, 10, 0, 0)"); // Not supported by Edge/Safari.
test_valid_value("color", "rgb(100%, 200%, 300%)", "rgb(255, 255, 255)");
test_valid_value("color", "field");
test_valid_value("color", "fieldtext");
</script>
</body>
</html>

Просмотреть файл

@ -248,10 +248,10 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
break;
case ColorID::MozEventreerow:
case ColorID::MozField:
case ColorID::Field:
aColor = mSystemColors.colorBackground;
break;
case ColorID::MozFieldtext:
case ColorID::Fieldtext:
aColor = mSystemColors.textColorPrimary;
break;
case ColorID::MozDialog:

Просмотреть файл

@ -328,11 +328,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
aColor = mColorWindowFrame;
break;
case ColorID::Window:
case ColorID::MozField:
case ColorID::Field:
case ColorID::MozCombobox:
aColor = NS_RGB(0xff, 0xff, 0xff);
break;
case ColorID::MozFieldtext:
case ColorID::Fieldtext:
case ColorID::MozComboboxtext:
aColor = mColorFieldText;
break;

Просмотреть файл

@ -218,7 +218,7 @@ nsresult nsLookAndFeel::InitCellHighlightColors() {
// on top of another background
int32_t minLuminosityDifference = NS_SUFFICIENT_LUMINOSITY_DIFFERENCE / 5;
int32_t backLuminosityDifference =
NS_LUMINOSITY_DIFFERENCE(mMozWindowBackground, mMozFieldBackground);
NS_LUMINOSITY_DIFFERENCE(mMozWindowBackground, mFieldBackground);
if (backLuminosityDifference >= minLuminosityDifference) {
mMozCellHighlightBackground = mMozWindowBackground;
mMozCellHighlightText = mMozWindowText;
@ -227,8 +227,8 @@ nsresult nsLookAndFeel::InitCellHighlightColors() {
uint16_t hue, sat, luminance;
uint8_t alpha;
mMozCellHighlightBackground = mMozFieldBackground;
mMozCellHighlightText = mMozFieldText;
mMozCellHighlightBackground = mFieldBackground;
mMozCellHighlightText = mFieldText;
NS_RGB2HSV(mMozCellHighlightBackground, hue, sat, luminance, alpha);
@ -425,11 +425,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
break;
case ColorID::MozEventreerow:
case ColorID::MozField:
aColor = mMozFieldBackground;
case ColorID::Field:
aColor = mFieldBackground;
break;
case ColorID::MozFieldtext:
aColor = mMozFieldText;
case ColorID::Fieldtext:
aColor = mFieldText;
break;
case ColorID::MozButtondefault:
// default button border color
@ -1062,9 +1062,9 @@ void nsLookAndFeel::EnsureInit() {
style = GetStyleContext(MOZ_GTK_TEXT_VIEW_TEXT);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
ApplyColorOver(color, &bgColor);
mMozFieldBackground = GDK_RGBA_TO_NS_RGBA(bgColor);
mFieldBackground = GDK_RGBA_TO_NS_RGBA(bgColor);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
mMozFieldText = GDK_RGBA_TO_NS_RGBA(color);
mFieldText = GDK_RGBA_TO_NS_RGBA(color);
// Selected text and background
gtk_style_context_get_background_color(

Просмотреть файл

@ -72,8 +72,8 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
nscolor mNativeHyperLinkText = kBlack;
nscolor mComboBoxText = kBlack;
nscolor mComboBoxBackground = kWhite;
nscolor mMozFieldText = kBlack;
nscolor mMozFieldBackground = kWhite;
nscolor mFieldText = kBlack;
nscolor mFieldBackground = kWhite;
nscolor mMozWindowText = kBlack;
nscolor mMozWindowBackground = kWhite;
nscolor mMozWindowActiveBorder = kBlack;

Просмотреть файл

@ -27,8 +27,8 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
switch (aID) {
// Override the solid black that GetStandinForNativeColor provides for
// -moz-FieldText, to match our behavior under the real GTK.
case ColorID::MozFieldtext:
// FieldText, to match our behavior under the real GTK.
case ColorID::Fieldtext:
aColor = NS_RGB(0x21, 0x21, 0x21);
break;

Просмотреть файл

@ -146,6 +146,8 @@ const char nsXPLookAndFeel::sColorPrefs[][41] = {
"ui.buttonshadow",
"ui.buttontext",
"ui.captiontext",
"ui.-moz-field",
"ui.-moz-fieldtext",
"ui.graytext",
"ui.highlight",
"ui.highlighttext",
@ -166,8 +168,6 @@ const char nsXPLookAndFeel::sColorPrefs[][41] = {
"ui.windowframe",
"ui.windowtext",
"ui.-moz-buttondefault",
"ui.-moz-field",
"ui.-moz-fieldtext",
"ui.-moz-dialog",
"ui.-moz-dialogtext",
"ui.-moz-dragtargetzone",
@ -629,10 +629,10 @@ nscolor nsXPLookAndFeel::GetStandinForNativeColor(ColorID aID) {
case ColorID::MozButtondefault:
result = NS_RGB(0x69, 0x69, 0x69);
break;
case ColorID::MozField:
case ColorID::Field:
result = NS_RGB(0xFF, 0xFF, 0xFF);
break;
case ColorID::MozFieldtext:
case ColorID::Fieldtext:
result = NS_RGB(0x00, 0x00, 0x00);
break;
case ColorID::MozDialog:
@ -837,8 +837,8 @@ nsresult nsXPLookAndFeel::GetColorImpl(ColorID aID,
// from the CSS3 working draft (not yet finalized)
// http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color
case ColorID::MozField:
case ColorID::MozFieldtext:
case ColorID::Field:
case ColorID::Fieldtext:
aResult = NS_RGB(0xff, 0x00, 0xff);
break;

Просмотреть файл

@ -292,11 +292,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
break;
case ColorID::MozEventreerow:
case ColorID::MozOddtreerow:
case ColorID::MozField:
case ColorID::Field:
case ColorID::MozCombobox:
idx = COLOR_WINDOW;
break;
case ColorID::MozFieldtext:
case ColorID::Fieldtext:
case ColorID::MozComboboxtext:
idx = COLOR_WINDOWTEXT;
break;