Commit d6ab6f4a authored by Cosmin Sabou's avatar Cosmin Sabou
Browse files

Backed out changeset f456713ddff8 (bug 1798836) for causing build bustages on...

Backed out changeset f456713ddff8 (bug 1798836) for causing build bustages on Window.webidl. CLOSED TREE
parent fe3a1ffb
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -277,24 +277,19 @@ interface nsIContentViewer : nsISupports

  /**
   * Returns the preferred width and height of the content, constrained to the
   * given maximum values. If either maxWidth or maxHeight is less than or
   * equal to zero, that dimension is not constrained.
   *
   * If a pref width is provided, it is max'd with the min-content size.
   * given maximum values. If either maxWidth or maxHeight is less than zero,
   * that dimension is not constrained.
   *
   * All input and output values are in CSS pixels.
   */
  void getContentSize(in long maxWidth,
                      in long maxHeight,
                      in long prefWidth,
                      out long width,
                      out long height);
  void getContentSize(in long maxWidth, in long maxHeight,
                      out long width, out long height);

%{C++
  mozilla::Maybe<mozilla::CSSIntSize> GetContentSize(int32_t aMaxWidth = 0, int32_t aMaxHeight = 0, int32_t aPrefWidth = 0) {
  mozilla::Maybe<mozilla::CSSIntSize> GetContentSize(int32_t aMaxWidth = 0, int32_t aMaxHeight = 0) {
    int32_t w = 0;
    int32_t h = 0;
    if (NS_SUCCEEDED(GetContentSize(aMaxWidth, aMaxHeight, aPrefWidth, &w, &h))) {
    if (NS_SUCCEEDED(GetContentSize(aMaxWidth, aMaxHeight, &w, &h))) {
      return mozilla::Some(mozilla::CSSIntSize(w, h));
    }
    return mozilla::Nothing();
+7 −5
Original line number Diff line number Diff line
@@ -3932,14 +3932,16 @@ void nsGlobalWindowInner::ResizeBy(int32_t aWidthDif, int32_t aHeightDif,

void nsGlobalWindowInner::SizeToContent(CallerType aCallerType,
                                        ErrorResult& aError) {
  FORWARD_TO_OUTER_OR_THROW(SizeToContentOuter, (aCallerType, {}, aError),
  FORWARD_TO_OUTER_OR_THROW(SizeToContentOuter, (aCallerType, 0, 0, aError),
                            aError, );
}

void nsGlobalWindowInner::SizeToContentConstrained(
    const SizeToContentConstraints& aConstraints, ErrorResult& aError) {
  FORWARD_TO_OUTER_OR_THROW(
      SizeToContentOuter, (CallerType::System, aConstraints, aError), aError, );
void nsGlobalWindowInner::SizeToContentConstrained(int32_t aMaxWidth,
                                                   int32_t aMaxHeight,
                                                   ErrorResult& aError) {
  FORWARD_TO_OUTER_OR_THROW(SizeToContentOuter,
                            (CallerType::System, aMaxWidth, aMaxHeight, aError),
                            aError, );
}

already_AddRefed<nsPIWindowRoot> nsGlobalWindowInner::GetTopWindowRoot() {
+2 −3
Original line number Diff line number Diff line
@@ -125,7 +125,6 @@ struct RequestInit;
class RequestOrUSVString;
class SharedWorker;
class Selection;
struct SizeToContentConstraints;
class WebTaskScheduler;
class WebTaskSchedulerMainThread;
class SpeechSynthesis;
@@ -863,8 +862,8 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
      mozilla::ErrorResult& aError);
  void SizeToContent(mozilla::dom::CallerType aCallerType,
                     mozilla::ErrorResult& aError);
  void SizeToContentConstrained(const mozilla::dom::SizeToContentConstraints&,
                                mozilla::ErrorResult&);
  void SizeToContentConstrained(int32_t aMaxWidth, int32_t aMaxHeight,
                                mozilla::ErrorResult& aError);
  mozilla::dom::Crypto* GetCrypto(mozilla::ErrorResult& aError);
  mozilla::dom::U2F* GetU2f(mozilla::ErrorResult& aError);
  nsIControllers* GetControllers(mozilla::ErrorResult& aError);
+3 −2
Original line number Diff line number Diff line
@@ -5466,7 +5466,8 @@ void nsGlobalWindowOuter::ResizeByOuter(int32_t aWidthDif, int32_t aHeightDif,
}

void nsGlobalWindowOuter::SizeToContentOuter(CallerType aCallerType,
                                             const SizeToContentConstraints& aConstraints,
                                             int32_t aMaxWidth,
                                             int32_t aMaxHeight,
                                             ErrorResult& aError) {
  if (!mDocShell) {
    return;
@@ -5489,7 +5490,7 @@ void nsGlobalWindowOuter::SizeToContentOuter(CallerType aCallerType,
    return aError.Throw(NS_ERROR_FAILURE);
  }

  auto contentSize = cv->GetContentSize(aConstraints.mMaxWidth, aConstraints.mMaxHeight, aConstraints.mPrefWidth);
  auto contentSize = cv->GetContentSize(aMaxWidth, aMaxHeight);
  if (!contentSize) {
    return aError.Throw(NS_ERROR_FAILURE);
  }
+3 −4
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@ class PrintPreviewResultInfo;
struct RequestInit;
class RequestOrUSVString;
class Selection;
struct SizeToContentConstraints;
class SpeechSynthesis;
class Timeout;
class U2F;
@@ -625,9 +624,9 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
  double GetScrollYOuter();

  MOZ_CAN_RUN_SCRIPT_BOUNDARY
  void SizeToContentOuter(mozilla::dom::CallerType,
                          const mozilla::dom::SizeToContentConstraints&,
                          mozilla::ErrorResult&);
  void SizeToContentOuter(mozilla::dom::CallerType aCallerType,
                          int32_t aMaxWidth, int32_t aMaxHeight,
                          mozilla::ErrorResult& aError);
  nsIControllers* GetControllersOuter(mozilla::ErrorResult& aError);
  nsresult GetControllers(nsIControllers** aControllers) override;
  float GetMozInnerScreenXOuter(mozilla::dom::CallerType aCallerType);
Loading