diff --git a/dom/html/test/file_fullscreen-table.html b/dom/html/test/file_fullscreen-table.html
new file mode 100644
index 000000000000..740ec56a8a86
--- /dev/null
+++ b/dom/html/test/file_fullscreen-table.html
@@ -0,0 +1,52 @@
+
+
+
+
+ Test for Bug 1223561
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini
index 99b425df8bd0..b231662bbb6f 100644
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -53,28 +53,6 @@ support-files =
file_bug1260704.png
file_formSubmission_img.jpg
file_formSubmission_text.txt
- file_fullscreen-api.html
- file_fullscreen-backdrop.html
- file_fullscreen-denied-inner.html
- file_fullscreen-denied.html
- file_fullscreen-esc-exit-inner.html
- file_fullscreen-esc-exit.html
- file_fullscreen-hidden.html
- file_fullscreen-lenient-setters.html
- file_fullscreen-multiple-inner.html
- file_fullscreen-multiple.html
- file_fullscreen-navigation.html
- file_fullscreen-nested.html
- file_fullscreen-prefixed.html
- file_fullscreen-plugins.html
- file_fullscreen-rollback.html
- file_fullscreen-scrollbar.html
- file_fullscreen-selector.html
- file_fullscreen-svg-element.html
- file_fullscreen-top-layer.html
- file_fullscreen-unprefix-disabled-inner.html
- file_fullscreen-unprefix-disabled.html
- file_fullscreen-utils.js
file_iframe_sandbox_a_if1.html
file_iframe_sandbox_a_if10.html
file_iframe_sandbox_a_if11.html
@@ -461,6 +439,30 @@ skip-if = toolkit == 'android'
[test_fullscreen-api.html]
tags = fullscreen
skip-if = toolkit == 'android'
+support-files =
+ file_fullscreen-api.html
+ file_fullscreen-backdrop.html
+ file_fullscreen-denied-inner.html
+ file_fullscreen-denied.html
+ file_fullscreen-esc-exit-inner.html
+ file_fullscreen-esc-exit.html
+ file_fullscreen-hidden.html
+ file_fullscreen-lenient-setters.html
+ file_fullscreen-multiple-inner.html
+ file_fullscreen-multiple.html
+ file_fullscreen-navigation.html
+ file_fullscreen-nested.html
+ file_fullscreen-prefixed.html
+ file_fullscreen-plugins.html
+ file_fullscreen-rollback.html
+ file_fullscreen-scrollbar.html
+ file_fullscreen-selector.html
+ file_fullscreen-svg-element.html
+ file_fullscreen-table.html
+ file_fullscreen-top-layer.html
+ file_fullscreen-unprefix-disabled-inner.html
+ file_fullscreen-unprefix-disabled.html
+ file_fullscreen-utils.js
[test_fullscreen-api-race.html]
tags = fullscreen
skip-if = toolkit == 'android' # just copy the conditions from the test above
diff --git a/dom/html/test/test_fullscreen-api.html b/dom/html/test/test_fullscreen-api.html
index 1ac5b3b5173c..65a38fddac56 100644
--- a/dom/html/test/test_fullscreen-api.html
+++ b/dom/html/test/test_fullscreen-api.html
@@ -45,6 +45,7 @@ var gTestWindows = [
"file_fullscreen-prefixed.html",
"file_fullscreen-unprefix-disabled.html",
"file_fullscreen-lenient-setters.html",
+ "file_fullscreen-table.html",
];
var testWindow = null;
diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp
index 2b6799f48539..25e2b0677422 100644
--- a/layout/generic/nsPlaceholderFrame.cpp
+++ b/layout/generic/nsPlaceholderFrame.cpp
@@ -206,10 +206,25 @@ nsPlaceholderFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
}
}
+ nsIFrame* parentFrame = GetParent();
+ // Placeholder of backdrop frame is a child of the corresponding top
+ // layer frame, and its style context inherits from that frame. In
+ // case of table, the top layer frame is the table wrapper frame.
+ // However, it will be skipped in CorrectStyleParentFrame below, so
+ // we need to handle it specially here.
+ if ((GetStateBits() & PLACEHOLDER_FOR_TOPLAYER) &&
+ parentFrame->GetType() == nsGkAtoms::tableWrapperFrame) {
+ MOZ_ASSERT(mOutOfFlowFrame->GetType() == nsGkAtoms::backdropFrame,
+ "Only placeholder of backdrop frame can be put inside "
+ "a table wrapper frame");
+ return parentFrame->StyleContext();
+ }
+
// Lie about our pseudo so we can step out of all anon boxes and
// pseudo-elements. The other option would be to reimplement the
// {ib} split gunk here.
- *aProviderFrame = CorrectStyleParentFrame(GetParent(), nsGkAtoms::placeholderFrame);
+ *aProviderFrame = CorrectStyleParentFrame(parentFrame,
+ nsGkAtoms::placeholderFrame);
return *aProviderFrame ? (*aProviderFrame)->StyleContext() : nullptr;
}
diff --git a/layout/style/res/ua.css b/layout/style/res/ua.css
index 931b32eb860f..a54913c684a4 100644
--- a/layout/style/res/ua.css
+++ b/layout/style/res/ua.css
@@ -22,7 +22,11 @@
}
*|*::-moz-table-wrapper {
+ /* The inherited properties here need to be safe to have on both the
+ * table and the table wrapper, generally because code ignores them
+ * for the table. */
display: inherit !important; /* table or inline-table */
+ -moz-top-layer: inherit !important;
margin: inherit ! important;
padding: 0 ! important;
border: none ! important;