diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js
index f6f407499cf3..a69409a47934 100644
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -284,7 +284,7 @@ function is_hidden(element) {
if (style.visibility != "visible") {
return true;
}
- if (style.display == "-moz-popup") {
+ if (XULPopupElement.isInstance(element)) {
return ["hiding", "closed"].includes(element.state);
}
diff --git a/browser/components/customizableui/CustomizableUI.jsm b/browser/components/customizableui/CustomizableUI.jsm
index 9a2b2117a13d..e97c97936377 100644
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -5596,7 +5596,7 @@ class OverflowableToolbar {
let style = win.getComputedStyle(child);
if (
style.display == "none" ||
- style.display == "-moz-popup" ||
+ win.XULPopupElement.isInstance(child) ||
(style.position != "static" && style.position != "relative")
) {
continue;
diff --git a/browser/components/customizableui/test/browser_PanelMultiView.js b/browser/components/customizableui/test/browser_PanelMultiView.js
index b3c1ccf1f581..645f09f03d9e 100644
--- a/browser/components/customizableui/test/browser_PanelMultiView.js
+++ b/browser/components/customizableui/test/browser_PanelMultiView.js
@@ -39,14 +39,15 @@ const EVENT_TYPES = [
* they need to read style or layout information, like other code normally does.
*/
function is_visible(element) {
- var style = element.ownerGlobal.getComputedStyle(element);
+ let win = element.ownerGlobal;
+ let style = win.getComputedStyle(element);
if (style.display == "none") {
return false;
}
if (style.visibility != "visible") {
return false;
}
- if (style.display == "-moz-popup" && element.state != "open") {
+ if (win.XULPopupElement.isInstance(element) && element.state != "open") {
return false;
}
diff --git a/browser/components/uitour/test/head.js b/browser/components/uitour/test/head.js
index 5157cf9ee4b9..9aa6d69e642b 100644
--- a/browser/components/uitour/test/head.js
+++ b/browser/components/uitour/test/head.js
@@ -68,14 +68,15 @@ function taskify(fun) {
}
function is_hidden(element) {
- var style = element.ownerGlobal.getComputedStyle(element);
+ let win = element.ownerGlobal;
+ let style = win.getComputedStyle(element);
if (style.display == "none") {
return true;
}
if (style.visibility != "visible") {
return true;
}
- if (style.display == "-moz-popup") {
+ if (win.XULPopupElement.isInstance(element)) {
return ["hiding", "closed"].includes(element.state);
}
@@ -88,14 +89,15 @@ function is_hidden(element) {
}
function is_visible(element) {
- var style = element.ownerGlobal.getComputedStyle(element);
+ let win = element.ownerGlobal;
+ let style = win.getComputedStyle(element);
if (style.display == "none") {
return false;
}
if (style.visibility != "visible") {
return false;
}
- if (style.display == "-moz-popup" && element.state != "open") {
+ if (win.XULPopupElement.isInstance(element) && element.state != "open") {
return false;
}
diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp
index e2c8dfd4c37f..05fee4220a1c 100644
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3486,7 +3486,7 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// If the mousedown happened inside a popup, don't try to set focus on
// one of its containing elements
- if (frame->StyleDisplay()->mDisplay == StyleDisplay::MozPopup) {
+ if (frame->IsMenuPopupFrame()) {
newFocus = nullptr;
break;
}
diff --git a/layout/base/crashtests/306940-1.html b/layout/base/crashtests/306940-1.html
index f6197c37c4af..51cced408f71 100644
--- a/layout/base/crashtests/306940-1.html
+++ b/layout/base/crashtests/306940-1.html
@@ -8,14 +8,13 @@ function init()
var c1 = document.getElementById("c1");
var f1 = document.getElementById("f1");
var a1 = document.getElementById("a1");
-
+
function first()
{
- f1.style.display = "-moz-popup";
c1.style.height = "2em";
window.status = "A";
}
-
+
function second()
{
c1.style.position = "absolute";
diff --git a/layout/base/crashtests/372475-1.xhtml b/layout/base/crashtests/372475-1.xhtml
deleted file mode 100644
index ec3d7546313b..000000000000
--- a/layout/base/crashtests/372475-1.xhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layout/base/crashtests/373628.html b/layout/base/crashtests/373628.html
index d71cc2518bdc..749af86b9ced 100644
--- a/layout/base/crashtests/373628.html
+++ b/layout/base/crashtests/373628.html
@@ -113,7 +113,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -314,7 +314,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -345,7 +345,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -378,12 +378,12 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
@@ -414,7 +414,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
@@ -448,7 +448,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
@@ -479,7 +479,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
@@ -553,7 +553,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -598,7 +598,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -639,7 +639,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -699,7 +699,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -740,7 +740,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -780,7 +780,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -880,7 +880,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
@@ -919,7 +919,7 @@ mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m mm m
-
+
diff --git a/layout/base/crashtests/405049-1.xhtml b/layout/base/crashtests/405049-1.xhtml
index fb68de11eb9b..07d2f4b18d5f 100644
--- a/layout/base/crashtests/405049-1.xhtml
+++ b/layout/base/crashtests/405049-1.xhtml
@@ -1,3 +1,3 @@
-
-
\ No newline at end of file
+
+
diff --git a/layout/base/crashtests/613817-1.svg b/layout/base/crashtests/613817-1.svg
deleted file mode 100644
index 9f5165ffe5fa..000000000000
--- a/layout/base/crashtests/613817-1.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list
index 9218e01ea33c..cfd122e75d78 100644
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -137,7 +137,6 @@ load 369547-2.html
load 369945-1.xhtml
load 371681-1.xhtml
load 372237-1.html
-load 372475-1.xhtml
load 372550-1.html
load 373628-1.html
load 374297-1.html
@@ -328,7 +327,6 @@ load 595039-1.html
load 597924-1.html
load 606432-1.html
load 609821-1.xhtml
-load 613817-1.svg
load 615146-1.html
load 615781-1.xhtml
load 616495-single-side-composite-color-border.html
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 5559bd199e79..ec13c68c8511 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2399,14 +2399,12 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
} else if (display->mDisplay == StyleDisplay::Flex ||
display->mDisplay == StyleDisplay::WebkitBox ||
display->mDisplay == StyleDisplay::Grid ||
- display->mDisplay == StyleDisplay::MozBox ||
- display->mDisplay == StyleDisplay::MozPopup) {
+ display->mDisplay == StyleDisplay::MozBox) {
auto func = [&] {
if (display->mDisplay == StyleDisplay::Grid) {
return NS_NewGridContainerFrame;
}
- if ((display->mDisplay == StyleDisplay::MozBox ||
- display->mDisplay == StyleDisplay::MozPopup) &&
+ if (display->mDisplay == StyleDisplay::MozBox &&
!computedStyle->StyleVisibility()->EmulateMozBoxWithFlex()) {
return NS_NewBoxFrame;
}
@@ -4022,6 +4020,8 @@ const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULTagData(const Element& aElement,
ComputedStyle& aStyle) {
MOZ_ASSERT(aElement.IsXULElement());
+ static constexpr FrameConstructionData kPopupData(
+ NS_NewMenuPopupFrame, FCDATA_IS_POPUP | FCDATA_SKIP_ABSPOS_PUSH);
static constexpr FrameConstructionDataByTag sXULTagData[] = {
SIMPLE_XUL_CREATE(image, NS_NewImageBoxFrame),
@@ -4047,7 +4047,11 @@ nsCSSFrameConstructor::FindXULTagData(const Element& aElement,
SIMPLE_XUL_CREATE(splitter, NS_NewSplitterFrame),
SIMPLE_XUL_CREATE(slider, NS_NewSliderFrame),
SIMPLE_XUL_CREATE(scrollbar, NS_NewScrollbarFrame),
- SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame)};
+ SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame),
+ {nsGkAtoms::panel, kPopupData},
+ {nsGkAtoms::menupopup, kPopupData},
+ {nsGkAtoms::tooltip, kPopupData},
+ };
return FindDataByTag(aElement, aStyle, sXULTagData, ArrayLength(sXULTagData));
}
@@ -4457,11 +4461,6 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay& aDisplay,
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby));
return &data;
}
- case StyleDisplayInside::MozPopup: {
- static constexpr FrameConstructionData data(
- NS_NewMenuPopupFrame, FCDATA_IS_POPUP | FCDATA_SKIP_ABSPOS_PUSH);
- return &data;
- }
default:
MOZ_ASSERT_UNREACHABLE("unknown 'display' value");
return nullptr;
@@ -5465,15 +5464,6 @@ void nsCSSFrameConstructor::ConstructFramesFromItem(
nsContainerFrame* aParentFrame, nsFrameList& aFrameList) {
FrameConstructionItem& item = aIter.item();
ComputedStyle* computedStyle = item.mComputedStyle;
-
- const auto* disp = computedStyle->StyleDisplay();
- MOZ_ASSERT(!disp->IsAbsolutelyPositionedStyle() ||
- disp->DisplayInside() != StyleDisplayInside::MozBox,
- "This may be a frame that was previously blockified "
- "but isn't any longer! It probably needs explicit "
- "'display:block' to preserve behavior");
- Unused << disp; // (unused in configs that define the assertion away)
-
if (item.mIsText) {
// If this is collapsible whitespace next to a line boundary,
// don't create a frame. item.IsWhitespace() also sets the
@@ -5843,10 +5833,6 @@ bool nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
}
StyleDisplay display = aDisplay.value();
- if (LayoutFrameType::Menu == parentType) {
- return (StyleDisplay::MozPopup == display) ==
- (StyleDisplay::MozPopup == siblingDisplay);
- }
// To have decent performance we want to return false in cases in which
// reordering the two siblings has no effect on display. To ensure
// correctness, we MUST return false in cases where the two siblings have
diff --git a/layout/base/nsFrameTraversal.cpp b/layout/base/nsFrameTraversal.cpp
index c770feb845bd..f380e61684da 100644
--- a/layout/base/nsFrameTraversal.cpp
+++ b/layout/base/nsFrameTraversal.cpp
@@ -422,8 +422,7 @@ bool nsFrameIterator::IsPopupFrame(nsIFrame* aFrame) {
if (mSkipPopupChecks) {
return false;
}
-
- return (aFrame && aFrame->StyleDisplay()->mDisplay == StyleDisplay::MozPopup);
+ return aFrame && aFrame->IsMenuPopupFrame();
}
// nsVisualIterator implementation
diff --git a/layout/reftests/bugs/490173-1-ref.html b/layout/reftests/bugs/490173-1-ref.html
deleted file mode 100644
index 73bace2f3add..000000000000
--- a/layout/reftests/bugs/490173-1-ref.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-