Commit 335e125b authored by Sean Feng's avatar Sean Feng
Browse files

Bug 1675857 - Update <dialog> internal styles for spec alignment r=emilio

parent 9293bfdb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ void HTMLDialogElement::Close(

  RemoveFromTopLayerIfNeeded();

  RemoveStates(NS_EVENT_STATE_MODAL_DIALOG);

  RefPtr<AsyncEventDispatcher> eventDispatcher =
      new AsyncEventDispatcher(this, u"close"_ns, CanBubble::eNo);
  eventDispatcher->PostDOMEvent();
@@ -89,7 +91,6 @@ void HTMLDialogElement::RemoveFromTopLayerIfNeeded() {
  Document* doc = OwnerDoc();
  DebugOnly<Element*> removedElement = doc->TopLayerPop(predictFunc);
  MOZ_ASSERT(removedElement == this);
  RemoveStates(NS_EVENT_STATE_MODAL_DIALOG);
  doc->UnsetBlockedByModalDialog(*this);
}

+4 −7
Original line number Diff line number Diff line
@@ -843,15 +843,12 @@ dialog:-moz-topmost-modal-dialog {

dialog:-moz-modal-dialog {
  -moz-top-layer: top !important;
  /* This is a temporary solution until the relevant CSSWG issues
   * (https://github.com/w3c/csswg-drafts/issues/4645)
   * are resolved. */
  position: fixed;
  max-height: 100vh;
  max-width: 100vw;
  top: 50%;
  transform: translateY(-50%);
  overflow: auto;
  inset-block-start: 0;
  inset-block-end: 0;
  max-width: calc(100% - 6px - 2em);
  max-height: calc(100% - 6px - 2em);
}

/* https://html.spec.whatwg.org/#flow-content-3 */
+0 −7
Original line number Diff line number Diff line
[abspos-dialog-layout.html]
  [Dialog should be recentered if showModal() is called after removing 'open'.]
    expected: FAIL

  [Dialog should still be centered when removed, and re-added to the document.]
    expected: FAIL
+0 −13
Original line number Diff line number Diff line
[centering.html]
  [vertical-rl: tall viewport]
    expected: FAIL

  [vertical-lr: tall viewport]
    expected: FAIL

  [horizontal-tb (container vertical-rl): tall viewport]
    expected: FAIL

  [vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport]
    expected: FAIL