Skip to content

Commit

Permalink
Bug 1783940 - Remove -moz-* display values enabled-in-content prefs. …
Browse files Browse the repository at this point in the history
…r=dholbert

We have unshipped these since forever, no point in keeping the pref
around. Move the relevant tests to chrome ref/mochitests.

Differential Revision: https://phabricator.services.mozilla.com/D154152
  • Loading branch information
emilio committed Aug 9, 2022
1 parent 477338c commit 6eba703
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 176 deletions.
2 changes: 1 addition & 1 deletion layout/base/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ load 543648-1.html
load 560447-1.html
load 564063-1.html
load 569018-1.html
pref(layout.css.xul-display-values.content.enabled,true) load 570038-1.html
load chrome://reftest/content/crashtests/layout/base/crashtests/570038-1.html
load chrome://reftest/content/crashtests/layout/base/crashtests/572003.xhtml
load 572582-1.xhtml
load 576649-1.html
Expand Down
4 changes: 2 additions & 2 deletions layout/generic/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ load 1234701-1.html
load 1234701-2.html
load 1248227.html
load 1271765.html
pref(layout.css.xul-box-display-values.content.enabled,true) load 1272983-1.html
pref(layout.css.xul-box-display-values.content.enabled,true) load 1272983-2.html
load chrome://reftest/content/crashtests/layout/generic/crashtests/1272983-1.html
load chrome://reftest/content/crashtests/layout/generic/crashtests/1272983-2.html
load 1275059.html
load 1278007.html
load 1278080.html
Expand Down
49 changes: 0 additions & 49 deletions layout/generic/test/test_dynamic_reflow_root_disallowal.html
Original file line number Diff line number Diff line change
Expand Up @@ -601,42 +601,6 @@
outer.remove(); // clean up
}

function runMozBoxTest() {
// We create a -moz-box, with a child that looks like a good candidate
// for being a reflow root, except that really its size depends on its
// child's size (due to the min-sizing behavior of children of -moz-box).
// We exercise this size dependency (& reveal the issue, if the candidate is
// mistakenly flagged as a reflow root) by growing the size of the
// content and seeing how the rendering changes.
let mozBox = createStyledDiv("display: -moz-box; \
width: 10px; \
border: 2px solid teal");
let cand = createStyledDiv(gReflowRootCandidateStyles +
" border: 2px solid black;");
let inner = createStyledDiv("height: 20px; width: 20px; \
background: pink;");

cand.appendChild(inner);
mozBox.appendChild(cand);
gFBody.appendChild(mozBox);

// Note: This "is()" check is just validating that we're testing what we
// intend to be testing. Eventually, we'll remove support for -moz-box
// (as part of XUL), at which point this "is" check will start failing
// and we'll probably want to remove this test function, along with the
// IsXULBoxFrame() check that this test function is targeting in
// ReflowInput::InitDynamicReflowRoot.
is(gFWindow.getComputedStyle(mozBox).display, "-moz-box",
"'display:-moz-box' should be honored and show up in computed style");

let tweakFunc = function() {
inner.style.width = inner.style.height = "40px";
};
tweakAndCompareSnapshots(tweakFunc, "child-of-moz-box");

mozBox.remove(); // clean up
}

function runFixedPosTest() {
// We reset the 'will-change' value on the candidate (overriding
// 'will-change:transform'), so that it won't be a fixed-pos CB. We also
Expand Down Expand Up @@ -777,19 +741,6 @@
runFixedPosTest();
runMarginCollapseTest();
runFloatTest();

// Turn on 'display:-moz-box' support, so that we can validate that
// children of XUL boxes are excluded from being tagged as dynamic
// reflow roots. We run this test last (and then call finish), since
// pref-setting is async and this lets the rest of this mochitest
// (everything up to this point) be straightforward & synchronous.
SpecialPowers.pushPrefEnv(
{ set: [["layout.css.xul-box-display-values.content.enabled", true]]},
function() {
runMozBoxTest();
SimpleTest.finish();
}
);
}
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/box/reftest.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test-pref(layout.css.xul-box-display-values.content.enabled,true) == box-as-grid-or-flex-item-1.html box-as-grid-or-flex-item-1-ref.html
== chrome://reftest/content/box/box-as-grid-or-flex-item-1.html chrome://reftest/content/box/box-as-grid-or-flex-item-1-ref.html

== flexbox-abspos-container-1a.html flexbox-abspos-container-1-ref.html
== flexbox-abspos-container-1b.html flexbox-abspos-container-1-ref.html
Expand Down
14 changes: 7 additions & 7 deletions layout/reftests/bugs/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fuzzy(0-1,0-1) == 315920-20.svg 315920-20-ref.svg
== chrome://reftest/content/bugs/321402-5.xhtml chrome://reftest/content/bugs/321402-5-ref.xhtml
== chrome://reftest/content/bugs/321402-6.xhtml chrome://reftest/content/bugs/321402-6-ref.xhtml
== 321738-1.html 321738-1-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 322436-1.html 322436-1-ref.html
== chrome://reftest/content/bugs/322436-1.html chrome://reftest/content/bugs/322436-1-ref.html
== 322461-1.xml 322461-1-ref.html
== 323656-1.html 323656-1-ref.html
== 323656-2.html 323656-2-ref.html
Expand Down Expand Up @@ -938,7 +938,7 @@ fails == 411585-3.html 411585-3-ref.html # bug 426909
== 412607-1b.html 412607-1-ref.html
== 412679-1.html 412679-1-ref.html
fuzzy(0-1,0-17) == 412679-2.html 412679-2-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 413027-1.html 413027-1-ref.html
== chrome://reftest/content/bugs/413027-1.html chrome://reftest/content/bugs/413027-1-ref.html
fails == 413027-2.html 413027-2-ref.html
fails == 413027-3.html 413027-3-ref.html
== 413286-1a.html 413286-1-ref.html
Expand Down Expand Up @@ -1271,7 +1271,7 @@ pref(layout.css.caption-side-non-standard.enabled,true) == 478614-7.html 478614-
== 478811-4.html 478811-4-ref.html
== 478956-1a.html 478956-1-ref.html
== 478956-1b.html 478956-1-ref.html
pref(layout.css.xul-display-values.content.enabled,true) == 480017-1.html 480017-1-ref.html
== chrome://reftest/content/bugs/480017-1.html chrome://reftest/content/bugs/480017-1-ref.html
== 480880-1a.html 480880-1-ref.html
== 480880-1b.html 480880-1-ref.html
== 480880-1c.html 480880-1-ref.html
Expand Down Expand Up @@ -1372,7 +1372,7 @@ fuzzy-if(Android,0-5,0-2800) == 506481-1.html 506481-1-ref.html
== 507762-2.html 507762-2-ref.html
== 507762-3.html 507762-1-ref.html
== 507762-4.html 507762-2-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 508816-2.html 508816-2-ref.html
== chrome://reftest/content/bugs/508816-2.html chrome://reftest/content/bugs/508816-2-ref.html
== 508919-1.xhtml 508919-1-ref.xhtml
== 509155-1.xhtml 509155-1-ref.xhtml
fuzzy(0-1,0-1200) == 512410.html 512410-ref.html
Expand Down Expand Up @@ -1411,7 +1411,7 @@ fuzzy(0-5,0-50) == 526463-1.html 526463-1-ref.html
== 528038-2.html 528038-2-ref.html
== 528096-1.html 528096-1-ref.html
== 530686-1.html 530686-1-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 531098-1.html 531098-1-ref.html
== chrome://reftest/content/bugs/531098-1.html chrome://reftest/content/bugs/531098-1-ref.html
fuzzy-if(Android,0-2,0-48) fuzzy-if(cocoaWidget&&swgl,0-1,0-3) == 531200-1.html 531200-1-ref.html
== 531371-1.html 531371-1-ref.html
== 534526-1a.html 534526-1-ref.html
Expand Down Expand Up @@ -1521,7 +1521,7 @@ random-if(!winWidget) == 574907-2.html 574907-2-ref.html
random-if(!winWidget) != 574907-3.html 574907-3-notref.html
== 577838-1.html 577838-1-ref.html
== 577838-2.html 577838-2-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 579323-1.html 579323-1-ref.html
== chrome://reftest/content/bugs/579323-1.html chrome://reftest/content/bugs/579323-1-ref.html
== 579349-1.html 579349-1-ref.html
== 579655-1.html 579655-1-ref.html
fails-if(Android) random-if(layersGPUAccelerated) fuzzy(0-1,0-10000) == 579985-1.html 579985-1-ref.html # this bug was only for a regression in BasicLayers anyway
Expand Down Expand Up @@ -2085,7 +2085,7 @@ asserts(1-2) == 1588954.html 1588954-ref.html # Bug 1588954
== 1595199-1.html 1595199-1-ref.html
== 1599841-1.html 1599841-1-ref.html
!= 1599841-2.html 1599841-2-notref.html
pref(layout.css.xul-box-display-values.content.enabled,true) == 1606130.html 1606130-ref.html
== chrome://reftest/content/bugs/1606130.html chrome://reftest/content/bugs/1606130-ref.html
== 1608124-1.html 1608124-1-ref.html
skip-if(!OSX) != 1608124-2.html 1608124-2-notref.html
== 1613380.html 1613380-ref.html
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/text-overflow/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fuzzy(0-1,0-5) == clipped-elements.html clipped-elements-ref.html
fuzzy(0-47,0-18) == two-value-syntax.html two-value-syntax-ref.html
== single-value.html single-value-ref.html
fuzzy-if(gtkWidget,0-10,0-2) == atomic-under-marker.html atomic-under-marker-ref.html
pref(layout.css.xul-box-display-values.content.enabled,true) fuzzy(0-1,0-2616) skip-if(Android) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-12352) fails-if(gtkWidget) == xulscroll.html xulscroll-ref.html # gtkWidget:bug 1309107, bug 1328771
fuzzy(0-1,0-2616) skip-if(Android) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-12352) fails-if(gtkWidget) == chrome://reftest/content/text-overflow/xulscroll.html chrome://reftest/content/text-overflow/xulscroll-ref.html # gtkWidget:bug 1309107, bug 1328771
== combobox-zoom.html combobox-zoom-ref.html
== dynamic-change-1.html dynamic-change-1-ref.html
== float-edges-1.html float-edges-1-ref.html
Expand Down
1 change: 0 additions & 1 deletion layout/style/test/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ skip-if = toolkit == 'android'
[test_invalidation_basic.html]
[test_keyframes_rules.html]
[test_keyframes_vendor_prefix.html]
[test_layout_css_xul_display_values_content_enabled.html]
[test_load_events_on_stylesheets.html]
support-files = slow_broken_sheet.sjs slow_ok_sheet.sjs
[test_logical_properties.html]
Expand Down

This file was deleted.

6 changes: 2 additions & 4 deletions layout/style/test/test_non_content_accessible_values.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"display": [
"-moz-deck",
"-moz-popup",
"-moz-box",
"-moz-inline-box",
],
"-moz-appearance": [
"button-arrow-down",
Expand Down Expand Up @@ -127,10 +129,6 @@
],
};

if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) {
NON_CONTENT_ACCESSIBLE_VALUES.display.push("-moz-box", "-moz-inline-box");
}

const sheet = document.getElementById("sheet");
const div = document.querySelector("div");

Expand Down
2 changes: 2 additions & 0 deletions layout/tools/reftest/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ reftest.jar:
content/moz-bool-pref.css (../../../layout/reftests/css-parsing/moz-bool-pref.css)
content/editor/reftests/xul (../../../editor/reftests/xul/*)
content/bidi (../../reftests/bidi/*)
content/box (../../reftests/box/*)
content/box-ordinal (../../reftests/box-ordinal/*)
content/box-shadow (../../reftests/box-shadow/*)
content/bugs (../../reftests/bugs/*)
Expand All @@ -16,6 +17,7 @@ reftest.jar:
content/invalidation (../../reftests/invalidation/*)
content/native-theme (../../reftests/native-theme/*)
content/reftest-sanity (../../reftests/reftest-sanity/*)
content/text-overflow (../../reftests/text-overflow/*)
content/text-shadow (../../reftests/text-shadow/*)
content/writing-mode (../../reftests/writing-mode/*)
content/xul-document-load (../../reftests/xul-document-load/*)
Expand Down
1 change: 1 addition & 0 deletions layout/xul/test/chrome.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ support-files =
windowminmaxsize10.xhtml
titledpanelwindow.xhtml

[test_blockify_moz_box.html]
[test_bug159346.xhtml]
[test_bug372685.xhtml]
[test_bug381167.xhtml]
Expand Down
1 change: 0 additions & 1 deletion layout/xul/test/mochitest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[DEFAULT]
support-files =
file_bug386386.sjs
[test_blockify_moz_box.html]
[test_bug386386.html]
allow_xul_xbl = true
[test_bug394800.xhtml]
Expand Down
98 changes: 43 additions & 55 deletions layout/xul/test/test_blockify_moz_box.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
-->
<head>
<title>Test for Bug 1580012</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<style>
/* Styling for parents that blockify their children: */
.grid { display: grid; }
Expand Down Expand Up @@ -56,10 +55,9 @@
-->
</div>
<pre id="test">
<script type="application/javascript">
<script>

/** Test for Bug 1580012 **/
SimpleTest.waitForExplicitFinish();

function checkDisp(elemId, expectedDisplay) {
var elem = document.getElementById(elemId);
Expand All @@ -68,58 +66,48 @@
is(getComputedStyle(elem).display, expectedDisplay,
"Element with ID " + elemId + " should have expected display value");
}
function runTest() {
// Create CSS Style rules to add -moz-box / -moz-inline-box styling.
// Note that these style won't parse correctly until after we've flipped
// the prefs via pushPrefEnv(). That's why I'm creating these style rules
// here rather than just putting them inline in the <style> element.
var sheet = document.styleSheets[0];
sheet.insertRule(".moz-box { display: -moz-box; }");
sheet.insertRule(".moz-inline-box { display: -moz-inline-box; }");

// Check the computed 'display' of the various elements.
checkDisp("regularMozBox", "-moz-box");
checkDisp("regularMozInlineBox", "-moz-inline-box");

checkDisp("gridItemMozBox", "-moz-box");
checkDisp("gridItemMozInlineBox", "-moz-box");
checkDisp("gridGrandchildMozInlineBox", "-moz-inline-box");

checkDisp("flexItemMozBox", "-moz-box");
checkDisp("flexItemMozInlineBox", "-moz-box");
checkDisp("flexGrandchildMozInlineBox", "-moz-inline-box");

// XXXdholbert The floated boxes trigger assertion failures where
// nsLineLayout thinks it somehow ended up with an inline-level (really, just
// a non-'block') floated thing. In practice this isn't really a concern
// since -moz-box display values are disabled in content and since XUL
// doesn't use 'float' for layout. So: I've added a fatal assertion in
// ReflowInput.cpp to validate that we never actually encounter a floated
// -moz-box/-moz-inline-box, and I'm commenting out these lines (which
// trigger that fatal assertion).
//
// checkDisp("floatMozBox", "-moz-box");
// checkDisp("floatMozInlineBox", "-moz-box");


// XXXdholbert These abspos boxes trigger a diagnostic assertion added in
// bug 1582819 which is intended to flush out XUL content that is positioned
// and hence was previously blockified to 'block' but will now be '-moz-box'.
// The diagnostic assertion doesn't need to stay around forever, but while
// it exists, we can't test this scenario without triggering it.
//
// checkDisp("absMozBox", "-moz-box");
// checkDisp("absMozInlineBox", "-moz-box");

SimpleTest.finish();
}

SpecialPowers.pushPrefEnv({
"set": [
["layout.css.xul-box-display-values.content.enabled", true],
]
}, runTest);

// Create CSS Style rules to add -moz-box / -moz-inline-box styling.
// Note that these style won't parse correctly until after we've flipped
// the prefs via pushPrefEnv(). That's why I'm creating these style rules
// here rather than just putting them inline in the <style> element.
var sheet = document.styleSheets[0];
sheet.insertRule(".moz-box { display: -moz-box; }");
sheet.insertRule(".moz-inline-box { display: -moz-inline-box; }");

// Check the computed 'display' of the various elements.
checkDisp("regularMozBox", "-moz-box");
checkDisp("regularMozInlineBox", "-moz-inline-box");

checkDisp("gridItemMozBox", "-moz-box");
checkDisp("gridItemMozInlineBox", "-moz-box");
checkDisp("gridGrandchildMozInlineBox", "-moz-inline-box");

checkDisp("flexItemMozBox", "-moz-box");
checkDisp("flexItemMozInlineBox", "-moz-box");
checkDisp("flexGrandchildMozInlineBox", "-moz-inline-box");

// XXXdholbert The floated boxes trigger assertion failures where
// nsLineLayout thinks it somehow ended up with an inline-level (really, just
// a non-'block') floated thing. In practice this isn't really a concern
// since -moz-box display values are disabled in content and since XUL
// doesn't use 'float' for layout. So: I've added a fatal assertion in
// ReflowInput.cpp to validate that we never actually encounter a floated
// -moz-box/-moz-inline-box, and I'm commenting out these lines (which
// trigger that fatal assertion).
//
// checkDisp("floatMozBox", "-moz-box");
// checkDisp("floatMozInlineBox", "-moz-box");


// XXXdholbert These abspos boxes trigger a diagnostic assertion added in
// bug 1582819 which is intended to flush out XUL content that is positioned
// and hence was previously blockified to 'block' but will now be '-moz-box'.
// The diagnostic assertion doesn't need to stay around forever, but while
// it exists, we can't test this scenario without triggering it.
//
// checkDisp("absMozBox", "-moz-box");
// checkDisp("absMozInlineBox", "-moz-box");
</script>
</pre>
</body>
Expand Down
14 changes: 0 additions & 14 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8175,20 +8175,6 @@
value: true
mirror: always

- name: layout.css.xul-display-values.content.enabled
type: RelaxedAtomicBool
value: false
mirror: always
rust: true

# Pref to control whether display: -moz-box and display: -moz-inline-box are
# parsed in content pages.
- name: layout.css.xul-box-display-values.content.enabled
type: RelaxedAtomicBool
value: false
mirror: always
rust: true

# Whether to block large cursors intersecting UI.
- name: layout.cursor.block.enabled
type: bool
Expand Down
Loading

0 comments on commit 6eba703

Please sign in to comment.