Issue #2472 - Part 5: Make modal versions of <dialog> work, and tune styles.

This adds a pseudo-class `:-moz-modal-dialog` to be able to track whether the
dialog is in the top layer in CSS.
This implements default styling for modal dialogs following the HTML standard.
Slightly off-extreme color scheme chosen for unstyled <dialog> elements.
This commit is contained in:
Moonchild 2024-05-04 18:28:27 +02:00 committed by roytam1
commit 7d34b285e0
5 changed files with 57 additions and 4 deletions

View file

@ -41,10 +41,14 @@ public:
{
mReturnValue = aReturnValue;
}
void UnbindFromTree(bool aNullParent = true) /*override*/;
void Close(const mozilla::dom::Optional<nsAString>& aReturnValue);
void Show();
void ShowModal(ErrorResult& aError);
bool IsInTopLayer() const;
nsString mReturnValue;
@ -52,6 +56,9 @@ protected:
virtual ~HTMLDialogElement();
JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
private:
void RemoveFromTopLayerIfNeeded();
};
} // namespace dom