From 63a0851b9429eb4b1198727a0b90c4c97643d0dc Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Mon, 28 Mar 2016 11:11:24 +0200 Subject: [PATCH 1/2] Selection is blue on Windows and Mac, orange on Linux --- components/layout/display_list_builder.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index de6e707169c..b43391cf166 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -106,7 +106,10 @@ const INSERTION_POINT_LOGICAL_WIDTH: Au = Au(1 * AU_PER_PX); // Colors for selected text. TODO (#8077): Use the ::selection pseudo-element to set these. const SELECTION_FOREGROUND_COLOR: RGBA = RGBA { red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0 }; +#[cfg(target_os="linux")] const SELECTION_BACKGROUND_COLOR: RGBA = RGBA { red: 1.0, green: 0.5, blue: 0.0, alpha: 1.0 }; +#[cfg(not(target_os="linux"))] +const SELECTION_BACKGROUND_COLOR: RGBA = RGBA { red: 0.69, green: 0.84, blue: 1.0, alpha: 1.0 }; // TODO(gw): The transforms spec says that perspective length must // be positive. However, there is some confusion between the spec From 2bbf35f2aa71920384b2ba72b639852f692f1ef4 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Mon, 28 Mar 2016 18:26:17 +0800 Subject: [PATCH 2/2] Use black on blue color for default selection color --- components/layout/display_list_builder.rs | 5 +---- tests/wpt/mozilla/tests/css/input_selection_a.html | 4 ++-- tests/wpt/mozilla/tests/css/input_selection_ref.html | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index b43391cf166..c10d3853ead 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -105,10 +105,7 @@ impl<'a> DisplayListBuildState<'a> { const INSERTION_POINT_LOGICAL_WIDTH: Au = Au(1 * AU_PER_PX); // Colors for selected text. TODO (#8077): Use the ::selection pseudo-element to set these. -const SELECTION_FOREGROUND_COLOR: RGBA = RGBA { red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0 }; -#[cfg(target_os="linux")] -const SELECTION_BACKGROUND_COLOR: RGBA = RGBA { red: 1.0, green: 0.5, blue: 0.0, alpha: 1.0 }; -#[cfg(not(target_os="linux"))] +const SELECTION_FOREGROUND_COLOR: RGBA = RGBA { red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0 }; const SELECTION_BACKGROUND_COLOR: RGBA = RGBA { red: 0.69, green: 0.84, blue: 1.0, alpha: 1.0 }; // TODO(gw): The transforms spec says that perspective length must diff --git a/tests/wpt/mozilla/tests/css/input_selection_a.html b/tests/wpt/mozilla/tests/css/input_selection_a.html index 0e923f9425f..59484fc6db8 100644 --- a/tests/wpt/mozilla/tests/css/input_selection_a.html +++ b/tests/wpt/mozilla/tests/css/input_selection_a.html @@ -12,8 +12,8 @@ padding: 0; } ::selection { - color: white; - background: rgba(255, 127, 0, 1.0); + color: black; + background: rgba(176, 214, 255, 1.0); } diff --git a/tests/wpt/mozilla/tests/css/input_selection_ref.html b/tests/wpt/mozilla/tests/css/input_selection_ref.html index 6903f7d9118..2f6dcd296f2 100644 --- a/tests/wpt/mozilla/tests/css/input_selection_ref.html +++ b/tests/wpt/mozilla/tests/css/input_selection_ref.html @@ -7,8 +7,8 @@