Bug 1348208 part 1 - Remove -moz-force-broken-image-icon. r=dbaron draft
authorXidorn Quan <me@upsuper.org>
Fri, 17 Mar 2017 22:49:39 +1100
changeset 501341 81fc42bbf88c1437ee4447e02a08e4f83e887272
parent 501340 5088f799f85c37c95c1e9435e3450085654d58c9
child 501342 5d65fc37426552d5701133a753e012396e980611
push id49935
push userxquan@mozilla.com
push dateMon, 20 Mar 2017 00:42:21 +0000
reviewersdbaron
bugs1348208
milestone55.0a1
Bug 1348208 part 1 - Remove -moz-force-broken-image-icon. r=dbaron MozReview-Commit-ID: 3UdSXIuXeJV
devtools/shared/css/generated/properties-db.js
dom/animation/test/mozilla/file_discrete-animations.html
layout/generic/nsImageFrame.cpp
layout/style/nsCSSPropList.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsComputedDOMStylePropertyList.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/test/property_database.js
layout/style/test/stylo-failures.md
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -968,30 +968,16 @@ exports.CSS_PROPERTIES = {
     "supports": [],
     "values": [
       "inherit",
       "initial",
       "normal",
       "unset"
     ]
   },
-  "-moz-force-broken-image-icon": {
-    "isInherited": false,
-    "subproperties": [
-      "-moz-force-broken-image-icon"
-    ],
-    "supports": [
-      7
-    ],
-    "values": [
-      "inherit",
-      "initial",
-      "unset"
-    ]
-  },
   "-moz-hyphens": {
     "isInherited": true,
     "subproperties": [
       "hyphens"
     ],
     "supports": [],
     "values": [
       "auto",
@@ -2900,17 +2886,16 @@ exports.CSS_PROPERTIES = {
       "font-variant-alternates",
       "font-variant-caps",
       "font-variant-east-asian",
       "font-variant-ligatures",
       "font-variant-numeric",
       "font-variant-position",
       "font-variation-settings",
       "font-weight",
-      "-moz-force-broken-image-icon",
       "grid-auto-columns",
       "grid-auto-flow",
       "grid-auto-rows",
       "grid-column-end",
       "grid-column-gap",
       "grid-column-start",
       "grid-row-end",
       "grid-row-gap",
--- a/dom/animation/test/mozilla/file_discrete-animations.html
+++ b/dom/animation/test/mozilla/file_discrete-animations.html
@@ -55,21 +55,16 @@ const gMozillaSpecificProperties = {
     from: "center",
     to: "end"
   },
   "-moz-float-edge": {
     // https://developer.mozilla.org/en/docs/Web/CSS/-moz-float-edge
     from: "margin-box",
     to: "content-box"
   },
-  "-moz-force-broken-image-icon": {
-    // https://developer.mozilla.org/en/docs/Web/CSS/-moz-force-broken-image-icon
-    from: "1",
-    to: "5"
-  },
   "image-rendering": {
     // https://drafts.csswg.org/css-images-3/#propdef-image-rendering
     from: "-moz-crisp-edges",
     to: "auto"
   },
   "-moz-stack-sizing": {
     // https://developer.mozilla.org/en/docs/Web/CSS/-moz-stack-sizing
     from: "ignore",
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -451,30 +451,26 @@ nsImageFrame::ShouldCreateImageFrameFor(
                HaveSpecifiedSize(aStyleContext->StylePosition()))) {
     // Image is fine; do the image frame thing
     return true;
   }
 
   // Check if we want to use a placeholder box with an icon or just
   // let the presShell make us into inline text.  Decide as follows:
   //
-  //  - if our special "force icons" style is set, show an icon
-  //  - else if our "do not show placeholders" pref is set, skip the icon
+  //  - if our "do not show placeholders" pref is set, skip the icon
   //  - else:
   //  - if there is a src attribute, there is no alt attribute,
   //    and this is not an <object> (which could not possibly have
   //    such an attribute), show an icon.
   //  - if QuirksMode, and the IMG has a size show an icon.
   //  - otherwise, skip the icon
   bool useSizedBox;
   
-  if (aStyleContext->StyleUIReset()->mForceBrokenImageIcon) {
-    useSizedBox = true;
-  }
-  else if (gIconLoad && gIconLoad->mPrefForceInlineAltText) {
+  if (gIconLoad && gIconLoad->mPrefForceInlineAltText) {
     useSizedBox = false;
   }
   else if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::src) &&
            !aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::alt) &&
            !aElement->IsHTMLElement(nsGkAtoms::object) &&
            !aElement->IsHTMLElement(nsGkAtoms::input)) {
     // Use a sized box if we have no alt text.  This means no alt attribute
     // and the node is not an object or an input (since those always have alt
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -2080,27 +2080,16 @@ CSS_PROP_FONT(
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
         CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
         // NOTE: This property has range restrictions on interpolation!
     "",
     0,
     kFontWeightKTable,
     offsetof(nsStyleFont, mFont.weight),
     eStyleAnimType_Custom)
-CSS_PROP_UIRESET(
-    -moz-force-broken-image-icon,
-    _moz_force_broken_image_icon,
-    CSS_PROP_DOMPROP_PREFIXED(ForceBrokenImageIcon),
-    CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_VALUE_NONNEGATIVE,
-    "",
-    VARIANT_HI,
-    nullptr,
-    CSS_PROP_NO_OFFSET,
-    eStyleAnimType_Discrete) // bug 58646
 CSS_PROP_SHORTHAND(
     grid,
     grid,
     Grid,
     CSS_PROPERTY_PARSE_FUNCTION,
     "layout.css.grid.enabled")
 CSS_PROP_SHORTHAND(
     grid-area,
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -4649,24 +4649,16 @@ nsComputedDOMStyle::DoGetFloatEdge()
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(uint8_t(StyleBorder()->mFloatEdge),
                                    nsCSSProps::kFloatEdgeKTable));
   return val.forget();
 }
 
 already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetForceBrokenImageIcon()
-{
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetNumber(StyleUIReset()->mForceBrokenImageIcon);
-  return val.forget();
-}
-
-already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetImageOrientation()
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   nsAutoString string;
   nsStyleImageOrientation orientation = StyleVisibility()->mImageOrientation;
 
   if (orientation.IsFromImage()) {
     string.AppendLiteral("from-image");
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -497,17 +497,16 @@ private:
   already_AddRefed<CSSValue> DoGetScrollSnapPointsY();
   already_AddRefed<CSSValue> DoGetScrollSnapDestination();
   already_AddRefed<CSSValue> DoGetScrollSnapCoordinate();
   already_AddRefed<CSSValue> DoGetShapeOutside();
 
   /* User interface properties */
   already_AddRefed<CSSValue> DoGetCaretColor();
   already_AddRefed<CSSValue> DoGetCursor();
-  already_AddRefed<CSSValue> DoGetForceBrokenImageIcon();
   already_AddRefed<CSSValue> DoGetIMEMode();
   already_AddRefed<CSSValue> DoGetUserFocus();
   already_AddRefed<CSSValue> DoGetUserInput();
   already_AddRefed<CSSValue> DoGetUserModify();
   already_AddRefed<CSSValue> DoGetUserSelect();
   already_AddRefed<CSSValue> DoGetWindowDragging();
 
   /* Column properties */
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -282,17 +282,16 @@ COMPUTED_STYLE_PROP(_moz_border_right_co
 COMPUTED_STYLE_PROP(_moz_border_top_colors,        BorderTopColors)
 COMPUTED_STYLE_PROP(_moz_box_align,                BoxAlign)
 COMPUTED_STYLE_PROP(_moz_box_direction,            BoxDirection)
 COMPUTED_STYLE_PROP(_moz_box_flex,                 BoxFlex)
 COMPUTED_STYLE_PROP(_moz_box_ordinal_group,        BoxOrdinalGroup)
 COMPUTED_STYLE_PROP(_moz_box_orient,               BoxOrient)
 COMPUTED_STYLE_PROP(_moz_box_pack,                 BoxPack)
 COMPUTED_STYLE_PROP(_moz_float_edge,               FloatEdge)
-COMPUTED_STYLE_PROP(_moz_force_broken_image_icon,  ForceBrokenImageIcon)
 COMPUTED_STYLE_PROP(_moz_image_region,             ImageRegion)
 COMPUTED_STYLE_PROP(_moz_orient,                   Orient)
 COMPUTED_STYLE_PROP(_moz_osx_font_smoothing,       OsxFontSmoothing)
 COMPUTED_STYLE_PROP(_moz_outline_radius_bottomleft, OutlineRadiusBottomLeft)
 COMPUTED_STYLE_PROP(_moz_outline_radius_bottomright,OutlineRadiusBottomRight)
 COMPUTED_STYLE_PROP(_moz_outline_radius_topleft,    OutlineRadiusTopLeft)
 COMPUTED_STYLE_PROP(_moz_outline_radius_topright,   OutlineRadiusTopRight)
 COMPUTED_STYLE_PROP(_moz_stack_sizing,             StackSizing)
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -5319,23 +5319,16 @@ nsRuleNode::ComputeUIResetData(void* aSt
 
   // ime-mode: enum, inherit, initial
   SetValue(*aRuleData->ValueForImeMode(),
            ui->mIMEMode, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentUI->mIMEMode,
            NS_STYLE_IME_MODE_AUTO);
 
-  // force-broken-image-icons: integer, inherit, initial
-  SetValue(*aRuleData->ValueForForceBrokenImageIcon(),
-           ui->mForceBrokenImageIcon,
-           conditions,
-           SETVAL_INTEGER | SETVAL_UNSET_INITIAL,
-           parentUI->mForceBrokenImageIcon, 0);
-
   // -moz-window-dragging: enum, inherit, initial
   SetValue(*aRuleData->ValueForWindowDragging(),
            ui->mWindowDragging, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentUI->mWindowDragging,
            StyleWindowDragging::Default);
 
   // -moz-window-shadow: enum, inherit, initial
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -4197,46 +4197,41 @@ nsStyleUserInterface::CalcDifference(con
 }
 
 //-----------------------
 // nsStyleUIReset
 //
 
 nsStyleUIReset::nsStyleUIReset(const nsPresContext* aContext)
   : mUserSelect(StyleUserSelect::Auto)
-  , mForceBrokenImageIcon(0)
   , mIMEMode(NS_STYLE_IME_MODE_AUTO)
   , mWindowDragging(StyleWindowDragging::Default)
   , mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT)
 {
   MOZ_COUNT_CTOR(nsStyleUIReset);
 }
 
 nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
   : mUserSelect(aSource.mUserSelect)
-  , mForceBrokenImageIcon(aSource.mForceBrokenImageIcon)
   , mIMEMode(aSource.mIMEMode)
   , mWindowDragging(aSource.mWindowDragging)
   , mWindowShadow(aSource.mWindowShadow)
 {
   MOZ_COUNT_CTOR(nsStyleUIReset);
 }
 
 nsStyleUIReset::~nsStyleUIReset()
 {
   MOZ_COUNT_DTOR(nsStyleUIReset);
 }
 
 nsChangeHint
 nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
 {
   // ignore mIMEMode
-  if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
-    return nsChangeHint_ReconstructFrame;
-  }
   if (mWindowShadow != aNewData.mWindowShadow) {
     // We really need just an nsChangeHint_SyncFrameView, except
     // on an ancestor of the frame, so we get that by doing a
     // reflow.
     return NS_STYLE_HINT_REFLOW;
   }
   if (mUserSelect != aNewData.mUserSelect) {
     return NS_STYLE_HINT_VISUAL;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3375,17 +3375,16 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants as hints not handled for descendants.
     return nsChangeHint_NeedReflow |
            nsChangeHint_ReflowChangesSizeOrPosition |
            nsChangeHint_ClearAncestorIntrinsics;
   }
 
   mozilla::StyleUserSelect     mUserSelect;     // [reset](selection-style)
-  uint8_t mForceBrokenImageIcon; // [reset] (0 if not forcing, otherwise forcing)
   uint8_t                      mIMEMode;        // [reset]
   mozilla::StyleWindowDragging mWindowDragging; // [reset]
   uint8_t                      mWindowShadow;   // [reset]
 };
 
 struct nsCursorImage
 {
   bool mHaveHotspot;
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -1696,24 +1696,16 @@ var gCSSProperties = {
   "-moz-float-edge": {
     domProp: "MozFloatEdge",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "content-box" ],
     other_values: [ "margin-box" ],
     invalid_values: [ "content", "padding", "border", "margin" ]
   },
-  "-moz-force-broken-image-icon": {
-    domProp: "MozForceBrokenImageIcon",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "0" ],
-    other_values: [ "1" ],
-    invalid_values: []
-  },
   "-moz-image-region": {
     domProp: "MozImageRegion",
     inherited: true,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "rect(3px 20px 15px 4px)", "rect(17px, 21px, 33px, 2px)" ],
     invalid_values: [ "rect(17px, 21px, 33, 2px)" ]
   },
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -162,22 +162,16 @@ to mochitest command.
     * test_inherit_storage.html `-colors` [12]
     * test_initial_computation.html `-colors` [16]
     * test_initial_storage.html `-colors` [24]
     * test_value_storage.html `-colors` [96]
     * test_shorthand_property_getters.html `-colors` [1]
   * -moz-box-ordinal-group servo/servo#16000
     * test_value_storage.html `-box-` [94]
   * -moz-force-broken-image-icon servo/servo#16001
-    * test_compute_data_with_start_struct.html `-moz-force-broken-image-icon` [2]
-    * test_inherit_computation.html `-moz-force-broken-image-icon` [2]
-    * test_inherit_storage.html `-moz-force-broken-image-icon` [2]
-    * test_initial_computation.html `-moz-force-broken-image-icon` [4]
-    * test_initial_storage.html `-moz-force-broken-image-icon` [4]
-    * test_value_storage.html `-moz-force-broken-image-icon` [4]
   * -{moz,webkit}-text-size-adjust servo/servo#16002
     * test_compute_data_with_start_struct.html `-text-size-adjust` [2]
     * test_inherit_computation.html `-text-size-adjust` [8]
     * test_inherit_storage.html `-text-size-adjust` [10]
     * test_initial_computation.html `-text-size-adjust` [4]
     * test_initial_storage.html `-text-size-adjust` [5]
     * test_value_storage.html `-text-size-adjust` [12]
   * -moz-transform: need different parsing rules servo/servo#16003