Update web-platform-tests to revision cbd8c8ca929bc1aea71087be3b826cf1ee189a52

This commit is contained in:
WPT Sync Bot 2019-10-28 10:25:08 +00:00
parent 0c20fba2ab
commit 9c6bf785bd
150 changed files with 1798 additions and 876 deletions

View file

@ -14,6 +14,9 @@
[Revoke blob URL after creating Request, will fetch] [Revoke blob URL after creating Request, will fetch]
expected: FAIL expected: FAIL
[Revoke blob URL after calling fetch, fetch should succeed]
expected: FAIL
[url-with-fetch.any.html] [url-with-fetch.any.html]
[Untitled] [Untitled]
@ -34,3 +37,6 @@
[Revoke blob URL after creating Request, will fetch] [Revoke blob URL after creating Request, will fetch]
expected: FAIL expected: FAIL
[Revoke blob URL after calling fetch, fetch should succeed]
expected: FAIL

File diff suppressed because it is too large Load diff

View file

@ -5,9 +5,9 @@
[[data-expected-height\] 7] [[data-expected-height\] 7]
expected: FAIL expected: FAIL
[[data-expected-height\] 3] [[data-expected-height\] 1]
expected: FAIL expected: FAIL
[[data-expected-height\] 4] [[data-expected-height\] 2]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,4 @@
[perspective-interpolation.html] [perspective-interpolation.html]
expected: CRASH
[ perspective interpolation] [ perspective interpolation]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,17 @@
[MediaQueryList-addListener-handleEvent.html]
expected: TIMEOUT
[throws if handleEvent is falsy and not callable]
expected: NOTRUN
[looks up handleEvent method on every event dispatch]
expected: FAIL
[rethrows errors when getting handleEvent]
expected: TIMEOUT
[doesn't look up handleEvent method on callable event listeners]
expected: FAIL
[throws if handleEvent is thruthy and not callable]
expected: NOTRUN

View file

@ -0,0 +1,7 @@
[MediaQueryList-addListener-removeListener.html]
[listeners are called when <iframe> is resized]
expected: FAIL
[listeners are called correct number of times]
expected: FAIL

View file

@ -0,0 +1,4 @@
[matchMedia.html]
[iframe.matchMedia("(min-aspect-ratio: 1/1)") matches]
expected: FAIL

View file

@ -1,18 +0,0 @@
[matchMedia.xht]
bug: https://github.com/servo/servo/issues/20818
expected: TIMEOUT
[window.matchMedia exists]
expected: FAIL
[MediaQueryList.matches for "(min-aspect-ratio: 1/1)"]
expected: FAIL
[Resize iframe from 200x100 to 200x50, then to 100x50]
expected: NOTRUN
[Listeners are called in the order which they have been added]
expected: NOTRUN
[Listener added twice is only called once.]
expected: NOTRUN

View file

@ -1,10 +0,0 @@
[matchMediaAddListener-handleEvent.html]
[throws if handleEvent is falsy and not callable]
expected: FAIL
[rethrows errors when getting handleEvent]
expected: FAIL
[throws if handleEvent is thruthy and not callable]
expected: FAIL

View file

@ -1,5 +0,0 @@
[matchMediaAddListener.html]
type: testharness
[CSS Test: CSSOM View matchMedia addListener]
expected: FAIL

View file

@ -1,2 +0,0 @@
[contenttype_txt.html]
expected: CRASH

View file

@ -312,24 +312,27 @@
[<iframe>: separate response Content-Type: */* text/html] [<iframe>: separate response Content-Type: */* text/html]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html] [<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain] [<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html */*] [<iframe>: separate response Content-Type: text/html */*]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain] [<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL

View file

@ -56,3 +56,6 @@
[separate text/javascript x/x] [separate text/javascript x/x]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -1,6 +1,5 @@
[embedded-credentials.tentative.sub.html] [embedded-credentials.tentative.sub.html]
type: testharness type: testharness
expected: TIMEOUT
[Embedded credentials are treated as network errors.] [Embedded credentials are treated as network errors.]
expected: FAIL expected: FAIL
@ -11,11 +10,5 @@
expected: FAIL expected: FAIL
[Embedded credentials matching the top-level are treated as network errors for cross-origin URLs.] [Embedded credentials matching the top-level are treated as network errors for cross-origin URLs.]
expected: TIMEOUT expected: FAIL
[Embedded credentials matching the top-level are not treated as network errors for same-origin URLs.]
expected: TIMEOUT
[Embedded credentials matching the top-level are not treated as network errors for relative URLs.]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[navigation-unload-same-origin-fragment.html]
[Tests that a fragment navigation in the unload handler will not block the initial navigation]
expected: FAIL

View file

@ -0,0 +1,4 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[window-iframe-messagechannel-success.https.html]
[postMessaging to a same-origin iframe via MessageChannel allows them to see each others' modifications]
expected: FAIL

View file

@ -0,0 +1,13 @@
[window-iframe-messagechannel.https.html]
[postMessaging to a same-site iframe via MessageChannel allows them to see each others' modifications]
expected: FAIL
[postMessaging with a MessageChannel that's been cross-site should succeed]
expected: FAIL
[postMessaging to a cross-site iframe via MessageChannel should fail]
expected: FAIL
[postMessaging to a same-origin iframe via MessageChannel allows them to see each others' modifications]
expected: FAIL

View file

@ -1,6 +1,5 @@
[iframe_sandbox_popups_escaping-3.html] [iframe_sandbox_popups_escaping-3.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +1,5 @@
[iframe_sandbox_popups_nonescaping-2.html] [iframe_sandbox_popups_nonescaping-2.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: FAIL

View file

@ -1,5 +1,5 @@
[form-double-submit-3.html] [form-double-submit-3.html]
expected: ERROR expected: ERROR
[<button> should have the same double-submit protection as <input type=submit>] [<button> should have the same double-submit protection as <input type=submit>]
expected: TIMEOUT expected: FAIL

View file

@ -1,7 +1,11 @@
[form-submission-algorithm.html] [form-submission-algorithm.html]
expected: TIMEOUT
[If form's firing submission events is true, then return; 'submit' event] [If form's firing submission events is true, then return; 'submit' event]
expected: FAIL expected: FAIL
[If form's firing submission events is true, then return; 'invalid' event] [If form's firing submission events is true, then return; 'invalid' event]
expected: FAIL expected: FAIL
[Cannot navigate (after constructing the entry list)]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[DOMContentLoaded-defer.html]
[The end: DOMContentLoaded and defer scripts]
expected: FAIL

View file

@ -2,5 +2,5 @@
type: testharness type: testharness
expected: TIMEOUT expected: TIMEOUT
[Navigation Timing 2 WPT] [Navigation Timing 2 WPT]
expected: FAIL expected: NOTRUN

View file

@ -1,5 +1,5 @@
[nested-context-navigations-iframe.html] [nested-context-navigations-iframe.html]
expected: TIMEOUT expected: CRASH
[Test that iframe navigations are not observable by the parent, even after history navigations by the parent] [Test that iframe navigations are not observable by the parent, even after history navigations by the parent]
expected: FAIL expected: FAIL

View file

@ -1,4 +1,5 @@
[realtimeanalyser-fft-scaling.html] [realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.] [X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL expected: FAIL

View file

@ -1,5 +0,0 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[005.html] [005.html]
expected: ERROR
[dedicated worker in shared worker in dedicated worker] [dedicated worker in shared worker in dedicated worker]
expected: FAIL expected: FAIL

View file

@ -1,6 +1,5 @@
[003.html] [003.html]
type: testharness type: testharness
expected: ERROR
[shared] [shared]
expected: FAIL expected: FAIL

View file

@ -89,11 +89,11 @@ jobs:
- template: tools/ci/azure/install_safari.yml - template: tools/ci/azure/install_safari.yml
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
- script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-tbpl - --log-tbpl-level info --channel dev chrome infrastructure/ - script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-mach - --log-mach-level info --channel dev chrome infrastructure/
displayName: 'Run tests (Chrome Dev)' displayName: 'Run tests (Chrome Dev)'
- script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-tbpl - --log-tbpl-level info --channel nightly firefox infrastructure/ - script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-mach - --log-mach-level info --channel nightly firefox infrastructure/
displayName: 'Run tests (Firefox Nightly)' displayName: 'Run tests (Firefox Nightly)'
- script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-tbpl - --log-tbpl-level info --channel preview safari infrastructure/ - script: no_proxy='*' ./wpt run --yes --no-manifest-update --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-mach - --log-mach-level info --channel preview safari infrastructure/
displayName: 'Run tests (Safari Technology Preview)' displayName: 'Run tests (Safari Technology Preview)'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'
@ -227,7 +227,7 @@ jobs:
- template: tools/ci/azure/install_edge.yml - template: tools/ci/azure/install_edge.yml
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
- script: python ./wpt run --yes --no-manifest-update --install-fonts --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-tbpl - --log-tbpl-level info --channel dev edgechromium infrastructure/ - script: python ./wpt run --yes --no-manifest-update --install-fonts --manifest MANIFEST.json --metadata infrastructure/metadata/ --log-mach - --log-mach-level info --channel dev edgechromium infrastructure/
displayName: 'Run tests (Edge Dev)' displayName: 'Run tests (Edge Dev)'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'
@ -260,7 +260,7 @@ jobs:
channel: dev channel: dev
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
- script: python ./wpt run --yes --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --install-fonts --this-chunk $(System.JobPositionInPhase) --total-chunks $(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-tbpl - --log-tbpl-level info --channel dev edgechromium - script: python ./wpt run --yes --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --install-fonts --this-chunk $(System.JobPositionInPhase) --total-chunks $(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info --channel dev edgechromium
displayName: 'Run tests (Edge Dev)' displayName: 'Run tests (Edge Dev)'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'
@ -296,7 +296,7 @@ jobs:
channel: canary channel: canary
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
- script: python ./wpt run --yes --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --install-fonts --this-chunk $(System.JobPositionInPhase) --total-chunks $(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-tbpl - --log-tbpl-level info --channel canary edgechromium - script: python ./wpt run --yes --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --install-fonts --this-chunk $(System.JobPositionInPhase) --total-chunks $(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info --channel canary edgechromium
displayName: 'Run tests (Edge Canary)' displayName: 'Run tests (Edge Canary)'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'
@ -332,7 +332,7 @@ jobs:
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
# --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18634 # --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18634
- script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-tbpl - --log-tbpl-level info safari --exclude /inert/inert-retargeting.tentative.html --exclude /inert/inert-retargeting-iframe.tentative.html - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info safari --exclude /inert/inert-retargeting.tentative.html --exclude /inert/inert-retargeting-iframe.tentative.html
displayName: 'Run tests' displayName: 'Run tests'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'
@ -364,7 +364,7 @@ jobs:
- template: tools/ci/azure/install_safari.yml - template: tools/ci/azure/install_safari.yml
- template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_hosts.yml
- template: tools/ci/azure/update_manifest.yml - template: tools/ci/azure/update_manifest.yml
- script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-tbpl - --log-tbpl-level info --channel preview safari - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info --channel preview safari
displayName: 'Run tests' displayName: 'Run tests'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish results' displayName: 'Publish results'

View file

@ -7,42 +7,38 @@ search: False
# default: empty # default: empty
# allowed: list # allowed: list
requirements: requirements:
- tools/requirements_flake8.txt: - docs/requirements.txt
update: all - tools/requirements_flake8.txt
pin: True - tools/requirements_mypy.txt
- tools/requirements_mypy.txt: - tools/wpt/requirements.txt
update: all - tools/wptrunner/requirements.txt
pin: True - tools/wptrunner/requirements_android_webview.txt
- tools/wpt/requirements.txt: - tools/wptrunner/requirements_chrome.txt
update: all - tools/wptrunner/requirements_chrome_android.txt
pin: True - tools/wptrunner/requirements_chrome_ios.txt
- tools/wptrunner/requirements.txt: - tools/wptrunner/requirements_edge.txt
update: all - tools/wptrunner/requirements_edge_chromium.txt
pin: True - tools/wptrunner/requirements_epiphany.txt
- tools/wptrunner/requirements_chrome.txt: - tools/wptrunner/requirements_firefox.txt
update: all - tools/wptrunner/requirements_ie.txt
pin: True - tools/wptrunner/requirements_opera.txt
- tools/wptrunner/requirements_chrome_android.txt: - tools/wptrunner/requirements_safari.txt
update: all - tools/wptrunner/requirements_sauce.txt
pin: True - tools/wptrunner/requirements_servo.txt
- tools/wptrunner/requirements_edge.txt: - tools/wptrunner/requirements_webkit.txt
update: all
pin: True # try and avoid bogus PRs where these get updated (has happened occasionally)
- tools/wptrunner/requirements_firefox.txt: - annotation-protocol/requirements.txt:
update: all update: False
pin: True - css/requirements.txt:
- tools/wptrunner/requirements_ie.txt: update: False
update: all - tools/third_party/html5lib/requirements-optional.txt:
pin: True update: False
- tools/wptrunner/requirements_opera.txt: - tools/third_party/html5lib/requirements-test.txt:
update: all update: False
pin: True - tools/third_party/html5lib/requirements.txt:
- tools/wptrunner/requirements_safari.txt: update: False
update: all - tools/third_party/pytest/doc/en/requirements.txt:
pin: True update: False
- tools/wptrunner/requirements_sauce.txt: - tools/third_party/pytest/tasks/requirements.txt:
update: all update: False
pin: True
- tools/wptrunner/requirements_servo.txt:
update: all
pin: True

View file

@ -13,6 +13,7 @@
<script> <script>
"use strict"; "use strict";
setup({ single_test: true });
document.domain = "{{host}}"; document.domain = "{{host}}";
window.onload = () => { window.onload = () => {

View file

@ -7,8 +7,9 @@
text text
</div> </div>
<script> <script>
test(function() {
// Force a layout before removing. // Force a layout before removing.
document.body.offsetTop; document.body.offsetTop;
document.getElementById('target').remove(); document.getElementById('target').remove();
done(); }, '-webkit-box: removal of child');
</script> </script>

View file

@ -6,8 +6,9 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script nonce='abc'> <script nonce='abc'>
setup({ single_test: true });
window.addEventListener('securitypolicyviolation', function(e) { window.addEventListener('securitypolicyviolation', function(e) {
test(function() { assert_unreached("Should not have fired event")}); assert_unreached("Should not have fired event");
}); });
</script> </script>

View file

@ -6,8 +6,9 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script> <script>
setup({ single_test: true });
window.addEventListener('securitypolicyviolation', function(e) { window.addEventListener('securitypolicyviolation', function(e) {
test(function() { assert_unreached("securitypolicyviolat was fired")}); assert_unreached("securitypolicyviolat was fired");
}); });
</script> </script>
</head> </head>

View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test Reference: bug 1584018</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<style>
.container {
width: 100px;
height: 100px;
}
.scroll-inner {
overflow:scroll;
height:100%;
}
</style>
<div class="container">
<div class="scroll-inner">
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
</div>

View file

@ -0,0 +1,62 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Testcase, bug 1584018</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1584018">
<link rel="match" href="flex-child-percent-basis-resize-1-ref.html">
<style>
.flex-container {
display: flex;
flex-direction: row;
width: 100px;
}
.flex-item {
flex: 1 0 auto;
}
.scroll-outer {
overflow:hidden;
/* this combination is important */
height: 100%;
max-height: 100px;
}
.scroll-inner {
overflow:scroll;
height:100%;
}
</style>
<div class="flex-container">
<div class="flex-item">
<div class="scroll-outer">
<div class="scroll-inner">
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
</div>
</div>
</div>

View file

@ -11,7 +11,7 @@
<meta name="flags" content="ahem"> <meta name="flags" content="ahem">
<link rel="stylesheet" href="/css/support/grid.css"> <link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="/css/support/alignment.css"> <link rel="stylesheet" href="/css/support/alignment.css">
<link rel="stylesheet" href="support/width-keyword-classes.css"> <link rel="stylesheet" href="/css/support/width-keyword-classes.css">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style> <style>
body { body {

View file

@ -0,0 +1,222 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout test: align-self property</title>
<link rel="author" title="Rossana Monteriso" href="mailto:rmonteriso@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#alignment-values">
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#propdef-direction">
<meta name="assert" content="This test checks that the align-self property is applied correctly for RL and LR, vertical and horizontal writing modes.">
<meta name="flags" content="ahem">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="/css/support/alignment.css">
<link rel="stylesheet" href="/css/support/width-keyword-classes.css">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
.grid {
grid-template-columns: 100px 100px;
grid-template-rows: 200px 200px;
margin-bottom: 20px;
}
.cell {
width: 20px;
height: 40px;
}
.item {
width: 8px;
height: 16px;
background: black;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.grid')">
<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
<div class="alignSelfStretch firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200"></div>
<div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="100" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="100" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="0" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
<div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="100" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="0" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="100" data-offset-y="360" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- Default alignment and initial values. -->
<div style="position: relative">
<div class="grid fit-content alignItemsCenter" data-expected-width="200" data-expected-height="400">
<div class="cell alignSelfAuto firstRowFirstColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
<div class="cell firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="0" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="100" data-offset-y="360" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
<div class="alignSelfAuto firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200"></div>
<div class="cell firstRowSecondColumn" data-offset-x="100" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfStart secondRowFirstColumn" data-offset-x="0" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd secondRowSecondColumn" data-offset-x="100" data-offset-y="360" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- RTL direction (it should not affect the block-flow direction). -->
<div style="position: relative">
<div class="grid fit-content directionRTL" data-expected-width="200" data-expected-height="400">
<div class="alignSelfStretch firstRowFirstColumn" data-offset-x="100" data-offset-y="0" data-expected-width="100" data-expected-height="200"></div>
<div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="80" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="80" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content directionRTL" data-expected-width="200" data-expected-height="400">
<div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="180" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="80" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="180" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="80" data-offset-y="360" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- RTL direction (it should not affect the block-flow) with opposite directions grid container vs grid item. -->
<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
<div class="alignSelfStretch firstRowFirstColumn directionRTL" data-offset-x="0" data-offset-y="0" data-expected-width="100" data-expected-height="200"></div>
<div class="cell alignSelfStart firstRowSecondColumn directionRTL" data-offset-x="100" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd firstRowSecondColumn directionRTL" data-offset-x="100" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfCenter secondRowFirstColumn directionRTL" data-offset-x="0" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
<div class="cell alignSelfFlexEnd firstRowFirstColumn directionRTL" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfFlexStart firstRowSecondColumn directionRTL" data-offset-x="100" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn directionRTL" data-offset-x="0" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn directionRTL" data-offset-x="100" data-offset-y="360" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- Vertical RL writing mode. -->
<div style="position: relative">
<div class="grid fit-content verticalRL" data-expected-width="400" data-expected-height="200">
<div class="alignSelfStretch firstRowFirstColumn" data-offset-x="200" data-offset-y="0" data-expected-width="200" data-expected-height="100"></div>
<div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="380" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="200" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="90" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content verticalRL" data-expected-width="400" data-expected-height="200">
<div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="200" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="380" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="180" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="0" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- Vertical LR writing mode. -->
<div style="position: relative">
<div class="grid fit-content verticalLR" data-expected-width="400" data-expected-height="200">
<div class="alignSelfStretch firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="100"></div>
<div class="cell alignSelfStart firstRowSecondColumn" data-offset-x="0" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfEnd firstRowSecondColumn" data-offset-x="180" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfCenter secondRowFirstColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content verticalLR" data-expected-width="400" data-expected-height="200">
<div class="cell alignSelfFlexEnd firstRowFirstColumn" data-offset-x="180" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfFlexStart firstRowSecondColumn" data-offset-x="0" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfStart secondRowFirstColumn" data-offset-x="200" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn" data-offset-x="380" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>
</div>
</div>
<!-- Vertical RL writing mode with opposite block-flow directions grid container vs grid item. -->
<div style="position: relative">
<div class="grid fit-content verticalRL" data-expected-width="400" data-expected-height="200">
<div class="alignSelfStretch firstRowFirstColumn verticalLR" data-offset-x="200" data-offset-y="0" data-expected-width="200" data-expected-height="100">
</div>
<div class="cell alignSelfStart firstRowSecondColumn verticalLR" data-offset-x="380" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfEnd firstRowSecondColumn verticalLR" data-offset-x="200" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfCenter secondRowFirstColumn verticalLR" data-offset-x="90" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content verticalRL" data-expected-width="400" data-expected-height="200">
<div class="cell alignSelfFlexEnd firstRowFirstColumn verticalLR" data-offset-x="200" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfFlexStart firstRowSecondColumn verticalLR" data-offset-x="380" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfSelfStart secondRowFirstColumn verticalLR" data-offset-x="0" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn verticalLR" data-offset-x="180" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
</div>
</div>
<!-- Vertical LR writing mode with opposite block-flow directions grid container vs grid item. -->
<div style="position: relative">
<div class="grid fit-content verticalLR" data-expected-width="400" data-expected-height="200">
<div class="alignSelfStretch firstRowFirstColumn verticalRL" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="100">
</div>
<div class="cell alignSelfStart firstRowSecondColumn verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfEnd firstRowSecondColumn verticalRL" data-offset-x="180" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfCenter secondRowFirstColumn verticalRL" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
</div>
</div>
<div style="position: relative">
<div class="grid fit-content verticalLR" data-expected-width="400" data-expected-height="200">
<div class="cell alignSelfFlexEnd firstRowFirstColumn verticalRL" data-offset-x="180" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfFlexStart firstRowSecondColumn verticalRL" data-offset-x="0" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfSelfStart secondRowFirstColumn verticalRL" data-offset-x="380" data-offset-y="0" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
<div class="cell alignSelfSelfEnd secondRowSecondColumn verticalRL" data-offset-x="200" data-offset-y="100" data-expected-width="20" data-expected-height="40">
<div class="item"></div>
</div>
</div>
</div>
</body>

View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test Reference: bug 1584018</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<style>
.container {
width: 100px;
height: 100px;
}
.scroll-inner {
overflow:scroll;
height:100%;
}
</style>
<div class="container">
<div class="scroll-inner">
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
</div>

View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Testcase, bug 1584018</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-grid">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1584018">
<link rel="match" href="grid-child-percent-basis-resize-1-ref.html">
<style>
.grid-container {
display: grid;
width: 100px;
}
.grid-item {
}
.scroll-outer {
overflow:hidden;
/* this combination is important */
height: 100%;
max-height: 100px;
}
.scroll-inner {
overflow:scroll;
height:100%;
}
</style>
<div class="grid-container">
<div class="grid-item">
<div class="scroll-outer">
<div class="scroll-inner">
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>CSS Test: Multi-column element with scrolled content clipping</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"/>
<link rel="help" href="http://www.w3.org/TR/css3-multicol/#columns"/>
<link rel="match" href="reference/multicol-clip-scrolled-content-001-ref.html"/>
<style>
#columns {
column-width: 350px;
}
.spacer {
height: 200px;
width: 10px;
}
#outer {
border: 1px solid black;
overflow: scroll;
height: 300px;
width: 300px;
}
.inner {
overflow: scroll;
}
.clipped_target {
overflow: scroll;
background: red;
width: 50px;
height: 50px;
}
</style>
<div class=spacer></div>
<div id=columns>
<div class=spacer></div>
<div id=outer>
<div class=inner>
<pre class=clipped_target>
scrollable
content
goes
here
</pre>
</div>
<div class=spacer></div>
<div class=spacer></div>
</div>
</div>
<script>
window.onload = () => { outer.scrollTop = 100; };
</script>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>CSS Test: Multi-column element with scrolled content clipping (reference)</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"/>
<link rel="help" href="http://www.w3.org/TR/css3-multicol/#columns"/>
<style>
#columns {
column-width: 350px;
}
.spacer {
height: 200px;
width: 10px;
}
#outer {
border: 1px solid black;
overflow: scroll;
height: 300px;
width: 300px;
}
.inner {
overflow: scroll;
visibility: hidden;
}
.clipped_target {
width: 50px;
height: 50px;
}
</style>
<div class=spacer></div>
<div id=columns>
<div class=spacer></div>
<div id=outer>
<div class=inner>
<pre class=clipped_target>
scrollable
content
goes
here
</pre>
</div>
<div class=spacer></div>
<div class=spacer></div>
</div>
</div>
<script>
window.onload = () => { outer.scrollTop = 100; };
</script>
</html>

View file

@ -0,0 +1,27 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<style>
#target {
width: 100px;
height: 100px;
background: red;
/* For this simple case, hidden and clip are equivalent */
overflow: hidden;
}
#container {
overflow: auto;
height: 300px;
}
#fill {
background: blue;
height: 5000px;
}
</style>
<div id="container">
<div id="target">
<div id="fill"></div>
</div>
</div>

View file

@ -0,0 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<title>overflow: clip clips its contents and doesn't cause scrollable overflow</title>
<link rel="help" href="https://drafts.csswg.org/css-overflow/#valdef-overflow-clip">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="match" href="clip-001-ref.html">
<style>
#target {
width: 100px;
height: 100px;
background: red;
overflow: -moz-hidden-unscrollable;
overflow: clip;
}
#container {
overflow: auto;
height: 300px;
}
#fill {
background: blue;
height: 5000px;
}
</style>
<div id="container">
<div id="target">
<div id="fill"></div>
</div>
</div>

View file

@ -0,0 +1,36 @@
<!doctype html>
<meta charset="utf-8">
<title>Overflow areas are updated when dynamically changed to overflow: clip</title>
<link rel="help" href="https://drafts.csswg.org/css-overflow/#valdef-overflow-clip">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="match" href="clip-001-ref.html">
<style>
#target {
width: 100px;
height: 100px;
overflow: visible;
}
#container {
overflow: auto;
height: 300px;
}
#fill {
height: 5000px;
background: blue;
}
</style>
<div id="container">
<div id="target">
<div id="fill"></div>
</div>
</div>
<script>
onload = function() {
let target = document.getElementById("target");
window.unused = target.getBoundingClientRect(); // Update layout
target.style.overflow = "-moz-hidden-unscrollable";
target.style.overflow = "clip";
}
</script>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: Parsing tree-abiding pseudo-elements</title>
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#treelike">
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<meta name="assert" content="This test checks that gutters adjacent to collapsed tracks don't reduce the space available for aligning adjacent grid items." />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
// Generated content pseudo-elements
test_valid_selector("::before");
test_valid_selector("*::before", "::before");
test_valid_selector("foo.bar[baz]::before");
test_invalid_selector("::before *");
test_valid_selector("::after");
test_valid_selector("*::after", "::after");
test_valid_selector("foo.bar[baz]::after");
test_invalid_selector("::after *");
// List marker pseudo-element
test_valid_selector("::marker");
test_valid_selector("*::marker", "::marker");
test_valid_selector("foo.bar[baz]::marker");
test_invalid_selector("::marker *");
// Placeholder input pseudo-element
test_valid_selector("::placeholder");
test_valid_selector("*::placeholder", "::placeholder");
test_valid_selector("foo.bar[baz]::placeholder");
test_invalid_selector("::placeholder *");
// Combinations of the above
test_invalid_selector("::before::before");
test_invalid_selector("::after::before");
test_invalid_selector("::marker::before");
test_invalid_selector("::placeholder::before");
test_invalid_selector("::before::after");
test_invalid_selector("::after::after");
test_invalid_selector("::marker::after");
test_invalid_selector("::placeholder::after");
test_valid_selector("::before::marker");
test_valid_selector("::after::marker");
test_invalid_selector("::marker::marker");
test_invalid_selector("::placeholder::marker");
test_invalid_selector("::before::placeholder");
test_invalid_selector("::after::placeholder");
test_invalid_selector("::marker::placeholder");
test_invalid_selector("::placeholder::placeholder");
</script>

View file

@ -5,31 +5,10 @@
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo"> <link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<style id="styleElm"> <style id="styleElm">
</style> </style>
<script> <script>
function parse_selector(selector_text) {
try {
styleElm.sheet.insertRule(selector_text+"{}");
styleElm.sheet.deleteRule(0);
return true;
} catch (ex) {
return false;
}
}
function test_valid_selector(selector_text) {
test(function(){
assert_true(parse_selector(selector_text));
}, "Should be a valid selector: '" + selector_text + "'");
}
function test_invalid_selector(selector_text) {
test(function(){
assert_false(parse_selector(selector_text));
}, "Should be an invalid selector: '" + selector_text + "'");
}
test_invalid_selector("::slotted"); test_invalid_selector("::slotted");
test_invalid_selector("::slotted()"); test_invalid_selector("::slotted()");
test_invalid_selector("::slotted(*).class"); test_invalid_selector("::slotted(*).class");

View file

@ -55,12 +55,17 @@
</div> </div>
<div id="log"></div> <div id="log"></div>
<script> <script>
test(function() {
assert_true(
verifyTextPoints({ verifyTextPoints({
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50}, roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
containerWidth: 200, containerWidth: 200,
containerHeight: 200, containerHeight: 200,
lineHeight: 10 lineHeight: 10
}, 10, 1.5); }, 10, 1.5),
"Lines positioned properly around the shape."
);
});
</script> </script>
</body> </body>
</html> </html>

View file

@ -58,12 +58,17 @@
</div> </div>
<div id="log"></div> <div id="log"></div>
<script> <script>
test(function() {
assert_true(
verifyTextPoints({ verifyTextPoints({
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50}, roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
containerWidth: 200, containerWidth: 200,
containerHeight: 200, containerHeight: 200,
lineHeight: 10 lineHeight: 10
}, 10, 1); }, 10, 1),
"Lines positioned properly around the shape."
);
});
</script> </script>
</body> </body>
</html> </html>

View file

@ -60,12 +60,17 @@
</div> </div>
<div id="log"></div> <div id="log"></div>
<script> <script>
test(function() {
assert_true(
verifyTextPoints({ verifyTextPoints({
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50}, roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
containerWidth: 200, containerWidth: 200,
containerHeight: 200, containerHeight: 200,
lineHeight: 10 lineHeight: 10
}, 10, 1.5); }, 10, 1.5),
"Lines positioned properly around the shape."
);
});
</script> </script>
</body> </body>
</html> </html>

View file

@ -59,12 +59,17 @@
</div> </div>
<div id="log"></div> <div id="log"></div>
<script> <script>
test(function() {
assert_true(
verifyTextPoints({ verifyTextPoints({
roundedRect: {x: 100, y: 10, width: 100, height: 100, rx: 50, ry: 50}, roundedRect: {x: 100, y: 10, width: 100, height: 100, rx: 50, ry: 50},
containerWidth: 200, containerWidth: 200,
containerHeight: 200, containerHeight: 200,
lineHeight: 10 lineHeight: 10
}, 10, 1, "right"); }, 10, 1, "right"),
"Lines positioned properly around the shape."
);
});
</script> </script>
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
function verifyTextPoints(shape, numLines, tolerance, side) { function verifyTextPoints(shape, numLines, tolerance, side) {
var failed = false; var passed = true;
if (tolerance === undefined) if (tolerance === undefined)
tolerance = 0.5; tolerance = 0.5;
if (side === undefined) if (side === undefined)
@ -19,11 +19,9 @@ function verifyTextPoints(shape, numLines, tolerance, side) {
if( Math.abs( (actual - expected[i])) > tolerance ){ if( Math.abs( (actual - expected[i])) > tolerance ){
line.style.setProperty('color', 'red'); line.style.setProperty('color', 'red');
console.log('diff: ' + Math.abs(actual - expected[i])); console.log('diff: ' + Math.abs(actual - expected[i]));
failed = true; passed = false;
} }
} }
if (window.done) {
assert_false(failed, "Lines positioned properly around the shape."); return passed;
done();
}
} }

View file

@ -32,8 +32,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [182, 199, 201, 199, 182, 0]); approxShapeTest('test', 'line-', 2, [182, 199, 201, 199, 182, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -32,8 +32,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [218, 236, 238, 236, 218, 160]); approxShapeTest('test', 'line-', 2, [218, 236, 238, 236, 218, 160]);
done();
} }
</script> </script>
</head> </head>

View file

@ -34,8 +34,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [181, 199, 201, 199, 181, 0]); approxShapeTest('test', 'line-', 2, [181, 199, 201, 199, 181, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -42,8 +42,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [200, 214, 216, 214, 200, 158, 0]); approxShapeTest('test', 'line-', 2, [200, 214, 216, 214, 200, 158, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -46,8 +46,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 3, [182, 198, 200, 198, 182, 0]); approxShapeTest('test', 'line-', 3, [182, 198, 200, 198, 182, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -34,8 +34,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]); approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -34,8 +34,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]); approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -33,8 +33,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]); approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -39,7 +39,7 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({explicit_done: true}); setup({single_test: true});
document.fonts.ready.then(()=> { document.fonts.ready.then(()=> {
approxShapeTest('test', 'line-', 2, [48, 88, 128, 168, 180, 0]); approxShapeTest('test', 'line-', 2, [48, 88, 128, 168, 180, 0]);
done(); done();

View file

@ -41,8 +41,10 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="support/spec-example-utils.js"></script> <script src="support/spec-example-utils.js"></script>
<script> <script>
setup({ single_test: true });
function checkFloats() { function checkFloats() {
approxShapeTest('test', 'line-', 2, [242, 256, 258, 256, 242, 204, 0]); approxShapeTest('test', 'line-', 2, [242, 256, 258, 256, 242, 204, 0]);
done();
} }
</script> </script>
</head> </head>

View file

@ -11,7 +11,6 @@ function approxShapeTest(testId, linePrefix, epsilon, lineOffsets) {
var line = document.getElementById(linePrefix + i); var line = document.getElementById(linePrefix + i);
assert_approx_equals(line.offsetLeft, lineOffsets[i] + testOffset, epsilon, 'Line ' + i + ' is positioned properly'); assert_approx_equals(line.offsetLeft, lineOffsets[i] + testOffset, epsilon, 'Line ' + i + ' is positioned properly');
} }
done();
} }
runTest(); runTest();
} }

View file

@ -29,7 +29,7 @@
outline: solid 1px black; outline: solid 1px black;
} }
#test4 { #test4 {
animation: outline-anim 3s 0s paused reverse-linear; animation: outline-anim 3s 0s paused reverse linear;
outline: solid 1px black; outline: solid 1px black;
} }
</style> </style>

View file

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>CSSOM View Module test:MediaQueryList</title>
<link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" />
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css">
</style>
</head>
<body>
<p>This case tests the MediaQueryList</p>
<div id="log"></div>
<script>
test(function(){
assert_equals(window.matchMedia('(min-width: 1px)').matches, true, "Expected any device to match min-width: 1px");
},'matchMedia');
</script>
</body>
</html>

View file

@ -0,0 +1,106 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="flags" content="dom">
<title>CSS Test: CSSOM View MediaQueryList::addListener with handleEvent</title>
<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/matchMedia.js"></script>
<div id="log"></div>
<script>
"use strict";
setup({ allow_uncaught_exception: true });
promise_test(async t => {
const mql = await createMQL(t);
let _this;
let _event;
const listener = {
handleEvent(event) {
_this = this;
_event = event;
},
};
mql.addListener(listener);
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(_this, listener);
assert_equals(_event.media, mql.media);
assert_equals(_event.matches, mql.matches);
}, "calls handleEvent method of event listener");
promise_test(async t => {
const mql = await createMQL(t);
let calls = 0;
mql.addListener({
get handleEvent() {
calls++;
return function() {};
},
});
assert_equals(calls, 0);
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(calls, 1);
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(calls, 2);
}, "looks up handleEvent method on every event dispatch");
promise_test(async t => {
const mql = await createMQL(t);
let calls = 0;
const listener = () => {
calls++;
};
Object.defineProperty(listener, "handleEvent", {
get: t.unreached_func("handleEvent method should not be looked up on functions"),
});
mql.addListener(listener);
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(calls, 1);
}, "doesn't look up handleEvent method on callable event listeners");
const uncaught_error_test = async (t, listener) => {
const mql = await createMQL(t);
mql.addListener(listener);
const eventWatcher = new EventWatcher(t, window, "error");
const errorPromise = eventWatcher.wait_for("error");
triggerMQLEvent(mql);
const event = await errorPromise;
throw event.error;
};
promise_test(t => {
const error = { name: "test" };
const listener = {
get handleEvent() {
throw error;
},
};
return promise_rejects_exactly(t, error, uncaught_error_test(t, listener));
}, "rethrows errors when getting handleEvent");
promise_test(t => {
const listener = { handleEvent: null };
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
}, "throws if handleEvent is falsy and not callable");
promise_test(t => {
const listener = { handleEvent: "str" };
return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener));
}, "throws if handleEvent is thruthy and not callable");
</script>

View file

@ -0,0 +1,121 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="flags" content="dom">
<title>CSS Test: CSSOM View MediaQueryList::{add,remove}Listener</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/matchMedia.js"></script>
<div id="log"></div>
<script>
"use strict";
test(function() {
const mql = window.matchMedia("all");
assert_inherits(mql, "addListener");
assert_equals(typeof mql.addListener, "function");
}, "MediaQueryList::addListener is a function");
promise_test(async t => {
const iframe = await createIFrame(t, 200, 100);
const heightMQL = iframe.contentWindow.matchMedia("(max-height: 50px)");
const widthMQL = iframe.contentWindow.matchMedia("(min-width: 150px)");
let heightEvent;
let widthEvent;
heightMQL.addListener(event => {
heightEvent = event;
});
widthMQL.addListener(event => {
widthEvent = event;
});
assert_false(heightMQL.matches);
assert_true(widthMQL.matches);
iframe.height = "50"; // 200x100 => 200x50
await waitForChangesReported();
assert_equals(heightEvent.media, heightMQL.media);
assert_true(heightEvent.matches);
assert_true(heightMQL.matches);
assert_true(widthMQL.matches);
iframe.width = "100"; // 200x50 => 100x50
await waitForChangesReported();
assert_equals(widthEvent.media, widthMQL.media);
assert_false(widthEvent.matches);
assert_false(widthMQL.matches);
assert_true(heightMQL.matches);
}, "listeners are called when <iframe> is resized");
promise_test(async t => {
const mql = await createMQL(t);
let eventsCount = 0;
mql.addListener(() => {
eventsCount++;
});
for (let i = 1; i <= 10; i++) {
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(eventsCount, i);
}
}, "listeners are called correct number of times");
promise_test(async t => {
const mql = await createMQL(t);
const calls = [];
mql.addListener(() => {
calls.push("1st");
});
mql.addListener(() => {
calls.push("2nd");
});
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(calls[0], "1st");
assert_equals(calls[1], "2nd");
}, "listeners are called in order they were added");
promise_test(async t => {
const mql = await createMQL(t);
let called = 0;
const listener = () => {
called++;
};
mql.addListener(listener);
mql.addListener(listener);
triggerMQLEvent(mql);
await waitForChangesReported();
assert_equals(called, 1);
}, "listener that was added twice is called only once");
test(function() {
const mql = window.matchMedia("all");
assert_inherits(mql, "removeListener");
assert_equals(typeof mql.removeListener, "function");
}, "MediaQueryList::removeListener is a function");
promise_test(async t => {
const mql = await createMQL(t);
const listener = t.unreached_func("should not be called");
mql.addListener(listener);
mql.removeListener(listener);
triggerMQLEvent(mql);
await waitForChangesReported();
}, "MediaQueryList::removeListener removes added listener");
</script>

View file

@ -1,12 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>cssom-view - MediaQueryList with empty string</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function () {
var mql = window.matchMedia('');
assert_equals(mql.media, '', "This should be an empty media query list");
assert_equals(mql.matches, true, "Empty media query list should evaluate to true");
});
</script>

View file

@ -9,22 +9,10 @@
<script> <script>
"use strict"; "use strict";
test(t => {
assert_equals(MediaQueryListEvent.length, 1);
assert_throws(new TypeError(), () => {
new MediaQueryListEvent();
});
}, "type argument is required");
test(t => { test(t => {
assert_equals(new MediaQueryListEvent("test").type, "test"); assert_equals(new MediaQueryListEvent("test").type, "test");
}, 'type can be different from "change"'); }, 'type can be different from "change"');
test(t => {
assert_equals(Object.getPrototypeOf(MediaQueryListEvent), Event);
assert_true(new MediaQueryListEvent("change") instanceof Event);
}, "extends Event");
test(t => { test(t => {
const event = new MediaQueryListEvent("change"); const event = new MediaQueryListEvent("change");
@ -47,16 +35,4 @@ test(t => {
assert_true(event.bubbles); assert_true(event.bubbles);
assert_true(event.cancelable); assert_true(event.cancelable);
}, "init dictionary overrides"); }, "init dictionary overrides");
test(t => {
const event = new MediaQueryListEvent("change");
assert_idl_attribute(event, "media");
assert_readonly(event, "media");
}, "MediaQueryListEvent::media is read-only IDL attribute");
test(t => {
const event = new MediaQueryListEvent("change");
assert_idl_attribute(event, "matches");
assert_readonly(event, "matches");
}, "MediaQueryListEvent::matches is read-only IDL attribute");
</script> </script>

View file

@ -0,0 +1,79 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="flags" content="dom">
<title>CSS Test: CSSOM View matchMedia and MediaQueryList</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-window-matchmedia">
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface">
<link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/matchMedia.js"></script>
<div id="log"></div>
<script>
"use strict";
test(() => {
assert_equals(
typeof window.matchMedia,
"function",
"FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run."
);
}, "window.matchMedia is a function");
test(() => {
const mql = window.matchMedia("all");
assert_equals(mql.media, "all");
assert_true(mql.matches);
}, 'window.matchMedia("all") matches');
test(() => {
const mql = window.matchMedia("");
assert_equals(mql.media, "");
assert_true(mql.matches);
}, 'window.matchMedia("") matches');
test(() => {
const mql = window.matchMedia("(min-width: 1px)");
assert_equals(mql.media, "(min-width: 1px)");
assert_true(mql.matches);
}, 'window.matchMedia("(min-width: 1px)") matches');
test(() => {
const mql = window.matchMedia("::");
assert_true(mql instanceof MediaQueryList);
assert_equals(mql.media, "not all");
assert_false(mql.matches);
}, 'media query with syntax error is serialized as "not all"');
promise_test(async t => {
const iframe = await createIFrame(t, 200);
const mql = iframe.contentWindow.matchMedia("(max-width: 199px), all and (min-width: 200px)");
assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)");
assert_true(mql.matches);
}, 'iframe.matchMedia("(max-width: 199px), all and (min-width: 200px)") is serialized w/o "all"');
promise_test(async t => {
const iframe = await createIFrame(t);
const mql = iframe.contentWindow.matchMedia("(min-aspect-ratio: 1/1)");
assert_true(mql.matches);
}, 'iframe.matchMedia("(min-aspect-ratio: 1/1)") matches');
promise_test(async t => {
const iframe = await createIFrame(t, 200);
const mql = iframe.contentWindow.matchMedia("(width: 200px)");
assert_true(mql.matches);
}, 'iframe.matchMedia("(width: 200px)") matches');
promise_test(async t => {
const iframe = await createIFrame(t, 200, 100);
const mql = iframe.contentWindow.matchMedia("(max-height: 50px)");
assert_false(mql.matches);
}, 'iframe.matchMedia("(max-height: 50px)") matches');
promise_test(async t => {
const iframe = await createIFrame(t, 200, 100);
const mql = iframe.contentWindow.matchMedia("(min-width: 150px)");
assert_true(mql.matches);
}, 'iframe.matchMedia("(min-width: 150px)") matches');
</script>

View file

@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: CSSOM View matchMedia and MediaQueryList</title>
<meta name="timeout" content="long"/>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com" />
<link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-window-matchmedia" />
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" />
<link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries" />
<meta name="flags" content="dom" />
<script src="/resources/testharness.js" type="text/javascript" />
<script src="/resources/testharnessreport.js" type="text/javascript" />
<style type="text/css"><![CDATA[
iframe { border: none; }
]]></style>
</head>
<body>
<noscript>Test not run - javascript required.</noscript>
<div id="log" />
<iframe width="200" height="100" />
<script type="text/javascript"><![CDATA[
function reflow(doc) {
doc.body.offsetWidth;
}
var iframe = document.querySelector("iframe");
var iframe_window = window.frames[0];
reflow(iframe_window.document);
test(function(){
assert_inherits(window, "matchMedia");
}, "window.matchMedia exists");
test(function(){
assert_true(window.matchMedia instanceof Function, "FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run.");
}, "window.matchMedia is a Function");
var mql, mql1, mql2, mql3;
test(function(){
mql = window.matchMedia("all");
assert_true(mql instanceof MediaQueryList, "matchMedia(\"all\") returned MediaQueryList object.");
}, "window.matchMedia(\"all\")");
test(function(){
assert_idl_attribute(mql, "media", "Check that MediaQueryList.media exists.");
}, "MediaQueryList.media exists");
test(function(){
assert_readonly(mql, "media", "Check that MediaQueryList.media is readonly.");
}, "MediaQueryList.media is readonly");
test(function(){
assert_equals(mql.media, "all");
}, "MediaQueryList.media for \"all\"");
test(function(){
assert_idl_attribute(mql, "matches", "Check that MediaQueryList.matches exists.");
}, "MediaQueryList.matches exists");
test(function(){
assert_readonly(mql, "matches", "Check that MediaQueryList.matches is readonly.");
}, "MediaQueryList.matches is readonly");
test(function(){
assert_true(mql.matches);
}, "MediaQueryList.matches for \"all\"");
test(function(){
assert_inherits(mql, "addListener");
}, "MediaQueryList.addListener exists");
test(function(){
assert_true(mql.addListener instanceof Function);
}, "MediaQueryList.addListener is a Function");
test(function(){
assert_inherits(mql, "removeListener");
}, "MediaQueryList.removeListener exists");
test(function(){
assert_true(mql.removeListener instanceof Function);
}, "MediaQueryList.removeListener is a Function");
test(function(){
mql = window.matchMedia("::");
assert_true(mql instanceof MediaQueryList, "window.matchMedia(\"::\") returned MediaQueryList object.");
assert_equals(mql.media, "not all", "MediaQueryList.media serialized as \"not all\" from original string with syntax error.");
}, "MediaQueryList.media syntax error");
test(function(){
assert_false(mql.matches);
}, "MediaQueryList.matches for \"not all\"");
test(function(){
mql = iframe_window.matchMedia("(max-width: 199px), all and (min-width: 200px)");
assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)");
assert_true(mql.matches);
}, "MediaQueryList.matches for \"(max-width: 199px), all and (min-width: 200px)\"")
test(function(){
mql = iframe_window.matchMedia("(min-aspect-ratio: 1/1)");
assert_true(mql.matches);
}, "MediaQueryList.matches for \"(min-aspect-ratio: 1/1)\"");
test(function(){
mql = iframe_window.matchMedia("(width: 200px)");
assert_true(mql.matches);
}, "MediaQueryList.matches for \"(width: 200px)\"");
test(function(){
mql1 = iframe_window.matchMedia("(max-height: 50px)");
assert_false(mql1.matches);
}, "MediaQueryList.matches for \"(max-height: 50px)\"");
test(function(){
mql2 = iframe_window.matchMedia("(min-width: 150px)");
assert_true(mql2.matches);
}, "MediaQueryList.matches for \"(min-width: 150px)\"");
var resizeTest = async_test("Resize iframe from 200x100 to 200x50, then to 100x50");
var listenerOrderTest = async_test("Listeners are called in the order which they have been added");
var duplicateListenerTest = async_test("Listener added twice is only called once.");
window.onload = function(){
var rmListener = function(x){
resizeTest.step(function(){
assert_unreached("removeListener was not successful.");
});
};
var dupListener = function(x){
duplicateListenerTest.step(function(){
assert_false(mql1.dupListenerCalled, "Check that this listener has not been called before.");
mql1.dupListenerCalled = true;
});
};
mql1.firstListenerCalled = false;
mql1.dupListenerCalled = false;
// Add listener twice and remove it below. Should not be called.
mql1.addListener(rmListener);
mql1.addListener(rmListener);
// Add listener twice. Should only be called once.
mql1.addListener(dupListener);
mql1.addListener(dupListener);
mql1.addListener(function(x){
resizeTest.step(function(){
assert_equals(x, mql1, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on.");
assert_true(x.matches, "(max-height: 50px) should now pass.");
assert_true(mql2.matches, "(min-width: 150px) should still pass.");
iframe.width = "100";
});
listenerOrderTest.step(function(){
assert_false(mql1.firstListenerCalled, "Check that this listener is only called once.");
mql1.firstListenerCalled = true;
});
});
mql1.addListener(function(x){
listenerOrderTest.step(function(){
assert_true(mql1.firstListenerCalled, "Check that the listener added last is called last.");
});
listenerOrderTest.done();
});
mql1.removeListener(rmListener);
mql2.addListener(function(x){
duplicateListenerTest.done();
resizeTest.step(function(){
assert_equals(x, mql2, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on.");
assert_true(mql1.matches, "(max-height: 50px) should still pass.");
assert_false(x.matches, "(min-width: 150px) should now fail.");
});
resizeTest.done();
});
iframe.height = "50";
};]]>
</script>
</body>
</html>

View file

@ -1,136 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: CSSOM View matchMedia handleEvent via addListener</title>
<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/matchMedia.js"></script>
<div id="log"></div>
<script>
setup({ allow_uncaught_exception: true });
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let _this;
let _event;
const eventListener = {
handleEvent(event) {
_this = this;
_event = event;
},
};
mql.addListener(eventListener);
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(_this, eventListener);
assert_equals(_event.matches, mql.matches);
assert_equals(_event.media, MEDIA_QUERY);
}, "calls handleEvent method of event listener");
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let uncaughtError;
const errorHandler = event => {
uncaughtError = event.error;
};
window.addEventListener("error", errorHandler);
t.add_cleanup(() => {
window.removeEventListener("error", errorHandler);
});
const thrownError = { name: "test" };
mql.addListener({
get handleEvent() {
throw thrownError;
},
});
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(uncaughtError, thrownError);
}, "rethrows errors when getting handleEvent");
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let calls = 0;
mql.addListener({
get handleEvent() {
calls++;
return function() {};
},
});
assert_equals(calls, 0);
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(calls, 1);
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(calls, 2);
}, "looks up handleEvent method on every event dispatch");
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let calls = 0;
const eventListener = function() { calls++; };
Object.defineProperty(eventListener, "handleEvent", {
get: t.unreached_func("handleEvent method should not be looked up on functions"),
});
mql.addListener(eventListener);
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(calls, 1);
}, "doesn't look up handleEvent method on callable event listeners");
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let uncaughtError;
const errorHandler = event => {
uncaughtError = event.error;
};
window.addEventListener("error", errorHandler);
t.add_cleanup(() => {
window.removeEventListener("error", errorHandler);
});
mql.addListener({ handleEvent: null });
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(uncaughtError.name, "TypeError");
}, "throws if handleEvent is falsy and not callable");
promise_test(async t => {
const iframe = await createIframe(t);
const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY);
let uncaughtError;
const errorHandler = event => {
uncaughtError = event.error;
};
window.addEventListener("error", errorHandler);
t.add_cleanup(() => {
window.removeEventListener("error", errorHandler);
});
mql.addListener({ handleEvent: "str" });
triggerMQLEvent(iframe);
await waitForChangesReported();
assert_equals(uncaughtError.name, "TypeError");
}, "throws if handleEvent is thruthy and not callable");
</script>

View file

@ -1,65 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: CSSOM View matchMedia addListener</title>
<link rel="author" title="Chris Wu" href="mailto:pwx.frontend@gmail.com" />
<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" />
<meta name="flags" content="dom" />
<script src="/resources/testharness.js" type="text/javascript"></script>
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
<style type="text/css">
iframe { border: none; }
</style>
</head>
<body>
<div id="log"></div>
<iframe width="200" height="100" id="iframe1"></iframe>
<script>
function reflow(doc) {
doc.body.offsetWidth;
}
var iframe = document.querySelector("iframe");
var iframe_window = window.frames[0];
var iframe1 = document.getElementById("iframe1");
reflow(iframe_window.document);
var i = 0;
var totalCount = 10;
var count = 0;
var divineCount = 10;
var width_list = [201,199];
var mq1 = iframe_window.matchMedia("(max-width:200px)");
mq1.addListener(function(mql){
count = count + 1;
});
var equalAssert = async_test("Check for the correct number of event triggers");
var changeFrameWidth = function(iWidth) {
iframe1.style.width = iWidth + "px";
i = (i === 0) ? 1 : 0;
totalCount = totalCount - 1;
if(totalCount > 0)
{
step_timeout(function(){
changeFrameWidth(width_list[i]);
}, 100);
}
else
{
step_timeout(function(){
equalAssert.step(function(){
assert_equals(divineCount, count, "this will be 10 times of event triggers by change width");
});
equalAssert.done();
}, 100);
}
};
changeFrameWidth(width_list[0]);
</script>
</body>
</html>

View file

@ -1,11 +1,21 @@
const IFRAME_BASE_WIDTH = "200"; const IFRAME_DEFAULT_SIZE = "200";
const MEDIA_QUERY = `(max-width: ${IFRAME_BASE_WIDTH}px)`; const iframes = new WeakMap();
async function createMQL(t) {
const iframe = await createIFrame(t);
const mql = iframe.contentWindow.matchMedia(`(max-width: ${IFRAME_DEFAULT_SIZE}px)`);
assert_true(mql.matches, "MQL should match on newly created <iframe>");
iframes.set(mql, iframe);
return mql;
}
function createIFrame(t, width = IFRAME_DEFAULT_SIZE, height = width) {
assert_not_equals(document.body, null, "<body> element is missing");
function createIframe(t) {
const iframe = document.createElement("iframe"); const iframe = document.createElement("iframe");
iframe.srcdoc = ""; iframe.srcdoc = "";
iframe.width = IFRAME_BASE_WIDTH; iframe.width = String(width);
iframe.height = "100"; iframe.height = String(height);
iframe.style.border = "none"; iframe.style.border = "none";
t.add_cleanup(() => { t.add_cleanup(() => {
@ -14,6 +24,7 @@ function createIframe(t) {
return new Promise(resolve => { return new Promise(resolve => {
iframe.addEventListener("load", () => { iframe.addEventListener("load", () => {
iframe.contentDocument.body.offsetWidth; // reflow
resolve(iframe); resolve(iframe);
}); });
@ -21,8 +32,10 @@ function createIframe(t) {
}); });
} }
function triggerMQLEvent(iframe) { function triggerMQLEvent(mql) {
iframe.width = iframe.width === IFRAME_BASE_WIDTH ? "250" : IFRAME_BASE_WIDTH; const iframe = iframes.get(mql);
assert_not_equals(iframe, undefined, "Passed MQL instance was not created with createMQL");
iframe.width = iframe.width === IFRAME_DEFAULT_SIZE ? "250" : IFRAME_DEFAULT_SIZE;
} }
function waitForChangesReported() { function waitForChangesReported() {

View file

@ -36,3 +36,62 @@ function test_invalid_value(property, value) {
assert_equals(div.style.getPropertyValue(property), ""); assert_equals(div.style.getPropertyValue(property), "");
}, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value"); }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value");
} }
// serializedSelector can be the expected serialization of selector,
// or an array of permitted serializations,
// or omitted if value should serialize as selector.
function test_valid_selector(selector, serializedSelector) {
if (arguments.length < 2)
serializedSelector = selector;
const stringifiedSelector = JSON.stringify(selector);
test(function(){
document.querySelector(selector);
assert_true(true, stringifiedSelector + " should not throw in querySelector");
const style = document.createElement("style");
document.head.append(style);
const {sheet} = style;
document.head.removeChild(style);
const {cssRules} = sheet;
assert_equals(cssRules.length, 0, "Sheet should have no rule");
sheet.insertRule(selector + "{}");
assert_equals(cssRules.length, 1, "Sheet should have 1 rule");
const readSelector = cssRules[0].selectorText;
if (Array.isArray(serializedSelector))
assert_in_array(readSelector, serializedSelector, "serialization should be sound");
else
assert_equals(readSelector, serializedSelector, "serialization should be canonical");
sheet.deleteRule(0);
assert_equals(cssRules.length, 0, "Sheet should have no rule");
sheet.insertRule(readSelector + "{}");
assert_equals(cssRules.length, 1, "Sheet should have 1 rule");
assert_equals(cssRules[0].selectorText, readSelector, "serialization should round-trip");
}, stringifiedSelector + " should be a valid selector");
}
function test_invalid_selector(selector) {
const stringifiedSelector = JSON.stringify(selector);
test(function(){
assert_throws(
DOMException.SYNTAX_ERR,
() => document.querySelector(selector),
stringifiedSelector + " should throw in querySelector");
const style = document.createElement("style");
document.head.append(style);
const {sheet} = style;
document.head.removeChild(style);
assert_throws(
DOMException.SYNTAX_ERR,
() => sheet.insertRule(selector + "{}"),
stringifiedSelector + " should throw in insertRule");
}, stringifiedSelector + " should be an invalid selector");
}

View file

@ -1,3 +1,4 @@
recommonmark==0.5.0 recommonmark==0.6.0
Sphinx==1.8.5 # pin this to the last Py2 release
Sphinx==1.8.5 # pyup: <2.0
sphinx-argparse==0.2.5 sphinx-argparse==0.2.5

View file

@ -6,11 +6,11 @@ Currently, Android WebView support is experimental.
## Prerequisites ## Prerequisites
#### Please check [Chrome for Android](chrome_android.md) for the common instructions for Android support first. Please check [Chrome for Android](chrome_android.md) for the common instructions for Android support first.
#### Ensure you have a userdebug or eng Android build installed on the device. Ensure you have a userdebug or eng Android build installed on the device.
#### Install an up-to-date version of system webview shell. Install an up-to-date version of system webview shell:
1. Go to [chromium-browser-snapshots](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Android/) 1. Go to [chromium-browser-snapshots](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Android/)
2. Find the subdirectory with the highest number and click it, this number can be found 2. Find the subdirectory with the highest number and click it, this number can be found
in the "Commit Position" column of row "LAST_CHANGE" (at bottom of page). in the "Commit Position" column of row "LAST_CHANGE" (at bottom of page).
@ -21,7 +21,7 @@ Currently, Android WebView support is experimental.
* Run an emulator with * Run an emulator with
[writable system partition from command line](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_emulator.md/) [writable system partition from command line](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_emulator.md/)
#### If you have an issue with ChromeDriver version mismatch, try one of the following. If you have an issue with ChromeDriver version mismatch, try one of the following:
* Try removing `_venv/bin/chromedriver` such that wpt runner can install a matching version * Try removing `_venv/bin/chromedriver` such that wpt runner can install a matching version
automatically. Failing that, please check your environment path and make automatically. Failing that, please check your environment path and make
sure that no other ChromeDriver is used. sure that no other ChromeDriver is used.
@ -30,16 +30,16 @@ Currently, Android WebView support is experimental.
./wpt run --webdriver-binary <binary path> ... ./wpt run --webdriver-binary <binary path> ...
``` ```
#### Configure host remap rules in the [webview commandline file](https://cs.chromium.org/chromium/src/android_webview/docs/commandline-flags.md?l=57). Configure host remap rules in the [webview commandline file](https://cs.chromium.org/chromium/src/android_webview/docs/commandline-flags.md?l=57):
``` ```
adb shell "echo '_ --host-resolver-rules=\"MAP nonexistent.*.test ~NOTFOUND, MAP *.test 127.0.0.1\"' > /data/local/tmp/webview-command-line" adb shell "echo '_ --host-resolver-rules=\"MAP nonexistent.*.test ~NOTFOUND, MAP *.test 127.0.0.1\"' > /data/local/tmp/webview-command-line"
``` ```
#### Ensure that `adb` can be found on your system's PATH. Ensure that `adb` can be found on your system's PATH.
## Running Tests ## Running Tests
#### Example command line: Example command line:
```bash ```bash
./wpt run --test-type=testharness android_webview <TESTS> ./wpt run --test-type=testharness android_webview <TESTS>

View file

@ -452,7 +452,9 @@ is called, the two conditions above apply like normal.
Dedicated and shared workers don't have an event that corresponds to the `load` Dedicated and shared workers don't have an event that corresponds to the `load`
event in a document. Therefore these worker tests always behave as if the event in a document. Therefore these worker tests always behave as if the
`explicit_done` property is set to true. Service workers depend on the `explicit_done` property is set to true (unless they are defined using [the
"multi-global" pattern](testharness.html#multi-global-tests)). Service workers
depend on the
[install](https://w3c.github.io/ServiceWorker/#service-worker-global-scope-install-event) [install](https://w3c.github.io/ServiceWorker/#service-worker-global-scope-install-event)
event which is fired following the completion of [running the event which is fired following the completion of [running the
worker](https://html.spec.whatwg.org/multipage/workers.html#run-a-worker). worker](https://html.spec.whatwg.org/multipage/workers.html#run-a-worker).

View file

@ -178,6 +178,11 @@ be made available by the framework:
self.GLOBAL.isWindow() self.GLOBAL.isWindow()
self.GLOBAL.isWorker() self.GLOBAL.isWorker()
Although [the global `done` function must be explicitly invoked for most
dedicated worker tests and shared worker
tests](testharness-api.html#determining-when-all-tests-are-complete), it is
automatically invoked for tests defined using the "multi-global" pattern.
### Specifying a test title in auto-generated boilerplate tests ### Specifying a test title in auto-generated boilerplate tests
Use `// META: title=This is the title of the test` at the beginning of the resource. Use `// META: title=This is the title of the test` at the beginning of the resource.

View file

@ -5,6 +5,7 @@
<script src=/resources/testharnessreport.js></script> <script src=/resources/testharnessreport.js></script>
<iframe src="Element-getElementsByTagName-change-document-HTMLNess-iframe.xml"></iframe> <iframe src="Element-getElementsByTagName-change-document-HTMLNess-iframe.xml"></iframe>
<script> <script>
setup({ single_test: true });
onload = function() { onload = function() {
var parent = document.createElement("div"); var parent = document.createElement("div");
var child1 = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); var child1 = document.createElementNS("http://www.w3.org/1999/xhtml", "a");

View file

@ -44,36 +44,36 @@
create_test("{{host}}:{{ports[https][0]}}", FORCED, { create_test("{{host}}:{{ports[https][0]}}", FORCED, {
"site": "same-origin", "site": "same-origin",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[][www]}}:{{ports[https][0]}}", FORCED, { create_test("{{hosts[][www]}}:{{ports[https][0]}}", FORCED, {
"site": "same-site", "site": "same-site",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", FORCED, { create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", FORCED, {
"site": "cross-site", "site": "cross-site",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{host}}:{{ports[https][0]}}", USER, { create_test("{{host}}:{{ports[https][0]}}", USER, {
"site": "same-origin", "site": "same-origin",
"user": "?1", "user": "?1",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[][www]}}:{{ports[https][0]}}", USER, { create_test("{{hosts[][www]}}:{{ports[https][0]}}", USER, {
"site": "same-site", "site": "same-site",
"user": "?1", "user": "?1",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", USER, { create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", USER, {
"site": "cross-site", "site": "cross-site",
"user": "?1", "user": "?1",
"mode": "nested-navigate" "mode": "navigate"
}); });
</script> </script>

View file

@ -68,7 +68,7 @@
assert_header_equals(e.data, { assert_header_equals(e.data, {
"site": "cross-site", "site": "cross-site",
"user": "", "user": "",
"mode": "nested-navigate", "mode": "navigate",
}); });
t.done(); t.done();
})); }));

View file

@ -27,18 +27,18 @@
create_test("{{host}}:{{ports[https][0]}}", { create_test("{{host}}:{{ports[https][0]}}", {
"site": "same-origin", "site": "same-origin",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[][www]}}:{{ports[https][0]}}", { create_test("{{hosts[][www]}}:{{ports[https][0]}}", {
"site": "same-site", "site": "same-site",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", { create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", {
"site": "cross-site", "site": "cross-site",
"user": "", "user": "",
"mode": "nested-navigate" "mode": "navigate"
}); });
</script> </script>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html>
<script>
const channel = new MessageChannel();
window.parent.postMessage({ state: "port1", data: channel.port1 }, '*', [channel.port1]);
window.onmessage = () => window.parent.postMessage({ state: "port2", data: channel.port2 }, '*', [channel.port2]);
</script>

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-origin

View file

@ -0,0 +1,7 @@
<!DOCTYPE html>
<script>
const channel = new MessageChannel();
window.parent.postMessage(channel.port2, '*', [channel.port2]);
channel.port1.onmessage = e => { alert(e.data); channel.port1.postMessage("message event received") };
channel.port1.onmessageerror = () => channel.port1.postMessage("messageerror event received");
</script>

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-origin

View file

@ -1,23 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Structured cloning of SharedArrayBuffers into windows using MessageChannel</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#structuredserialize">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-incrementer.js"></script>
<div id="log"></div>
<script>
promise_test(t => {
return new Promise(resolve => {
const iframe = document.createElement("iframe");
window.onmessage = t.step_func((message) => {
// data will be a MessagePort
resolve(testSharingViaIncrementerScript(t, message.data, "window", message.data, "iframe"));
});
iframe.src = "resources/incrementer-iframe-messagechannel.html";
document.body.appendChild(iframe);
});
}, "postMessaging to a same-origin iframe via MessageChannel allows them to see each others' modifications");
</script>

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Structured cloning of SharedArrayBuffers into windows using MessageChannel</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#structuredserialize">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-incrementer.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<div id="log"></div>
<script>
["same-origin", "same-site"].forEach(originOrSite => {
promise_test(t => {
return new Promise(resolve => {
const iframe = document.createElement("iframe");
window.onmessage = t.step_func((message) => {
// data will be a MessagePort
resolve(testSharingViaIncrementerScript(t, message.data, "window", message.data, "iframe"));
});
let url = "resources/incrementer-iframe-messagechannel.html";
if (originOrSite === "same-site") {
url = get_host_info().HTTPS_REMOTE_ORIGIN + new URL(url, window.location).pathname;
}
iframe.src = url;
document.body.appendChild(iframe);
});
}, `postMessaging to a ${originOrSite} iframe via MessageChannel allows them to see each others' modifications`);
});
promise_test(t => {
return new Promise(resolve => {
const iframe = document.createElement("iframe");
window.onmessage = t.step_func(message => {
// data will be a MessagePort
message.data.postMessage(new SharedArrayBuffer(10));
message.data.onmessage = t.step_func(message => {
assert_equals(message.data, "messageerror event received");
resolve();
});
});
iframe.src = get_host_info().HTTPS_NOTSAMESITE_ORIGIN + new URL("resources/iframe-messagechannel-failure.html", window.location).pathname;
document.body.append(iframe);
});
}, "postMessaging to a cross-site iframe via MessageChannel should fail");
promise_test(t => {
return new Promise(resolve => {
const iframe = document.createElement("iframe");
let port = null;
window.onmessage = t.step_func(message => {
if (message.data.state === "port1") {
port = message.data.data;
port.postMessage(new SharedArrayBuffer(10));
message.source.postMessage("send port2", "*");
} else if (message.data.state === "port2") {
// Note that onmessage calls start()
message.data.data.onmessage = t.step_func(message => {
assert_true(message.data instanceof SharedArrayBuffer);
assert_equals(message.data.byteLength, 10);
resolve();
});
message.data.data.onmessageerror = t.unreached_func();
}
});
iframe.src = get_host_info().HTTPS_NOTSAMESITE_ORIGIN + new URL("resources/iframe-messagechannel-complex.html", window.location).pathname;
document.body.append(iframe);
});
}, "postMessaging with a MessageChannel that's been cross-site should succeed");
</script>

View file

@ -1,2 +1,2 @@
// JavaScript file with UTF-8 BOM. // JavaScript file with UTF-8 BOM.
executed_utf8_bom = '三村かな子'; window.executed_utf8_bom = '三村かな子';

View file

@ -84,6 +84,11 @@ dictionary MediaCapabilitiesInfo {
dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo { dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo {
required MediaKeySystemAccess keySystemAccess; required MediaKeySystemAccess keySystemAccess;
MediaDecodingConfiguration configuration;
};
dictionary MediaCapabilitiesEncodingInfo : MediaCapabilitiesInfo {
MediaEncodingConfiguration configuration;
}; };
[Exposed=Window] [Exposed=Window]

View file

@ -92,7 +92,7 @@ function step1() {
} }
function step2() { function step2() {
assert_equals(entries.length, 4, "Has 3 total notifications because 4th element was added."); assert_equals(entries.length, 4, "Has 4 total notifications because 4th element was added.");
checkRect(entries[3].boundingClientRect, [0, 100, 300, 400], "Check 4th entry rect"); checkRect(entries[3].boundingClientRect, [0, 100, 300, 400], "Check 4th entry rect");
assert_equals(entries[3].target.id, 'target4', "Check 4th entry target id."); assert_equals(entries[3].target.id, 'target4', "Check 4th entry target id.");
checkIsIntersecting(entries, 3, false); checkIsIntersecting(entries, 3, false);

Some files were not shown because too many files have changed in this diff Show more