From b747b90cd85dddee604dff862006e6d5957ef469 Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Wed, 30 Oct 2019 10:17:29 +0200 Subject: [PATCH] Backed out changeset ec25a8482342 (bug 1592389) for mochitest failure at layout/style/test/test_value_computation.html. On a CLOSED TREE --- layout/generic/nsTextFrame.cpp | 4 ++-- layout/style/test/property_database.js | 2 -- .../components/style/values/specified/color.rs | 6 ++---- .../css/css-color/parsing/color-valid.html | 2 -- widget/android/nsLookAndFeel.cpp | 4 ++-- widget/cocoa/nsLookAndFeel.mm | 4 ++-- widget/gtk/nsLookAndFeel.cpp | 18 +++++++++--------- widget/gtk/nsLookAndFeel.h | 4 ++-- widget/headless/HeadlessLookAndFeelGTK.cpp | 4 ++-- widget/nsXPLookAndFeel.cpp | 8 ++++---- widget/windows/nsLookAndFeel.cpp | 4 ++-- 11 files changed, 27 insertions(+), 33 deletions(-) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 599817f29fdf..8ba4761889dc 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -4076,9 +4076,9 @@ void nsTextPaintStyle::InitCommonColors() { mFrameBackgroundColor = NS_ComposeColors(defaultBgColor, bgColor); mSystemFieldForegroundColor = - LookAndFeel::GetColor(LookAndFeel::ColorID::Fieldtext); + LookAndFeel::GetColor(LookAndFeel::ColorID::MozFieldtext); mSystemFieldBackgroundColor = - LookAndFeel::GetColor(LookAndFeel::ColorID::Field); + LookAndFeel::GetColor(LookAndFeel::ColorID::MozField); if (bgFrame->IsThemed()) { // Assume a native widget has sufficient contrast always diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 8c91835187bf..0d364831e32c 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -5196,8 +5196,6 @@ var gCSSProperties = { "hsl(1turn, 0%, 0%)", ], other_values: [ - "field", - "fieldtext", "green", "#f3c", "#fed292", diff --git a/servo/components/style/values/specified/color.rs b/servo/components/style/values/specified/color.rs index 01e5890d015b..acad3383014d 100644 --- a/servo/components/style/values/specified/color.rs +++ b/servo/components/style/values/specified/color.rs @@ -119,10 +119,6 @@ pub enum SystemColor { Buttonshadow, Buttontext, Captiontext, - #[parse(aliases = "-moz-field")] - Field, - #[parse(aliases = "-moz-fieldtext")] - Fieldtext, Graytext, Highlight, Highlighttext, @@ -143,6 +139,8 @@ pub enum SystemColor { Windowframe, Windowtext, MozButtondefault, + MozField, + MozFieldtext, MozDialog, MozDialogtext, /// Used to highlight valid regions to drop something onto. diff --git a/testing/web-platform/tests/css/css-color/parsing/color-valid.html b/testing/web-platform/tests/css/css-color/parsing/color-valid.html index 62df82623a4e..48e97561f40c 100644 --- a/testing/web-platform/tests/css/css-color/parsing/color-valid.html +++ b/testing/web-platform/tests/css/css-color/parsing/color-valid.html @@ -28,8 +28,6 @@ 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"); diff --git a/widget/android/nsLookAndFeel.cpp b/widget/android/nsLookAndFeel.cpp index 1be57cb9b100..e841ca98e31f 100644 --- a/widget/android/nsLookAndFeel.cpp +++ b/widget/android/nsLookAndFeel.cpp @@ -248,10 +248,10 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { break; case ColorID::MozEventreerow: - case ColorID::Field: + case ColorID::MozField: aColor = mSystemColors.colorBackground; break; - case ColorID::Fieldtext: + case ColorID::MozFieldtext: aColor = mSystemColors.textColorPrimary; break; case ColorID::MozDialog: diff --git a/widget/cocoa/nsLookAndFeel.mm b/widget/cocoa/nsLookAndFeel.mm index 9f18c7d695b6..979fd0393ffc 100644 --- a/widget/cocoa/nsLookAndFeel.mm +++ b/widget/cocoa/nsLookAndFeel.mm @@ -328,11 +328,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { aColor = mColorWindowFrame; break; case ColorID::Window: - case ColorID::Field: + case ColorID::MozField: case ColorID::MozCombobox: aColor = NS_RGB(0xff, 0xff, 0xff); break; - case ColorID::Fieldtext: + case ColorID::MozFieldtext: case ColorID::MozComboboxtext: aColor = mColorFieldText; break; diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp index 7d51ce02b813..432a39cbb52c 100644 --- a/widget/gtk/nsLookAndFeel.cpp +++ b/widget/gtk/nsLookAndFeel.cpp @@ -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, mFieldBackground); + NS_LUMINOSITY_DIFFERENCE(mMozWindowBackground, mMozFieldBackground); if (backLuminosityDifference >= minLuminosityDifference) { mMozCellHighlightBackground = mMozWindowBackground; mMozCellHighlightText = mMozWindowText; @@ -227,8 +227,8 @@ nsresult nsLookAndFeel::InitCellHighlightColors() { uint16_t hue, sat, luminance; uint8_t alpha; - mMozCellHighlightBackground = mFieldBackground; - mMozCellHighlightText = mFieldText; + mMozCellHighlightBackground = mMozFieldBackground; + mMozCellHighlightText = mMozFieldText; NS_RGB2HSV(mMozCellHighlightBackground, hue, sat, luminance, alpha); @@ -425,11 +425,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { break; case ColorID::MozEventreerow: - case ColorID::Field: - aColor = mFieldBackground; + case ColorID::MozField: + aColor = mMozFieldBackground; break; - case ColorID::Fieldtext: - aColor = mFieldText; + case ColorID::MozFieldtext: + aColor = mMozFieldText; 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); - mFieldBackground = GDK_RGBA_TO_NS_RGBA(bgColor); + mMozFieldBackground = GDK_RGBA_TO_NS_RGBA(bgColor); gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color); - mFieldText = GDK_RGBA_TO_NS_RGBA(color); + mMozFieldText = GDK_RGBA_TO_NS_RGBA(color); // Selected text and background gtk_style_context_get_background_color( diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h index b0926a9ecec0..eb73ff4cbae2 100644 --- a/widget/gtk/nsLookAndFeel.h +++ b/widget/gtk/nsLookAndFeel.h @@ -72,8 +72,8 @@ class nsLookAndFeel final : public nsXPLookAndFeel { nscolor mNativeHyperLinkText = kBlack; nscolor mComboBoxText = kBlack; nscolor mComboBoxBackground = kWhite; - nscolor mFieldText = kBlack; - nscolor mFieldBackground = kWhite; + nscolor mMozFieldText = kBlack; + nscolor mMozFieldBackground = kWhite; nscolor mMozWindowText = kBlack; nscolor mMozWindowBackground = kWhite; nscolor mMozWindowActiveBorder = kBlack; diff --git a/widget/headless/HeadlessLookAndFeelGTK.cpp b/widget/headless/HeadlessLookAndFeelGTK.cpp index 39e7cb87ba13..d40bd423290d 100644 --- a/widget/headless/HeadlessLookAndFeelGTK.cpp +++ b/widget/headless/HeadlessLookAndFeelGTK.cpp @@ -27,8 +27,8 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { switch (aID) { // Override the solid black that GetStandinForNativeColor provides for - // FieldText, to match our behavior under the real GTK. - case ColorID::Fieldtext: + // -moz-FieldText, to match our behavior under the real GTK. + case ColorID::MozFieldtext: aColor = NS_RGB(0x21, 0x21, 0x21); break; diff --git a/widget/nsXPLookAndFeel.cpp b/widget/nsXPLookAndFeel.cpp index 071dca7e6a60..6059143ebdca 100644 --- a/widget/nsXPLookAndFeel.cpp +++ b/widget/nsXPLookAndFeel.cpp @@ -629,10 +629,10 @@ nscolor nsXPLookAndFeel::GetStandinForNativeColor(ColorID aID) { case ColorID::MozButtondefault: result = NS_RGB(0x69, 0x69, 0x69); break; - case ColorID::Field: + case ColorID::MozField: result = NS_RGB(0xFF, 0xFF, 0xFF); break; - case ColorID::Fieldtext: + case ColorID::MozFieldtext: 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::Field: - case ColorID::Fieldtext: + case ColorID::MozField: + case ColorID::MozFieldtext: aResult = NS_RGB(0xff, 0x00, 0xff); break; diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp index 038400b0dd29..154b5067c050 100644 --- a/widget/windows/nsLookAndFeel.cpp +++ b/widget/windows/nsLookAndFeel.cpp @@ -292,11 +292,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { break; case ColorID::MozEventreerow: case ColorID::MozOddtreerow: - case ColorID::Field: + case ColorID::MozField: case ColorID::MozCombobox: idx = COLOR_WINDOW; break; - case ColorID::Fieldtext: + case ColorID::MozFieldtext: case ColorID::MozComboboxtext: idx = COLOR_WINDOWTEXT; break;