Closed Bug 1652228 Opened 4 years ago Closed 4 years ago

Perma layout/style/test/test_flexbox_reflow_counts.html | bug in test; 'childToPreserve' should be child of 'parent' when Gecko 80 switches to late beta on 2020-08-07

Categories

(Core :: Layout, defect)

defect

Tracking

()

VERIFIED FIXED
mozilla80
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 + verified

People

(Reporter: aryx, Assigned: dholbert)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

central-as-late-beta simulation: https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel%2Crunnable&revision=911887fd1f3b6f8ab1a5caf5ddc991ec5c7bbb09&selectedTaskRun=AJ7DtxzqSsSP9_aWFbxWQA.0

Log: https://treeherder.mozilla.org/logviewer.html#?job_id=309301573&repo=try

TEST-UNEXPECTED-FAIL | layout/style/test/test_flexbox_reflow_counts.html | bug in test; 'childToPreserve' should be child of 'parent'
TEST-UNEXPECTED-FAIL | layout/style/test/test_flexbox_reflow_counts.html | uncaught exception - TypeError: parent.appendChild is not a function at removeChildrenExcept@http://mochi.test:8888/tests/layout/style/test/test_flexbox_reflow_counts.html:79:12

layout.dynamic-reflow-roots.enabled is only enabled for EARLY_BETA_OR_EARLIER.

Interesting! This wasn't intended to depend on layout.dynamic-reflow-roots.enabled. Do we know for sure that that's the pref involved here?

(I just tried running this mochitest manually, with that pref set to false, and it passed without issues. So I suspect there might be something else involved instead/also.)

In any case, I'll take a look here.

Assignee: nobody → dholbert

It looks like the problem is that the automatically-defined varialble content is actually a pointer to window, in Firefox release & late-beta (but not in Firefox Nightly or in Chrome).

Whereas, the test is expecting it to be a pointer to the <div id="content"> node.

I don't know what the explanation is for this magic window behavior, but maybe it's a quirk that we're getting rid of? (hence the maybe-new nightly-specific behavior that happens to match Chrome)

In any case, we can easily fix this by just explicitly declaring the content variable, instead of relying on the automagic behavior.

(In reply to Daniel Holbert [:dholbert] from comment #2)

I don't know what the explanation is for this magic window behavior, but maybe it's a quirk that we're getting rid of? (hence the maybe-new nightly-specific behavior that happens to match Chrome)

Yeah, looks like this is the thing in bug 1632116. The relevant pref that changes behavior here (in the late beta simulation) is dom.window.content.untrusted.enabled.

Not that we need it, but just to illustrate for anyone curious: here's a minimized testcase for demonstrating the problem here -- load this data URI, with web console (ctrl+shift+k) open:

data:text/html,<div id="content"></div><script>console.log(content)</script>

In Nightly, this logs the <div> (as the mochitest expects that it would).
In Firefox release (v78), this logs the Window, and then it prints the following warning about this behavior being deprecated:
The ‘content’ attribute of Window objects is deprecated. Please use ‘window.top’ instead.

(In reply to Daniel Holbert [:dholbert] from comment #1)

Interesting! This wasn't intended to depend on layout.dynamic-reflow-roots.enabled. Do we know for sure that that's the pref involved here?

(I just tried running this mochitest manually, with that pref set to false, and it passed without issues. So I suspect there might be something else involved instead/also.)

No. Thank you for identifying the related pref.

Before this patch, the test tries to remove all children from the 'content'
node except for one, as part of cleaning up. This is unnecessary, because none
of the subtests ever add any additional children to the 'content' element.
(It's also problematic because in late beta & release, 'content' is a special
variable name by default.)

While we're at it, this patch also makes us address the other nodes more
consistently, using the explicit variable declarations at the top of the
script section rather than their implicit ID-granted variable names.

Severity: -- → S3
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/afca8223767c
In test_flexbox_reflow_counts.html, don't bother pruning (nonexistent) children from 'content' node, and use consistent vars. r=TYLin
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: