Commit 735caca3 authored by Dorel Luca's avatar Dorel Luca
Browse files

Merge mozilla-central to autoland

parents 7fb3331f 0baa4083
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1061,8 +1061,7 @@ Toolbox.prototype = {
  get notificationBox() {
    if (!this._notificationBox) {
      let { NotificationBox, PriorityLevels } =
        this.browserRequire(
          "devtools/client/shared/components/NotificationBox");
        this.browserRequire("devtools/client/shared/components/NotificationBox");

      NotificationBox = this.React.createFactory(NotificationBox);

+53 −36
Original line number Diff line number Diff line
@@ -125,12 +125,13 @@ function Inspector(toolbox) {

  this.nodeMenuTriggerInfo = null;

  this._clearSearchResultsLabel = this._clearSearchResultsLabel.bind(this);
  this._handleRejectionIfNotDestroyed = this._handleRejectionIfNotDestroyed.bind(this);
  this._onContextMenu = this._onContextMenu.bind(this);
  this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
  this._onContextMenu = this._onContextMenu.bind(this);
  this._onMarkupFrameLoad = this._onMarkupFrameLoad.bind(this);
  this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
  this._clearSearchResultsLabel = this._clearSearchResultsLabel.bind(this);
  this._updateDebuggerPausedWarning = this._updateDebuggerPausedWarning.bind(this);

  this.onDetached = this.onDetached.bind(this);
  this.onMarkupLoaded = this.onMarkupLoaded.bind(this);
@@ -173,19 +174,19 @@ Inspector.prototype = {
  },

  get inspector() {
    return this._toolbox.inspector;
    return this.toolbox.inspector;
  },

  get walker() {
    return this._toolbox.walker;
    return this.toolbox.walker;
  },

  get selection() {
    return this._toolbox.selection;
    return this.toolbox.selection;
  },

  get highlighter() {
    return this._toolbox.highlighter;
    return this.toolbox.highlighter;
  },

  // Added in 53.
@@ -198,6 +199,14 @@ Inspector.prototype = {
    return this._target.client.traits.getXPath;
  },

  get notificationBox() {
    if (!this._notificationBox) {
      this._notificationBox = this.toolbox.getNotificationBox();
    }

    return this._notificationBox;
  },

  /**
   * Handle promise rejections for various asynchronous actions, and only log errors if
   * the inspector panel still exists.
@@ -219,32 +228,10 @@ Inspector.prototype = {
    this.selection.on("detached-front", this.onDetached);

    if (this.target.isLocalTab) {
      // Show a warning when the debugger is paused.
      // We show the warning only when the inspector
      // is selected.
      this.updateDebuggerPausedWarning = () => {
        let notificationBox = this._toolbox.getNotificationBox();
        let notification =
          notificationBox.getNotificationWithValue("inspector-script-paused");
        if (!notification && this._toolbox.currentToolId == "inspector" &&
            this._toolbox.threadClient.paused) {
          let message = INSPECTOR_L10N.getStr("debuggerPausedWarning.message");
          notificationBox.appendNotification(message,
            "inspector-script-paused", "", notificationBox.PRIORITY_WARNING_HIGH);
        }

        if (notification && this._toolbox.currentToolId != "inspector") {
          notificationBox.removeNotification(notification);
        }

        if (notification && !this._toolbox.threadClient.paused) {
          notificationBox.removeNotification(notification);
        }
      };
      this.target.on("thread-paused", this.updateDebuggerPausedWarning);
      this.target.on("thread-resumed", this.updateDebuggerPausedWarning);
      this._toolbox.on("select", this.updateDebuggerPausedWarning);
      this.updateDebuggerPausedWarning();
      this.target.on("thread-paused", this._updateDebuggerPausedWarning);
      this.target.on("thread-resumed", this._updateDebuggerPausedWarning);
      this.toolbox.on("select", this._updateDebuggerPausedWarning);
      this._updateDebuggerPausedWarning();
    }

    this._initMarkup();
@@ -423,6 +410,35 @@ Inspector.prototype = {
    this.searchResultsLabel.textContent = str;
  },

  /**
   * Show a warning notification box when the debugger is paused. We show the warning only
   * when the inspector is selected.
   */
  _updateDebuggerPausedWarning: function() {
    if (!this.toolbox.threadClient.paused && !this._notificationBox) {
      return;
    }

    let notificationBox = this.notificationBox;
    let notification = this.notificationBox.getNotificationWithValue(
      "inspector-script-paused");

    if (!notification && this.toolbox.currentToolId == "inspector" &&
        this.toolbox.threadClient.paused) {
      let message = INSPECTOR_L10N.getStr("debuggerPausedWarning.message");
      notificationBox.appendNotification(message,
        "inspector-script-paused", "", notificationBox.PRIORITY_WARNING_HIGH);
    }

    if (notification && this.toolbox.currentToolId != "inspector") {
      notificationBox.removeNotification(notification);
    }

    if (notification && !this.toolbox.threadClient.paused) {
      notificationBox.removeNotification(notification);
    }
  },

  get React() {
    return this._toolbox.React;
  },
@@ -1278,9 +1294,9 @@ Inspector.prototype = {
    this.selection.off("detached-front", this.onDetached);
    this.sidebar.off("select", this.onSidebarSelect);
    this.target.off("will-navigate", this._onBeforeNavigate);
    this.target.off("thread-paused", this.updateDebuggerPausedWarning);
    this.target.off("thread-resumed", this.updateDebuggerPausedWarning);
    this._toolbox.off("select", this.updateDebuggerPausedWarning);
    this.target.off("thread-paused", this._updateDebuggerPausedWarning);
    this.target.off("thread-resumed", this._updateDebuggerPausedWarning);
    this._toolbox.off("select", this._updateDebuggerPausedWarning);

    for (let [, panel] of this._panels) {
      panel.destroy();
@@ -1318,7 +1334,7 @@ Inspector.prototype = {
    this.styleChangeTracker.destroy();
    this.search.destroy();

    this.telemetry = null;
    this._notificationBox = null;
    this._target = null;
    this._toolbox = null;
    this.breadcrumbs = null;
@@ -1334,6 +1350,7 @@ Inspector.prototype = {
    this.show3PaneTooltip = null;
    this.sidebar = null;
    this.store = null;
    this.telemetry = null;
    this.threePaneTooltip = null;

    this._panelDestroyer = promise.all([
+43 −79
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@
#include "nsCSSValue.h"
#include "nsColor.h"
#include "nsPresContext.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/ServoDeclarationBlock.h"
#include "mozilla/StyleAnimationValue.h" // For AnimationValue
#include "mozilla/ServoCSSParser.h"
#include "mozilla/ServoStyleSet.h"
@@ -38,11 +40,8 @@ struct ValueWrapper {
  ValueWrapper(nsCSSPropertyID aPropID, const AnimationValue& aValue)
    : mPropID(aPropID)
  {
    if (aValue.mServo) {
    MOZ_ASSERT(!aValue.IsNull());
    mServoValues.AppendElement(aValue.mServo);
      return;
    }
    MOZ_CRASH("old style system disabled");
  }
  ValueWrapper(nsCSSPropertyID aPropID,
               const RefPtr<RawServoAnimationValue>& aValue)
@@ -56,7 +55,7 @@ struct ValueWrapper {
      return false;
    }

    if (!mServoValues.IsEmpty()) {
    MOZ_ASSERT(!mServoValues.IsEmpty());
    size_t len = mServoValues.Length();
    if (len != aOther.mServoValues.Length()) {
      return false;
@@ -70,9 +69,6 @@ struct ValueWrapper {
    return true;
  }

    MOZ_CRASH("old style system disabled");
  }

  bool operator!=(const ValueWrapper& aOther) const
  {
    return !(*this == aOther);
@@ -304,10 +300,6 @@ AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
    return false;
  }

  bool isServo = valueToAddWrapper
                 ? !valueToAddWrapper->mServoValues.IsEmpty()
                 : !destWrapper->mServoValues.IsEmpty();
  if (isServo) {
  return AddOrAccumulateForServo(aDest,
                                 valueToAddWrapper,
                                 destWrapper,
@@ -315,9 +307,6 @@ AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
                                 aCount);
}

  MOZ_CRASH("old style system disabled");
}

nsresult
nsSMILCSSValueType::SandwichAdd(nsSMILValue& aDest,
                                const nsSMILValue& aValueToAdd) const
@@ -387,14 +376,9 @@ nsSMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom,
  const ValueWrapper* fromWrapper = ExtractValueWrapper(aFrom);
  const ValueWrapper* toWrapper = ExtractValueWrapper(aTo);
  MOZ_ASSERT(toWrapper, "expecting non-null endpoint");

  if (!toWrapper->mServoValues.IsEmpty()) {
  return ComputeDistanceForServo(fromWrapper, *toWrapper, aDistance);
}

  MOZ_CRASH("old style system disabled");
}


static nsresult
InterpolateForServo(const ValueWrapper* aStartWrapper,
@@ -466,17 +450,12 @@ nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
  const ValueWrapper* startWrapper = ExtractValueWrapper(aStartVal);
  const ValueWrapper* endWrapper = ExtractValueWrapper(aEndVal);
  MOZ_ASSERT(endWrapper, "expecting non-null endpoint");

  if (!endWrapper->mServoValues.IsEmpty()) {
  return InterpolateForServo(startWrapper,
                             *endWrapper,
                             aUnitDistance,
                             aResult);
}

  MOZ_CRASH("old style system disabled");
}

// Helper function to extract presContext
static nsPresContext*
GetPresContextForElement(Element* aElem)
@@ -600,34 +579,25 @@ nsSMILCSSValueType::ValueFromAnimationValue(nsCSSPropertyID aPropID,
}

// static
void
nsSMILCSSValueType::ValueToString(const nsSMILValue& aValue,
                                  nsAString& aString)
bool
nsSMILCSSValueType::SetPropertyValues(const nsSMILValue& aValue,
                                      DeclarationBlock& aDecl)
{
  MOZ_ASSERT(aValue.mType == &nsSMILCSSValueType::sSingleton,
             "Unexpected SMIL value type");
  const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
  if (!wrapper) {
    return;
  }

  if (wrapper->mServoValues.IsEmpty()) {
    MOZ_CRASH("old style system disabled");
    return false;
  }

  if (nsCSSProps::IsShorthand(wrapper->mPropID)) {
    // In case of shorthand on servo, we iterate over all mServoValues array
    // since we have multiple AnimationValues in the array for each longhand
    // component.
    Servo_Shorthand_AnimationValues_Serialize(wrapper->mPropID,
                                              &wrapper->mServoValues,
                                              &aString);
    return;
  bool changed = false;
  for (const auto& value : wrapper->mServoValues) {
    changed |=
      Servo_DeclarationBlock_SetPropertyToAnimationValue(
        aDecl.AsServo()->Raw(), value);
  }

  Servo_AnimationValue_Serialize(wrapper->mServoValues[0],
                                 wrapper->mPropID,
                                 &aString);
  return changed;
}

// static
@@ -667,9 +637,6 @@ nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue,
    return;
  }

  bool isServo = !valueToMatchWrapper->mServoValues.IsEmpty();

  if (isServo) {
  ServoAnimationValues zeroValues;
  zeroValues.SetCapacity(valueToMatchWrapper->mServoValues.Length());

@@ -683,7 +650,4 @@ nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue,
  }
  aValue.mU.mPtr = new ValueWrapper(valueToMatchWrapper->mPropID,
                                    Move(zeroValues));
  } else {
    MOZ_CRASH("old style system disabled");
  }
}
+4 −8
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

namespace mozilla {
struct AnimationValue;
class DeclarationBlock;
namespace dom {
class Element;
} // namespace dom
@@ -103,16 +104,11 @@ public:
                                             const AnimationValue& aValue);

  /**
   * Creates a string representation of the given nsSMILValue.
   * Sets the relevant property values in the declaration block.
   *
   * Note: aValue is expected to be of this type (that is, it's expected to
   * have been initialized by nsSMILCSSValueType::sSingleton).  If aValue is a
   * freshly-initialized value the resulting string will be empty.
   *
   * @param       aValue   The nsSMILValue to be converted into a string.
   * @param [out] aString  The string to be populated with the given value.
   * Returns whether the declaration changed.
   */
  static void ValueToString(const nsSMILValue& aValue, nsAString& aString);
  static bool SetPropertyValues(const nsSMILValue&, mozilla::DeclarationBlock&);

  /**
   * Return the CSS property animated by the specified value.
+4 −0
Original line number Diff line number Diff line
# Skip tests that rely on wasm signal handlers.
asm.js/testTimeout1.js
asm.js/testTimeout2.js
asm.js/testTimeout3.js
asm.js/testTimeout4.js
asm.js/testTimeout5.js
asm.js/testTimeout6.js
ion/iloop.js
wasm/timeout

# Skip tests that run too slowly under tsan.
basic/spread-call-maxarg.js
basic/spread-call-near-maxarg.js
Loading