mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 9f01716569ae5dfd79675ea55718e48017d077a8
This commit is contained in:
parent
9b24798390
commit
93a31731d9
117 changed files with 3664 additions and 843 deletions
|
@ -34,3 +34,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
|
@ -56,9 +56,3 @@
|
||||||
[background-position length(px) / events]
|
[background-position length(px) / events]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[font-size length(em) / values]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[font-size length(em) / events]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -71,3 +71,6 @@
|
||||||
[text-indent intermediate]
|
[text-indent intermediate]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[opacity end]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[matchMedia-display-none-iframe.html]
|
||||||
|
expected: ERROR
|
|
@ -312,3 +312,21 @@
|
||||||
[<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;" text/plain]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: combined response Content-Type: */* text/html]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: separate response Content-Type: text/html */*]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -59,3 +59,6 @@
|
||||||
[separate text/javascript;charset=windows-1252 error text/javascript]
|
[separate text/javascript;charset=windows-1252 error text/javascript]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[separate text/javascript;charset=windows-1252 text/javascript]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,3 @@
|
||||||
[X-Content-Type-Options%3A%20nosniff%0C]
|
[X-Content-Type-Options%3A%20nosniff%0C]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Content-Type-Options%3A%20nosniff]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[traverse_the_history_4.html]
|
||||||
|
[Multiple history traversals, last would be aborted]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
[open-features-negative-innerwidth-innerheight.html]
|
[open-features-negative-innerwidth-innerheight.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: negative values for legacy `innerwidth`, `innerheight`]
|
[HTML: window.open `features`: negative values for legacy `innerwidth`, `innerheight`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=-404.5" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerwidth=-404.5" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerwidth=-404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerheight=-404e1" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerheight=-404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerwidth=-404e1" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
[open-features-negative-screenx-screeny.html]
|
[open-features-negative-screenx-screeny.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: negative values for legacy `screenx`, `screeny`]
|
[HTML: window.open `features`: negative values for legacy `screenx`, `screeny`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=-204" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screeny=-204" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screeny=-204.5" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screeny=-0" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screenx=-0" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screenx=-204.5" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
[open-features-negative-top-left.html]
|
[open-features-negative-top-left.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: negative values for `top`, `left`]
|
[HTML: window.open `features`: negative values for `top`, `left`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "top=-204" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "top=-204.5" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "left=-204" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "top=-0" should NOT set "top=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "left=-204.5" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "left=-0" should NOT set "left=204"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
[open-features-negative-width-height.html]
|
[open-features-negative-width-height.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: negative values for `width`, `height`]
|
[HTML: window.open `features`: negative values for `width`, `height`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=-404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "height=-404e1" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "height=-404.5" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=-404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=-404e1" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=-404.5" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,48 +1,32 @@
|
||||||
[open-features-non-integer-height.html]
|
[open-features-non-integer-height.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for feature `height`]
|
[HTML: window.open `features`: non-integer values for feature `height`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405*3" should set "height=405"]
|
[features "height=405*3" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405.32" should set "height=405"]
|
[features "height=405.32" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405e1" should set "height=405"]
|
[features "height=405e1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405/5" should set "height=405"]
|
[features "height=405/5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405^4" should set "height=405"]
|
[features "height=405^4" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405.5" should set "height=405"]
|
[features "height=405.5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405e-1" should set "height=405"]
|
[features "height=405e-1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405 " should set "height=405"]
|
[features "height=405 " should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=405LLl" should set "height=405"]
|
[features "height=405LLl" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "height=/404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[top=0,left=0,width=401,: absence of feature "height" should be treated same as "height=0"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[top=0,left=0: absence of feature "height" should be treated same as "height=0"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "height=_404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "height=L404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,32 @@
|
||||||
[open-features-non-integer-innerheight.html]
|
[open-features-non-integer-innerheight.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for legacy feature `innerheight`]
|
[HTML: window.open `features`: non-integer values for legacy feature `innerheight`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405e-1" should set "height=405"]
|
[features "innerheight=405e-1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405LLl" should set "height=405"]
|
[features "innerheight=405LLl" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405^4" should set "height=405"]
|
[features "innerheight=405^4" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405e1" should set "height=405"]
|
[features "innerheight=405e1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405 " should set "height=405"]
|
[features "innerheight=405 " should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405/5" should set "height=405"]
|
[features "innerheight=405/5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405.32" should set "height=405"]
|
[features "innerheight=405.32" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405.5" should set "height=405"]
|
[features "innerheight=405.5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=405*3" should set "height=405"]
|
[features "innerheight=405*3" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerheight=_404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerheight=L404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerheight=/404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,32 @@
|
||||||
[open-features-non-integer-innerwidth.html]
|
[open-features-non-integer-innerwidth.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for legacy feature `innerwidth`]
|
[HTML: window.open `features`: non-integer values for legacy feature `innerwidth`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405e-1" should set "width=405"]
|
[features "innerwidth=405e-1" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405*3" should set "width=405"]
|
[features "innerwidth=405*3" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405.5" should set "width=405"]
|
[features "innerwidth=405.5" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405e1" should set "width=405"]
|
[features "innerwidth=405e1" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405.32" should set "width=405"]
|
[features "innerwidth=405.32" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405 " should set "width=405"]
|
[features "innerwidth=405 " should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405LLl" should set "width=405"]
|
[features "innerwidth=405LLl" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405/5" should set "width=405"]
|
[features "innerwidth=405/5" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=405^4" should set "width=405"]
|
[features "innerwidth=405^4" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "innerwidth=/404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerwidth=_404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "innerwidth=L404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,32 @@
|
||||||
[open-features-non-integer-left.html]
|
[open-features-non-integer-left.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for feature `left`]
|
[HTML: window.open `features`: non-integer values for feature `left`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105e1" should set "left=105"]
|
[features "left=105e1" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105 " should set "left=105"]
|
[features "left=105 " should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105/5" should set "left=105"]
|
[features "left=105/5" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105e-1" should set "left=105"]
|
[features "left=105e-1" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105^4" should set "left=105"]
|
[features "left=105^4" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105LLl" should set "left=105"]
|
[features "left=105LLl" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105.32" should set "left=105"]
|
[features "left=105.32" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105*3" should set "left=105"]
|
[features "left=105*3" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=105.5" should set "left=105"]
|
[features "left=105.5" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "left=L104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "left=/104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "left=_104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,32 @@
|
||||||
[open-features-non-integer-screenx.html]
|
[open-features-non-integer-screenx.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for legacy feature `screenx`]
|
[HTML: window.open `features`: non-integer values for legacy feature `screenx`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105.5" should set "left=105"]
|
[features "screenx=105.5" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105e1" should set "left=105"]
|
[features "screenx=105e1" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105 " should set "left=105"]
|
[features "screenx=105 " should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105*3" should set "left=105"]
|
[features "screenx=105*3" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105e-1" should set "left=105"]
|
[features "screenx=105e-1" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105^4" should set "left=105"]
|
[features "screenx=105^4" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105LLl" should set "left=105"]
|
[features "screenx=105LLl" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105/5" should set "left=105"]
|
[features "screenx=105/5" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=105.32" should set "left=105"]
|
[features "screenx=105.32" should set "left=105"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screenx=_104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screenx=L104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screenx=/104" should NOT set "left=104"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,32 @@
|
||||||
[open-features-non-integer-screeny.html]
|
[open-features-non-integer-screeny.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for legacy feature `screeny`]
|
[HTML: window.open `features`: non-integer values for legacy feature `screeny`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405^4" should set "height=405"]
|
[features "screeny=405^4" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405e-1" should set "height=405"]
|
[features "screeny=405e-1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405LLl" should set "height=405"]
|
[features "screeny=405LLl" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405e1" should set "height=405"]
|
[features "screeny=405e1" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405 " should set "height=405"]
|
[features "screeny=405 " should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405/5" should set "height=405"]
|
[features "screeny=405/5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405*3" should set "height=405"]
|
[features "screeny=405*3" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405.32" should set "height=405"]
|
[features "screeny=405.32" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=405.5" should set "height=405"]
|
[features "screeny=405.5" should set "height=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "screeny=_404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screeny=L404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "screeny=/404" should NOT set "height=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -1,48 +1,32 @@
|
||||||
[open-features-non-integer-width.html]
|
[open-features-non-integer-width.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[HTML: window.open `features`: non-integer values for feature `width`]
|
[HTML: window.open `features`: non-integer values for feature `width`]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405^4" should set "width=405"]
|
[features "width=405^4" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405.5" should set "width=405"]
|
[features "width=405.5" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405e1" should set "width=405"]
|
[features "width=405e1" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405 " should set "width=405"]
|
[features "width=405 " should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405.32" should set "width=405"]
|
[features "width=405.32" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405LLl" should set "width=405"]
|
[features "width=405LLl" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405*3" should set "width=405"]
|
[features "width=405*3" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405e-1" should set "width=405"]
|
[features "width=405e-1" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[features "width=405/5" should set "width=405"]
|
[features "width=405/5" should set "width=405"]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[top=0,left=0: absence of feature "width" should be treated same as "width=0"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=_404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[top=0,left=0,height=401,: absence of feature "width" should be treated same as "width=0"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=/404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
[features "width=L404" should NOT set "width=404"]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[iframe_sandbox_navigate_history_go_back.html]
|
||||||
|
[Check that sandboxed iframe can not navigate their ancestors]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[iframe_sandbox_navigate_history_go_forward.html]
|
||||||
|
[Check that sandboxed iframe can not navigate their ancestors]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
[toggleEvent.html]
|
||||||
|
[Calling open twice on 'details' fires only one toggle event]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[DOMContentLoaded-defer.html]
|
|
||||||
[The end: DOMContentLoaded and defer scripts]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[promise-rejection-events.html]
|
[promise-rejection-events.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire]
|
[delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -8,3 +9,6 @@
|
||||||
[no unhandledrejection/rejectionhandled: rejection handler attached synchronously to a promise created from createImageBitmap]
|
[no unhandledrejection/rejectionhandled: rejection handler attached synchronously to a promise created from createImageBitmap]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[rejectionhandled is dispatched from a queued task, and not immediately]
|
||||||
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
[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
|
||||||
|
|
||||||
|
|
|
@ -191,3 +191,9 @@
|
||||||
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[30\]\t9.4836157560348511e-1\t9.5236867666244507e-1\t4.0071010589599609e-3\t4.2075103446311962e-3\t3.8985999999999999e-3\n\t[31\]\t9.2646563053131104e-1\t9.3139332532882690e-1\t4.9276947975158691e-3\t5.2906700783754857e-3\t3.8985999999999999e-3\n\t[32\]\t9.0087991952896118e-1\t9.0675884485244751e-1\t5.8789253234863281e-3\t6.4834496590358351e-3\t3.8985999999999999e-3\n\t[33\]\t8.7170630693435669e-1\t8.7856203317642212e-1\t6.8557262420654297e-3\t7.8033490899654511e-3\t3.8985999999999999e-3\n\t[34\]\t8.3906102180480957e-1\t8.4691369533538818e-1\t7.8526735305786133e-3\t9.2721059699818163e-3\t3.8985999999999999e-3\n\t...and 31037 more errors.\n\tMax AbsError of 9.8276454210281372e-1 at index of 39267.\n\t[39267\]\t-2.1306337878227066e-23\t-9.8276454210281372e-1\t9.8276454210281372e-1\t1.0000000000000000e+0\t3.8985999999999999e-3\n\tMax RelError of 3.3137802965303198e+0 at index of 1253.\n\t[1253\]\t-4.3022233992815018e-2\t-9.9732093513011932e-3\t3.3049024641513824e-2\t3.3137802965303198e+0\t3.8985999999999999e-3\n]
|
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[30\]\t9.4836157560348511e-1\t9.5236867666244507e-1\t4.0071010589599609e-3\t4.2075103446311962e-3\t3.8985999999999999e-3\n\t[31\]\t9.2646563053131104e-1\t9.3139332532882690e-1\t4.9276947975158691e-3\t5.2906700783754857e-3\t3.8985999999999999e-3\n\t[32\]\t9.0087991952896118e-1\t9.0675884485244751e-1\t5.8789253234863281e-3\t6.4834496590358351e-3\t3.8985999999999999e-3\n\t[33\]\t8.7170630693435669e-1\t8.7856203317642212e-1\t6.8557262420654297e-3\t7.8033490899654511e-3\t3.8985999999999999e-3\n\t[34\]\t8.3906102180480957e-1\t8.4691369533538818e-1\t7.8526735305786133e-3\t9.2721059699818163e-3\t3.8985999999999999e-3\n\t...and 31037 more errors.\n\tMax AbsError of 9.8276454210281372e-1 at index of 39267.\n\t[39267\]\t-2.1306337878227066e-23\t-9.8276454210281372e-1\t9.8276454210281372e-1\t1.0000000000000000e+0\t3.8985999999999999e-3\n\tMax RelError of 3.3137802965303198e+0 at index of 1253.\n\t[1253\]\t-4.3022233992815018e-2\t-9.9732093513011932e-3\t3.3049024641513824e-2\t3.3137802965303198e+0\t3.8985999999999999e-3\n]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[30\]\t9.4836157560348511e-1\t9.5236867666244507e-1\t4.0071010589599609e-3\t4.2075103446311962e-3\t3.8985999999999999e-3\n\t[31\]\t9.2646563053131104e-1\t9.3139332532882690e-1\t4.9276947975158691e-3\t5.2906700783754857e-3\t3.8985999999999999e-3\n\t[32\]\t9.0087991952896118e-1\t9.0675884485244751e-1\t5.8789253234863281e-3\t6.4834496590358351e-3\t3.8985999999999999e-3\n\t[33\]\t8.7170630693435669e-1\t8.7856203317642212e-1\t6.8557262420654297e-3\t7.8033490899654511e-3\t3.8985999999999999e-3\n\t[34\]\t8.3906102180480957e-1\t8.4691369533538818e-1\t7.8526735305786133e-3\t9.2721059699818163e-3\t3.8985999999999999e-3\n\t...and 31037 more errors.\n\tMax AbsError of 9.8016768693923950e-1 at index of 39267.\n\t[39267\]\t-2.5968551635742188e-3\t-9.8276454210281372e-1\t9.8016768693923950e-1\t9.9735760189514189e-1\t3.8985999999999999e-3\n\tMax RelError of 3.3137802965303198e+0 at index of 1253.\n\t[1253\]\t-4.3022233992815018e-2\t-9.9732093513011932e-3\t3.3049024641513824e-2\t3.3137802965303198e+0\t3.8985999999999999e-3\n]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[X SNR (21.44080528729615 dB) is not greater than or equal to 65.737. Got 21.44080528729615.]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[xrBoundedReferenceSpace_updates.https.html]
|
[xrBoundedReferenceSpace_updates.https.html]
|
||||||
expected: ERROR
|
expected: TIMEOUT
|
||||||
['XRBoundedReferenceSpace updates properly when the changes are applied]
|
['XRBoundedReferenceSpace updates properly when the changes are applied]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[xrSession_visibilityState.https.html]
|
||||||
|
[Ensures that the XRSession's visibilityState is correctly reported and that the associated visibilitychange event fires.]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[WorkerGlobalScope-close.html]
|
||||||
|
[Test sending a message after closing.]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[transition_calc_implicit.html]
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,32 +0,0 @@
|
||||||
workflow "Build & Release Manifest" {
|
|
||||||
on = "push"
|
|
||||||
resolves = ["manifest-build-and-tag"]
|
|
||||||
}
|
|
||||||
|
|
||||||
action "manifest-build-and-tag" {
|
|
||||||
uses = "./tools/docker/github"
|
|
||||||
runs = ["python", "tools/ci/manifest_build.py"]
|
|
||||||
secrets = ["GITHUB_TOKEN"]
|
|
||||||
}
|
|
||||||
|
|
||||||
workflow "Build & Publish Documentation Website" {
|
|
||||||
on = "push"
|
|
||||||
resolves = ["website-build-and-publish"]
|
|
||||||
}
|
|
||||||
|
|
||||||
action "website-build-and-publish" {
|
|
||||||
uses = "./tools/docker/documentation"
|
|
||||||
runs = ["/bin/bash", "tools/ci/website_build.sh"]
|
|
||||||
secrets = ["DEPLOY_TOKEN"]
|
|
||||||
}
|
|
||||||
|
|
||||||
workflow "Synchronize the Pull Request Preview" {
|
|
||||||
on = "pull_request"
|
|
||||||
resolves = "update-pr-preview"
|
|
||||||
}
|
|
||||||
|
|
||||||
action "update-pr-preview" {
|
|
||||||
uses = "./tools/docker/github"
|
|
||||||
runs = ["python", "tools/ci/update_pr_preview.py", "https://api.github.com"]
|
|
||||||
secrets = ["GITHUB_TOKEN"]
|
|
||||||
}
|
|
14
tests/wpt/web-platform-tests/.github/workflows/pull_request.yml
vendored
Normal file
14
tests/wpt/web-platform-tests/.github/workflows/pull_request.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
on: pull_request
|
||||||
|
name: Synchronize the Pull Request Preview
|
||||||
|
jobs:
|
||||||
|
update-pr-preview:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: update-pr-preview
|
||||||
|
uses: ./tools/docker/github
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
entrypoint: python
|
||||||
|
args: tools/ci/update_pr_preview.py https://api.github.com
|
14
tests/wpt/web-platform-tests/.github/workflows/push-build-publish-documentation-website.yml
vendored
Normal file
14
tests/wpt/web-platform-tests/.github/workflows/push-build-publish-documentation-website.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
on: push
|
||||||
|
name: Build & Publish Documentation Website
|
||||||
|
jobs:
|
||||||
|
website-build-and-publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: website-build-and-publish
|
||||||
|
uses: ./tools/docker/documentation
|
||||||
|
env:
|
||||||
|
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
with:
|
||||||
|
entrypoint: /bin/bash
|
||||||
|
args: tools/ci/website_build.sh
|
14
tests/wpt/web-platform-tests/.github/workflows/push-build-release-manifest.yml
vendored
Normal file
14
tests/wpt/web-platform-tests/.github/workflows/push-build-release-manifest.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
on: push
|
||||||
|
name: Build & Release Manifest
|
||||||
|
jobs:
|
||||||
|
manifest-build-and-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: manifest-build-and-tag
|
||||||
|
uses: ./tools/docker/github
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
entrypoint: python
|
||||||
|
args: tools/ci/manifest_build.py
|
|
@ -191,23 +191,6 @@ that modify sensitive resources (such as `.py`). The latter require
|
||||||
someone with merge access to comment with "LGTM" or "w3c-test:mirror" to
|
someone with merge access to comment with "LGTM" or "w3c-test:mirror" to
|
||||||
indicate the pull request has been checked.
|
indicate the pull request has been checked.
|
||||||
|
|
||||||
Finding Things
|
|
||||||
==============
|
|
||||||
|
|
||||||
Each top-level directory matches the shortname used by a standard, with
|
|
||||||
some exceptions. (Typically the shortname is from the standard's
|
|
||||||
corresponding GitHub repository.)
|
|
||||||
|
|
||||||
For some of the specifications, the tree under the top-level directory
|
|
||||||
represents the sections of the respective documents, using the section
|
|
||||||
IDs for directory names, with a maximum of three levels deep.
|
|
||||||
|
|
||||||
So if you're looking for tests in HTML for "The History interface",
|
|
||||||
they will be under `html/browsers/history/the-history-interface/`.
|
|
||||||
|
|
||||||
Various resources that tests depend on are in `common`, `images`, and
|
|
||||||
`fonts`.
|
|
||||||
|
|
||||||
Branches
|
Branches
|
||||||
========
|
========
|
||||||
|
|
||||||
|
@ -269,31 +252,6 @@ For more details, see the [lint-tool documentation][lint-tool].
|
||||||
|
|
||||||
[lint-tool]: https://web-platform-tests.org/writing-tests/lint-tool.html
|
[lint-tool]: https://web-platform-tests.org/writing-tests/lint-tool.html
|
||||||
|
|
||||||
Test Review
|
|
||||||
===========
|
|
||||||
|
|
||||||
We can sometimes take a little while to go through pull requests
|
|
||||||
because we have to go through all the tests and ensure that they match
|
|
||||||
the specification correctly. But we look at all of them, and take
|
|
||||||
everything that we can.
|
|
||||||
|
|
||||||
META.yml files are used only to indicate who should be notified of pull
|
|
||||||
requests. If you are interested in receiving notifications of proposed
|
|
||||||
changes to tests in a given directory, feel free to add yourself to the
|
|
||||||
META.yml file. Anyone with expertise in the specification under test can
|
|
||||||
approve a pull request. In particular, if a test change has already
|
|
||||||
been adequately reviewed "upstream" in another repository, it can be
|
|
||||||
pushed here without any further review by supplying a link to the
|
|
||||||
upstream review.
|
|
||||||
|
|
||||||
Search filters to find things to review:
|
|
||||||
|
|
||||||
* [Open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
|
||||||
* [Reviewed but still open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3Amozilla%3Agecko-sync+-label%3Achromium-export+-label%3Awebkit-export+-label%3Aservo-export+-label%3Avendor-imports+review%3Aapproved+-label%3A%22do+not+merge+yet%22+-label%3A%22status%3Aneeds-spec-decision%22) (Merge? Something left to fix? Ping other reviewer?)
|
|
||||||
* [Open PRs without reviewers](https://github.com/web-platform-tests/wpt/pulls?q=is%3Apr+is%3Aopen+label%3Astatus%3Aneeds-reviewers)
|
|
||||||
* [Open PRs with label `infra` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Ainfra+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
|
||||||
* [Open PRs with label `docs` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Adocs+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
|
||||||
|
|
||||||
Getting Involved
|
Getting Involved
|
||||||
================
|
================
|
||||||
|
|
||||||
|
|
|
@ -2,21 +2,15 @@
|
||||||
(_ => {
|
(_ => {
|
||||||
var HOST = "{{host}}";
|
var HOST = "{{host}}";
|
||||||
var SECURE_PORT = ":{{ports[https][0]}}";
|
var SECURE_PORT = ":{{ports[https][0]}}";
|
||||||
var PORT = ":{{ports[http][0]}}";
|
|
||||||
var CROSS_ORIGIN_HOST = "{{hosts[alt][]}}";
|
var CROSS_ORIGIN_HOST = "{{hosts[alt][]}}";
|
||||||
var SECURE_CROSS_ORIGIN_HOST = "{{hosts[alt][]}}";
|
|
||||||
|
|
||||||
//For secure cookie verification
|
//For secure cookie verification
|
||||||
window.SECURE_ORIGIN = "https://" + HOST + SECURE_PORT;
|
window.SECURE_ORIGIN = "https://" + HOST + SECURE_PORT;
|
||||||
window.INSECURE_ORIGIN = "http://" + HOST + PORT;
|
|
||||||
|
|
||||||
//standard references
|
//standard references
|
||||||
window.ORIGIN = "http://" + HOST + PORT;
|
window.SECURE_SUBDOMAIN_ORIGIN = "https://{{domains[www1]}}" + SECURE_PORT;
|
||||||
window.WWW_ORIGIN = "http://{{domains[www]}}" + PORT;
|
window.SECURE_CROSS_SITE_ORIGIN = "https://" + CROSS_ORIGIN_HOST + SECURE_PORT;
|
||||||
window.SUBDOMAIN_ORIGIN = "http://{{domains[www1]}}" + PORT;
|
window.CROSS_SITE_HOST = CROSS_ORIGIN_HOST;
|
||||||
window.CROSS_SITE_ORIGIN = "http://" + CROSS_ORIGIN_HOST + PORT;
|
|
||||||
window.SECURE_CROSS_SITE_ORIGIN = "https://" + SECURE_CROSS_ORIGIN_HOST + SECURE_PORT;
|
|
||||||
window.CROSS_SITE_HOST = SECURE_CROSS_ORIGIN_HOST;
|
|
||||||
|
|
||||||
// Set the global cookie name.
|
// Set the global cookie name.
|
||||||
window.HTTP_COOKIE = "cookie_via_http";
|
window.HTTP_COOKIE = "cookie_via_http";
|
||||||
|
@ -159,8 +153,9 @@ async function resetSameSiteCookies(origin, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given an |expectedStatus| and |expectedValue|, assert the |cookies| contains the
|
// Given an |expectedStatus| and |expectedValue|, assert the |cookies| contains the
|
||||||
// proper set of cookie names and values.
|
// proper set of cookie names and values, according to the legacy behavior where
|
||||||
function verifySameSiteCookieState(expectedStatus, expectedValue, cookies) {
|
// unspecified SameSite attribute defaults to SameSite=None behavior.
|
||||||
|
function verifySameSiteCookieStateLegacy(expectedStatus, expectedValue, cookies) {
|
||||||
assert_equals(cookies["samesite_none"], expectedValue, "SameSite=None cookies are always sent.");
|
assert_equals(cookies["samesite_none"], expectedValue, "SameSite=None cookies are always sent.");
|
||||||
assert_equals(cookies["samesite_unspecified"], expectedValue, "Unspecified-SameSite cookies are always sent.");
|
assert_equals(cookies["samesite_unspecified"], expectedValue, "Unspecified-SameSite cookies are always sent.");
|
||||||
if (expectedStatus == SameSiteStatus.CROSS_SITE) {
|
if (expectedStatus == SameSiteStatus.CROSS_SITE) {
|
||||||
|
@ -195,10 +190,14 @@ function verifySameSiteCookieStateWithSameSiteByDefault(expectedStatus, expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isLegacySameSite() {
|
||||||
|
return location.search === "?legacy-samesite";
|
||||||
|
}
|
||||||
|
|
||||||
// Get the proper verifier based on the test's variant type.
|
// Get the proper verifier based on the test's variant type.
|
||||||
function getSameSiteVerifier() {
|
function getSameSiteVerifier() {
|
||||||
return (location.search && location.search === "?samesite-by-default-cookies.tentative") ?
|
return isLegacySameSite() ?
|
||||||
verifySameSiteCookieStateWithSameSiteByDefault : verifySameSiteCookieState;
|
verifySameSiteCookieStateLegacy : verifySameSiteCookieStateWithSameSiteByDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,8 @@ def main(request, response):
|
||||||
headers.append(("Content-Type", "text/html; charset=utf-8"))
|
headers.append(("Content-Type", "text/html; charset=utf-8"))
|
||||||
headers.append(makeCookieHeader("samesite_strict", value, {"SameSite":"Strict","path":"/"}))
|
headers.append(makeCookieHeader("samesite_strict", value, {"SameSite":"Strict","path":"/"}))
|
||||||
headers.append(makeCookieHeader("samesite_lax", value, {"SameSite":"Lax","path":"/"}))
|
headers.append(makeCookieHeader("samesite_lax", value, {"SameSite":"Lax","path":"/"}))
|
||||||
headers.append(makeCookieHeader("samesite_none", value, {"SameSite":"None", "path":"/"}))
|
# SameSite=None cookies must be Secure.
|
||||||
|
headers.append(makeCookieHeader("samesite_none", value, {"SameSite":"None", "path":"/", "Secure": ""}))
|
||||||
headers.append(makeCookieHeader("samesite_unspecified", value, {"path":"/"}))
|
headers.append(makeCookieHeader("samesite_unspecified", value, {"path":"/"}))
|
||||||
|
|
||||||
document = """
|
document = """
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="timeout" content="long">
|
|
||||||
<meta name="variant" content="">
|
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
|
||||||
<script>
|
|
||||||
function create_test(origin, target, expectedStatus, title) {
|
|
||||||
promise_test(t => {
|
|
||||||
var value = "" + Math.random();
|
|
||||||
return resetSameSiteCookies(origin, value)
|
|
||||||
.then(_ => {
|
|
||||||
return credFetch(target + "/cookies/resources/list.py")
|
|
||||||
|
|
||||||
.then(r => r.json())
|
|
||||||
.then(cookies => getSameSiteVerifier()(expectedStatus, value, cookies));
|
|
||||||
});
|
|
||||||
}, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No redirect:
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain fetches are strictly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site fetches are cross-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host fetches are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host fetches are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host fetches are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain fetches are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site fetches are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site fetches are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site fetches are cross-site");
|
|
||||||
</script>
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<meta name="variant" content="">
|
||||||
|
<meta name="variant" content="?legacy-samesite">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
<script>
|
||||||
|
function create_test(origin, target, expectedStatus, title) {
|
||||||
|
promise_test(t => {
|
||||||
|
var value = "" + Math.random();
|
||||||
|
return resetSameSiteCookies(origin, value)
|
||||||
|
.then(_ => {
|
||||||
|
return credFetch(target + "/cookies/resources/list.py")
|
||||||
|
|
||||||
|
.then(r => r.json())
|
||||||
|
.then(cookies => getSameSiteVerifier()(expectedStatus, value, cookies));
|
||||||
|
});
|
||||||
|
}, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No redirect:
|
||||||
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site fetches are cross-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host fetches are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain fetches are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site fetches are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site fetches are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site fetches are cross-site");
|
||||||
|
</script>
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
}, title);
|
}, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host top-level form GETs are strictly same-site");
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host top-level form GETs are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain top-level form GETs are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain top-level form GETs are strictly same-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Reloaded cross-site top-level form GETs are laxly same-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Reloaded cross-site top-level form GETs are laxly same-site");
|
||||||
</script>
|
</script>
|
|
@ -1,69 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="timeout" content="long">
|
|
||||||
<meta name="variant" content="">
|
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
|
||||||
<script>
|
|
||||||
function create_test(origin, target, expectedStatus, title) {
|
|
||||||
promise_test(t => {
|
|
||||||
var value = "" + Math.random();
|
|
||||||
return resetSameSiteCookies(origin, value)
|
|
||||||
.then(_ => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
var f = document.createElement('form');
|
|
||||||
f.action = target + "/cookies/resources/postToParent.py";
|
|
||||||
f.target = "_blank";
|
|
||||||
f.method = "GET";
|
|
||||||
|
|
||||||
// If |target| contains a `redir` parameter, extract it, and add it
|
|
||||||
// to the form so it doesn't get dropped in the submission.
|
|
||||||
var url = new URL(f.action);
|
|
||||||
if (url.pathname == "/cookies/resources/redirectWithCORSHeaders.py") {
|
|
||||||
var i = document.createElement("input");
|
|
||||||
i.name = "location";
|
|
||||||
i.type="hidden";
|
|
||||||
i.value = url.searchParams.get("location");
|
|
||||||
f.appendChild(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
var msgHandler = e => {
|
|
||||||
window.removeEventListener("message", msgHandler);
|
|
||||||
e.source.close();
|
|
||||||
try {
|
|
||||||
getSameSiteVerifier()(expectedStatus, value, e.data);
|
|
||||||
resolve("Popup received the cookie.");
|
|
||||||
} catch (e) {
|
|
||||||
reject(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener("message", msgHandler);
|
|
||||||
document.body.appendChild(f);
|
|
||||||
f.submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No redirect:
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host top-level form GETs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain top-level form GETs are strictly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Cross-site top-level form GETs are laxly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host top-level form GETs are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host top-level form GETs are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host top-level form GETs are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain top-level form GETs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain top-level form GETs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain top-level form GETs are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Same-host redirecting to cross-site top-level form GETs are laxly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Subdomain redirecting to cross-site top-level form GETs are laxly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Cross-site redirecting to cross-site top-level form GETs are laxly same-site");
|
|
||||||
</script>
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<meta name="variant" content="">
|
||||||
|
<meta name="variant" content="?legacy-samesite">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
<script>
|
||||||
|
function create_test(origin, target, expectedStatus, title) {
|
||||||
|
promise_test(t => {
|
||||||
|
var value = "" + Math.random();
|
||||||
|
return resetSameSiteCookies(origin, value)
|
||||||
|
.then(_ => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var f = document.createElement('form');
|
||||||
|
f.action = target + "/cookies/resources/postToParent.py";
|
||||||
|
f.target = "_blank";
|
||||||
|
f.method = "GET";
|
||||||
|
|
||||||
|
// If |target| contains a `redir` parameter, extract it, and add it
|
||||||
|
// to the form so it doesn't get dropped in the submission.
|
||||||
|
var url = new URL(f.action);
|
||||||
|
if (url.pathname == "/cookies/resources/redirectWithCORSHeaders.py") {
|
||||||
|
var i = document.createElement("input");
|
||||||
|
i.name = "location";
|
||||||
|
i.type="hidden";
|
||||||
|
i.value = url.searchParams.get("location");
|
||||||
|
f.appendChild(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
var msgHandler = e => {
|
||||||
|
window.removeEventListener("message", msgHandler);
|
||||||
|
e.source.close();
|
||||||
|
try {
|
||||||
|
getSameSiteVerifier()(expectedStatus, value, e.data);
|
||||||
|
resolve("Popup received the cookie.");
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("message", msgHandler);
|
||||||
|
document.body.appendChild(f);
|
||||||
|
f.submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No redirect:
|
||||||
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Cross-site top-level form GETs are laxly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host top-level form GETs are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain top-level form GETs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain top-level form GETs are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Same-host redirecting to cross-site top-level form GETs are laxly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Subdomain redirecting to cross-site top-level form GETs are laxly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Cross-site redirecting to cross-site top-level form GETs are laxly same-site");
|
||||||
|
</script>
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
}, title);
|
}, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host top-level form POSTs are strictly same-site");
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host top-level form POSTs are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain top-level form POSTs are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain top-level form POSTs are strictly same-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Reloaded cross-site top-level form POSTs are not same-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Reloaded cross-site top-level form POSTs are not same-site");
|
||||||
</script>
|
</script>
|
|
@ -1,58 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="timeout" content="long">
|
|
||||||
<meta name="variant" content="">
|
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
|
||||||
<script>
|
|
||||||
function create_test(origin, target, expectedStatus, title) {
|
|
||||||
promise_test(t => {
|
|
||||||
var value = "" + Math.random();
|
|
||||||
return resetSameSiteCookies(origin, value)
|
|
||||||
.then(_ => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
var f = document.createElement('form');
|
|
||||||
f.action = target + "/cookies/resources/postToParent.py";
|
|
||||||
f.target = "_blank";
|
|
||||||
f.method = "POST";
|
|
||||||
|
|
||||||
var msgHandler = e => {
|
|
||||||
window.removeEventListener("message", msgHandler);
|
|
||||||
e.source.close();
|
|
||||||
try {
|
|
||||||
getSameSiteVerifier()(expectedStatus, value, e.data);
|
|
||||||
resolve("Popup received the cookie.");
|
|
||||||
} catch (e) {
|
|
||||||
reject(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener("message", msgHandler);
|
|
||||||
document.body.appendChild(f);
|
|
||||||
f.submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No redirect:
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host top-level form POSTs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain top-level form POSTs are strictly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site top-level form POSTs are cross-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host top-level form POSTs are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host top-level form POSTs are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host top-level form POSTs are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain top-level form POSTs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain top-level form POSTs are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain top-level form POSTs are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site top-level form POSTs are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site top-level form POSTs are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site top-level form POSTs are cross-site");
|
|
||||||
</script>
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<meta name="variant" content="">
|
||||||
|
<meta name="variant" content="?legacy-samesite">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
<script>
|
||||||
|
function create_test(origin, target, expectedStatus, title) {
|
||||||
|
promise_test(t => {
|
||||||
|
var value = "" + Math.random();
|
||||||
|
return resetSameSiteCookies(origin, value)
|
||||||
|
.then(_ => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var f = document.createElement('form');
|
||||||
|
f.action = target + "/cookies/resources/postToParent.py";
|
||||||
|
f.target = "_blank";
|
||||||
|
f.method = "POST";
|
||||||
|
|
||||||
|
var msgHandler = e => {
|
||||||
|
window.removeEventListener("message", msgHandler);
|
||||||
|
e.source.close();
|
||||||
|
try {
|
||||||
|
getSameSiteVerifier()(expectedStatus, value, e.data);
|
||||||
|
resolve("Popup received the cookie.");
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("message", msgHandler);
|
||||||
|
document.body.appendChild(f);
|
||||||
|
f.submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No redirect:
|
||||||
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site top-level form POSTs are cross-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host top-level form POSTs are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain top-level form POSTs are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain top-level form POSTs are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site top-level form POSTs are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site top-level form POSTs are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site top-level form POSTs are cross-site");
|
||||||
|
</script>
|
|
@ -2,7 +2,7 @@
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="timeout" content="long">
|
<meta name="timeout" content="long">
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
}, title);
|
}, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host fetches are strictly same-site");
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host fetches are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain fetches are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain fetches are strictly same-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Reloaded cross-site fetches are cross-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Reloaded cross-site fetches are cross-site");
|
||||||
</script>
|
</script>
|
|
@ -1,62 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="timeout" content="long">
|
|
||||||
<meta name="variant" content="">
|
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
|
||||||
<!-- We're appending an <iframe> to the document's body, so execute tests after we have a body -->
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
function create_test(origin, target, expectedStatus, title) {
|
|
||||||
promise_test(t => {
|
|
||||||
var value = "" + Math.random();
|
|
||||||
return resetSameSiteCookies(origin, value)
|
|
||||||
.then(_ => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
var iframe = document.createElement("iframe");
|
|
||||||
iframe.onerror = _ => reject("IFrame could not be loaded.");
|
|
||||||
|
|
||||||
var msgHandler = e => {
|
|
||||||
if (e.source == iframe.contentWindow) {
|
|
||||||
// Cleanup, then verify cookie state:
|
|
||||||
document.body.removeChild(iframe);
|
|
||||||
window.removeEventListener("message", msgHandler);
|
|
||||||
try {
|
|
||||||
getSameSiteVerifier()(expectedStatus, value, e.data);
|
|
||||||
resolve();
|
|
||||||
} catch(e) {
|
|
||||||
reject(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener("message", msgHandler);
|
|
||||||
|
|
||||||
iframe.src = target + "/cookies/resources/postToParent.py";
|
|
||||||
document.body.appendChild(iframe);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No redirect:
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain fetches are strictly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site fetches are cross-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host fetches are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host fetches are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host fetches are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain fetches are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain fetches are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site fetches are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site fetches are cross-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site fetches are cross-site");
|
|
||||||
</script>
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<meta name="variant" content="">
|
||||||
|
<meta name="variant" content="?legacy-samesite">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
<!-- We're appending an <iframe> to the document's body, so execute tests after we have a body -->
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
function create_test(origin, target, expectedStatus, title) {
|
||||||
|
promise_test(t => {
|
||||||
|
var value = "" + Math.random();
|
||||||
|
return resetSameSiteCookies(origin, value)
|
||||||
|
.then(_ => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var iframe = document.createElement("iframe");
|
||||||
|
iframe.onerror = _ => reject("IFrame could not be loaded.");
|
||||||
|
|
||||||
|
var msgHandler = e => {
|
||||||
|
if (e.source == iframe.contentWindow) {
|
||||||
|
// Cleanup, then verify cookie state:
|
||||||
|
document.body.removeChild(iframe);
|
||||||
|
window.removeEventListener("message", msgHandler);
|
||||||
|
try {
|
||||||
|
getSameSiteVerifier()(expectedStatus, value, e.data);
|
||||||
|
resolve();
|
||||||
|
} catch(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("message", msgHandler);
|
||||||
|
|
||||||
|
iframe.src = target + "/cookies/resources/postToParent.py";
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No redirect:
|
||||||
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site fetches are cross-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host fetches are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host fetches are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain fetches are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain fetches are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site fetches are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site fetches are cross-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site fetches are cross-site");
|
||||||
|
</script>
|
|
@ -2,7 +2,7 @@
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="timeout" content="long">
|
<meta name="timeout" content="long">
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -47,12 +47,13 @@
|
||||||
expectedStatus == SameSiteStatus.CROSS_SITE ?
|
expectedStatus == SameSiteStatus.CROSS_SITE ?
|
||||||
assert_cookie_absent(target, "samesite_lax", value) :
|
assert_cookie_absent(target, "samesite_lax", value) :
|
||||||
assert_cookie_present(target, "samesite_lax", value)];
|
assert_cookie_present(target, "samesite_lax", value)];
|
||||||
if (location.search && location.search === "?samesite-by-default-cookies.tentative") {
|
if (isLegacySameSite()) {
|
||||||
|
// Legacy behavior: unspecified SameSite acts like SameSite=None.
|
||||||
|
asserts.push(assert_cookie_present(target, "samesite_unspecified", value));
|
||||||
|
} else {
|
||||||
asserts.push(expectedStatus == SameSiteStatus.CROSS_SITE ?
|
asserts.push(expectedStatus == SameSiteStatus.CROSS_SITE ?
|
||||||
assert_cookie_absent(target, "samesite_unspecified", value) :
|
assert_cookie_absent(target, "samesite_unspecified", value) :
|
||||||
assert_cookie_present(target, "samesite_unspecified", value));
|
assert_cookie_present(target, "samesite_unspecified", value));
|
||||||
} else {
|
|
||||||
asserts.push(assert_cookie_present(target, "samesite_unspecified", value));
|
|
||||||
}
|
}
|
||||||
return Promise.all(asserts);
|
return Promise.all(asserts);
|
||||||
});
|
});
|
||||||
|
@ -60,22 +61,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// No redirect:
|
// No redirect:
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host images are strictly same-site");
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host images are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain images are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain images are strictly same-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site images are cross-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.CROSS_SITE, "Cross-site images are cross-site");
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host images are strictly same-site");
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host images are strictly same-site");
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host images are strictly same-site");
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host images are strictly same-site");
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host images are strictly same-site");
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host images are strictly same-site");
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain images are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain images are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain images are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain images are strictly same-site");
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain images are strictly same-site");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain images are strictly same-site");
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site images are cross-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Same-host redirecting to cross-site images are cross-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site images are cross-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Subdomain redirecting to cross-site images are cross-site");
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site images are cross-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.CROSS_SITE, "Cross-site redirecting to cross-site images are cross-site");
|
||||||
</script>
|
</script>
|
|
@ -7,7 +7,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('message', function(e) {
|
window.addEventListener('message', function(e) {
|
||||||
if (ORIGIN !== window.location.origin)
|
if (SECURE_ORIGIN !== window.location.origin)
|
||||||
return;
|
return;
|
||||||
if (window.location.origin !== e.origin)
|
if (window.location.origin !== e.origin)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// Helper to either set or clear some cookies on its own origin, or
|
// Helper to either set or clear some cookies on its own origin, or
|
||||||
// (potentially) cross-site on ORIGIN.
|
// (potentially) cross-site on SECURE_ORIGIN.
|
||||||
window.onmessage = e => {
|
window.onmessage = e => {
|
||||||
var originToUse = ORIGIN;
|
var originToUse = SECURE_ORIGIN;
|
||||||
if (e.data.useOwnOrigin)
|
if (e.data.useOwnOrigin)
|
||||||
originToUse = self.origin;
|
originToUse = self.origin;
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
<script>
|
<script>
|
||||||
promise_test(async function(t) {
|
promise_test(async function(t) {
|
||||||
let w = window.open(ORIGIN + "/cookies/samesite/resources/puppet.html");
|
let w = window.open(SECURE_ORIGIN + "/cookies/samesite/resources/puppet.html");
|
||||||
await wait_for_message("READY", ORIGIN);
|
await wait_for_message("READY", SECURE_ORIGIN);
|
||||||
let random = "" + Math.random();
|
let random = "" + Math.random();
|
||||||
w.postMessage({type: "set", value: random}, "*");
|
w.postMessage({type: "set", value: random}, "*");
|
||||||
let e = await wait_for_message("set-complete", ORIGIN)
|
let e = await wait_for_message("set-complete", SECURE_ORIGIN)
|
||||||
assert_dom_cookie("samesite_strict", e.data.value, true);
|
assert_dom_cookie("samesite_strict", e.data.value, true);
|
||||||
assert_dom_cookie("samesite_lax", e.data.value, true);
|
assert_dom_cookie("samesite_lax", e.data.value, true);
|
||||||
assert_dom_cookie("samesite_none", e.data.value, true);
|
assert_dom_cookie("samesite_none", e.data.value, true);
|
||||||
|
@ -20,16 +20,15 @@
|
||||||
}, "Same-site window should be able to set `SameSite=Lax` or `SameSite=Strict` cookies.");
|
}, "Same-site window should be able to set `SameSite=Lax` or `SameSite=Strict` cookies.");
|
||||||
|
|
||||||
promise_test(async function(t) {
|
promise_test(async function(t) {
|
||||||
let w = window.open(CROSS_SITE_ORIGIN + "/cookies/samesite/resources/puppet.html");
|
let w = window.open(SECURE_CROSS_SITE_ORIGIN + "/cookies/samesite/resources/puppet.html");
|
||||||
await wait_for_message("READY", CROSS_SITE_ORIGIN);
|
await wait_for_message("READY", SECURE_CROSS_SITE_ORIGIN);
|
||||||
let random = "" + Math.random();
|
let random = "" + Math.random();
|
||||||
w.postMessage({type: "set", value: random}, "*");
|
w.postMessage({type: "set", value: random}, "*");
|
||||||
let e = await wait_for_message("set-complete", CROSS_SITE_ORIGIN);
|
let e = await wait_for_message("set-complete", SECURE_CROSS_SITE_ORIGIN);
|
||||||
assert_dom_cookie("samesite_strict", e.data.value, false);
|
assert_dom_cookie("samesite_strict", e.data.value, false);
|
||||||
assert_dom_cookie("samesite_lax", e.data.value, false);
|
assert_dom_cookie("samesite_lax", e.data.value, false);
|
||||||
assert_dom_cookie("samesite_none", e.data.value, true);
|
assert_dom_cookie("samesite_none", e.data.value, true);
|
||||||
assert_dom_cookie("samesite_unspecified", e.data.value,
|
assert_dom_cookie("samesite_unspecified", e.data.value, isLegacySameSite());
|
||||||
location.search !== "?samesite-by-default-cookies.tentative");
|
|
||||||
w.close();
|
w.close();
|
||||||
}, "Cross-site window shouldn't be able to set `SameSite=Lax` or `SameSite=Strict` cookies.");
|
}, "Cross-site window shouldn't be able to set `SameSite=Lax` or `SameSite=Strict` cookies.");
|
||||||
</script>
|
</script>
|
|
@ -2,7 +2,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="timeout" content="long">
|
<meta name="timeout" content="long">
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -23,12 +23,12 @@
|
||||||
// a new random value on each run, so on each run we are overwriting and
|
// a new random value on each run, so on each run we are overwriting and
|
||||||
// checking for a cookie with a different random value.
|
// checking for a cookie with a different random value.
|
||||||
let value = "" + Math.random();
|
let value = "" + Math.random();
|
||||||
let url_from = ORIGIN + "/cookies/samesite/resources/navigate.html";
|
let url_from = SECURE_ORIGIN + "/cookies/samesite/resources/navigate.html";
|
||||||
let url_to = origin_to + "/cookies/resources/setSameSite.py?" + value;
|
let url_to = origin_to + "/cookies/resources/setSameSite.py?" + value;
|
||||||
var w = window.open(url_from);
|
var w = window.open(url_from);
|
||||||
await wait_for_message('READY', ORIGIN);
|
await wait_for_message('READY', SECURE_ORIGIN);
|
||||||
assert_equals(ORIGIN, window.origin);
|
assert_equals(SECURE_ORIGIN, window.origin);
|
||||||
assert_equals(ORIGIN, w.origin);
|
assert_equals(SECURE_ORIGIN, w.origin);
|
||||||
let command = (method === "POST") ? "post-form" : "navigate";
|
let command = (method === "POST") ? "post-form" : "navigate";
|
||||||
w.postMessage({ type: command, url: url_to }, "*");
|
w.postMessage({ type: command, url: url_to }, "*");
|
||||||
let message = await wait_for_message('COOKIES_SET', origin_to);
|
let message = await wait_for_message('COOKIES_SET', origin_to);
|
||||||
|
@ -37,8 +37,8 @@
|
||||||
}, title);
|
}, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate_test("GET", ORIGIN, "Same-site top-level navigation should be able to set SameSite=* cookies.");
|
navigate_test("GET", SECURE_ORIGIN, "Same-site top-level navigation should be able to set SameSite=* cookies.");
|
||||||
navigate_test("GET", CROSS_SITE_ORIGIN, "Cross-site top-level navigation should be able to set SameSite=* cookies.");
|
navigate_test("GET", SECURE_CROSS_SITE_ORIGIN, "Cross-site top-level navigation should be able to set SameSite=* cookies.");
|
||||||
navigate_test("POST", ORIGIN, "Same-site top-level POST should be able to set SameSite=* cookies.");
|
navigate_test("POST", SECURE_ORIGIN, "Same-site top-level POST should be able to set SameSite=* cookies.");
|
||||||
navigate_test("POST", CROSS_SITE_ORIGIN, "Cross-site top-level POST should be able to set SameSite=* cookies.");
|
navigate_test("POST", SECURE_CROSS_SITE_ORIGIN, "Cross-site top-level POST should be able to set SameSite=* cookies.");
|
||||||
</script>
|
</script>
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="variant" content="">
|
<meta name="variant" content="">
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
<meta name="variant" content="?legacy-samesite">
|
||||||
<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="/cookies/resources/cookie-helper.sub.js"></script>
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
}, title);
|
}, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host auxiliary navigations are strictly same-site.");
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Reloaded same-host auxiliary navigations are strictly same-site.");
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain auxiliary navigations are strictly same-site.");
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Reloaded subdomain auxiliary navigations are strictly same-site.");
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Reloaded cross-site auxiliary navigations are laxly same-site");
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Reloaded cross-site auxiliary navigations are laxly same-site");
|
||||||
</script>
|
</script>
|
|
@ -1,56 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="timeout" content="long">
|
|
||||||
<meta name="variant" content="">
|
|
||||||
<meta name="variant" content="?samesite-by-default-cookies.tentative">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
|
||||||
<script>
|
|
||||||
function create_test(origin, target, expectedStatus, title) {
|
|
||||||
promise_test(t => {
|
|
||||||
var value = "" + Math.random();
|
|
||||||
return resetSameSiteCookies(origin, value)
|
|
||||||
.then(_ => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
var w = window.open(origin + "/cookies/resources/postToParent.py");
|
|
||||||
|
|
||||||
var msgHandler = e => {
|
|
||||||
window.removeEventListener("message", msgHandler);
|
|
||||||
w.close();
|
|
||||||
try {
|
|
||||||
getSameSiteVerifier()(expectedStatus, value, e.data);
|
|
||||||
resolve("Popup received the cookie.");
|
|
||||||
} catch (e) {
|
|
||||||
reject(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener("message", msgHandler);
|
|
||||||
|
|
||||||
if (!w)
|
|
||||||
reject("Popup could not be opened (did you whitelist the test site in your popup blocker?).");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
// No redirect:
|
|
||||||
create_test(ORIGIN, ORIGIN, SameSiteStatus.STRICT, "Same-host auxiliary navigations are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain auxiliary navigations are strictly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Cross-site auxiliary navigations are laxly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(ORIGIN, redirectTo(ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host auxiliary navigations are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host auxiliary navigations are strictly same-site");
|
|
||||||
create_test(ORIGIN, redirectTo(CROSS_SITE_ORIGIN, ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host auxiliary navigations are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain auxiliary navigations are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain auxiliary navigations are strictly same-site");
|
|
||||||
create_test(SUBDOMAIN_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain auxiliary navigations are strictly same-site");
|
|
||||||
|
|
||||||
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Same-host redirecting to cross-site auxiliary navigations are laxly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(SUBDOMAIN_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Subdomain redirecting to cross-site auxiliary navigations are laxly same-site");
|
|
||||||
create_test(CROSS_SITE_ORIGIN, redirectTo(CROSS_SITE_ORIGIN, CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Cross-site redirecting to cross-site auxiliary navigations are laxly same-site");
|
|
||||||
</script>
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="timeout" content="long">
|
||||||
|
<meta name="variant" content="">
|
||||||
|
<meta name="variant" content="?legacy-samesite">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/cookies/resources/cookie-helper.sub.js"></script>
|
||||||
|
<script>
|
||||||
|
function create_test(origin, target, expectedStatus, title) {
|
||||||
|
promise_test(t => {
|
||||||
|
var value = "" + Math.random();
|
||||||
|
return resetSameSiteCookies(origin, value)
|
||||||
|
.then(_ => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var w = window.open(origin + "/cookies/resources/postToParent.py");
|
||||||
|
|
||||||
|
var msgHandler = e => {
|
||||||
|
window.removeEventListener("message", msgHandler);
|
||||||
|
w.close();
|
||||||
|
try {
|
||||||
|
getSameSiteVerifier()(expectedStatus, value, e.data);
|
||||||
|
resolve("Popup received the cookie.");
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("message", msgHandler);
|
||||||
|
|
||||||
|
if (!w)
|
||||||
|
reject("Popup could not be opened (did you whitelist the test site in your popup blocker?).");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No redirect:
|
||||||
|
create_test(SECURE_ORIGIN, SECURE_ORIGIN, SameSiteStatus.STRICT, "Same-host auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN, SameSiteStatus.STRICT, "Subdomain auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN, SameSiteStatus.LAX, "Cross-site auxiliary navigations are laxly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to same-host auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to same-host auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to same-host auxiliary navigations are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to same-host:
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Same-host redirecting to subdomain auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Subdomain redirecting to subdomain auxiliary navigations are strictly same-site");
|
||||||
|
create_test(SECURE_SUBDOMAIN_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_SUBDOMAIN_ORIGIN), SameSiteStatus.STRICT, "Cross-site redirecting to subdomain auxiliary navigations are strictly same-site");
|
||||||
|
|
||||||
|
// Redirect from {same-host,subdomain,cross-site} to cross-site:
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Same-host redirecting to cross-site auxiliary navigations are laxly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_SUBDOMAIN_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Subdomain redirecting to cross-site auxiliary navigations are laxly same-site");
|
||||||
|
create_test(SECURE_CROSS_SITE_ORIGIN, redirectTo(SECURE_CROSS_SITE_ORIGIN, SECURE_CROSS_SITE_ORIGIN), SameSiteStatus.LAX, "Cross-site redirecting to cross-site auxiliary navigations are laxly same-site");
|
||||||
|
</script>
|
|
@ -28,6 +28,8 @@ assert_not_inherited('padding-bottom', '0px', '10px');
|
||||||
assert_not_inherited('padding-left', '0px', '10px');
|
assert_not_inherited('padding-left', '0px', '10px');
|
||||||
assert_not_inherited('padding-right', '0px', '10px');
|
assert_not_inherited('padding-right', '0px', '10px');
|
||||||
assert_not_inherited('padding-top', '0px', '10px');
|
assert_not_inherited('padding-top', '0px', '10px');
|
||||||
|
|
||||||
|
assert_inherited('visibility', 'visible', 'collapse');
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS basic box model: getComputedStyle().visibility</title>
|
||||||
|
<link rel="help" href="https://www.w3.org/TR/CSS2/visufx.html#visibility">
|
||||||
|
<meta name="assert" content="visibility computed value is as specified.">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/css/support/computed-testcommon.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="target"></div>
|
||||||
|
<script>
|
||||||
|
test_computed_value("visibility", "visible");
|
||||||
|
test_computed_value("visibility", "hidden");
|
||||||
|
test_computed_value("visibility", "collapse");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS Logical Properties and Values: getComputedStyle().inset</title>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
|
||||||
|
<meta name="assert" content="Computed value is as specified, with lengths made absolute.">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/css/support/computed-testcommon.js"></script>
|
||||||
|
<style>
|
||||||
|
#target {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="target"></div>
|
||||||
|
<script>
|
||||||
|
test_computed_value("inset", "auto");
|
||||||
|
test_computed_value("inset", "-10px");
|
||||||
|
|
||||||
|
test_computed_value("inset", "calc(10px - 0.5em) -20%", "-10px -20%");
|
||||||
|
test_computed_value("inset", "auto auto", "auto");
|
||||||
|
|
||||||
|
test_computed_value("inset", "10px calc(10px - 0.5em) -30px", "10px -10px -30px");
|
||||||
|
test_computed_value("inset", "auto auto auto", "auto");
|
||||||
|
|
||||||
|
test_computed_value("inset", "10px 20px auto -30px");
|
||||||
|
test_computed_value("inset", "auto auto auto auto", "auto");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS Logical Properties and Values: parsing inset with invalid values</title>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
|
||||||
|
<meta name="assert" content="inset supports only the grammar '<'top'>{1,4}'.">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/css/support/parsing-testcommon.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
test_invalid_value("inset", "none");
|
||||||
|
test_invalid_value("inset", "20%, calc(10px - 0.5em)");
|
||||||
|
test_invalid_value("inset", "10px auto 20px auto 30px");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS Logical Properties and Values: parsing inset with valid values</title>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
|
||||||
|
<meta name="assert" content="inset supports the full grammar '<'top'>{1,4}'.">
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/css/support/parsing-testcommon.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
test_valid_value("inset", "auto");
|
||||||
|
test_valid_value("inset", "-10px");
|
||||||
|
|
||||||
|
test_valid_value("inset", "calc(-0.5em + 10px) -20%");
|
||||||
|
test_valid_value("inset", "auto auto", "auto");
|
||||||
|
|
||||||
|
test_valid_value("inset", "10px calc(-0.5em + 10px) -30px");
|
||||||
|
test_valid_value("inset", "auto auto auto", "auto");
|
||||||
|
|
||||||
|
test_valid_value("inset", "10px calc(-0.5em + 10px) auto -30px");
|
||||||
|
test_valid_value("inset", "auto auto auto auto", "auto");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Reference for CSS Basic User Interface Test: appearance: textfield</title>
|
||||||
|
<style>
|
||||||
|
#container { width: 500px; }
|
||||||
|
</style>
|
||||||
|
<div id="container">
|
||||||
|
<a>a</a>
|
||||||
|
<button>button</button>
|
||||||
|
<input type="text" value="input-text">
|
||||||
|
<input type="text" value="input-search"><!-- intentionally type="text" -->
|
||||||
|
<textarea>textarea</textarea>
|
||||||
|
<input type="button" value="input-button">
|
||||||
|
<input type="submit" value="input-submit">
|
||||||
|
<input type="reset" value="input-reset">
|
||||||
|
<input type="range">
|
||||||
|
<input type="checkbox">
|
||||||
|
<input type="radio">
|
||||||
|
<input type="color">
|
||||||
|
<select><option>select</option></select>
|
||||||
|
<select multiple><option>select-multiple</option></select>
|
||||||
|
<meter value=0.5></meter>
|
||||||
|
<progress value=0.5></progress>
|
||||||
|
</div>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS Basic User Interface Test: appearance: textfield</title>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-ui-4/#appearance-switching">
|
||||||
|
<meta name="assert" content="textfield is an alias to auto except on input type=search.">
|
||||||
|
<link rel="match" href="appearance-textfield-001-ref.html">
|
||||||
|
<style>
|
||||||
|
#container { width: 500px; }
|
||||||
|
/*
|
||||||
|
* If the value being tested is not supported, then 'none' is used instead,
|
||||||
|
* which is intended to fail the test.
|
||||||
|
*/
|
||||||
|
#container > * { appearance: none; appearance: textfield; }
|
||||||
|
</style>
|
||||||
|
<div id="container">
|
||||||
|
<a>a</a>
|
||||||
|
<button>button</button>
|
||||||
|
<input type="text" value="input-text">
|
||||||
|
<input type="search" value="input-search">
|
||||||
|
<textarea>textarea</textarea>
|
||||||
|
<input type="button" value="input-button">
|
||||||
|
<input type="submit" value="input-submit">
|
||||||
|
<input type="reset" value="input-reset">
|
||||||
|
<input type="range">
|
||||||
|
<input type="checkbox">
|
||||||
|
<input type="radio">
|
||||||
|
<input type="color">
|
||||||
|
<select><option>select</option></select>
|
||||||
|
<select multiple><option>select-multiple</option></select>
|
||||||
|
<meter value=0.5></meter>
|
||||||
|
<progress value=0.5></progress>
|
||||||
|
</div>
|
|
@ -0,0 +1,36 @@
|
||||||
|
<!-- DO NOT EDIT THIS FILE.
|
||||||
|
Edit the appearance-* file instead and then run:
|
||||||
|
./tools/appearance-build-webkit-reftests.py
|
||||||
|
-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CSS Basic User Interface Test: -webkit-appearance: textfield</title>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-ui-4/#appearance-switching">
|
||||||
|
<meta name="assert" content="textfield is an alias to auto except on input type=search.">
|
||||||
|
<link rel="match" href="appearance-textfield-001-ref.html">
|
||||||
|
<style>
|
||||||
|
#container { width: 500px; }
|
||||||
|
/*
|
||||||
|
* If the value being tested is not supported, then 'none' is used instead,
|
||||||
|
* which is intended to fail the test.
|
||||||
|
*/
|
||||||
|
#container > * { -webkit-appearance: none; -webkit-appearance: textfield; }
|
||||||
|
</style>
|
||||||
|
<div id="container">
|
||||||
|
<a>a</a>
|
||||||
|
<button>button</button>
|
||||||
|
<input type="text" value="input-text">
|
||||||
|
<input type="search" value="input-search">
|
||||||
|
<textarea>textarea</textarea>
|
||||||
|
<input type="button" value="input-button">
|
||||||
|
<input type="submit" value="input-submit">
|
||||||
|
<input type="reset" value="input-reset">
|
||||||
|
<input type="range">
|
||||||
|
<input type="checkbox">
|
||||||
|
<input type="radio">
|
||||||
|
<input type="color">
|
||||||
|
<select><option>select</option></select>
|
||||||
|
<select multiple><option>select-multiple</option></select>
|
||||||
|
<meter value=0.5></meter>
|
||||||
|
<progress value=0.5></progress>
|
||||||
|
</div>
|
|
@ -22,9 +22,8 @@ the [general test guidelines](../writing-tests/general-guidelines).
|
||||||
The review must happen in public, but there is no requirement for it
|
The review must happen in public, but there is no requirement for it
|
||||||
to happen in any specific location. In particular if a vendor is
|
to happen in any specific location. In particular if a vendor is
|
||||||
submitting tests that have already been publicly reviewed in their own
|
submitting tests that have already been publicly reviewed in their own
|
||||||
review system, that review may be carried forward. For other tests, we
|
review system, that review may be carried forward. For other submissions, we
|
||||||
strongly recommend using either Reviewable or GitHub's built-in review
|
recommend using GitHub's built-in review tools.
|
||||||
tools.
|
|
||||||
|
|
||||||
Regardless of what review tool is used, the review must be clearly
|
Regardless of what review tool is used, the review must be clearly
|
||||||
linked in the pull request.
|
linked in the pull request.
|
||||||
|
@ -38,3 +37,26 @@ working on other things as tests frequently only get pushed upstream
|
||||||
once the code lands in their implementation.
|
once the code lands in their implementation.
|
||||||
|
|
||||||
To assist with test reviews, a [review checklist](checklist) is available.
|
To assist with test reviews, a [review checklist](checklist) is available.
|
||||||
|
|
||||||
|
[GitHub.com allows reviewers to formally signal their approval of a pull
|
||||||
|
request through a dedicated user
|
||||||
|
interface.](https://help.github.com/en/articles/about-pull-request-reviews)
|
||||||
|
Every pull request submitted to WPT must be approved by at least one project
|
||||||
|
collaborator before it can be merged.
|
||||||
|
|
||||||
|
## Notifications
|
||||||
|
|
||||||
|
META.yml files are used only to indicate who should be notified of pull
|
||||||
|
requests. If you are interested in receiving notifications of proposed
|
||||||
|
changes to tests in a given directory, feel free to add yourself to the
|
||||||
|
META.yml file.
|
||||||
|
|
||||||
|
## Finding contributions to review
|
||||||
|
|
||||||
|
Here are a few search filters to find things to review:
|
||||||
|
|
||||||
|
* [Open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
||||||
|
* [Reviewed but still open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3Amozilla%3Agecko-sync+-label%3Achromium-export+-label%3Awebkit-export+-label%3Aservo-export+-label%3Avendor-imports+review%3Aapproved+-label%3A%22do+not+merge+yet%22+-label%3A%22status%3Aneeds-spec-decision%22) (Merge? Something left to fix? Ping other reviewer?)
|
||||||
|
* [Open PRs without reviewers](https://github.com/web-platform-tests/wpt/pulls?q=is%3Apr+is%3Aopen+label%3Astatus%3Aneeds-reviewers)
|
||||||
|
* [Open PRs with label `infra` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Ainfra+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
||||||
|
* [Open PRs with label `docs` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Adocs+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22+-label%3Avendor-imports)
|
||||||
|
|
|
@ -10,15 +10,15 @@ and should be easy to run in any browser.
|
||||||
|
|
||||||
## Test Layout
|
## Test Layout
|
||||||
|
|
||||||
Each top level directory in the repository corresponds to tests for a
|
Most of the repository's top-level directories hold tests for specific web
|
||||||
single specification, with the exception of `css/` which contains
|
standards. For [W3C specs](https://www.w3.org/standards/), these directories
|
||||||
test suites for CSS WG specifications. For W3C specs, these directories
|
are typically named after the shortname of the spec (i.e. the name used for
|
||||||
are typically named after the shortname of the spec (i.e. the name
|
snapshot publications under `/TR/`); for [WHATWG
|
||||||
used for snapshot publications under `/TR/`); for WHATWG specs, they
|
specs](https://spec.whatwg.org/), they are typically named after the subdomain
|
||||||
are typically named after the subdomain of the spec (i.e. trimming
|
of the spec (i.e. trimming `.spec.whatwg.org` from the URL); for other specs,
|
||||||
`.spec.whatwg.org` from the URL); for other specs, something deemed
|
something deemed sensible is used. The `css/` directory contains test suites
|
||||||
sensible is used. In any case, there are occasional exceptions for
|
for [the CSS Working Group
|
||||||
historic reasons.
|
specifications](https://www.w3.org/Style/CSS/current-work).
|
||||||
|
|
||||||
Within the specification-specific directory there are two common ways
|
Within the specification-specific directory there are two common ways
|
||||||
of laying out tests: the first is a flat structure which is sometimes
|
of laying out tests: the first is a flat structure which is sometimes
|
||||||
|
@ -28,6 +28,12 @@ in the specification. The latter provides some implicit metadata about
|
||||||
the part of a specification being tested according to its location in
|
the part of a specification being tested according to its location in
|
||||||
the filesystem, and is preferred for larger specifications.
|
the filesystem, and is preferred for larger specifications.
|
||||||
|
|
||||||
|
For example, tests in HTML for ["The History
|
||||||
|
interface"](https://html.spec.whatwg.org/multipage/history.html#the-history-interface)
|
||||||
|
are located in `html/browsers/history/the-history-interface/`.
|
||||||
|
|
||||||
|
Various resources that tests depend on are in `common`, `images`, `fonts`,
|
||||||
|
`media`, and `resources`.
|
||||||
|
|
||||||
## Test Types
|
## Test Types
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,8 @@ GitHub UI. Below is one method and others can be found on
|
||||||
4. Wait for feedback on your pull request and once your pull request is
|
4. Wait for feedback on your pull request and once your pull request is
|
||||||
accepted, delete your branch (see '[When Pull Request is Accepted](#cleanup)').
|
accepted, delete your branch (see '[When Pull Request is Accepted](#cleanup)').
|
||||||
|
|
||||||
That's it! Your pull request will go into a queue and will be reviewed soon.
|
[This page on the submissions process](submission-process) has more detail
|
||||||
|
about what to expect when contributing code to WPT.
|
||||||
|
|
||||||
## Refine
|
## Refine
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,24 @@
|
||||||
# Submitting Tests
|
# Submitting Tests
|
||||||
|
|
||||||
Test submission is via the typical [GitHub workflow][github flow]:
|
Test submission is via the typical [GitHub workflow][github flow]. For detailed
|
||||||
|
guidelines on setup and each of these steps, please refer to the [Github Test
|
||||||
|
Submission](github-intro) documentation.
|
||||||
|
|
||||||
* Fork the [GitHub repository][repo] (and make sure you're still relatively in
|
* Fork the [GitHub repository][repo].
|
||||||
sync with it if you forked a while ago)
|
|
||||||
|
|
||||||
* Create a branch for your changes. Being a key of effective Git flow, it is
|
* Create a feature branch for your changes.
|
||||||
strongly recommended that the **topic branch** tradition be followed here,
|
|
||||||
i.e. the branch naming convention is based on the "topic" you will be working
|
|
||||||
on, e.g. `git checkout -b topic-name`
|
|
||||||
|
|
||||||
* Make your changes
|
* Make your changes.
|
||||||
|
|
||||||
* Run the `lint` script in the root of your checkout to detect common
|
* Run the `lint` script in the root of your checkout to detect common
|
||||||
mistakes in test submissions. This will also be run after submission
|
mistakes in test submissions. There is [detailed documentation for the lint
|
||||||
and any errors will prevent your PR being accepted. If it detects an
|
tool](lint-tool).
|
||||||
error that forms an essential part of your test, edit the list of
|
|
||||||
exceptions stored in `tools/lint/lint.whitelist`.
|
|
||||||
|
|
||||||
* Commit your changes.
|
* Commit your changes.
|
||||||
|
|
||||||
* Push your local branch to your GitHub repository.
|
* Push your local branch to your GitHub repository.
|
||||||
|
|
||||||
* Using the GitHub UI create a Pull Request for your branch.
|
* Using the GitHub UI, create a Pull Request for your branch.
|
||||||
|
|
||||||
* When you get review comments, make more commits to your branch to
|
* When you get review comments, make more commits to your branch to
|
||||||
address the comments.
|
address the comments.
|
||||||
|
@ -30,8 +26,9 @@ on, e.g. `git checkout -b topic-name`
|
||||||
* Once everything is reviewed and all issues are addressed, your pull
|
* Once everything is reviewed and all issues are addressed, your pull
|
||||||
request will be automatically merged.
|
request will be automatically merged.
|
||||||
|
|
||||||
For detailed guidelines on setup and each of these steps, please refer to the
|
We can sometimes take a little while to go through pull requests because we
|
||||||
[Github Test Submission](../writing-tests/github-intro) documentation.
|
have to go through all the tests and ensure that they match the specification
|
||||||
|
correctly. But we look at all of them, and take everything that we can.
|
||||||
|
|
||||||
Hop on to the [mailing list][public-test-infra] or [IRC][]
|
Hop on to the [mailing list][public-test-infra] or [IRC][]
|
||||||
([webclient][web irc], join channel `#testing`) if you have an issue. There is
|
([webclient][web irc], join channel `#testing`) if you have an issue. There is
|
||||||
|
|
|
@ -297,6 +297,11 @@ only takes `actual` and `description` as arguments.
|
||||||
The description parameter is used to present more useful error messages when
|
The description parameter is used to present more useful error messages when
|
||||||
a test fails.
|
a test fails.
|
||||||
|
|
||||||
|
When assertions are violated, they throw a runtime exception. This interrupts
|
||||||
|
test execution, so subsequent statements are not evaluated. A given test can
|
||||||
|
only fail due to one such violation, so if you would like to assert multiple
|
||||||
|
behaviors independently, you should use multiple tests.
|
||||||
|
|
||||||
NOTE: All asserts must be located in a `test()` or a step of an
|
NOTE: All asserts must be located in a `test()` or a step of an
|
||||||
`async_test()`, unless the test is a single page test. Asserts outside
|
`async_test()`, unless the test is a single page test. Asserts outside
|
||||||
these places won't be detected correctly by the harness and may cause
|
these places won't be detected correctly by the harness and may cause
|
||||||
|
@ -802,6 +807,24 @@ asserts that one `assert_func(actual, expected_array_N, extra_arg1, ..., extra_a
|
||||||
allows multiple behaviours. Test authors should not use this method simply to hide
|
allows multiple behaviours. Test authors should not use this method simply to hide
|
||||||
UA bugs.
|
UA bugs.
|
||||||
|
|
||||||
|
## Formatting ##
|
||||||
|
|
||||||
|
When many JavaScript Object values are coerced to a String, the resulting value
|
||||||
|
will be `"[object Object]"`. This obscures helpful information, making the
|
||||||
|
coerced value unsuitable for use in assertion messages, test names, and
|
||||||
|
debugging statements.
|
||||||
|
|
||||||
|
testharness.js provides a global function named `format_value` which produces
|
||||||
|
more distinctive string representations of many kinds of objects, including
|
||||||
|
arrays and the more important DOM Node types. It also translates String values
|
||||||
|
containing control characters to include human-readable representations.
|
||||||
|
|
||||||
|
```js
|
||||||
|
format_value(document); // "Document node with 2 children"
|
||||||
|
format_value("foo\uffffbar"); // "\"foo\\uffffbar\""
|
||||||
|
format_value([-0, Infinity]); // "[-0, Infinity]"
|
||||||
|
```
|
||||||
|
|
||||||
## Metadata ##
|
## Metadata ##
|
||||||
|
|
||||||
It is possible to add optional metadata to tests; this can be done in
|
It is possible to add optional metadata to tests; this can be done in
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<meta charset=utf-8>
|
||||||
|
<title>Element Timing: observe element with background image in its first letter</title>
|
||||||
|
<body>
|
||||||
|
<style>
|
||||||
|
#target::first-letter {
|
||||||
|
background-image: url('/images/black-rectangle.png');
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="resources/element-timing-helpers.js"></script>
|
||||||
|
<script>
|
||||||
|
let beforeRender = performance.now();
|
||||||
|
async_test(function (t) {
|
||||||
|
if (!window.PerformanceElementTiming) {
|
||||||
|
assert_unreached("PerformanceElementTiming is not implemented");
|
||||||
|
}
|
||||||
|
const div = document.getElementById('target');
|
||||||
|
let textObserved = false;
|
||||||
|
let imageObserved = false;
|
||||||
|
const observer = new PerformanceObserver(
|
||||||
|
t.step_func(function(entryList) {
|
||||||
|
entryList.getEntries().forEach(entry => {
|
||||||
|
if (entry.name === 'text-paint') {
|
||||||
|
checkTextElement(entry, 'my_div', 'target', beforeRender, div);
|
||||||
|
textObserved = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assert_equals(entry.name, 'image-paint');
|
||||||
|
const pathname = window.location.origin + '/images/black-rectangle.png';
|
||||||
|
checkElement(entry, pathname, 'my_div', 'target', beforeRender, div);
|
||||||
|
checkNaturalSize(entry, 100, 50);
|
||||||
|
imageObserved = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (textObserved && imageObserved)
|
||||||
|
t.done();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
observer.observe({entryTypes: ['element']});
|
||||||
|
}, 'Element with elementtiming attribute and background image in first-letter is observable.');
|
||||||
|
</script>
|
||||||
|
<div id='target' elementtiming='my_div'>A</div>
|
||||||
|
</body>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Check that sandboxed iframe can navigate their self</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
var t = async_test();
|
||||||
|
onmessage = t.step_func((e) => {
|
||||||
|
if (e.data == 'pushstatebackdone') t.done();
|
||||||
|
});
|
||||||
|
|
||||||
|
function doNavigation() {
|
||||||
|
frames[0].postMessage('pushstateback', '*');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<iframe id="child_frame" sandbox="allow-scripts" src="support/iframe-tried-to-be-navigated-by-history.html" onload="doNavigation();"></iframe>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Check that sandboxed iframe can not navigate their ancestors</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
var t = async_test();
|
||||||
|
onpopstate = t.unreached_func('no pop state');
|
||||||
|
|
||||||
|
function doNavigation() {
|
||||||
|
history.pushState( {state: "one past"}, 'page 2', '');
|
||||||
|
frames[0].postMessage('back', '*');
|
||||||
|
t.step_timeout(() => {
|
||||||
|
t.done();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<iframe id="child_frame" sandbox="allow-scripts" src="support/iframe-tried-to-be-navigated-by-history.html" onload="doNavigation();"></iframe>
|
|
@ -0,0 +1,28 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Check that sandboxed iframe can not navigate their ancestors</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
var t = async_test();
|
||||||
|
var pop_state_count = 0;
|
||||||
|
onpopstate = t.step_func((e) => {
|
||||||
|
pop_state_count++;
|
||||||
|
if (pop_state_count == 1) {
|
||||||
|
// Should not generate a pop state
|
||||||
|
frames[0].postMessage('forward', '*');
|
||||||
|
t.step_timeout(() => {
|
||||||
|
t.done();
|
||||||
|
}, 1000);
|
||||||
|
} else if (pop_state_count > 1) {
|
||||||
|
assert_unreached('no pop state');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function doNavigation() {
|
||||||
|
history.pushState( {state: "one past"}, 'page 2', '');
|
||||||
|
// Should generate a pop state
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<iframe id="child_frame" sandbox="allow-scripts" src="support/iframe-tried-to-be-navigated-by-history.html" onload="doNavigation();"></iframe>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<p>This is a frame that tries to navigate via history API.</p>
|
||||||
|
<script>
|
||||||
|
window.onmessage = (e) => {
|
||||||
|
if (e.data == 'back') {
|
||||||
|
history.back();
|
||||||
|
} else if (e.data == 'forward') {
|
||||||
|
history.forward();
|
||||||
|
} else if (e.data = 'pushstateback') {
|
||||||
|
onpopstate = (e) => {
|
||||||
|
parent.postMessage('pushstatebackdone', '*');
|
||||||
|
};
|
||||||
|
|
||||||
|
history.pushState({someState: 'blah'}, '');
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -359,7 +359,7 @@ interface Element : Node {
|
||||||
[CEReactions] Attr? setAttributeNodeNS(Attr attr);
|
[CEReactions] Attr? setAttributeNodeNS(Attr attr);
|
||||||
[CEReactions] Attr removeAttributeNode(Attr attr);
|
[CEReactions] Attr removeAttributeNode(Attr attr);
|
||||||
|
|
||||||
ShadowRoot attachShadow(optional ShadowRootInit init = {});
|
ShadowRoot attachShadow(ShadowRootInit init);
|
||||||
readonly attribute ShadowRoot? shadowRoot;
|
readonly attribute ShadowRoot? shadowRoot;
|
||||||
|
|
||||||
Element? closest(DOMString selectors);
|
Element? closest(DOMString selectors);
|
||||||
|
|
|
@ -27,7 +27,7 @@ interface mixin Body {
|
||||||
};
|
};
|
||||||
typedef (Request or USVString) RequestInfo;
|
typedef (Request or USVString) RequestInfo;
|
||||||
|
|
||||||
[Constructor(RequestInfo input, optional RequestInit init),
|
[Constructor(RequestInfo input, optional RequestInit init = {}),
|
||||||
Exposed=(Window,Worker)]
|
Exposed=(Window,Worker)]
|
||||||
interface Request {
|
interface Request {
|
||||||
readonly attribute ByteString method;
|
readonly attribute ByteString method;
|
||||||
|
@ -72,7 +72,7 @@ enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
|
||||||
enum RequestCredentials { "omit", "same-origin", "include" };
|
enum RequestCredentials { "omit", "same-origin", "include" };
|
||||||
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
|
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
|
||||||
enum RequestRedirect { "follow", "error", "manual" };
|
enum RequestRedirect { "follow", "error", "manual" };
|
||||||
[Constructor(optional BodyInit? body = null, optional ResponseInit init), Exposed=(Window,Worker)]
|
[Constructor(optional BodyInit? body = null, optional ResponseInit init = {}), Exposed=(Window,Worker)]
|
||||||
interface Response {
|
interface Response {
|
||||||
[NewObject] static Response error();
|
[NewObject] static Response error();
|
||||||
[NewObject] static Response redirect(USVString url, optional unsigned short status = 302);
|
[NewObject] static Response redirect(USVString url, optional unsigned short status = 302);
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
// (https://github.com/tidoust/reffy-reports)
|
// (https://github.com/tidoust/reffy-reports)
|
||||||
// Source: Geolocation Sensor (https://wicg.github.io/geolocation-sensor/)
|
// Source: Geolocation Sensor (https://wicg.github.io/geolocation-sensor/)
|
||||||
|
|
||||||
[Constructor(optional GeolocationSensorOptions options),
|
[Constructor(optional GeolocationSensorOptions options = {}),
|
||||||
SecureContext,
|
SecureContext,
|
||||||
Exposed=(DedicatedWorker, Window)]
|
Exposed=(DedicatedWorker, Window)]
|
||||||
interface GeolocationSensor : Sensor {
|
interface GeolocationSensor : Sensor {
|
||||||
static Promise<GeolocationSensorReading> read(optional ReadOptions readOptions);
|
static Promise<GeolocationSensorReading> read(optional ReadOptions readOptions = {});
|
||||||
readonly attribute unrestricted double? latitude;
|
readonly attribute unrestricted double? latitude;
|
||||||
readonly attribute unrestricted double? longitude;
|
readonly attribute unrestricted double? longitude;
|
||||||
readonly attribute unrestricted double? altitude;
|
readonly attribute unrestricted double? altitude;
|
||||||
|
|
|
@ -134,7 +134,7 @@ interface mixin HTMLOrSVGElement {
|
||||||
attribute DOMString nonce; // intentionally no [CEReactions]
|
attribute DOMString nonce; // intentionally no [CEReactions]
|
||||||
|
|
||||||
[CEReactions] attribute long tabIndex;
|
[CEReactions] attribute long tabIndex;
|
||||||
void focus(optional FocusOptions options);
|
void focus(optional FocusOptions options = {});
|
||||||
void blur();
|
void blur();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ interface TimeRanges {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional TrackEventInit eventInitDict)]
|
Constructor(DOMString type, optional TrackEventInit eventInitDict = {})]
|
||||||
interface TrackEvent : Event {
|
interface TrackEvent : Event {
|
||||||
readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
|
readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
|
||||||
};
|
};
|
||||||
|
@ -1098,7 +1098,7 @@ interface ValidityState {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional FormDataEventInit eventInitDict)]
|
Constructor(DOMString type, optional FormDataEventInit eventInitDict = {})]
|
||||||
interface FormDataEvent : Event {
|
interface FormDataEvent : Event {
|
||||||
readonly attribute FormData formData;
|
readonly attribute FormData formData;
|
||||||
};
|
};
|
||||||
|
@ -1149,8 +1149,8 @@ interface HTMLTemplateElement : HTMLElement {
|
||||||
HTMLConstructor]
|
HTMLConstructor]
|
||||||
interface HTMLSlotElement : HTMLElement {
|
interface HTMLSlotElement : HTMLElement {
|
||||||
[CEReactions] attribute DOMString name;
|
[CEReactions] attribute DOMString name;
|
||||||
sequence<Node> assignedNodes(optional AssignedNodesOptions options);
|
sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
|
||||||
sequence<Element> assignedElements(optional AssignedNodesOptions options);
|
sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary AssignedNodesOptions {
|
dictionary AssignedNodesOptions {
|
||||||
|
@ -1231,7 +1231,7 @@ interface mixin CanvasTransform {
|
||||||
|
|
||||||
[NewObject] DOMMatrix getTransform();
|
[NewObject] DOMMatrix getTransform();
|
||||||
void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
|
void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
|
||||||
void setTransform(optional DOMMatrix2DInit transform);
|
void setTransform(optional DOMMatrix2DInit transform = {});
|
||||||
void resetTransform();
|
void resetTransform();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1373,7 +1373,7 @@ interface CanvasGradient {
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
interface CanvasPattern {
|
interface CanvasPattern {
|
||||||
// opaque object
|
// opaque object
|
||||||
void setTransform(optional DOMMatrix2DInit transform);
|
void setTransform(optional DOMMatrix2DInit transform = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
|
@ -1408,7 +1408,7 @@ interface ImageData {
|
||||||
[Constructor(optional (Path2D or DOMString) path),
|
[Constructor(optional (Path2D or DOMString) path),
|
||||||
Exposed=(Window,Worker)]
|
Exposed=(Window,Worker)]
|
||||||
interface Path2D {
|
interface Path2D {
|
||||||
void addPath(Path2D path, optional DOMMatrix2DInit transform);
|
void addPath(Path2D path, optional DOMMatrix2DInit transform = {});
|
||||||
};
|
};
|
||||||
Path2D includes CanvasPath;
|
Path2D includes CanvasPath;
|
||||||
|
|
||||||
|
@ -1438,7 +1438,7 @@ interface OffscreenCanvas : EventTarget {
|
||||||
|
|
||||||
OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId, optional any options = null);
|
OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId, optional any options = null);
|
||||||
ImageBitmap transferToImageBitmap();
|
ImageBitmap transferToImageBitmap();
|
||||||
Promise<Blob> convertToBlob(optional ImageEncodeOptions options);
|
Promise<Blob> convertToBlob(optional ImageEncodeOptions options = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
|
@ -1465,7 +1465,7 @@ OffscreenCanvasRenderingContext2D includes CanvasPath;
|
||||||
|
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface CustomElementRegistry {
|
interface CustomElementRegistry {
|
||||||
[CEReactions] void define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options);
|
[CEReactions] void define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options = {});
|
||||||
any get(DOMString name);
|
any get(DOMString name);
|
||||||
Promise<void> whenDefined(DOMString name);
|
Promise<void> whenDefined(DOMString name);
|
||||||
[CEReactions] void upgrade(Node root);
|
[CEReactions] void upgrade(Node root);
|
||||||
|
@ -1561,7 +1561,7 @@ interface DataTransferItem {
|
||||||
callback FunctionStringCallback = void (DOMString data);
|
callback FunctionStringCallback = void (DOMString data);
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional DragEventInit eventInitDict)]
|
Constructor(DOMString type, optional DragEventInit eventInitDict = {})]
|
||||||
interface DragEvent : MouseEvent {
|
interface DragEvent : MouseEvent {
|
||||||
readonly attribute DataTransfer? dataTransfer;
|
readonly attribute DataTransfer? dataTransfer;
|
||||||
};
|
};
|
||||||
|
@ -1620,7 +1620,7 @@ interface Window : EventTarget {
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
|
void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
|
||||||
void postMessage(any message, optional WindowPostMessageOptions options);
|
void postMessage(any message, optional WindowPostMessageOptions options = {});
|
||||||
};
|
};
|
||||||
Window includes GlobalEventHandlers;
|
Window includes GlobalEventHandlers;
|
||||||
Window includes WindowEventHandlers;
|
Window includes WindowEventHandlers;
|
||||||
|
@ -1668,7 +1668,7 @@ interface Location { // but see also additional creation steps and overridden in
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
|
Constructor(DOMString type, optional PopStateEventInit eventInitDict = {})]
|
||||||
interface PopStateEvent : Event {
|
interface PopStateEvent : Event {
|
||||||
readonly attribute any state;
|
readonly attribute any state;
|
||||||
};
|
};
|
||||||
|
@ -1678,7 +1678,7 @@ dictionary PopStateEventInit : EventInit {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional HashChangeEventInit eventInitDict)]
|
Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {})]
|
||||||
interface HashChangeEvent : Event {
|
interface HashChangeEvent : Event {
|
||||||
readonly attribute USVString oldURL;
|
readonly attribute USVString oldURL;
|
||||||
readonly attribute USVString newURL;
|
readonly attribute USVString newURL;
|
||||||
|
@ -1690,7 +1690,7 @@ dictionary HashChangeEventInit : EventInit {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
|
Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {})]
|
||||||
interface PageTransitionEvent : Event {
|
interface PageTransitionEvent : Event {
|
||||||
readonly attribute boolean persisted;
|
readonly attribute boolean persisted;
|
||||||
};
|
};
|
||||||
|
@ -1737,7 +1737,8 @@ interface mixin NavigatorOnLine {
|
||||||
readonly attribute boolean onLine;
|
readonly attribute boolean onLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)]
|
[Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}),
|
||||||
|
Exposed=(Window,Worker)]
|
||||||
interface ErrorEvent : Event {
|
interface ErrorEvent : Event {
|
||||||
readonly attribute DOMString message;
|
readonly attribute DOMString message;
|
||||||
readonly attribute USVString filename;
|
readonly attribute USVString filename;
|
||||||
|
@ -1887,8 +1888,8 @@ interface mixin WindowOrWorkerGlobalScope {
|
||||||
void queueMicrotask(VoidFunction callback);
|
void queueMicrotask(VoidFunction callback);
|
||||||
|
|
||||||
// ImageBitmap
|
// ImageBitmap
|
||||||
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options);
|
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
|
||||||
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
|
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
|
||||||
};
|
};
|
||||||
Window includes WindowOrWorkerGlobalScope;
|
Window includes WindowOrWorkerGlobalScope;
|
||||||
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
|
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
|
||||||
|
@ -2012,7 +2013,8 @@ interface mixin AnimationFrameProvider {
|
||||||
Window includes AnimationFrameProvider;
|
Window includes AnimationFrameProvider;
|
||||||
DedicatedWorkerGlobalScope includes AnimationFrameProvider;
|
DedicatedWorkerGlobalScope includes AnimationFrameProvider;
|
||||||
|
|
||||||
[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker,AudioWorklet)]
|
[Constructor(DOMString type, optional MessageEventInit eventInitDict = {}),
|
||||||
|
Exposed=(Window,Worker,AudioWorklet)]
|
||||||
interface MessageEvent : Event {
|
interface MessageEvent : Event {
|
||||||
readonly attribute any data;
|
readonly attribute any data;
|
||||||
readonly attribute USVString origin;
|
readonly attribute USVString origin;
|
||||||
|
@ -2033,7 +2035,7 @@ dictionary MessageEventInit : EventInit {
|
||||||
|
|
||||||
typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;
|
typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;
|
||||||
|
|
||||||
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict), Exposed=(Window,Worker)]
|
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict = {}), Exposed=(Window,Worker)]
|
||||||
interface EventSource : EventTarget {
|
interface EventSource : EventTarget {
|
||||||
readonly attribute USVString url;
|
readonly attribute USVString url;
|
||||||
readonly attribute boolean withCredentials;
|
readonly attribute boolean withCredentials;
|
||||||
|
@ -2085,7 +2087,8 @@ interface WebSocket : EventTarget {
|
||||||
void send(ArrayBufferView data);
|
void send(ArrayBufferView data);
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)]
|
[Constructor(DOMString type, optional CloseEventInit eventInitDict = {}),
|
||||||
|
Exposed=(Window,Worker)]
|
||||||
interface CloseEvent : Event {
|
interface CloseEvent : Event {
|
||||||
readonly attribute boolean wasClean;
|
readonly attribute boolean wasClean;
|
||||||
readonly attribute unsigned short code;
|
readonly attribute unsigned short code;
|
||||||
|
@ -2107,7 +2110,7 @@ interface MessageChannel {
|
||||||
[Exposed=(Window,Worker,AudioWorklet), Transferable]
|
[Exposed=(Window,Worker,AudioWorklet), Transferable]
|
||||||
interface MessagePort : EventTarget {
|
interface MessagePort : EventTarget {
|
||||||
void postMessage(any message, sequence<object> transfer);
|
void postMessage(any message, sequence<object> transfer);
|
||||||
void postMessage(any message, optional PostMessageOptions options);
|
void postMessage(any message, optional PostMessageOptions options = {});
|
||||||
void start();
|
void start();
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
@ -2149,7 +2152,7 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
|
||||||
[Replaceable] readonly attribute DOMString name;
|
[Replaceable] readonly attribute DOMString name;
|
||||||
|
|
||||||
void postMessage(any message, sequence<object> transfer);
|
void postMessage(any message, sequence<object> transfer);
|
||||||
void postMessage(any message, optional PostMessageOptions options);
|
void postMessage(any message, optional PostMessageOptions options = {});
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
@ -2170,12 +2173,13 @@ interface mixin AbstractWorker {
|
||||||
attribute EventHandler onerror;
|
attribute EventHandler onerror;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(USVString scriptURL, optional WorkerOptions options), Exposed=(Window,Worker)]
|
[Constructor(USVString scriptURL, optional WorkerOptions options = {}),
|
||||||
|
Exposed=(Window,Worker)]
|
||||||
interface Worker : EventTarget {
|
interface Worker : EventTarget {
|
||||||
void terminate();
|
void terminate();
|
||||||
|
|
||||||
void postMessage(any message, sequence<object> transfer);
|
void postMessage(any message, sequence<object> transfer);
|
||||||
void postMessage(any message, optional PostMessageOptions options);
|
void postMessage(any message, optional PostMessageOptions options = {});
|
||||||
attribute EventHandler onmessage;
|
attribute EventHandler onmessage;
|
||||||
attribute EventHandler onmessageerror;
|
attribute EventHandler onmessageerror;
|
||||||
};
|
};
|
||||||
|
@ -2190,7 +2194,7 @@ enum WorkerType { "classic", "module" };
|
||||||
|
|
||||||
Worker includes AbstractWorker;
|
Worker includes AbstractWorker;
|
||||||
|
|
||||||
[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options),
|
[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {}),
|
||||||
Exposed=(Window,Worker)]
|
Exposed=(Window,Worker)]
|
||||||
interface SharedWorker : EventTarget {
|
interface SharedWorker : EventTarget {
|
||||||
readonly attribute MessagePort port;
|
readonly attribute MessagePort port;
|
||||||
|
@ -2242,7 +2246,7 @@ interface mixin WindowLocalStorage {
|
||||||
Window includes WindowLocalStorage;
|
Window includes WindowLocalStorage;
|
||||||
|
|
||||||
[Exposed=Window,
|
[Exposed=Window,
|
||||||
Constructor(DOMString type, optional StorageEventInit eventInitDict)]
|
Constructor(DOMString type, optional StorageEventInit eventInitDict = {})]
|
||||||
interface StorageEvent : Event {
|
interface StorageEvent : Event {
|
||||||
readonly attribute DOMString? key;
|
readonly attribute DOMString? key;
|
||||||
readonly attribute DOMString? oldValue;
|
readonly attribute DOMString? oldValue;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// (https://github.com/tidoust/reffy-reports)
|
// (https://github.com/tidoust/reffy-reports)
|
||||||
// Source: Magnetometer (https://w3c.github.io/magnetometer/)
|
// Source: Magnetometer (https://w3c.github.io/magnetometer/)
|
||||||
|
|
||||||
[Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext,
|
[Constructor(optional MagnetometerSensorOptions sensorOptions = {}), SecureContext,
|
||||||
Exposed=Window]
|
Exposed=Window]
|
||||||
interface Magnetometer : Sensor {
|
interface Magnetometer : Sensor {
|
||||||
readonly attribute double? x;
|
readonly attribute double? x;
|
||||||
|
@ -17,7 +17,7 @@ dictionary MagnetometerSensorOptions : SensorOptions {
|
||||||
MagnetometerLocalCoordinateSystem referenceFrame = "device";
|
MagnetometerLocalCoordinateSystem referenceFrame = "device";
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext,
|
[Constructor(optional MagnetometerSensorOptions sensorOptions = {}), SecureContext,
|
||||||
Exposed=Window]
|
Exposed=Window]
|
||||||
interface UncalibratedMagnetometer : Sensor {
|
interface UncalibratedMagnetometer : Sensor {
|
||||||
readonly attribute double? x;
|
readonly attribute double? x;
|
||||||
|
|
|
@ -36,7 +36,7 @@ interface MediaSession {
|
||||||
|
|
||||||
void setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);
|
void setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);
|
||||||
|
|
||||||
void setPositionState(MediaPositionState? state);
|
void setPositionState(optional MediaPositionState? state);
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(optional MediaMetadataInit init), Exposed=Window]
|
[Constructor(optional MediaMetadataInit init), Exposed=Window]
|
||||||
|
@ -61,9 +61,9 @@ dictionary MediaImage {
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary MediaPositionState {
|
dictionary MediaPositionState {
|
||||||
required double duration;
|
double duration;
|
||||||
double playbackRate = 1.0;
|
double playbackRate;
|
||||||
double position = 0.0;
|
double position;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary MediaSessionActionDetails {
|
dictionary MediaSessionActionDetails {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// (https://github.com/tidoust/reffy-reports)
|
// (https://github.com/tidoust/reffy-reports)
|
||||||
// Source: Notifications API Standard (https://notifications.spec.whatwg.org/)
|
// Source: Notifications API Standard (https://notifications.spec.whatwg.org/)
|
||||||
|
|
||||||
[Constructor(DOMString title, optional NotificationOptions options),
|
[Constructor(DOMString title, optional NotificationOptions options = {}),
|
||||||
Exposed=(Window,Worker)]
|
Exposed=(Window,Worker)]
|
||||||
interface Notification : EventTarget {
|
interface Notification : EventTarget {
|
||||||
static readonly attribute NotificationPermission permission;
|
static readonly attribute NotificationPermission permission;
|
||||||
|
@ -77,8 +77,8 @@ dictionary GetNotificationOptions {
|
||||||
};
|
};
|
||||||
|
|
||||||
partial interface ServiceWorkerRegistration {
|
partial interface ServiceWorkerRegistration {
|
||||||
Promise<void> showNotification(DOMString title, optional NotificationOptions options);
|
Promise<void> showNotification(DOMString title, optional NotificationOptions options = {});
|
||||||
Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter);
|
Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(DOMString type, NotificationEventInit eventInitDict),
|
[Constructor(DOMString type, NotificationEventInit eventInitDict),
|
||||||
|
|
|
@ -17,11 +17,11 @@ dictionary OrientationSensorOptions : SensorOptions {
|
||||||
OrientationSensorLocalCoordinateSystem referenceFrame = "device";
|
OrientationSensorLocalCoordinateSystem referenceFrame = "device";
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(optional OrientationSensorOptions sensorOptions), SecureContext, Exposed=Window]
|
[Constructor(optional OrientationSensorOptions sensorOptions = {}), SecureContext, Exposed=Window]
|
||||||
interface AbsoluteOrientationSensor : OrientationSensor {
|
interface AbsoluteOrientationSensor : OrientationSensor {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(optional OrientationSensorOptions sensorOptions), SecureContext, Exposed=Window]
|
[Constructor(optional OrientationSensorOptions sensorOptions = {}), SecureContext, Exposed=Window]
|
||||||
interface RelativeOrientationSensor : OrientationSensor {
|
interface RelativeOrientationSensor : OrientationSensor {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ interface ServiceWorker : EventTarget {
|
||||||
readonly attribute USVString scriptURL;
|
readonly attribute USVString scriptURL;
|
||||||
readonly attribute ServiceWorkerState state;
|
readonly attribute ServiceWorkerState state;
|
||||||
void postMessage(any message, sequence<object> transfer);
|
void postMessage(any message, sequence<object> transfer);
|
||||||
void postMessage(any message, optional PostMessageOptions options);
|
void postMessage(any message, optional PostMessageOptions options = {});
|
||||||
|
|
||||||
// event
|
// event
|
||||||
attribute EventHandler onstatechange;
|
attribute EventHandler onstatechange;
|
||||||
|
@ -60,7 +60,7 @@ interface ServiceWorkerContainer : EventTarget {
|
||||||
readonly attribute ServiceWorker? controller;
|
readonly attribute ServiceWorker? controller;
|
||||||
readonly attribute Promise<ServiceWorkerRegistration> ready;
|
readonly attribute Promise<ServiceWorkerRegistration> ready;
|
||||||
|
|
||||||
[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options);
|
[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options = {});
|
||||||
|
|
||||||
[NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
|
[NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
|
||||||
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
|
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
|
||||||
|
@ -115,7 +115,7 @@ interface Client {
|
||||||
readonly attribute DOMString id;
|
readonly attribute DOMString id;
|
||||||
readonly attribute ClientType type;
|
readonly attribute ClientType type;
|
||||||
void postMessage(any message, sequence<object> transfer);
|
void postMessage(any message, sequence<object> transfer);
|
||||||
void postMessage(any message, optional PostMessageOptions options);
|
void postMessage(any message, optional PostMessageOptions options = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=ServiceWorker]
|
[Exposed=ServiceWorker]
|
||||||
|
@ -138,7 +138,7 @@ enum FrameType {
|
||||||
interface Clients {
|
interface Clients {
|
||||||
// The objects returned will be new instances every time
|
// The objects returned will be new instances every time
|
||||||
[NewObject] Promise<any> get(DOMString id);
|
[NewObject] Promise<any> get(DOMString id);
|
||||||
[NewObject] Promise<FrozenArray<Client>> matchAll(optional ClientQueryOptions options);
|
[NewObject] Promise<FrozenArray<Client>> matchAll(optional ClientQueryOptions options = {});
|
||||||
[NewObject] Promise<WindowClient?> openWindow(USVString url);
|
[NewObject] Promise<WindowClient?> openWindow(USVString url);
|
||||||
[NewObject] Promise<void> claim();
|
[NewObject] Promise<void> claim();
|
||||||
};
|
};
|
||||||
|
@ -155,7 +155,7 @@ enum ClientType {
|
||||||
"all"
|
"all"
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(DOMString type, optional ExtendableEventInit eventInitDict), Exposed=ServiceWorker]
|
[Constructor(DOMString type, optional ExtendableEventInit eventInitDict = {}), Exposed=ServiceWorker]
|
||||||
interface ExtendableEvent : Event {
|
interface ExtendableEvent : Event {
|
||||||
void waitUntil(Promise<any> f);
|
void waitUntil(Promise<any> f);
|
||||||
};
|
};
|
||||||
|
@ -183,7 +183,7 @@ dictionary FetchEventInit : ExtendableEventInit {
|
||||||
DOMString replacesClientId = "";
|
DOMString replacesClientId = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), Exposed=ServiceWorker]
|
[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict = {}), Exposed=ServiceWorker]
|
||||||
interface ExtendableMessageEvent : ExtendableEvent {
|
interface ExtendableMessageEvent : ExtendableEvent {
|
||||||
readonly attribute any data;
|
readonly attribute any data;
|
||||||
readonly attribute USVString origin;
|
readonly attribute USVString origin;
|
||||||
|
@ -206,13 +206,13 @@ partial interface mixin WindowOrWorkerGlobalScope {
|
||||||
|
|
||||||
[SecureContext, Exposed=(Window,Worker)]
|
[SecureContext, Exposed=(Window,Worker)]
|
||||||
interface Cache {
|
interface Cache {
|
||||||
[NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
|
[NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options = {});
|
||||||
[NewObject] Promise<FrozenArray<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
|
[NewObject] Promise<FrozenArray<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options = {});
|
||||||
[NewObject] Promise<void> add(RequestInfo request);
|
[NewObject] Promise<void> add(RequestInfo request);
|
||||||
[NewObject] Promise<void> addAll(sequence<RequestInfo> requests);
|
[NewObject] Promise<void> addAll(sequence<RequestInfo> requests);
|
||||||
[NewObject] Promise<void> put(RequestInfo request, Response response);
|
[NewObject] Promise<void> put(RequestInfo request, Response response);
|
||||||
[NewObject] Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options);
|
[NewObject] Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options = {});
|
||||||
[NewObject] Promise<FrozenArray<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
|
[NewObject] Promise<FrozenArray<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary CacheQueryOptions {
|
dictionary CacheQueryOptions {
|
||||||
|
@ -223,7 +223,7 @@ dictionary CacheQueryOptions {
|
||||||
|
|
||||||
[SecureContext, Exposed=(Window,Worker)]
|
[SecureContext, Exposed=(Window,Worker)]
|
||||||
interface CacheStorage {
|
interface CacheStorage {
|
||||||
[NewObject] Promise<any> match(RequestInfo request, optional MultiCacheQueryOptions options);
|
[NewObject] Promise<any> match(RequestInfo request, optional MultiCacheQueryOptions options = {});
|
||||||
[NewObject] Promise<boolean> has(DOMString cacheName);
|
[NewObject] Promise<boolean> has(DOMString cacheName);
|
||||||
[NewObject] Promise<Cache> open(DOMString cacheName);
|
[NewObject] Promise<Cache> open(DOMString cacheName);
|
||||||
[NewObject] Promise<boolean> delete(DOMString cacheName);
|
[NewObject] Promise<boolean> delete(DOMString cacheName);
|
||||||
|
|
|
@ -23,7 +23,7 @@ partial interface Performance {
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=(Window,Worker),
|
[Exposed=(Window,Worker),
|
||||||
Constructor(DOMString markName, optional PerformanceMarkOptions markOptions)]
|
Constructor(DOMString markName, optional PerformanceMarkOptions markOptions = {})]
|
||||||
interface PerformanceMark : PerformanceEntry {
|
interface PerformanceMark : PerformanceEntry {
|
||||||
readonly attribute any detail;
|
readonly attribute any detail;
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,123 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>format_value utility function</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="log"></div>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script>
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value(null), "null");
|
||||||
|
}, "null");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value(undefined), "undefined");
|
||||||
|
}, "undefined");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value(true), "true");
|
||||||
|
assert_equals(format_value(false), "false");
|
||||||
|
}, "boolean values");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value(0.4), "0.4");
|
||||||
|
assert_equals(format_value(0), "0");
|
||||||
|
assert_equals(format_value(-0), "-0");
|
||||||
|
}, "number values");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value("a string"), "\"a string\"");
|
||||||
|
assert_equals(format_value("new\nline"), "\"new\\nline\"");
|
||||||
|
}, "string values");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.createElement("span");
|
||||||
|
node.setAttribute("data-foo", "bar");
|
||||||
|
assert_true(
|
||||||
|
/<span\b/i.test(format_value(node)), "element includes tag name"
|
||||||
|
);
|
||||||
|
assert_true(
|
||||||
|
/data-foo=["']?bar["']?/i.test(format_value(node)),
|
||||||
|
"element includes attributes"
|
||||||
|
);
|
||||||
|
}, "node value: element node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var text = document.createTextNode("wpt");
|
||||||
|
assert_equals(format_value(text), "Text node \"wpt\"");
|
||||||
|
}, "node value: text node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.createProcessingInstruction("wpt1", "wpt2");
|
||||||
|
assert_equals(
|
||||||
|
format_value(node),
|
||||||
|
"ProcessingInstruction node with target \"wpt1\" and data \"wpt2\""
|
||||||
|
);
|
||||||
|
}, "node value: ProcessingInstruction node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.createComment("wpt");
|
||||||
|
assert_equals(format_value(node), "Comment node <!--wpt-->");
|
||||||
|
}, "node value: comment node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.implementation.createDocument(
|
||||||
|
"application/xhtml+xml", "", null
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "Document node with 0 children");
|
||||||
|
|
||||||
|
node.appendChild(document.createElement('html'));
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "Document node with 1 child");
|
||||||
|
}, "node value: document node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.implementation.createDocumentType("foo", "baz", "baz");
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "DocumentType node");
|
||||||
|
}, "node value: DocumentType node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = document.createDocumentFragment();
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "DocumentFragment node with 0 children");
|
||||||
|
|
||||||
|
node.appendChild(document.createElement("span"));
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "DocumentFragment node with 1 child");
|
||||||
|
|
||||||
|
node.appendChild(document.createElement("span"));
|
||||||
|
|
||||||
|
assert_equals(format_value(node), "DocumentFragment node with 2 children");
|
||||||
|
}, "node value: DocumentFragment node");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value(Symbol("wpt")), "symbol \"Symbol(wpt)\"");
|
||||||
|
}, "symbol value");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
assert_equals(format_value([]), "[]");
|
||||||
|
assert_equals(format_value(["one"]), "[\"one\"]");
|
||||||
|
assert_equals(format_value(["one", "two"]), "[\"one\", \"two\"]");
|
||||||
|
}, "array values");
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var obj = {
|
||||||
|
toString: function() {
|
||||||
|
throw "wpt";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
assert_equals(
|
||||||
|
format_value(obj), "[stringifying object threw wpt with type string]"
|
||||||
|
);
|
||||||
|
}, "object value with faulty `toString`");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Trivial animVal testcase, to see wheter we support it at all. Should result in a 200x200 rect and only PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var rect = createSVGElement("rect");
|
||||||
|
rect.setAttribute("id", "rect");
|
||||||
|
rect.setAttribute("width", "200");
|
||||||
|
rect.setAttribute("height", "200");
|
||||||
|
rect.setAttribute("fill", "green");
|
||||||
|
rect.setAttribute("onclick", "executeTest()");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "width");
|
||||||
|
animate.setAttribute("from", "200");
|
||||||
|
animate.setAttribute("to", "100");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
rect.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(rect);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_approx_equals(rect.width.animVal.value, 200, epsilon);
|
||||||
|
assert_equals(rect.width.baseVal.value, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
// Check half-time conditions
|
||||||
|
assert_approx_equals(rect.width.animVal.value, 150, epsilon);
|
||||||
|
assert_equals(rect.width.baseVal.value, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
// Check just before-end conditions
|
||||||
|
assert_approx_equals(rect.width.animVal.value, 100, epsilon);
|
||||||
|
assert_equals(rect.width.baseVal.value, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 2.0, sample2],
|
||||||
|
["animation", 3.999, sample3],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,97 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Animate SVGMarkerElement orientAttr from an angle to auto</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
|
||||||
|
var marker = createSVGElement("marker");
|
||||||
|
marker.setAttribute("id", "marker");
|
||||||
|
marker.setAttribute("viewBox", "0 0 10 10");
|
||||||
|
marker.setAttribute("markerWidth", "2");
|
||||||
|
marker.setAttribute("markerHeight", "2");
|
||||||
|
marker.setAttribute("refX", "5");
|
||||||
|
marker.setAttribute("refY", "5");
|
||||||
|
marker.setAttribute("markerUnits", "strokeWidth");
|
||||||
|
|
||||||
|
var markerPath = createSVGElement("path");
|
||||||
|
markerPath.setAttribute("fill", "blue");
|
||||||
|
markerPath.setAttribute("d", "M 5 0 L 10 10 L 0 10 Z");
|
||||||
|
marker.appendChild(markerPath);
|
||||||
|
|
||||||
|
var defsElement = createSVGElement("defs");
|
||||||
|
defsElement.appendChild(marker);
|
||||||
|
rootSVGElement.appendChild(defsElement);
|
||||||
|
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("fill", "none");
|
||||||
|
path.setAttribute("stroke", "green");
|
||||||
|
path.setAttribute("stroke-width", "10");
|
||||||
|
path.setAttribute("marker-start", "url(#marker)");
|
||||||
|
path.setAttribute("marker-end", "url(#marker)");
|
||||||
|
path.setAttribute("d", "M 130 135 L 180 135 L 180 185");
|
||||||
|
path.setAttribute("transform", "translate(-130, -120)");
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
var animate1 = createSVGElement("animate");
|
||||||
|
animate1.setAttribute("id", "animation");
|
||||||
|
animate1.setAttribute("attributeName", "orient");
|
||||||
|
animate1.setAttribute("begin", "0s");
|
||||||
|
animate1.setAttribute("dur", "4s");
|
||||||
|
animate1.setAttribute("from", "90deg");
|
||||||
|
animate1.setAttribute("to", "auto");
|
||||||
|
animate1.setAttribute("fill", "freeze");
|
||||||
|
marker.appendChild(animate1);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 90, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 0.001, sample2],
|
||||||
|
["animation", 1.999, sample2],
|
||||||
|
["animation", 2.001, sample3],
|
||||||
|
["animation", 3.999, sample3],
|
||||||
|
["animation", 4.001, sample3]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,97 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Animate SVGMarkerElement orientAttr from auto to auto-start-reverse</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
|
||||||
|
var marker = createSVGElement("marker");
|
||||||
|
marker.setAttribute("id", "marker");
|
||||||
|
marker.setAttribute("viewBox", "0 0 10 10");
|
||||||
|
marker.setAttribute("markerWidth", "2");
|
||||||
|
marker.setAttribute("markerHeight", "2");
|
||||||
|
marker.setAttribute("refX", "5");
|
||||||
|
marker.setAttribute("refY", "5");
|
||||||
|
marker.setAttribute("markerUnits", "strokeWidth");
|
||||||
|
|
||||||
|
var markerPath = createSVGElement("path");
|
||||||
|
markerPath.setAttribute("fill", "blue");
|
||||||
|
markerPath.setAttribute("d", "M 5 0 L 10 10 L 0 10 Z");
|
||||||
|
marker.appendChild(markerPath);
|
||||||
|
|
||||||
|
var defsElement = createSVGElement("defs");
|
||||||
|
defsElement.appendChild(marker);
|
||||||
|
rootSVGElement.appendChild(defsElement);
|
||||||
|
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("fill", "none");
|
||||||
|
path.setAttribute("stroke", "green");
|
||||||
|
path.setAttribute("stroke-width", "10");
|
||||||
|
path.setAttribute("marker-start", "url(#marker)");
|
||||||
|
path.setAttribute("marker-end", "url(#marker)");
|
||||||
|
path.setAttribute("d", "M 130 135 L 180 135 L 180 185");
|
||||||
|
path.setAttribute("transform", "translate(-130, -120)");
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
var animate1 = createSVGElement("animate");
|
||||||
|
animate1.setAttribute("id", "animation");
|
||||||
|
animate1.setAttribute("attributeName", "orient");
|
||||||
|
animate1.setAttribute("begin", "0s");
|
||||||
|
animate1.setAttribute("dur", "4s");
|
||||||
|
animate1.setAttribute("from", "auto");
|
||||||
|
animate1.setAttribute("to", "auto-start-reverse");
|
||||||
|
animate1.setAttribute("fill", "freeze");
|
||||||
|
marker.appendChild(animate1);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 0.001, sample2],
|
||||||
|
["animation", 1.999, sample2],
|
||||||
|
["animation", 2.001, sample3],
|
||||||
|
["animation", 3.999, sample3],
|
||||||
|
["animation", 4.001, sample3]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,94 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Animate SVGMarkerElement orientAttr to an angle</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
|
||||||
|
var marker = createSVGElement("marker");
|
||||||
|
marker.setAttribute("id", "marker");
|
||||||
|
marker.setAttribute("viewBox", "0 0 10 10");
|
||||||
|
marker.setAttribute("markerWidth", "2");
|
||||||
|
marker.setAttribute("markerHeight", "2");
|
||||||
|
marker.setAttribute("refX", "5");
|
||||||
|
marker.setAttribute("refY", "5");
|
||||||
|
marker.setAttribute("markerUnits", "strokeWidth");
|
||||||
|
|
||||||
|
var markerPath = createSVGElement("path");
|
||||||
|
markerPath.setAttribute("fill", "blue");
|
||||||
|
markerPath.setAttribute("d", "M 5 0 L 10 10 L 0 10 Z");
|
||||||
|
marker.appendChild(markerPath);
|
||||||
|
|
||||||
|
var defsElement = createSVGElement("defs");
|
||||||
|
defsElement.appendChild(marker);
|
||||||
|
rootSVGElement.appendChild(defsElement);
|
||||||
|
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("fill", "none");
|
||||||
|
path.setAttribute("stroke", "green");
|
||||||
|
path.setAttribute("stroke-width", "10");
|
||||||
|
path.setAttribute("marker-start", "url(#marker)");
|
||||||
|
path.setAttribute("marker-end", "url(#marker)");
|
||||||
|
path.setAttribute("d", "M 130 135 L 180 135 L 180 185");
|
||||||
|
path.setAttribute("transform", "translate(-130, -120)");
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
var animate1 = createSVGElement("animate");
|
||||||
|
animate1.setAttribute("id", "animation");
|
||||||
|
animate1.setAttribute("attributeName", "orient");
|
||||||
|
animate1.setAttribute("begin", "0s");
|
||||||
|
animate1.setAttribute("dur", "4s");
|
||||||
|
animate1.setAttribute("to", "180deg");
|
||||||
|
animate1.setAttribute("fill", "freeze");
|
||||||
|
marker.appendChild(animate1);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 90, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_approx_equals(marker.orientAngle.animVal.value, 180, epsilon);
|
||||||
|
assert_equals(marker.orientAngle.baseVal.value, 0);
|
||||||
|
|
||||||
|
assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 2.0, sample2],
|
||||||
|
["animation", 3.999, sample3],
|
||||||
|
["animation", 4.001, sample3]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,68 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test calcMode discrete with from-to animation on numbers. You should see a green 100x100 rect and only PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var rect = createSVGElement("rect");
|
||||||
|
rect.setAttribute("id", "rect");
|
||||||
|
rect.setAttribute("x", "100");
|
||||||
|
rect.setAttribute("width", "100");
|
||||||
|
rect.setAttribute("height", "100");
|
||||||
|
rect.setAttribute("fill", "green");
|
||||||
|
rect.setAttribute("onclick", "executeTest()");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "x");
|
||||||
|
animate.setAttribute("values", "100;200;300");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "3s");
|
||||||
|
animate.setAttribute("keyTimes", "0;0.5;1");
|
||||||
|
animate.setAttribute("calcMode", "discrete");
|
||||||
|
animate.setAttribute("fill", "freeze");
|
||||||
|
rect.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(rect);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
assert_equals(rect.x.animVal.value, 100);
|
||||||
|
assert_equals(rect.x.baseVal.value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(rect.x.animVal.value, 200);
|
||||||
|
assert_equals(rect.x.baseVal.value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(rect.x.animVal.value, 300);
|
||||||
|
assert_equals(rect.x.baseVal.value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.499, sample1],
|
||||||
|
["animation", 1.501, sample2],
|
||||||
|
["animation", 2.999, sample2],
|
||||||
|
["animation", 3.001, sample3]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.clickX = 150;
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,63 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test calcMode discrete with from-to animation on numbers. You should see a green 100x100 rect and only PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var rect = createSVGElement("rect");
|
||||||
|
rect.setAttribute("id", "rect");
|
||||||
|
rect.setAttribute("x", "100");
|
||||||
|
rect.setAttribute("width", "100");
|
||||||
|
rect.setAttribute("height", "100");
|
||||||
|
rect.setAttribute("fill", "green");
|
||||||
|
rect.setAttribute("onclick", "executeTest()");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "x");
|
||||||
|
animate.setAttribute("from", "100");
|
||||||
|
animate.setAttribute("to", "0");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
animate.setAttribute("calcMode", "discrete");
|
||||||
|
rect.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(rect);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(rect.x.animVal.value, 100);
|
||||||
|
assert_equals(rect.x.baseVal.value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(rect.x.animVal.value, 0);
|
||||||
|
assert_equals(rect.x.baseVal.value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.999, sample1],
|
||||||
|
["animation", 2.001, sample2],
|
||||||
|
["animation", 3.999, sample2],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.clickX = 150;
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M -20 -20 C 20 -20 20 -20 20 20 S 20 40 -20 20 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M -20 -20 C 20 -20 20 -20 20 20 S 20 40 -20 20 Z");
|
||||||
|
animate.setAttribute("to", "M -20 -20 c 0 40 0 40 40 40 s 40 0 0 -40 z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 C 20 -20 20 -20 20 20 S 20 40 -20 20 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 C 10 -10 10 -10 20 20 S 30 35 -10 10 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 c 10 30 10 30 40 40 s 30 5 -10 -30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 c 0.00999832 39.99 0.00999832 39.99 40 40 s 39.99 0.00499916 -0.00999832 -39.99 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M -30 -30 L 30 0 V 30 H 0 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M -30 -30 L 30 0 V 30 H 0 Z");
|
||||||
|
animate.setAttribute("to", "M 30 30 l -60 -30 v -30 h 30 Z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 L 30 0 V 30 H 0 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -15 -15 L 15 0 V 15 H 0 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M 15 15 l -30 -15 v -15 h 15 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M 29.985 29.985 l -59.97 -29.985 v -29.985 h 29.985 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", 'M -80 40 A 150 160 30 1 1 0 100 M 40 60 A 170 180 90 1 1 300 200 Z M 300 100');
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", 'M -80 40 A 150 160 30 1 1 0 100 M 40 60 A 170 180 90 1 1 300 200 Z M 300 100');
|
||||||
|
animate.setAttribute("to", 'm -70 30 a 160 170 60 1 1 60 40 m 120 70 a 180 190 120 1 1 100 150 Z m 120 -60');
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -80 40 A 150 160 30 1 1 0 100 M 40 60 A 170 180 90 1 1 300 200 Z M 300 100");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -77.5 37.5 A 152.5 162.5 37.5 1 1 -2.5 92.5 M 57.5 80 A 172.5 182.5 97.5 1 1 277.5 222.5 Z M 282.5 95");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "m -72.5 32.5 a 157.5 167.5 52.5 1 1 65 45 m 100 42.5 a 177.5 187.5 112.5 1 1 140 147.5 Z m 155 -35");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "m -70.0025 30.0025 a 159.997 169.997 59.9925 1 1 60.005 40.005 m 119.98 69.9725 a 179.997 189.997 119.993 1 1 100.04 149.998 Z m 120.035 -59.975");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M -30 -30 Q 30 -30 30 0 T -30 30 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M -30 -30 Q 30 -30 30 0 T -30 30 Z");
|
||||||
|
animate.setAttribute("to", "M -30 -30 q 30 0 30 30 t -30 30 z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 Q 30 -30 30 0 T -30 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 Q 22.5 -30 22.5 0 T -30 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 q 37.5 0 37.5 30 t -37.5 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 q 30.0075 0 30.0075 30 t -30.0075 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M -20 -20 c 0 40 0 40 40 40 s 40 0 0 -40 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M -20 -20 c 0 40 0 40 40 40 s 40 0 0 -40 Z");
|
||||||
|
animate.setAttribute("to", "M -20 -20 C 20 -20 20 -20 20 20 S 20 40 -20 20 Z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 c 0 40 0 40 40 40 s 40 0 0 -40 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 c 10 30 10 30 40 40 s 30 5 -10 -30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 C 10 -10 10 -10 20 20 S 30 35 -10 10 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -20 -20 C 19.99 -19.99 19.99 -19.99 20 20 S 20.01 39.995 -19.99 19.99 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M 30 30 l -60 -30 v -30 h 30 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M 30 30 l -60 -30 v -30 h 30 Z");
|
||||||
|
animate.setAttribute("to", "M -30 -30 L 30 0 V 30 H 0 Z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M 30 30 l -60 -30 v -30 h 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M 15 15 l -30 -15 v -15 h 15 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -15 -15 L 15 0 V 15 H 0 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -29.985 -29.985 L 29.985 0 V 29.985 H 0 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", 'm -70 30 a 160 170 60 1 1 60 40 m 120 70 a 180 190 120 1 1 100 150 Z m 120 -60');
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", 'm -70 30 a 160 170 60 1 1 60 40 m 120 70 a 180 190 120 1 1 100 150 Z m 120 -60');
|
||||||
|
animate.setAttribute("to", 'M -80 40 A 150 160 30 1 1 0 100 M 40 60 A 170 180 90 1 1 300 200 Z M 300 100');
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "m -70 30 a 160 170 60 1 1 60 40 m 120 70 a 180 190 120 1 1 100 150 Z m 120 -60");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "m -72.5 32.5 a 157.5 167.5 52.5 1 1 65 45 m 100 42.5 a 177.5 187.5 112.5 1 1 140 147.5 Z m 155 -35");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -77.5 37.5 A 152.5 162.5 37.5 1 1 -2.5 92.5 M 57.5 80 A 172.5 182.5 97.5 1 1 277.5 222.5 Z M 282.5 95");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -79.9975 39.9975 A 150.003 160.003 30.0075 1 1 -0.00249481 99.9925 M 40.0175 60.02 A 170.003 180.003 90.0075 1 1 299.977 200.022 Z M 299.982 99.995");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,68 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test path animation where coordinate modes of start and end differ. You should see PASS messages</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
||||||
|
|
||||||
|
<svg>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rootSVGElement = document.querySelector("svg");
|
||||||
|
var epsilon = 1.0;
|
||||||
|
|
||||||
|
// Setup test document
|
||||||
|
var path = createSVGElement("path");
|
||||||
|
path.setAttribute("id", "path");
|
||||||
|
path.setAttribute("d", "M -30 -30 q 30 0 30 30 t -30 30 Z");
|
||||||
|
path.setAttribute("fill", "green");
|
||||||
|
path.setAttribute("onclick", "executeTest()");
|
||||||
|
path.setAttribute("transform", "translate(50, 50)");
|
||||||
|
|
||||||
|
var animate = createSVGElement("animate");
|
||||||
|
animate.setAttribute("id", "animation");
|
||||||
|
animate.setAttribute("attributeName", "d");
|
||||||
|
animate.setAttribute("from", "M -30 -30 q 30 0 30 30 t -30 30 Z");
|
||||||
|
animate.setAttribute("to", "M -30 -30 Q 30 -30 30 0 T -30 30 Z");
|
||||||
|
animate.setAttribute("begin", "0s");
|
||||||
|
animate.setAttribute("dur", "4s");
|
||||||
|
path.appendChild(animate);
|
||||||
|
rootSVGElement.appendChild(path);
|
||||||
|
|
||||||
|
// Setup animation test
|
||||||
|
function sample1() {
|
||||||
|
// Check initial/end conditions
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 q 30 0 30 30 t -30 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample2() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 q 37.5 0 37.5 30 t -37.5 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample3() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 Q 22.5 -30 22.5 0 T -30 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sample4() {
|
||||||
|
assert_equals(path.getAttribute('d'), "M -30 -30 Q 29.9925 -30 29.9925 0 T -30 30 Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
smil_async_test((t) => {
|
||||||
|
const expectedValues = [
|
||||||
|
// [animationId, time, sampleCallback]
|
||||||
|
["animation", 0.0, sample1],
|
||||||
|
["animation", 1.0, sample2],
|
||||||
|
["animation", 3.0, sample3],
|
||||||
|
["animation", 3.999, sample4],
|
||||||
|
["animation", 4.001, sample1]
|
||||||
|
];
|
||||||
|
|
||||||
|
runAnimationTest(t, expectedValues);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.clickX = 40;
|
||||||
|
window.clickY = 70;
|
||||||
|
|
||||||
|
</script>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue