зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset bb7c330d407f (bug 1637307) for wpt failures at layout/generic/ViewportFrame.cpp on s CLOSED TREE
This commit is contained in:
Родитель
44c378a7fb
Коммит
a9c2a2b735
|
@ -13415,17 +13415,6 @@ Element* Document::GetTopLayerTop() {
|
|||
return element;
|
||||
}
|
||||
|
||||
bool Document::DoesTopLayerContain(const Element* aElement) const {
|
||||
for (const nsWeakPtr& weakPtr : mTopLayer) {
|
||||
nsCOMPtr<Element> element(do_QueryReferent(weakPtr));
|
||||
if (element && element == aElement) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Element* Document::GetUnretargetedFullScreenElement() {
|
||||
for (const nsWeakPtr& weakPtr : Reversed(mTopLayer)) {
|
||||
nsCOMPtr<Element> element(do_QueryReferent(weakPtr));
|
||||
|
|
|
@ -3405,9 +3405,6 @@ class Document : public nsINode,
|
|||
// Not const because all the fullscreen goop is not const
|
||||
bool FullscreenEnabled(CallerType aCallerType);
|
||||
Element* GetTopLayerTop();
|
||||
|
||||
bool DoesTopLayerContain(const Element* aElement) const;
|
||||
|
||||
// Return the fullscreen element in the top layer
|
||||
Element* GetUnretargetedFullScreenElement();
|
||||
bool Fullscreen() { return !!GetFullscreenElement(); }
|
||||
|
|
|
@ -44,13 +44,6 @@ void HTMLDialogElement::Close(
|
|||
ErrorResult ignored;
|
||||
SetOpen(false, ignored);
|
||||
ignored.SuppressException();
|
||||
|
||||
Document* doc = OwnerDoc();
|
||||
auto predictFunc = [self = RefPtr<HTMLDialogElement>(this)](
|
||||
Element* element) { return element == self; };
|
||||
|
||||
doc->TopLayerPop(predictFunc);
|
||||
|
||||
RefPtr<AsyncEventDispatcher> eventDispatcher = new AsyncEventDispatcher(
|
||||
this, NS_LITERAL_STRING("close"), CanBubble::eNo);
|
||||
eventDispatcher->PostDOMEvent();
|
||||
|
@ -65,32 +58,12 @@ void HTMLDialogElement::Show() {
|
|||
ignored.SuppressException();
|
||||
}
|
||||
|
||||
bool HTMLDialogElement::IsInTopLayer() const {
|
||||
return OwnerDoc()->DoesTopLayerContain(this);
|
||||
}
|
||||
|
||||
void HTMLDialogElement::UnbindFromTree(bool aNullParent) {
|
||||
if (IsInTopLayer()) {
|
||||
Document* doc = OwnerDoc();
|
||||
auto predictFunc = [self = RefPtr<HTMLDialogElement>(this)](
|
||||
Element* element) { return element == self; };
|
||||
|
||||
doc->TopLayerPop(predictFunc);
|
||||
}
|
||||
nsGenericHTMLElement::UnbindFromTree(aNullParent);
|
||||
}
|
||||
|
||||
void HTMLDialogElement::ShowModal(ErrorResult& aError) {
|
||||
if (!IsInComposedDoc() || Open()) {
|
||||
aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
Document* doc = OwnerDoc();
|
||||
if (!IsInTopLayer()) {
|
||||
doc->TopLayerPush(this);
|
||||
}
|
||||
|
||||
SetOpen(true, aError);
|
||||
aError.SuppressException();
|
||||
}
|
||||
|
|
|
@ -37,14 +37,10 @@ class HTMLDialogElement final : public nsGenericHTMLElement {
|
|||
mReturnValue = aReturnValue;
|
||||
}
|
||||
|
||||
virtual 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;
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче