Backed out 5 changesets (bug 1492958) for bc failures in browser/base/content/test/static/browser_parsable_css.js CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 12 Nov 2018 14:36:43 +0200
changeset 445938 442a3c0bcd48daaff9eb76cc8dae160c57dcbb3a
parent 445937 91edec50a1cf4fc681b542e289f89896b9a8a088
child 445939 43dbbb0cce0d823fdac9c9e997b1548d041eb820
push id35030
push usercsabou@mozilla.com
push dateTue, 13 Nov 2018 04:24:01 +0000
treeherdermozilla-central@f6df375b8698 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1492958
milestone65.0a1
backs outd7c8793ee054c4b37256fedb88e00b4cfb193ef2
e59edfbbd32739bcfb522e7b645851f1a4e386c6
5e643bc2e17b2125541148c56a0ca1b5ae3c40d4
59cf251c1a59ee8797bfe1609b7f7797d10f24e6
edc955448df6d25bff57269836980bf41c7f7315
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
Backed out 5 changesets (bug 1492958) for bc failures in browser/base/content/test/static/browser_parsable_css.js CLOSED TREE Backed out changeset d7c8793ee054 (bug 1492958) Backed out changeset e59edfbbd327 (bug 1492958) Backed out changeset 5e643bc2e17b (bug 1492958) Backed out changeset 59cf251c1a59 (bug 1492958) Backed out changeset edc955448df6 (bug 1492958)
devtools/shared/css/generated/properties-db.js
layout/generic/nsFrame.cpp
layout/style/ServoBindings.toml
layout/style/ServoCSSPropList.mako.py
layout/style/nsStyleConsts.h
layout/style/test/property_database.js
layout/style/test/test_non_content_accessible_values.html
servo/components/style/cbindgen.toml
servo/components/style/properties/data.py
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhands/ui.mako.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/computed/ui.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/ui.rs
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -1351,24 +1351,29 @@ exports.CSS_PROPERTIES = {
   },
   "-moz-user-select": {
     "isInherited": false,
     "subproperties": [
       "-moz-user-select"
     ],
     "supports": [],
     "values": [
+      "-moz-all",
       "-moz-none",
       "-moz-text",
       "all",
       "auto",
+      "element",
+      "elements",
       "inherit",
       "initial",
       "none",
       "text",
+      "toggle",
+      "tri-state",
       "unset"
     ]
   },
   "-moz-window-dragging": {
     "isInherited": false,
     "subproperties": [
       "-moz-window-dragging"
     ],
@@ -2742,24 +2747,29 @@ exports.CSS_PROPERTIES = {
   },
   "-webkit-user-select": {
     "isInherited": false,
     "subproperties": [
       "-moz-user-select"
     ],
     "supports": [],
     "values": [
+      "-moz-all",
       "-moz-none",
       "-moz-text",
       "all",
       "auto",
+      "element",
+      "elements",
       "inherit",
       "initial",
       "none",
       "text",
+      "toggle",
+      "tri-state",
       "unset"
     ]
   },
   "align-content": {
     "isInherited": false,
     "subproperties": [
       "align-content"
     ],
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4157,17 +4157,19 @@ nsIFrame::IsSelectable(StyleUserSelect* 
   //
   StyleUserSelect selectStyle  = StyleUserSelect::Auto;
   nsIFrame* frame              = const_cast<nsIFrame*>(this);
   bool containsEditable        = false;
 
   while (frame) {
     const nsStyleUIReset* userinterface = frame->StyleUIReset();
     switch (userinterface->mUserSelect) {
-      case StyleUserSelect::All: {
+      case StyleUserSelect::All:
+      case StyleUserSelect::MozAll:
+      {
         // override the previous values
         if (selectStyle != StyleUserSelect::MozText) {
           selectStyle = userinterface->mUserSelect;
         }
         nsIContent* frameContent = frame->GetContent();
         containsEditable = frameContent &&
           frameContent->EditableDescendantCount() > 0;
         break;
@@ -4181,16 +4183,18 @@ nsIFrame::IsSelectable(StyleUserSelect* 
     }
     frame = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
   }
 
   // convert internal values to standard values
   if (selectStyle == StyleUserSelect::Auto ||
       selectStyle == StyleUserSelect::MozText) {
     selectStyle = StyleUserSelect::Text;
+  } else if (selectStyle == StyleUserSelect::MozAll) {
+    selectStyle = StyleUserSelect::All;
   }
 
   // If user tries to select all of a non-editable content,
   // prevent selection if it contains editable content.
   bool allowSelection = true;
   if (selectStyle == StyleUserSelect::All) {
     allowSelection = !containsEditable;
   }
@@ -4259,16 +4263,18 @@ nsFrame::HandlePress(nsPresContext* aPre
   // check whether style allows selection
   // if not, don't tell selection the mouse event even occurred.
   StyleUserSelect selectStyle;
   // check for select: none
   if (!IsSelectable(&selectStyle)) {
     return NS_OK;
   }
 
+  // When implementing StyleUserSelect::Element, StyleUserSelect::Elements and
+  // StyleUserSelect::Toggle, need to change this logic
   bool useFrameSelection = (selectStyle == StyleUserSelect::Text);
 
   // If the mouse is dragged outside the nearest enclosing scrollable area
   // while making a selection, the area will be scrolled. To do this, capture
   // the mouse on the nearest scrollable frame. If there isn't a scrollable
   // frame, or something else is already capturing the mouse, there's no
   // reason to capture.
   if (!nsIPresShell::GetCapturingContent()) {
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -391,17 +391,16 @@ cbindgen-types = [
     { gecko = "StyleDisplayMode", servo = "gecko::media_features::DisplayMode" },
     { gecko = "StyleFillRule", servo = "values::generics::basic_shape::FillRule" },
     { gecko = "StyleFontDisplay", servo = "font_face::FontDisplay" },
     { gecko = "StyleFontFaceSourceListComponent", servo = "font_face::FontFaceSourceListComponent" },
     { gecko = "StyleFontLanguageOverride", servo = "values::computed::font::FontLanguageOverride" },
     { gecko = "StylePathCommand", servo = "values::specified::svg_path::PathCommand" },
     { gecko = "StyleUnicodeRange", servo = "cssparser::UnicodeRange" },
     { gecko = "StyleOverflowWrap", servo = "values::computed::OverflowWrap" },
-    { gecko = "StyleUserSelect", servo = "values::computed::UserSelect" },
 ]
 
 mapped-generic-types = [
     { generic = true, gecko = "mozilla::RustCell", servo = "::std::cell::Cell" },
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },
     { generic = false, gecko = "mozilla::ServoRuleNode", servo = "Option<::rule_tree::StrongRuleNode>" },
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -105,17 +105,16 @@ SERIALIZED_PREDEFINED_TYPES = [
     "OverflowWrap",
     "Quotes",
     "Resize",
     "Scale",
     "TextAlign",
     "Translate",
     "TimingFunction",
     "TransformStyle",
-    "UserSelect",
     "background::BackgroundSize",
     "basic_shape::ClippingShape",
     "basic_shape::FloatAreaShape",
     "position::HorizontalPosition",
     "position::VerticalPosition",
     "url::ImageUrlOrNone",
 ]
 
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -218,16 +218,30 @@ enum class StyleUserFocus : uint8_t {
   Normal,
   SelectAll,
   SelectBefore,
   SelectAfter,
   SelectSame,
   SelectMenu,
 };
 
+// user-select
+enum class StyleUserSelect : uint8_t {
+  None,
+  Text,
+  Element,
+  Elements,
+  All,
+  Toggle,
+  TriState,
+  Auto,     // internal value - please use nsFrame::IsSelectable()
+  MozAll,   // force selection of all children, unless an ancestor has NONE set - bug 48096
+  MozText,  // Like TEXT, except that it won't get overridden by ancestors having ALL.
+};
+
 // user-input
 enum class StyleUserInput : uint8_t {
   None,
   Auto,
 };
 
 // user-modify
 enum class StyleUserModify : uint8_t {
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2620,17 +2620,17 @@ var gCSSProperties = {
     other_values: [ "read-write", "write-only" ],
     invalid_values: []
   },
   "-moz-user-select": {
     domProp: "MozUserSelect",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
-    other_values: [ "none", "text", "all", "-moz-none" ],
+    other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ],
     invalid_values: []
   },
   "background": {
     domProp: "background",
     inherited: false,
     type: CSS_TYPE_TRUE_SHORTHAND,
     subproperties: [ "background-attachment", "background-color", "background-image", "background-position-x", "background-position-y", "background-repeat", "background-clip", "background-origin", "background-size" ],
     initial_values: [ "transparent", "none", "repeat", "scroll", "0% 0%", "top left", "left top", "0% 0% / auto", "top left / auto", "left top / auto", "0% 0% / auto auto",
--- a/layout/style/test/test_non_content_accessible_values.html
+++ b/layout/style/test/test_non_content_accessible_values.html
@@ -105,19 +105,16 @@ const NON_CONTENT_ACCESSIBLE_VALUES = {
     "-moz-mac-disclosure-button-open",
     "-moz-mac-source-list",
     "-moz-mac-source-list-selection",
     "-moz-mac-vibrancy-dark",
     "-moz-mac-vibrancy-light",
     "-moz-mac-vibrant-titlebar-dark",
     "-moz-mac-vibrant-titlebar-light",
   ],
-  "-moz-user-select": [
-    "-moz-text",
-  ],
 };
 
 if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) {
   NON_CONTENT_ACCESSIBLE_VALUES.display.push("-moz-box", "-moz-inline-box");
 }
 
 const sheet = document.getElementById("sheet");
 const div = document.querySelector("div");
--- a/servo/components/style/cbindgen.toml
+++ b/servo/components/style/cbindgen.toml
@@ -48,11 +48,10 @@ include = [
   "FillRule",
   "FontDisplay",
   "FontFaceSourceListComponent",
   "FontLanguageOverride",
   "OverflowWrap",
   "TimingFunction",
   "PathCommand",
   "UnicodeRange",
-  "UserSelect",
 ]
 item_types = ["enums", "structs", "typedefs"]
--- a/servo/components/style/properties/data.py
+++ b/servo/components/style/properties/data.py
@@ -331,17 +331,16 @@ class Longhand(object):
                 "SVGOpacity",
                 "SVGPaintOrder",
                 "ScrollSnapType",
                 "TextAlign",
                 "TextDecorationLine",
                 "TextEmphasisPosition",
                 "TouchAction",
                 "TransformStyle",
-                "UserSelect",
                 "XSpan",
                 "XTextZoom",
                 "ZIndex",
             }
         if self.name == "overflow-y":
             return True
         return bool(self.keyword)
 
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1424,17 +1424,16 @@ impl Clone for ${style_struct.gecko_stru
         "Position": impl_position,
         "RGBAColor": impl_rgba_color,
         "SVGLength": impl_svg_length,
         "SVGOpacity": impl_svg_opacity,
         "SVGPaint": impl_svg_paint,
         "SVGWidth": impl_svg_length,
         "Transform": impl_transform,
         "TransformOrigin": impl_transform_origin,
-        "UserSelect": impl_simple,
         "url::UrlOrNone": impl_css_url,
     }
 
     def longhand_method(longhand):
         args = dict(ident=longhand.ident, gecko_ffi_name=longhand.gecko_ffi_name)
 
         # get the method and pass additional keyword or type-specific arguments
         if longhand.logical:
--- a/servo/components/style/properties/longhands/ui.mako.rs
+++ b/servo/components/style/properties/longhands/ui.mako.rs
@@ -26,23 +26,25 @@
     products="gecko",
     gecko_enum_prefix="StyleScrollbarWidth",
     animation_value_type="discrete",
     gecko_pref="layout.css.scrollbar-width.enabled",
     enabled_in="chrome",
     spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width"
 )}
 
-${helpers.predefined_type(
+${helpers.single_keyword(
     "-moz-user-select",
-    "UserSelect",
-    "computed::UserSelect::Auto",
+    "auto text none all element elements toggle tri-state -moz-all -moz-text",
     products="gecko",
+    alias="-webkit-user-select",
     gecko_ffi_name="mUserSelect",
-    alias="-webkit-user-select",
+    gecko_enum_prefix="StyleUserSelect",
+    gecko_strip_moz_prefix=False,
+    aliases="-moz-none=none",
     animation_value_type="discrete",
     spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select",
 )}
 
 // TODO(emilio): This probably should be hidden from content.
 ${helpers.single_keyword(
     "-moz-window-dragging",
     "default drag no-drag",
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -79,17 +79,17 @@ pub use self::table::XSpan;
 pub use self::text::{InitialLetter, LetterSpacing, LineHeight, MozTabSize};
 pub use self::text::{OverflowWrap, TextOverflow, WordSpacing};
 pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
 pub use self::time::Time;
 pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
 pub use self::transform::{TransformOrigin, TransformStyle, Translate};
 #[cfg(feature = "gecko")]
 pub use self::ui::CursorImage;
-pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect};
+pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon};
 pub use super::specified::{BorderStyle, TextDecorationLine};
 pub use super::{Auto, Either, None_};
 pub use app_units::Au;
 
 #[cfg(feature = "gecko")]
 pub mod align;
 pub mod angle;
 pub mod background;
--- a/servo/components/style/values/computed/ui.rs
+++ b/servo/components/style/values/computed/ui.rs
@@ -5,17 +5,17 @@
 //! Computed values for UI properties
 
 use crate::values::computed::color::Color;
 use crate::values::computed::url::ComputedImageUrl;
 use crate::values::computed::Number;
 use crate::values::generics::ui as generics;
 use crate::values::{Auto, Either};
 
-pub use crate::values::specified::ui::{MozForceBrokenImageIcon, UserSelect};
+pub use crate::values::specified::ui::MozForceBrokenImageIcon;
 
 /// auto | <color>
 pub type ColorOrAuto = Either<Color, Auto>;
 
 /// A computed value for the `cursor` property.
 pub type Cursor = generics::Cursor<CursorImage>;
 
 /// A computed value for item of `image cursors`.
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -77,17 +77,17 @@ pub use self::table::XSpan;
 pub use self::text::{InitialLetter, LetterSpacing, LineHeight, MozTabSize, TextAlign};
 pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle};
 pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing};
 pub use self::time::Time;
 pub use self::transform::{Rotate, Scale, Transform};
 pub use self::transform::{TransformOrigin, TransformStyle, Translate};
 #[cfg(feature = "gecko")]
 pub use self::ui::CursorImage;
-pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect};
+pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon};
 pub use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
 
 #[cfg(feature = "gecko")]
 pub mod align;
 pub mod angle;
 pub mod background;
 pub mod basic_shape;
 pub mod border;
--- a/servo/components/style/values/specified/ui.rs
+++ b/servo/components/style/values/specified/ui.rs
@@ -135,48 +135,8 @@ impl Parse for ScrollbarColor {
             return Ok(generics::ScrollbarColor::Auto);
         }
         Ok(generics::ScrollbarColor::Colors {
             thumb: Color::parse(context, input)?,
             track: Color::parse(context, input)?,
         })
     }
 }
-
-fn in_ua_sheet(context: &ParserContext) -> bool {
-    use crate::stylesheets::Origin;
-    context.stylesheet_origin == Origin::UserAgent
-}
-
-/// The specified value for the `user-select` property.
-///
-/// https://drafts.csswg.org/css-ui-4/#propdef-user-select
-#[allow(missing_docs)]
-#[derive(
-    Clone,
-    Copy,
-    Debug,
-    Eq,
-    MallocSizeOf,
-    Parse,
-    PartialEq,
-    SpecifiedValueInfo,
-    ToComputedValue,
-    ToCss,
-)]
-#[repr(u8)]
-pub enum UserSelect {
-    Auto,
-    Text,
-    #[parse(aliases = "-moz-none")]
-    None,
-    /// Force selection of all children, unless an ancestor has `none` set.
-    All,
-    /// Like `text`, except that it won't get overridden by ancestors having
-    /// `all`.
-    ///
-    /// FIXME(emilio): This only has one use in contenteditable.css, can we find
-    /// a better way to do this?
-    ///
-    /// See bug 1181130.
-    #[parse(condition = "in_ua_sheet")]
-    MozText,
-}