autofocus shouldn't work in cross origin documents
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
People
(Reporter: hiro, Assigned: hiro)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-needed)
Attachments
(3 files)
There is a web platform test to check this and currently it fails.
We should do the same origin check before we call SetAutoFocusElement.
Assignee | ||
Comment 2•5 years ago
|
||
I have a patch for this, but we need to rewrite browser/components/sessionstore/test/browser_formdata.js since it uses autofocus in two data URLs, and nika told me on Slack that we treat data URL is cross-origin.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
We also use SpecialPowers.spawn to run the script to focus to the input element
so that it will work in fission world.
Assignee | ||
Comment 5•5 years ago
|
||
Note that I've confirmed no-cross-origin-autofocus.html works fine with
enabling fission on w3c-test.org.
Depends on D44949
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
Note that the patch also fixes no-sandboxed-automatic-features.html.
Comment 11•5 years ago
|
||
Backed out changeset 5a021b9f8790 (bug 1578973) for browser-chrome failures at browser/base/content/test/forms/browser_selectpopup.js
Backout: https://hg.mozilla.org/integration/autoland/rev/baad7feb838cdfcb2793c089461308fd8333e369
Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=5a021b9f8790b0f6d39aefb29d9c65c2bc8f0ba3&selectedJob=266453393
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266444993&repo=autoland&lineNumber=1073
task 2019-09-13T00:25:03.567Z] 00:25:03 INFO - TEST-PASS | browser/base/content/test/forms/browser_selectpopup.js | Popup hidden when tab is closed -
[task 2019-09-13T00:25:03.567Z] 00:25:03 INFO - Leaving test bound
[task 2019-09-13T00:25:03.567Z] 00:25:03 INFO - Entering test bound
[task 2019-09-13T00:25:03.567Z] 00:25:03 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,%3Chtml%3E%3Cbody%3E%3Cdiv%20id%3D%27div%27%3E%3Ciframe%20id%3D%27frame%27%20width%3D%27320%27%20height%3D%27295%27%20style%3D%27border%3A%20none%3B%27%20%20%20%20%20%20%20%20src%3D%27data%3Atext/html%2C%3Cselect%20id%3Dselect%20autofocus%3E%3Coption%3Ehe%20he%20he%3C/option%3E%3Coption%3Eboo%20boo%3C/option%3E%3Coption%3Ebaz%20baz%3C/option%3E%3C/select%3E%27%3C/iframe%3E%3C/div%3E%3C/body%3E%3C/html%3E" line: 0}]
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - Buffered messages logged at 00:24:18
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - Longer timeout required, waiting longer... Remaining timeouts: 1
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - Buffered messages finished
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/forms/browser_selectpopup.js | Test timed out -
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - GECKO(1639) | JavaScript error: resource://testing-common/PromiseTestUtils.jsm, line 112: uncaught exception: Object
[task 2019-09-13T00:25:03.568Z] 00:25:03 INFO - Console message: [JavaScript Error: "uncaught exception: Object" {file: "resource://testing-common/PromiseTestUtils.jsm" line: 112}]
[task 2019-09-13T00:25:03.569Z] 00:25:03 INFO - GECKO(1639) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2019-09-13T00:25:03.569Z] 00:25:03 INFO - GECKO(1639) | MEMORY STAT | vsize 7596MB | residentFast 309MB | heapAllocated 75MB
[task 2019-09-13T00:25:03.569Z] 00:25:03 INFO - TEST-OK | browser/base/content/test/forms/browser_selectpopup.js | took 90047ms
[task 2019-09-13T00:25:03.569Z] 00:25:03 INFO - Not taking screenshot here: see the one that was previously logged
[task 2019-09-13T00:25:03.572Z] 00:25:03 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/forms/browser_selectpopup.js | Found a tab after previous test timed out: data:text/html,%3Chtml%3E%3Cbody%3E%3Cdiv%20id%3D%27div%27%3E%3Ciframe%20id%3D%27frame%27%20width%3D%27320%27%20height%3D%27295%27%20style%3D%27border%3A%20none%3B%27%20%20%20%20%20%20%20%20src%3D%27data%3Atext/html%2C%3Cselect%20id%3Dselect%20autofocus%3E%3Coption%3Ehe%20he%20he%3C/option%3E%3Coption%3Eboo%20boo%3C/option%3E%3Coption%3Ebaz%20baz%3C/option%3E%3C/select%3E%27%3C/iframe%3E%3C/div%3E%3C/body%3E%3C/html%3E -
[task 2019-09-13T00:25:03.573Z] 00:25:03 INFO - checking window state
[task 2019-09-13T00:25:03.573Z] 00:25:03 INFO - TEST-START | browser/base/content/test/forms/browser_selectpopup_colors.js
[task 2019-09-13T00:25:03.857Z] 00:25:03 INFO - Not taking screenshot here: see the one that was previously logged
[task 2019-09-13T00:25:03.857Z] 00:25:03 INFO - Buffered messages logged at 00:25:03
[task 2019-09-13T00:25:03.857Z] 00:25:03 INFO - Entering test bound setup
[task 2019-09-13T00:25:03.858Z] 00:25:03 INFO - Leaving test bound setup
[task 2019-09-13T00:25:03.858Z] 00:25:03 INFO - Entering test bound test_colors_applied_to_popup_items
[task 2019-09-13T00:25:03.859Z] 00:25:03 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,%3Chtml%3E%3Chead%3E%3Cstyle%3E%20%20.blue%20%7B%20color%3A%20%23fff%3B%20background-color%3A%20%2300f%3B%20%7D%20%20.green%20%7B%20color%3A%20%23800080%3B%20background-color%3A%20green%3B%20%7D%20%20.defaultColor%20%7B%20color%3A%20-moz-ComboboxText%3B%20%7D%20%20.defaultBackground%20%7B%20background-color%3A%20-moz-Combobox%3B%20%7D%3C/style%3E%3Cbody%3E%3Cselect%20id%3D%27one%27%3E%20%20%3Coption%20value%3D%22One%22%20style%3D%22color%3A%20%23fff%3B%20background-color%3A%20%23f00%3B%22%3E%" line: 0}]
[task 2019-09-13T00:25:03.859Z] 00:25:03 INFO - Buffered messages finished
[task 2019-09-13T00:25:03.864Z] 00:25:03 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/forms/browser_selectpopup.js | Uncaught exception received from previously timed out test - at chrome://mochitests/content/browser/browser/base/content/test/forms/head.js:3 - TypeError: ContentTask is null
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - Stack trace:
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - hideSelectPopup@chrome://mochitests/content/browser/browser/base/content/test/forms/head.js:3:29
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - @chrome://mochitests/content/browser/browser/base/content/test/forms/browser_selectpopup.js:410:9
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - AsyncTester_execTest/<@chrome://mochikit/content/browser-test.js:1350:34
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - asyncTester_execTest@chrome://mochikit/content/browser-test.js:1385:11
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1213:14
[task 2019-09-13T00:25:03.865Z] 00:25:03 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:805:67
Assignee | ||
Comment 12•5 years ago
|
||
Do'h! I missed somehow that browser_selectpopup.js uses autofocus in an iframe written in dataURL...
Assignee | ||
Comment 13•5 years ago
|
||
Adding 'leave-open' since I did unintentionally land only D44949.
Assignee | ||
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
Comment 17•5 years ago
|
||
Assignee | ||
Comment 18•5 years ago
|
||
Do'h! Why D45779 didn't land?
Comment 19•5 years ago
|
||
Comment 20•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Description
•