diff --git a/shadow-dom/.gitattributes b/shadow-dom/.gitattributes new file mode 100644 index 00000000000000..d69664f6389bf5 --- /dev/null +++ b/shadow-dom/.gitattributes @@ -0,0 +1,4 @@ +# Let Git normalize the line endings even if the core.autocrlf configuration +# variable is not set. +# See also: +* text=auto diff --git a/shadow-dom/04_00_Shadow_Trees/A_04_00_01.js b/shadow-dom/04_00_Shadow_Trees/A_04_00_01.js index 6081b0b79f7232..3caacdfe615f14 100644 --- a/shadow-dom/04_00_Shadow_Trees/A_04_00_01.js +++ b/shadow-dom/04_00_Shadow_Trees/A_04_00_01.js @@ -1,707 +1,707 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_00_01 = { - name:'A_04_00_01', - assert:'All HTML4 elements are able to host shadow trees', - link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', - highlight:'The existence of multiple DOM trees is enabled by letting any element in the ' + - 'document tree to host one or more additional DOM trees', - seealso:'http://www.w3.org/TR/html4/index/elements.html', - bug: ['https://bugs.webkit.org/show_bug.cgi?id=102864'] -}; - - - - -function A_04_00_01_test(elementName) { -// create element - var d = newHTMLDocument(); - var n = d.createElement(elementName); - d.body.appendChild(n); - -// add first shadow tree - var shadowTree1 = createSR(n); - assert_equals(shadowTree1.ownerDocument, d, 'Expected: Shadow tree 1 is part of the document, Actual: Shadow tree 1 is not part of the document'); - // add second shadow tree - var shadowTree2 = createSR(n); - assert_equals(shadowTree2.ownerDocument, d, 'Expected: Shadow tree 2 is part of the document, Actual: Shadow tree 2 is not part of the document'); -} - -test(function () { - A_04_00_01_test('A'); -}, 'A_04_00_01_T01', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('ABBR'); -}, 'A_04_00_01_T02', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('ACRONYM'); -}, 'A_04_00_01_T03', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('ADDRESS'); -}, 'A_04_00_01_T04', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('APPLET'); -}, 'A_04_00_01_T05', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - - -test(function () { - A_04_00_01_test('AUDIO'); -}, 'A_04_00_01_T05_01', PROPS(A_04_00_01, { - author:'Sergey G. Grekhov ', - reviewer:'' -})); - -test(function () { - A_04_00_01_test('B'); -}, 'A_04_00_01_T06', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BASE'); -}, 'A_04_00_01_T07', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BASEFONT'); -}, 'A_04_00_01_T08', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BDO'); -}, 'A_04_00_01_T09', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BIG'); -}, 'A_04_00_01_T10', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BLOCKQUOTE'); -}, 'A_04_00_01_T11', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BODY'); -}, 'A_04_00_01_T12', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BR'); -}, 'A_04_00_01_T12', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('BUTTON'); -}, 'A_04_00_01_T13', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('CAPTION'); -}, 'A_04_00_01_T14', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('CANVAS'); -}, 'A_04_00_01_T14_01', PROPS(A_04_00_01, { - author:'Sergey G. Grekhov ', - reviewer:'' -})); - - -test(function () { - A_04_00_01_test('CENTER'); -}, 'A_04_00_01_T15', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('CITE'); -}, 'A_04_00_01_T16', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('CODE'); -}, 'A_04_00_01_T17', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('COL'); -}, 'A_04_00_01_T18', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('COLGROUP'); -}, 'A_04_00_01_T19', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DD'); -}, 'A_04_00_01_T20', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DEL'); -}, 'A_04_00_01_T21', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DFN'); -}, 'A_04_00_01_T22', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DIR'); -}, 'A_04_00_01_T23', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DIV'); -}, 'A_04_00_01_T24', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DL'); -}, 'A_04_00_01_T25', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('DT'); -}, 'A_04_00_01_T26', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('EM'); -}, 'A_04_00_01_T27', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('EMBED'); -}, 'A_04_00_01_T27_01', PROPS(A_04_00_01, { - author:'Sergey G. Grekhov ', - reviewer:'' -})); - -test(function () { - A_04_00_01_test('FIELDSET'); -}, 'A_04_00_01_T28', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('FONT'); -}, 'A_04_00_01_T29', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('FORM'); -}, 'A_04_00_01_T30', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('FRAME'); -}, 'A_04_00_01_T31', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('FRAMESET'); -}, 'A_04_00_01_T32', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H1'); -}, 'A_04_00_01_T33', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H2'); -}, 'A_04_00_01_T34', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H3'); -}, 'A_04_00_01_T35', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H4'); -}, 'A_04_00_01_T36', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H5'); -}, 'A_04_00_01_T37', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('H6'); -}, 'A_04_00_01_T38', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('HEAD'); -}, 'A_04_00_01_T39', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('HR'); -}, 'A_04_00_01_T40', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('HTML'); -}, 'A_04_00_01_T41', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('I'); -}, 'A_04_00_01_T42', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('IFRAME'); -}, 'A_04_00_01_T43', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('IMG'); -}, 'A_04_00_01_T44', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - - -test(function () { - A_04_00_01_test('INPUT'); -}, 'A_04_00_01_T45', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('INS'); -}, 'A_04_00_01_T46', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('ISINDEX'); -}, 'A_04_00_01_T47', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('KBD'); -}, 'A_04_00_01_T48', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('LABEL'); -}, 'A_04_00_01_T49', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('LEGEND'); -}, 'A_04_00_01_T50', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('LI'); -}, 'A_04_00_01_T51', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('LINK'); -}, 'A_04_00_01_T52', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('MAP'); -}, 'A_04_00_01_T53', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('MENU'); -}, 'A_04_00_01_T54', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('META'); -}, 'A_04_00_01_T55', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('METER'); -}, 'A_04_00_01_T55_01', PROPS(A_04_00_01, { - author:'Sergey G. Grekhov ', - reviewer:'' -})); - - -test(function () { - A_04_00_01_test('NOFRAMES'); -}, 'A_04_00_01_T56', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('NOSCRIPT'); -}, 'A_04_00_01_T57', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('OBJECT'); -}, 'A_04_00_01_T58', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('OL'); -}, 'A_04_00_01_T59', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('OPTGROUP'); -}, 'A_04_00_01_T60', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('OPTION'); -}, 'A_04_00_01_T61', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('P'); -}, 'A_04_00_01_T62', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('PARAM'); -}, 'A_04_00_01_T63', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('PRE'); -}, 'A_04_00_01_T64', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('PROGRESS'); -}, 'A_04_00_01_T64_01', PROPS(A_04_00_01, { - author:'Sergey G. Grekhov ', - reviewer:'' -})); - -test(function () { - A_04_00_01_test('Q'); -}, 'A_04_00_01_T65', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('S'); -}, 'A_04_00_01_T66', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SAMP'); -}, 'A_04_00_01_T67', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SCRIPT'); -}, 'A_04_00_01_T68', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SELECT'); -}, 'A_04_00_01_T69', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SMALL'); -}, 'A_04_00_01_T70', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SPAN'); -}, 'A_04_00_01_T71', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('STRIKE'); -}, 'A_04_00_01_T72', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('STRONG'); -}, 'A_04_00_01_T73', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('STYLE'); -}, 'A_04_00_01_T74', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SUB'); -}, 'A_04_00_01_T75', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('SUP'); -}, 'A_04_00_01_T76', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TABLE'); -}, 'A_04_00_01_T77', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TBODY'); -}, 'A_04_00_01_T78', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TD'); -}, 'A_04_00_01_T79', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TEXTAREA'); -}, 'A_04_00_01_T80', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TFOOT'); -}, 'A_04_00_01_T81', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TH'); -}, 'A_04_00_01_T82', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('THEAD'); -}, 'A_04_00_01_T83', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TITLE'); -}, 'A_04_00_01_T84', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TR'); -}, 'A_04_00_01_T85', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('TT'); -}, 'A_04_00_01_T86', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('U'); -}, 'A_04_00_01_T87', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('UL'); -}, 'A_04_00_01_T88', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - -test(function () { - A_04_00_01_test('VAR'); -}, 'A_04_00_01_T89', PROPS(A_04_00_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' -})); - - +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_00_01 = { + name:'A_04_00_01', + assert:'All HTML4 elements are able to host shadow trees', + link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', + highlight:'The existence of multiple DOM trees is enabled by letting any element in the ' + + 'document tree to host one or more additional DOM trees', + seealso:'http://www.w3.org/TR/html4/index/elements.html', + bug: ['https://bugs.webkit.org/show_bug.cgi?id=102864'] +}; + + + + +function A_04_00_01_test(elementName) { +// create element + var d = newHTMLDocument(); + var n = d.createElement(elementName); + d.body.appendChild(n); + +// add first shadow tree + var shadowTree1 = createSR(n); + assert_equals(shadowTree1.ownerDocument, d, 'Expected: Shadow tree 1 is part of the document, Actual: Shadow tree 1 is not part of the document'); + // add second shadow tree + var shadowTree2 = createSR(n); + assert_equals(shadowTree2.ownerDocument, d, 'Expected: Shadow tree 2 is part of the document, Actual: Shadow tree 2 is not part of the document'); +} + +test(function () { + A_04_00_01_test('A'); +}, 'A_04_00_01_T01', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('ABBR'); +}, 'A_04_00_01_T02', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('ACRONYM'); +}, 'A_04_00_01_T03', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('ADDRESS'); +}, 'A_04_00_01_T04', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('APPLET'); +}, 'A_04_00_01_T05', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + + +test(function () { + A_04_00_01_test('AUDIO'); +}, 'A_04_00_01_T05_01', PROPS(A_04_00_01, { + author:'Sergey G. Grekhov ', + reviewer:'' +})); + +test(function () { + A_04_00_01_test('B'); +}, 'A_04_00_01_T06', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BASE'); +}, 'A_04_00_01_T07', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BASEFONT'); +}, 'A_04_00_01_T08', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BDO'); +}, 'A_04_00_01_T09', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BIG'); +}, 'A_04_00_01_T10', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BLOCKQUOTE'); +}, 'A_04_00_01_T11', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BODY'); +}, 'A_04_00_01_T12', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BR'); +}, 'A_04_00_01_T12', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('BUTTON'); +}, 'A_04_00_01_T13', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('CAPTION'); +}, 'A_04_00_01_T14', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('CANVAS'); +}, 'A_04_00_01_T14_01', PROPS(A_04_00_01, { + author:'Sergey G. Grekhov ', + reviewer:'' +})); + + +test(function () { + A_04_00_01_test('CENTER'); +}, 'A_04_00_01_T15', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('CITE'); +}, 'A_04_00_01_T16', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('CODE'); +}, 'A_04_00_01_T17', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('COL'); +}, 'A_04_00_01_T18', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('COLGROUP'); +}, 'A_04_00_01_T19', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DD'); +}, 'A_04_00_01_T20', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DEL'); +}, 'A_04_00_01_T21', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DFN'); +}, 'A_04_00_01_T22', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DIR'); +}, 'A_04_00_01_T23', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DIV'); +}, 'A_04_00_01_T24', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DL'); +}, 'A_04_00_01_T25', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('DT'); +}, 'A_04_00_01_T26', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('EM'); +}, 'A_04_00_01_T27', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('EMBED'); +}, 'A_04_00_01_T27_01', PROPS(A_04_00_01, { + author:'Sergey G. Grekhov ', + reviewer:'' +})); + +test(function () { + A_04_00_01_test('FIELDSET'); +}, 'A_04_00_01_T28', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('FONT'); +}, 'A_04_00_01_T29', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('FORM'); +}, 'A_04_00_01_T30', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('FRAME'); +}, 'A_04_00_01_T31', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('FRAMESET'); +}, 'A_04_00_01_T32', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H1'); +}, 'A_04_00_01_T33', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H2'); +}, 'A_04_00_01_T34', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H3'); +}, 'A_04_00_01_T35', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H4'); +}, 'A_04_00_01_T36', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H5'); +}, 'A_04_00_01_T37', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('H6'); +}, 'A_04_00_01_T38', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('HEAD'); +}, 'A_04_00_01_T39', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('HR'); +}, 'A_04_00_01_T40', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('HTML'); +}, 'A_04_00_01_T41', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('I'); +}, 'A_04_00_01_T42', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('IFRAME'); +}, 'A_04_00_01_T43', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('IMG'); +}, 'A_04_00_01_T44', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + + +test(function () { + A_04_00_01_test('INPUT'); +}, 'A_04_00_01_T45', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('INS'); +}, 'A_04_00_01_T46', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('ISINDEX'); +}, 'A_04_00_01_T47', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('KBD'); +}, 'A_04_00_01_T48', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('LABEL'); +}, 'A_04_00_01_T49', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('LEGEND'); +}, 'A_04_00_01_T50', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('LI'); +}, 'A_04_00_01_T51', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('LINK'); +}, 'A_04_00_01_T52', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('MAP'); +}, 'A_04_00_01_T53', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('MENU'); +}, 'A_04_00_01_T54', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('META'); +}, 'A_04_00_01_T55', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('METER'); +}, 'A_04_00_01_T55_01', PROPS(A_04_00_01, { + author:'Sergey G. Grekhov ', + reviewer:'' +})); + + +test(function () { + A_04_00_01_test('NOFRAMES'); +}, 'A_04_00_01_T56', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('NOSCRIPT'); +}, 'A_04_00_01_T57', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('OBJECT'); +}, 'A_04_00_01_T58', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('OL'); +}, 'A_04_00_01_T59', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('OPTGROUP'); +}, 'A_04_00_01_T60', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('OPTION'); +}, 'A_04_00_01_T61', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('P'); +}, 'A_04_00_01_T62', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('PARAM'); +}, 'A_04_00_01_T63', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('PRE'); +}, 'A_04_00_01_T64', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('PROGRESS'); +}, 'A_04_00_01_T64_01', PROPS(A_04_00_01, { + author:'Sergey G. Grekhov ', + reviewer:'' +})); + +test(function () { + A_04_00_01_test('Q'); +}, 'A_04_00_01_T65', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('S'); +}, 'A_04_00_01_T66', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SAMP'); +}, 'A_04_00_01_T67', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SCRIPT'); +}, 'A_04_00_01_T68', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SELECT'); +}, 'A_04_00_01_T69', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SMALL'); +}, 'A_04_00_01_T70', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SPAN'); +}, 'A_04_00_01_T71', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('STRIKE'); +}, 'A_04_00_01_T72', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('STRONG'); +}, 'A_04_00_01_T73', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('STYLE'); +}, 'A_04_00_01_T74', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SUB'); +}, 'A_04_00_01_T75', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('SUP'); +}, 'A_04_00_01_T76', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TABLE'); +}, 'A_04_00_01_T77', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TBODY'); +}, 'A_04_00_01_T78', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TD'); +}, 'A_04_00_01_T79', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TEXTAREA'); +}, 'A_04_00_01_T80', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TFOOT'); +}, 'A_04_00_01_T81', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TH'); +}, 'A_04_00_01_T82', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('THEAD'); +}, 'A_04_00_01_T83', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TITLE'); +}, 'A_04_00_01_T84', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TR'); +}, 'A_04_00_01_T85', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('TT'); +}, 'A_04_00_01_T86', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('U'); +}, 'A_04_00_01_T87', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('UL'); +}, 'A_04_00_01_T88', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + +test(function () { + A_04_00_01_test('VAR'); +}, 'A_04_00_01_T89', PROPS(A_04_00_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov , Aleksei Yu. Semenov ' +})); + + diff --git a/shadow-dom/04_00_Shadow_Trees/A_04_00_02.js b/shadow-dom/04_00_Shadow_Trees/A_04_00_02.js index 07225d9189868c..1c16479723b1da 100644 --- a/shadow-dom/04_00_Shadow_Trees/A_04_00_02.js +++ b/shadow-dom/04_00_Shadow_Trees/A_04_00_02.js @@ -1,101 +1,101 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_00_02 = { - name:'A_04_00_02', - assert:'Nodes, that are not elements, are not allowed to become shadow hosts', - link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', - highlight:'Only elements must be allowed to become shadow hosts.' -}; - -//check that 'text' node can't be used as a shadow host -test(function () { - var d = newHTMLDocument(); - var n = d.createTextNode('some text'); - d.body.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'Text node can\'t be used as shadow root'); -}, 'A_04_00_02_T01', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'comment' node can't be used as a shadow host -test(function () { - var d = newHTMLDocument(); - var n = d.createComment('comment'); - d.body.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'Comment node can\'t be used as shadow root'); -}, 'A_04_00_02_T02', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'CDATA' node can't be used as a shadow host -test(function () { - var d = newDocument(); - var n = d.createCDATASection('some data'); - d.documentElement.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'CDATA section can\'t be used as shadow root'); -}, 'A_04_00_02_T03', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'attribute' node can't be used as a shadow host -test(function () { - var d = newDocument(); - var n = d.createAttribute('attribute'); - d.documentElement.setAttributeNode(n); - assert_equals(n.createShadowRoot, undefined, 'Check that Attribute node can\'t be used as shadow root'); -}, 'A_04_00_02_T04', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'document fragment' node can't be used as a shadow host -test(function () { - var d = newDocument(); - var n = d.createDocumentFragment(); - d.documentElement.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'DocumentFragment node can\'t be used as shadow root'); -}, 'A_04_00_02_T05', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'entity reference' node can't be used as a shadow host -test(function () { - var d = newDocument(); - var n = d.createEntityReference('reference'); - d.documentElement.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'Entity Reference node can\'t be used as shadow root'); -}, 'A_04_00_02_T06', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that 'processing instruction' node can't be used as a shadow host -test(function () { - var d = newDocument(); - var n = d.createProcessingInstruction('xml', ' version = "1.0"'); - d.documentElement.appendChild(n); - assert_equals(n.createShadowRoot, undefined, 'Processing instruction node can\'t be used as shadow root'); -}, 'A_04_00_02_T07', PROPS(A_04_00_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that document can't be used as a shadow host -test(function () { - var d = newDocument(); - assert_equals(d.createShadowRoot, undefined, 'Document can\'t be used as shadow root'); -}, 'A_04_00_02_T08', PROPS(A_04_00_02, { - author:'Aleksei Yu. Semenov', -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_00_02 = { + name:'A_04_00_02', + assert:'Nodes, that are not elements, are not allowed to become shadow hosts', + link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', + highlight:'Only elements must be allowed to become shadow hosts.' +}; + +//check that 'text' node can't be used as a shadow host +test(function () { + var d = newHTMLDocument(); + var n = d.createTextNode('some text'); + d.body.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'Text node can\'t be used as shadow root'); +}, 'A_04_00_02_T01', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'comment' node can't be used as a shadow host +test(function () { + var d = newHTMLDocument(); + var n = d.createComment('comment'); + d.body.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'Comment node can\'t be used as shadow root'); +}, 'A_04_00_02_T02', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'CDATA' node can't be used as a shadow host +test(function () { + var d = newDocument(); + var n = d.createCDATASection('some data'); + d.documentElement.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'CDATA section can\'t be used as shadow root'); +}, 'A_04_00_02_T03', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'attribute' node can't be used as a shadow host +test(function () { + var d = newDocument(); + var n = d.createAttribute('attribute'); + d.documentElement.setAttributeNode(n); + assert_equals(n.createShadowRoot, undefined, 'Check that Attribute node can\'t be used as shadow root'); +}, 'A_04_00_02_T04', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'document fragment' node can't be used as a shadow host +test(function () { + var d = newDocument(); + var n = d.createDocumentFragment(); + d.documentElement.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'DocumentFragment node can\'t be used as shadow root'); +}, 'A_04_00_02_T05', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'entity reference' node can't be used as a shadow host +test(function () { + var d = newDocument(); + var n = d.createEntityReference('reference'); + d.documentElement.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'Entity Reference node can\'t be used as shadow root'); +}, 'A_04_00_02_T06', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that 'processing instruction' node can't be used as a shadow host +test(function () { + var d = newDocument(); + var n = d.createProcessingInstruction('xml', ' version = "1.0"'); + d.documentElement.appendChild(n); + assert_equals(n.createShadowRoot, undefined, 'Processing instruction node can\'t be used as shadow root'); +}, 'A_04_00_02_T07', PROPS(A_04_00_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that document can't be used as a shadow host +test(function () { + var d = newDocument(); + assert_equals(d.createShadowRoot, undefined, 'Document can\'t be used as shadow root'); +}, 'A_04_00_02_T08', PROPS(A_04_00_02, { + author:'Aleksei Yu. Semenov', +})); diff --git a/shadow-dom/04_00_Shadow_Trees/A_04_00_03.js b/shadow-dom/04_00_Shadow_Trees/A_04_00_03.js index c5ebf9cab0a143..2ac91f6243bb48 100644 --- a/shadow-dom/04_00_Shadow_Trees/A_04_00_03.js +++ b/shadow-dom/04_00_Shadow_Trees/A_04_00_03.js @@ -1,62 +1,62 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_00_03 = { - name:'A_04_00_03', - assert:'Shadow DOM subtree takes place of the shadow host\'s content when rendered', - link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', - highlight:'When rendered, the shadow tree takes place of the shadow host\'s content.' -}; - -// check that elements from shadow tree are rendered as a part of the host document -test(unit(function (ctx) { - - var d = newRenderedHTMLDocument(ctx); - var div = d.createElement('div'); - d.body.appendChild(div); - assert_true(div.offsetTop > 0, 'Expected: the host element is rendered before the check. Actual: the host element is not rendered'); - - var s = createSR(div); - var hr = d.createElement('hr'); - assert_true(hr.offsetTop == 0, 'Expected: The element to be added to shadow is not rendered before the check'); - - s.appendChild(hr); - assert_true(hr.offsetTop >= div.offsetTop, 'Expected: The element is rendered after adding to shadow tree'); - -}), 'A_04_00_03_T01', PROPS(A_04_00_03, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - - -//check that shadow root content is replaced by the shadow tree -test(unit(function (ctx) { - - var d = newRenderedHTMLDocument(ctx); - var div = d.createElement('div'); - div.innerHTML = 'Shadow Root content to be replaced'; - d.body.appendChild(div); - - assert_true(d.querySelector('#spandex').offsetTop > 0, 'Expected: The host element content is ' + - 'rendered before the check'); - - var s = createSR(div); - var hr = d.createElement('hr'); - assert_true(hr.offsetTop == 0, "Expected: The element to be added to shadow is not rendered before the check"); - - s.appendChild(hr); - assert_true(hr.offsetTop >= div.offsetTop, "Expected: The element is rendered after adding to shadow tree"); - assert_equals(d.querySelector('#spandex').offsetTop, 0, 'The shadow host element content should ' + - 'be replaced by the shadow tree'); - -}), 'A_04_00_03_T02', PROPS(A_04_00_03, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_00_03 = { + name:'A_04_00_03', + assert:'Shadow DOM subtree takes place of the shadow host\'s content when rendered', + link:'http://www.w3.org/TR/shadow-dom/#shadow-dom-subtrees', + highlight:'When rendered, the shadow tree takes place of the shadow host\'s content.' +}; + +// check that elements from shadow tree are rendered as a part of the host document +test(unit(function (ctx) { + + var d = newRenderedHTMLDocument(ctx); + var div = d.createElement('div'); + d.body.appendChild(div); + assert_true(div.offsetTop > 0, 'Expected: the host element is rendered before the check. Actual: the host element is not rendered'); + + var s = createSR(div); + var hr = d.createElement('hr'); + assert_true(hr.offsetTop == 0, 'Expected: The element to be added to shadow is not rendered before the check'); + + s.appendChild(hr); + assert_true(hr.offsetTop >= div.offsetTop, 'Expected: The element is rendered after adding to shadow tree'); + +}), 'A_04_00_03_T01', PROPS(A_04_00_03, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + + +//check that shadow root content is replaced by the shadow tree +test(unit(function (ctx) { + + var d = newRenderedHTMLDocument(ctx); + var div = d.createElement('div'); + div.innerHTML = 'Shadow Root content to be replaced'; + d.body.appendChild(div); + + assert_true(d.querySelector('#spandex').offsetTop > 0, 'Expected: The host element content is ' + + 'rendered before the check'); + + var s = createSR(div); + var hr = d.createElement('hr'); + assert_true(hr.offsetTop == 0, "Expected: The element to be added to shadow is not rendered before the check"); + + s.appendChild(hr); + assert_true(hr.offsetTop >= div.offsetTop, "Expected: The element is rendered after adding to shadow tree"); + assert_equals(d.querySelector('#spandex').offsetTop, 0, 'The shadow host element content should ' + + 'be replaced by the shadow tree'); + +}), 'A_04_00_03_T02', PROPS(A_04_00_03, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' })); \ No newline at end of file diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_01.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_01.js index 69bbe8ac656c40..7b1c040a87c9fb 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_01.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_01.js @@ -1,174 +1,174 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_01 = { - name:'A_04_01_01', - assert:'Upper-boundary encapsulation:' + - 'The ownerDocument property of all nodes in shadow tree refers to the document of the shadow host', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The ownerDocument property refers to the document of the shadow host' -}; - - -A_04_01_01.checkOwnerDocument = function (node, expectedOwnerDocument){ - assert_equals(node.ownerDocument, expectedOwnerDocument, 'node '+node.nodeName+' ownerDocument is not correct'); - - var i; - for (i=0; i', - reviewer:'Mikhail Fursov ' -})); - -// shadow host: elements with different depth in the original document -test(function () { - var d = newHTMLDocument(); - - var e1 = d.createElement('div'); - d.body.appendChild(e1); - var s1 = createSR(e1); - assert_equals(s1.ownerDocument, d, 'Check for a simple element at depth 1 [div]'); - - - var e2 = d.createElement('h1'); - e1.appendChild(e2); - var s2 = createSR(e2); - assert_equals(s2.ownerDocument, d, 'Check for a simple element at depth 2: [div.h1]'); - - var e3 = d.createElement('script'); - e2.appendChild(e3); - var s3 = createSR(e3); - assert_equals(s3.ownerDocument, d, 'Check for a simple element at depth 3: [div.h1.script]'); - -}, 'A_04_01_01_T02', PROPS(A_04_01_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - - -// check that element added to shadow tree automatically gets -// valid owner document -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e = d.createElement('div'); - e = s.appendChild(e); - assert_equals(e.ownerDocument, d, 'the ownerDocument of a node in a shadow tree must refer ' + - 'to the document of the shadow host'); - -}, 'A_04_01_01_T03', PROPS(A_04_01_01, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// shadow tree node: created by different document -test(function () { - var d1 = newHTMLDocument(); - var d2 = newHTMLDocument(); - - var s = createSR(d1.body); - var e = d2.createElement('div'); - e = s.appendChild(e); - - assert_equals(e.ownerDocument, d1, 'the ownerDocument of an adopted node in a shadow tree ' + - 'must refer to the document of the shadow host'); - -}, 'A_04_01_01_T04', PROPS(A_04_01_01, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that all children nodes of shadow root -// get valid owner document when added to shadow tree -test(function () { - var d1 = newHTMLDocument(); - var d2 = newHTMLDocument(); - var s = createSR(d1.body); - - var e1 = d2.createElement('div'); - var e2 = d2.createElement('div'); - - e1.appendChild(e2); - s.appendChild(e1); - - assert_equals(e2.ownerDocument, d1, 'the ownerDocument of an adopted node child nodes ' + - 'in a shadow tree must refer to the document of the shadow host'); - - A_04_01_01.checkOwnerDocument(e1, d1); - -}, 'A_04_01_01_T05', PROPS(A_04_01_01, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov' -})); - -// check that parent element of shadow node still refer to the -// original owner document -test(function () { - var d1 = newHTMLDocument(); - var d2 = newHTMLDocument(); - var s = createSR(d1.body); - - var e1 = d2.createElement('div'); - var e2 = d2.createElement('div'); - - e1.appendChild(e2); - s.appendChild(e2); - - assert_equals(e1.ownerDocument, d2, 'the ownerDocument of an adopted node parent node in a shadow tree ' + - 'must refer to the original document'); - -}, 'A_04_01_01_T06', PROPS(A_04_01_01, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -// shadow tree: any HTML5 element -test(function(){ - var i; - for (i=0; i', + reviewer:'Mikhail Fursov ' +})); + +// shadow host: elements with different depth in the original document +test(function () { + var d = newHTMLDocument(); + + var e1 = d.createElement('div'); + d.body.appendChild(e1); + var s1 = createSR(e1); + assert_equals(s1.ownerDocument, d, 'Check for a simple element at depth 1 [div]'); + + + var e2 = d.createElement('h1'); + e1.appendChild(e2); + var s2 = createSR(e2); + assert_equals(s2.ownerDocument, d, 'Check for a simple element at depth 2: [div.h1]'); + + var e3 = d.createElement('script'); + e2.appendChild(e3); + var s3 = createSR(e3); + assert_equals(s3.ownerDocument, d, 'Check for a simple element at depth 3: [div.h1.script]'); + +}, 'A_04_01_01_T02', PROPS(A_04_01_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + + +// check that element added to shadow tree automatically gets +// valid owner document +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e = d.createElement('div'); + e = s.appendChild(e); + assert_equals(e.ownerDocument, d, 'the ownerDocument of a node in a shadow tree must refer ' + + 'to the document of the shadow host'); + +}, 'A_04_01_01_T03', PROPS(A_04_01_01, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// shadow tree node: created by different document +test(function () { + var d1 = newHTMLDocument(); + var d2 = newHTMLDocument(); + + var s = createSR(d1.body); + var e = d2.createElement('div'); + e = s.appendChild(e); + + assert_equals(e.ownerDocument, d1, 'the ownerDocument of an adopted node in a shadow tree ' + + 'must refer to the document of the shadow host'); + +}, 'A_04_01_01_T04', PROPS(A_04_01_01, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that all children nodes of shadow root +// get valid owner document when added to shadow tree +test(function () { + var d1 = newHTMLDocument(); + var d2 = newHTMLDocument(); + var s = createSR(d1.body); + + var e1 = d2.createElement('div'); + var e2 = d2.createElement('div'); + + e1.appendChild(e2); + s.appendChild(e1); + + assert_equals(e2.ownerDocument, d1, 'the ownerDocument of an adopted node child nodes ' + + 'in a shadow tree must refer to the document of the shadow host'); + + A_04_01_01.checkOwnerDocument(e1, d1); + +}, 'A_04_01_01_T05', PROPS(A_04_01_01, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov' +})); + +// check that parent element of shadow node still refer to the +// original owner document +test(function () { + var d1 = newHTMLDocument(); + var d2 = newHTMLDocument(); + var s = createSR(d1.body); + + var e1 = d2.createElement('div'); + var e2 = d2.createElement('div'); + + e1.appendChild(e2); + s.appendChild(e2); + + assert_equals(e1.ownerDocument, d2, 'the ownerDocument of an adopted node parent node in a shadow tree ' + + 'must refer to the original document'); + +}, 'A_04_01_01_T06', PROPS(A_04_01_01, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +// shadow tree: any HTML5 element +test(function(){ + var i; + for (i=0; i', - reviewer:'Mikhail Fursov ' -})); - -// check that 'head' accessor is not exposed -// when added to shadow tree -test(function () { - var d1 = newHTMLDocument(); - var d2 = newHTMLDocument(); - var s = createSR(d1.documentElement); - - assert_not_equals(d2.head, null, 'initial DOM model state check failed!'); - var d2_head = d2.head; - - // now add head (with title) - s.appendChild(d2.head); - - assert_not_equals(d1.head, d2_head, '"head" in shadow DOM must not be exposed ' + - 'via the "document.head" DOM accessor'); - - assert_equals(d2.title, '', '"title" text in shadow DOM must not be ' + - 'exposed via "document.title" DOM accessor'); - -}, 'A_04_01_02_T02', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that element is not exposed via 'all' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - allLengthBefore = d.all.length; - e = d.createElement('br'); - d.body.appendChild(e); - assert_true(d.all.length>allLengthBefore, 'The element should be accessible before test'); - - s.appendChild(e); - - assert_equals(d.all.length, allLengthBefore, 'elements in shadow DOM must not ' + - 'be exposed via the "document.all" DOM accessor'); - -}, 'A_04_01_02_T03', PROPS(A_04_01_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -// check that element is not exposed via 'anchors' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('a'); - e.setAttribute('name', 'x'); - d.body.appendChild(e); - assert_true(d.anchors.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - - assert_equals(d.anchors.length, 0, - '"a" elements with "name" attributes in shadow DOM must not ' + - 'be exposed via the "document.anchors" DOM accessor'); - -}, 'A_04_01_02_T04', PROPS(A_04_01_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -// check that element is not exposed via 'applets' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('applet'); - d.body.appendChild(e); - assert_true(d.applets.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.applets.length, 0, - '"applets" elements in shadow DOM must not ' + - 'be exposed via the "document.applets" DOM accessor'); - - -}, 'A_04_01_02_T05', PROPS(A_04_01_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -// check that element is not exposed via 'embeds' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('embed'); - d.body.appendChild(e); - assert_true(d.embeds.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.embeds.length, 0, '"embeds" in shadow DOM must not be exposed via the ' + - '"document.embeds" DOM accessor'); - -}, 'A_04_01_02_T06', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that element is not exposed via 'forms' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('form'); - d.body.appendChild(e); - assert_true(d.forms.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.forms.length, 0, '"form" elements in shadow DOM must not be exposed via the ' + - 'document.forms DOM accessor'); - -}, 'A_04_01_02_T07', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that element is not exposed via 'images' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - var e = d.createElement('img'); - d.body.appendChild(e); - assert_true(d.images.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.images.length, 0, '"images" in shadow DOM must not be exposed via the ' + - '"document.images" DOM accessor'); - -}, 'A_04_01_02_T08', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -// check that 'a' element is not exposed via 'links' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('a'); - e.setAttribute('href', 'http://www.w3.org/'); - d.body.appendChild(e); - assert_true(d.links.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.links.length, 0, '"a" elements with "href" attributes in shadow DOM must not ' + - 'be exposed via the "document.links" DOM accessor'); - - -}, 'A_04_01_02_T09', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that 'area' element is not exposed via 'links' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('area'); - e.setAttribute('href', 'http://www.w3.org/'); - d.body.appendChild(e); - assert_true(d.links.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.links.length, 0, '"area" elements with href attributes in shadow DOM must ' + - 'not be exposed via the "document.links" DOM accessor'); - -}, 'A_04_01_02_T10', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -// check that element is not exposed via 'scripts' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('script'); - d.head.appendChild(e); - assert_true(d.scripts.length>0, 'The element should be accessible before test'); - - s.appendChild(e); - - assert_equals(d.scripts.length, 0, '"script" elements in shadow DOM must not be exposed via ' + - 'the "document.scripts" DOM accessor'); - -}, 'A_04_01_02_T11', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -// check that element is not exposed via 'getElementByName' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('div'); - e.setAttribute('name', 'bob'); - s.appendChild(e); - assert_equals(d.getElementsByName('bob').length, 0, 'elements (like "div") in shadow DOM ' + - 'must not be exposed via the getElementsByName DOM accessor'); - -}, 'A_04_01_02_T12_01', PROPS(A_04_01_02, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -// check that element is not exposed via 'getElementByTagName' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('div'); - e.setAttribute('name', 'bob'); - d.body.appendChild(e); - assert_true(d.getElementsByTagName('div').length > 0, 'The element should be accessible before test'); - - s.appendChild(e); - - assert_equals(d.getElementsByTagName('div').length, 0, 'elements (like "div") in shadow DOM ' + - 'must not be exposed via the getElementsByTagName DOM accessor'); - -}, 'A_04_01_02_T12_02', PROPS(A_04_01_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - - -// check that element is not exposed via 'getElementByClassName' accessor -// when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElement('div'); - e.setAttribute('name', 'bob'); - e.setAttribute('class', 'clazz'); - d.body.appendChild(e); - assert_true(d.getElementsByClassName('clazz').length > 0, 'The element should be accessible before test'); - - s.appendChild(e); - assert_equals(d.getElementsByClassName('clazz').length, 0, 'elements (like "div") in shadow DOM ' + - 'must not be exposed via the getElementsByClassName DOM accessor'); - -}, 'A_04_01_02_T12_03', PROPS(A_04_01_02, { - author:'Mikhail Fursov ', - reviewer:'Sergey G. Grekhov ' -})); - -//check that element is not exposed via 'getElementByTagNameNS' accessor -//when added to shadow tree -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.documentElement); - - e = d.createElementNS('http://www.w3c.org/namespace','div'); - d.body.appendChild(e); - assert_true(d.getElementsByTagNameNS('http://www.w3c.org/namespace','div').length > 0, 'The element should be accessible before test'); - - s.appendChild(e); - - assert_equals(d.getElementsByTagNameNS('http://www.w3c.org/namespace','div').length, 0, 'elements (like "div") in shadow DOM ' + - 'must not be exposed via the getElementsByTagNameNS DOM accessor'); - -}, 'A_04_01_02_T12_04', PROPS(A_04_01_02, { - author:'Aleksei Yu. Semenov ' +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_02 = { + name:'A_04_01_02', + assert:'Upper-boundary encapsulation: ' + + 'The shadow nodes and named shadow elements are not accessible using shadow host\'s ' + + 'document DOM tree accessors', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The nodes and named elements are not accessible using shadow host\'s document DOM tree accessors' +}; + +// check that 'body' accessor is not exposed +// when added to shadow tree +test(function () { + var d1 = newHTMLDocument(); + var d2 = newHTMLDocument(); + + var s = createSR(d1.documentElement); + + assert_not_equals(d2.body, null, 'initial DOM model state check failed!'); + var d2_body = d2.body; // remember the reference to d2.body + // now add body to shadow tree + s.appendChild(d2.body); + + assert_not_equals(d1.body, d2_body, '"body" in shadow DOM must not be exposed ' + + 'via the "document.body" DOM accessor'); + +}, 'A_04_01_02_T01', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that 'head' accessor is not exposed +// when added to shadow tree +test(function () { + var d1 = newHTMLDocument(); + var d2 = newHTMLDocument(); + var s = createSR(d1.documentElement); + + assert_not_equals(d2.head, null, 'initial DOM model state check failed!'); + var d2_head = d2.head; + + // now add head (with title) + s.appendChild(d2.head); + + assert_not_equals(d1.head, d2_head, '"head" in shadow DOM must not be exposed ' + + 'via the "document.head" DOM accessor'); + + assert_equals(d2.title, '', '"title" text in shadow DOM must not be ' + + 'exposed via "document.title" DOM accessor'); + +}, 'A_04_01_02_T02', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that element is not exposed via 'all' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + allLengthBefore = d.all.length; + e = d.createElement('br'); + d.body.appendChild(e); + assert_true(d.all.length>allLengthBefore, 'The element should be accessible before test'); + + s.appendChild(e); + + assert_equals(d.all.length, allLengthBefore, 'elements in shadow DOM must not ' + + 'be exposed via the "document.all" DOM accessor'); + +}, 'A_04_01_02_T03', PROPS(A_04_01_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +// check that element is not exposed via 'anchors' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('a'); + e.setAttribute('name', 'x'); + d.body.appendChild(e); + assert_true(d.anchors.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + + assert_equals(d.anchors.length, 0, + '"a" elements with "name" attributes in shadow DOM must not ' + + 'be exposed via the "document.anchors" DOM accessor'); + +}, 'A_04_01_02_T04', PROPS(A_04_01_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +// check that element is not exposed via 'applets' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('applet'); + d.body.appendChild(e); + assert_true(d.applets.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.applets.length, 0, + '"applets" elements in shadow DOM must not ' + + 'be exposed via the "document.applets" DOM accessor'); + + +}, 'A_04_01_02_T05', PROPS(A_04_01_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +// check that element is not exposed via 'embeds' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('embed'); + d.body.appendChild(e); + assert_true(d.embeds.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.embeds.length, 0, '"embeds" in shadow DOM must not be exposed via the ' + + '"document.embeds" DOM accessor'); + +}, 'A_04_01_02_T06', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that element is not exposed via 'forms' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('form'); + d.body.appendChild(e); + assert_true(d.forms.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.forms.length, 0, '"form" elements in shadow DOM must not be exposed via the ' + + 'document.forms DOM accessor'); + +}, 'A_04_01_02_T07', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that element is not exposed via 'images' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + var e = d.createElement('img'); + d.body.appendChild(e); + assert_true(d.images.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.images.length, 0, '"images" in shadow DOM must not be exposed via the ' + + '"document.images" DOM accessor'); + +}, 'A_04_01_02_T08', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +// check that 'a' element is not exposed via 'links' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('a'); + e.setAttribute('href', 'http://www.w3.org/'); + d.body.appendChild(e); + assert_true(d.links.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.links.length, 0, '"a" elements with "href" attributes in shadow DOM must not ' + + 'be exposed via the "document.links" DOM accessor'); + + +}, 'A_04_01_02_T09', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that 'area' element is not exposed via 'links' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('area'); + e.setAttribute('href', 'http://www.w3.org/'); + d.body.appendChild(e); + assert_true(d.links.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.links.length, 0, '"area" elements with href attributes in shadow DOM must ' + + 'not be exposed via the "document.links" DOM accessor'); + +}, 'A_04_01_02_T10', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +// check that element is not exposed via 'scripts' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('script'); + d.head.appendChild(e); + assert_true(d.scripts.length>0, 'The element should be accessible before test'); + + s.appendChild(e); + + assert_equals(d.scripts.length, 0, '"script" elements in shadow DOM must not be exposed via ' + + 'the "document.scripts" DOM accessor'); + +}, 'A_04_01_02_T11', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +// check that element is not exposed via 'getElementByName' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('div'); + e.setAttribute('name', 'bob'); + s.appendChild(e); + assert_equals(d.getElementsByName('bob').length, 0, 'elements (like "div") in shadow DOM ' + + 'must not be exposed via the getElementsByName DOM accessor'); + +}, 'A_04_01_02_T12_01', PROPS(A_04_01_02, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +// check that element is not exposed via 'getElementByTagName' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('div'); + e.setAttribute('name', 'bob'); + d.body.appendChild(e); + assert_true(d.getElementsByTagName('div').length > 0, 'The element should be accessible before test'); + + s.appendChild(e); + + assert_equals(d.getElementsByTagName('div').length, 0, 'elements (like "div") in shadow DOM ' + + 'must not be exposed via the getElementsByTagName DOM accessor'); + +}, 'A_04_01_02_T12_02', PROPS(A_04_01_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + + +// check that element is not exposed via 'getElementByClassName' accessor +// when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElement('div'); + e.setAttribute('name', 'bob'); + e.setAttribute('class', 'clazz'); + d.body.appendChild(e); + assert_true(d.getElementsByClassName('clazz').length > 0, 'The element should be accessible before test'); + + s.appendChild(e); + assert_equals(d.getElementsByClassName('clazz').length, 0, 'elements (like "div") in shadow DOM ' + + 'must not be exposed via the getElementsByClassName DOM accessor'); + +}, 'A_04_01_02_T12_03', PROPS(A_04_01_02, { + author:'Mikhail Fursov ', + reviewer:'Sergey G. Grekhov ' +})); + +//check that element is not exposed via 'getElementByTagNameNS' accessor +//when added to shadow tree +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.documentElement); + + e = d.createElementNS('http://www.w3c.org/namespace','div'); + d.body.appendChild(e); + assert_true(d.getElementsByTagNameNS('http://www.w3c.org/namespace','div').length > 0, 'The element should be accessible before test'); + + s.appendChild(e); + + assert_equals(d.getElementsByTagNameNS('http://www.w3c.org/namespace','div').length, 0, 'elements (like "div") in shadow DOM ' + + 'must not be exposed via the getElementsByTagNameNS DOM accessor'); + +}, 'A_04_01_02_T12_04', PROPS(A_04_01_02, { + author:'Aleksei Yu. Semenov ' })); \ No newline at end of file diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_03.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_03.js index 411bc6272b94e8..09bf2ace0cc2ab 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_03.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_03.js @@ -1,102 +1,102 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_03 = { - name:'A_04_01_03', - assert:'Upper-boundary encapsulation: ' + - 'The nodes and named elements are not accessible with Window object named properties', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'[[The nodes and named elements are not accessible]] using shadow host\'s ' + - 'document DOM tree accessors or [[with Window object named properties]]', - bug: ['https://bugs.webkit.org/show_bug.cgi?id=105617'] - -}; - -// check that 'a', 'applet', 'area', 'embed', 'form', 'frame', -// 'frameset', 'iframe', 'img' and 'object' named elements do not -// appear in window object named properties -test(unit(function (ctx) { - var f = newIFrame(ctx); - var d = f.contentWindow.document; - - var div = d.createElement('div'); - d.body.appendChild(div); - var s = createSR(div); - - //Window named properties - var namedElements = ['a', 'applet', 'area', 'embed', 'form', 'frame', - 'frameset', 'iframe','img', 'object']; - - namedElements.forEach(function (tagName) { - var element = d.createElement(tagName); - element.name = 'named_' + tagName; - d.body.appendChild(element); - - s.appendChild(element); - - assert_false(element.name in f.contentWindow, - 'Point 1: named "' + tagName + '" must not appear in window object named properties'); - - assert_false(element.name in d, - 'Point 2: named "' + tagName + '" must not appear in document object named properties'); - }); -}), 'A_04_01_03_T01', PROPS(A_04_01_03, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check that element with ID does not appear in window object named properties -test(unit(function (ctx) { - var f = newIFrame(ctx); - var d = f.contentWindow.document; - - var div1 = d.createElement('div'); - d.body.appendChild(div1); - var s = createSR(div1); - - var div2 = d.createElement('div'); - div2.id = 'divWithId'; - d.body.appendChild(div2); - - s.appendChild(div2); - - assert_false('divWithId' in f.contentWindow, - 'DIV element with ID must not appear in window object named properties'); - -}), 'A_04_01_03_T2', PROPS(A_04_01_03, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -//check that any HTML5 element with ID does not appear in window object named properties -test(unit(function (ctx) { - var f = newIFrame(ctx); - var d = f.contentWindow.document; - var s = createSR(d.documentElement); - - var i; - for (i=0; i' -})); - - - +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_03 = { + name:'A_04_01_03', + assert:'Upper-boundary encapsulation: ' + + 'The nodes and named elements are not accessible with Window object named properties', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'[[The nodes and named elements are not accessible]] using shadow host\'s ' + + 'document DOM tree accessors or [[with Window object named properties]]', + bug: ['https://bugs.webkit.org/show_bug.cgi?id=105617'] + +}; + +// check that 'a', 'applet', 'area', 'embed', 'form', 'frame', +// 'frameset', 'iframe', 'img' and 'object' named elements do not +// appear in window object named properties +test(unit(function (ctx) { + var f = newIFrame(ctx); + var d = f.contentWindow.document; + + var div = d.createElement('div'); + d.body.appendChild(div); + var s = createSR(div); + + //Window named properties + var namedElements = ['a', 'applet', 'area', 'embed', 'form', 'frame', + 'frameset', 'iframe','img', 'object']; + + namedElements.forEach(function (tagName) { + var element = d.createElement(tagName); + element.name = 'named_' + tagName; + d.body.appendChild(element); + + s.appendChild(element); + + assert_false(element.name in f.contentWindow, + 'Point 1: named "' + tagName + '" must not appear in window object named properties'); + + assert_false(element.name in d, + 'Point 2: named "' + tagName + '" must not appear in document object named properties'); + }); +}), 'A_04_01_03_T01', PROPS(A_04_01_03, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check that element with ID does not appear in window object named properties +test(unit(function (ctx) { + var f = newIFrame(ctx); + var d = f.contentWindow.document; + + var div1 = d.createElement('div'); + d.body.appendChild(div1); + var s = createSR(div1); + + var div2 = d.createElement('div'); + div2.id = 'divWithId'; + d.body.appendChild(div2); + + s.appendChild(div2); + + assert_false('divWithId' in f.contentWindow, + 'DIV element with ID must not appear in window object named properties'); + +}), 'A_04_01_03_T2', PROPS(A_04_01_03, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +//check that any HTML5 element with ID does not appear in window object named properties +test(unit(function (ctx) { + var f = newIFrame(ctx); + var d = f.contentWindow.document; + var s = createSR(d.documentElement); + + var i; + for (i=0; i' +})); + + + diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_04.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_04.js index e7a673b83d6cbd..853d1599faca3e 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_04.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_04.js @@ -1,135 +1,135 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_04 = { - name:'A_04_01_04', - assert:'Upper-boundary encapsulation: ' + - 'The shadow tree nodes are not present the document\'s NodeList, HTMLCollection or DOMElementMap collection instances', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The nodes are not present in any of the document\'s NodeList, HTMLCollection, ' + - 'or DOMElementMap instances' -}; - -// check node list returned by getElementsByTagName method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var span = d.createElement('span'); - d.body.appendChild(span); - s.appendChild(span); - - var nodeList = d.getElementsByTagName('span'); - assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.getElementsByTagName'); - -}, 'A_04_01_04_T01', PROPS(A_04_01_04, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check node list returned by getElementsByTagNameNS method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var span = d.createElement('span'); - d.body.appendChild(span); - s.appendChild(span); - - // getElementsByTagNameNS - var nodeList = d.getElementsByTagNameNS('*', 'span'); - assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.getElementsByTagNameNS'); - -}, 'A_04_01_04_T02', PROPS(A_04_01_04, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check node list returned by getElementsByClassName method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var span = d.createElement('span'); - span.setAttribute('class', 'shadowy'); - d.body.appendChild(span); - - s.appendChild(span); - - var nodeList = d.getElementsByClassName('shadowy'); - assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.getElementsByClassName'); - -}, 'A_04_01_04_T03', PROPS(A_04_01_04, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check node list returned by querySelectorAll method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var span = d.createElement('span'); - - // querySelectorAll - span.setAttribute('id', 'span_id'); - span.setAttribute('class', 'span_class'); - d.body.appendChild(span); - - s.appendChild(span); - - var nodeList1 = d.querySelectorAll('#span_id'); - assert_equals(nodeList1.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.querySelectorAll by their id'); - - var nodeList2 = d.querySelectorAll('.span_class'); - assert_equals(nodeList2.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.querySelectorAll by their class name'); - - var nodeList3 = d.querySelectorAll('span'); - assert_equals(nodeList3.length, 0, 'elements in shadow DOM must not be exposed via ' + - 'document.querySelectorAll by their tag name'); - -}, 'A_04_01_04_T04', PROPS(A_04_01_04, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check for HTMLCollection content -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var htmlCollections = ['anchors', 'links', 'embeds', 'forms', 'images', 'links', 'plugins','scripts']; - var htmlCollectionsElements = ['a', 'a', 'embed', 'form', 'img', 'area', 'embed', 'script']; - var cnt = 0; - htmlCollectionsElements.forEach(function (tagName) { - var e = d.createElement(tagName); - if (tagName=='a' || tagName=='area'){ - e.setAttribute('href', 'http://www.w3.org/'); - } - d.body.appendChild(e); - - s.appendChild(e); - var collection = null; - collection = d[htmlCollections[cnt]]; - if (collection) { - assert_equals(collection.length, 0, 'Elements in shadow DOM must not be exposed via ' + - 'document.' + htmlCollections[cnt] + ' collection cnt:'+cnt); - } - cnt++; - }); -}, 'A_04_01_04_T05', PROPS(A_04_01_04, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_04 = { + name:'A_04_01_04', + assert:'Upper-boundary encapsulation: ' + + 'The shadow tree nodes are not present the document\'s NodeList, HTMLCollection or DOMElementMap collection instances', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The nodes are not present in any of the document\'s NodeList, HTMLCollection, ' + + 'or DOMElementMap instances' +}; + +// check node list returned by getElementsByTagName method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var span = d.createElement('span'); + d.body.appendChild(span); + s.appendChild(span); + + var nodeList = d.getElementsByTagName('span'); + assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.getElementsByTagName'); + +}, 'A_04_01_04_T01', PROPS(A_04_01_04, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check node list returned by getElementsByTagNameNS method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var span = d.createElement('span'); + d.body.appendChild(span); + s.appendChild(span); + + // getElementsByTagNameNS + var nodeList = d.getElementsByTagNameNS('*', 'span'); + assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.getElementsByTagNameNS'); + +}, 'A_04_01_04_T02', PROPS(A_04_01_04, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check node list returned by getElementsByClassName method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var span = d.createElement('span'); + span.setAttribute('class', 'shadowy'); + d.body.appendChild(span); + + s.appendChild(span); + + var nodeList = d.getElementsByClassName('shadowy'); + assert_equals(nodeList.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.getElementsByClassName'); + +}, 'A_04_01_04_T03', PROPS(A_04_01_04, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check node list returned by querySelectorAll method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var span = d.createElement('span'); + + // querySelectorAll + span.setAttribute('id', 'span_id'); + span.setAttribute('class', 'span_class'); + d.body.appendChild(span); + + s.appendChild(span); + + var nodeList1 = d.querySelectorAll('#span_id'); + assert_equals(nodeList1.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.querySelectorAll by their id'); + + var nodeList2 = d.querySelectorAll('.span_class'); + assert_equals(nodeList2.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.querySelectorAll by their class name'); + + var nodeList3 = d.querySelectorAll('span'); + assert_equals(nodeList3.length, 0, 'elements in shadow DOM must not be exposed via ' + + 'document.querySelectorAll by their tag name'); + +}, 'A_04_01_04_T04', PROPS(A_04_01_04, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check for HTMLCollection content +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var htmlCollections = ['anchors', 'links', 'embeds', 'forms', 'images', 'links', 'plugins','scripts']; + var htmlCollectionsElements = ['a', 'a', 'embed', 'form', 'img', 'area', 'embed', 'script']; + var cnt = 0; + htmlCollectionsElements.forEach(function (tagName) { + var e = d.createElement(tagName); + if (tagName=='a' || tagName=='area'){ + e.setAttribute('href', 'http://www.w3.org/'); + } + d.body.appendChild(e); + + s.appendChild(e); + var collection = null; + collection = d[htmlCollections[cnt]]; + if (collection) { + assert_equals(collection.length, 0, 'Elements in shadow DOM must not be exposed via ' + + 'document.' + htmlCollections[cnt] + ' collection cnt:'+cnt); + } + cnt++; + }); +}, 'A_04_01_04_T05', PROPS(A_04_01_04, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' })); \ No newline at end of file diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_05.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_05.js index 66cd404560e06b..21454af1c8e3d3 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_05.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_05.js @@ -1,73 +1,73 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_05 = { - name:'A_04_01_05', - assert:'Upper-boundary encapsulation:' + - 'The nodes with a unique id and named elements are not addressable ' + - 'from any attributes of elements in shadow host\'s document', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The nodes with a unique id and named elements are not addressable from ' + - 'any attributes of elements in shadow host\'s document' -}; - -// check label.for attribute -test(function () { - var d = newHTMLDocument(); - var div = d.createElement('div'); - d.body.appendChild(div); - var s = createSR(div); - - // node in shadow with id - var input = d.createElement('input'); - input.setAttribute('type', 'text'); - input.setAttribute('id', 'input_id'); - d.body.appendChild(input); - s.appendChild(input); - - // node in host with a reference to host element with id - var label = d.createElement('label'); - label.setAttribute('for', 'input_id'); - d.body.appendChild(label); - - assert_equals(label.control, null, 'Elements in shadow DOM must not be accessible from ' + - 'owner\'s document label.for attribute'); - -}, 'A_04_01_05_T01', PROPS(A_04_01_05, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check form associated elements -test(function () { - - HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) { - var d = newHTMLDocument(); - var div = d.createElement('div'); - d.body.appendChild(div); - var s = createSR(div); - - var form = d.createElement('form'); - form.setAttribute('id', 'form_id'); - d.body.appendChild(form); - - var el = d.createElement(tagName); - el.setAttribute('form', 'form_id'); - d.body.appendChild(el); - - s.appendChild(form); - - assert_equals(el.form, null, 'Elements in shadow DOM must not be accessible from ' + - 'owner\'s document ' + tagName + '.form attribute'); - }); -}, 'A_04_01_05_T02', PROPS(A_04_01_05, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_05 = { + name:'A_04_01_05', + assert:'Upper-boundary encapsulation:' + + 'The nodes with a unique id and named elements are not addressable ' + + 'from any attributes of elements in shadow host\'s document', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The nodes with a unique id and named elements are not addressable from ' + + 'any attributes of elements in shadow host\'s document' +}; + +// check label.for attribute +test(function () { + var d = newHTMLDocument(); + var div = d.createElement('div'); + d.body.appendChild(div); + var s = createSR(div); + + // node in shadow with id + var input = d.createElement('input'); + input.setAttribute('type', 'text'); + input.setAttribute('id', 'input_id'); + d.body.appendChild(input); + s.appendChild(input); + + // node in host with a reference to host element with id + var label = d.createElement('label'); + label.setAttribute('for', 'input_id'); + d.body.appendChild(label); + + assert_equals(label.control, null, 'Elements in shadow DOM must not be accessible from ' + + 'owner\'s document label.for attribute'); + +}, 'A_04_01_05_T01', PROPS(A_04_01_05, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check form associated elements +test(function () { + + HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) { + var d = newHTMLDocument(); + var div = d.createElement('div'); + d.body.appendChild(div); + var s = createSR(div); + + var form = d.createElement('form'); + form.setAttribute('id', 'form_id'); + d.body.appendChild(form); + + var el = d.createElement(tagName); + el.setAttribute('form', 'form_id'); + d.body.appendChild(el); + + s.appendChild(form); + + assert_equals(el.form, null, 'Elements in shadow DOM must not be accessible from ' + + 'owner\'s document ' + tagName + '.form attribute'); + }); +}, 'A_04_01_05_T02', PROPS(A_04_01_05, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_06.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_06.js index f6eb0b4ba9a34b..76fc1b99d471d6 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_06.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_06.js @@ -1,221 +1,221 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_06 = { - name:'A_04_01_06', - assert:'Upper-boundary encapsulation: ' + - 'The nodes are accessible using shadow root\'s DOM tree accessor methods', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'[[The nodes are accessible using shadow root\'s DOM tree accessor methods]]' + - '[\\s\\S]*[[For convenience, the shadow root provides its own set of DOM tree accessor methods.]]' -}; - -// getElementsByTagName accessor -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - var e = d.createElement('img'); - s.appendChild(e); - - assert_equals(s.getElementsByTagName('img').length, 1, 'elementsin shadow DOM must be accessible via the ' + - 'shadow root .getElementsByTagName DOM accessor'); - -}, 'A_04_01_06_T01', PROPS(A_04_01_06, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// getElementsByTagNameNS accessor -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - var e = d.createElement('img'); - s.appendChild(e); - - assert_equals(s.getElementsByTagNameNS('*', 'img').length, 1, - 'elements in shadow DOM must be accessible via the ' + - 'shadow root .getElementsByTagNameNS DOM accessor'); - -}, 'A_04_01_06_T02', PROPS(A_04_01_06, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// getElementsByClassName accessor -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - e = d.createElement('div'); - e.setAttribute('class', 'div_class'); - s.appendChild(e); - assert_equals(s.getElementsByClassName('div_class').length, 1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .getElementsByClassName DOM accessor'); - -}, 'A_04_01_06_T03', PROPS(A_04_01_06, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// getElementById accessor -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - e = d.createElement('span'); - e.setAttribute('id', 'span_id'); - s.appendChild(e); - assert_equals(s.getElementById('span_id'), e, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .getElementById DOM accessor'); - -}, 'A_04_01_06_T04', PROPS(A_04_01_06, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -// querySelector accessor -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('span'); - e1.setAttribute('id', 'span_id'); - s.appendChild(e1); - - var e2 = d.createElement('div'); - e2.setAttribute('class', 'div_class'); - e1.appendChild(e2); - - var id_res = s.querySelector("#span_id"); - assert_equals(id_res, e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelector DOM accessor (by id)'); - - var elem_res = s.querySelector("span"); - assert_equals(elem_res, e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelector DOM accessor (by element)'); - - var class_res = s.querySelector(".div_class"); - assert_equals(class_res, e2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelector DOM accessor (by class name)'); - -}, 'A_04_01_06_T05', PROPS(A_04_01_06, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -// querySelectorAll accessor by element type -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('span'); - s.appendChild(e1); - - var e2 = d.createElement('span'); - e1.appendChild(e2); - - var res = s.querySelectorAll("span"); - assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (by element type)'); - - assert_true(res.item(0) == e1 || res.item(1) == e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e1 by element type)'); - - assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e2 by element type)'); - - -}, 'A_04_01_06_T06', PROPS(A_04_01_06, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - - -// querySelectorAll accessor with attribute value -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('span'); - e1.setAttribute('test', 'span_id'); - s.appendChild(e1); - - var e2 = d.createElement('span'); - e2.setAttribute('test', 'span_id'); - e1.appendChild(e2); - - var res = s.querySelectorAll("[test=span_id]"); - assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (by attribute value)'); - - assert_true(res.item(0) == e1 || res.item(1) == e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e1 by attribute value)'); - - assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e2 by attribute value)'); - - -}, 'A_04_01_06_T07', PROPS(A_04_01_06, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -// querySelectorAll accessor for class -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('div'); - e1.setAttribute('class', 'div_class'); - s.appendChild(e1); - - var e2 = d.createElement('div'); - e2.setAttribute('class', 'div_class'); - e1.appendChild(e2); - - var res = s.querySelectorAll(".div_class"); - assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (by class name)'); - - assert_true(res.item(0) == e1 || res.item(1) == e1, e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e1 by class name)'); - - assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (e2 by class name)'); - -}, 'A_04_01_06_T08', PROPS(A_04_01_06, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -//querySelector accessor by ID -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('span'); - e1.setAttribute('id', 'span_id'); - s.appendChild(e1); - - var e2 = d.createElement('div'); - e2.setAttribute('class', 'div_class'); - e1.appendChild(e2); - - var res = s.querySelectorAll("#span_id"); - assert_equals(res.length, 1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (by id)'); - - assert_equals(res.item(0), e1, 'elements in shadow DOM must be accessible via the ' + - 'shadow root .querySelectorAll DOM accessor (by id)'); - -}, 'A_04_01_06_T09', PROPS(A_04_01_06, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_06 = { + name:'A_04_01_06', + assert:'Upper-boundary encapsulation: ' + + 'The nodes are accessible using shadow root\'s DOM tree accessor methods', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'[[The nodes are accessible using shadow root\'s DOM tree accessor methods]]' + + '[\\s\\S]*[[For convenience, the shadow root provides its own set of DOM tree accessor methods.]]' +}; + +// getElementsByTagName accessor +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + var e = d.createElement('img'); + s.appendChild(e); + + assert_equals(s.getElementsByTagName('img').length, 1, 'elementsin shadow DOM must be accessible via the ' + + 'shadow root .getElementsByTagName DOM accessor'); + +}, 'A_04_01_06_T01', PROPS(A_04_01_06, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// getElementsByTagNameNS accessor +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + var e = d.createElement('img'); + s.appendChild(e); + + assert_equals(s.getElementsByTagNameNS('*', 'img').length, 1, + 'elements in shadow DOM must be accessible via the ' + + 'shadow root .getElementsByTagNameNS DOM accessor'); + +}, 'A_04_01_06_T02', PROPS(A_04_01_06, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// getElementsByClassName accessor +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + e = d.createElement('div'); + e.setAttribute('class', 'div_class'); + s.appendChild(e); + assert_equals(s.getElementsByClassName('div_class').length, 1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .getElementsByClassName DOM accessor'); + +}, 'A_04_01_06_T03', PROPS(A_04_01_06, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// getElementById accessor +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + e = d.createElement('span'); + e.setAttribute('id', 'span_id'); + s.appendChild(e); + assert_equals(s.getElementById('span_id'), e, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .getElementById DOM accessor'); + +}, 'A_04_01_06_T04', PROPS(A_04_01_06, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +// querySelector accessor +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('span'); + e1.setAttribute('id', 'span_id'); + s.appendChild(e1); + + var e2 = d.createElement('div'); + e2.setAttribute('class', 'div_class'); + e1.appendChild(e2); + + var id_res = s.querySelector("#span_id"); + assert_equals(id_res, e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelector DOM accessor (by id)'); + + var elem_res = s.querySelector("span"); + assert_equals(elem_res, e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelector DOM accessor (by element)'); + + var class_res = s.querySelector(".div_class"); + assert_equals(class_res, e2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelector DOM accessor (by class name)'); + +}, 'A_04_01_06_T05', PROPS(A_04_01_06, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +// querySelectorAll accessor by element type +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('span'); + s.appendChild(e1); + + var e2 = d.createElement('span'); + e1.appendChild(e2); + + var res = s.querySelectorAll("span"); + assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (by element type)'); + + assert_true(res.item(0) == e1 || res.item(1) == e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e1 by element type)'); + + assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e2 by element type)'); + + +}, 'A_04_01_06_T06', PROPS(A_04_01_06, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + + +// querySelectorAll accessor with attribute value +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('span'); + e1.setAttribute('test', 'span_id'); + s.appendChild(e1); + + var e2 = d.createElement('span'); + e2.setAttribute('test', 'span_id'); + e1.appendChild(e2); + + var res = s.querySelectorAll("[test=span_id]"); + assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (by attribute value)'); + + assert_true(res.item(0) == e1 || res.item(1) == e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e1 by attribute value)'); + + assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e2 by attribute value)'); + + +}, 'A_04_01_06_T07', PROPS(A_04_01_06, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +// querySelectorAll accessor for class +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('div'); + e1.setAttribute('class', 'div_class'); + s.appendChild(e1); + + var e2 = d.createElement('div'); + e2.setAttribute('class', 'div_class'); + e1.appendChild(e2); + + var res = s.querySelectorAll(".div_class"); + assert_equals(res.length, 2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (by class name)'); + + assert_true(res.item(0) == e1 || res.item(1) == e1, e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e1 by class name)'); + + assert_true(res.item(0) == e2 || res.item(1) == e2, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (e2 by class name)'); + +}, 'A_04_01_06_T08', PROPS(A_04_01_06, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +//querySelector accessor by ID +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('span'); + e1.setAttribute('id', 'span_id'); + s.appendChild(e1); + + var e2 = d.createElement('div'); + e2.setAttribute('class', 'div_class'); + e1.appendChild(e2); + + var res = s.querySelectorAll("#span_id"); + assert_equals(res.length, 1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (by id)'); + + assert_equals(res.item(0), e1, 'elements in shadow DOM must be accessible via the ' + + 'shadow root .querySelectorAll DOM accessor (by id)'); + +}, 'A_04_01_06_T09', PROPS(A_04_01_06, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' })); \ No newline at end of file diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_07.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_07.js index e21aec957da6a6..72ff9b654ee189 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_07.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_07.js @@ -1,74 +1,74 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_07 = { - name:'A_04_01_07', - assert:'Upper-boundary encapsulation:' + - 'The nodes with a unique id and named elements are addressable ' + - 'from any attributes of elements in the same shadow DOM subtree', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The nodes with a unique id and named elements are addressable ' + - 'from any attributes of elements in the same shadow tree' -}; - -// check for label.control -test(function () { - var d = newHTMLDocument(); - var div = d.createElement('div'); - d.body.appendChild(div); - var s = createSR(div); - - var input = d.createElement('input'); - input.setAttribute('type', 'text'); - input.setAttribute('id', 'input_id'); - d.body.appendChild(input); - - var label = d.createElement('label'); - label.setAttribute('for', 'input_id'); - s.appendChild(label); - s.appendChild(input); - - assert_equals(label.control, input, 'Elements in shadow DOM must be accessible from ' + - 'shadow document label.for attribute'); - -}, 'A_04_01_07_T01', PROPS(A_04_01_07, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check for elem.form associated elements -test(function () { - - HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) { - d = newHTMLDocument(); - - var form = d.createElement('form'); - var el = d.createElement(tagName); - - d.body.appendChild(form); - d.body.appendChild(el); - - form.setAttribute('id', 'form_id'); - el.setAttribute('form', 'form_id'); - - div = d.createElement('div'); - d.body.appendChild(div); - - var s = createSR(div); - s.appendChild(form); - s.appendChild(el); - - assert_equals(el.form, form, 'Elements in shadow DOM must be accessible from ' + - 'shadow document ' + tagName + '.form attribute'); - }); -}, 'A_04_01_07_T02', PROPS(A_04_01_07, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_07 = { + name:'A_04_01_07', + assert:'Upper-boundary encapsulation:' + + 'The nodes with a unique id and named elements are addressable ' + + 'from any attributes of elements in the same shadow DOM subtree', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The nodes with a unique id and named elements are addressable ' + + 'from any attributes of elements in the same shadow tree' +}; + +// check for label.control +test(function () { + var d = newHTMLDocument(); + var div = d.createElement('div'); + d.body.appendChild(div); + var s = createSR(div); + + var input = d.createElement('input'); + input.setAttribute('type', 'text'); + input.setAttribute('id', 'input_id'); + d.body.appendChild(input); + + var label = d.createElement('label'); + label.setAttribute('for', 'input_id'); + s.appendChild(label); + s.appendChild(input); + + assert_equals(label.control, input, 'Elements in shadow DOM must be accessible from ' + + 'shadow document label.for attribute'); + +}, 'A_04_01_07_T01', PROPS(A_04_01_07, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check for elem.form associated elements +test(function () { + + HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) { + d = newHTMLDocument(); + + var form = d.createElement('form'); + var el = d.createElement(tagName); + + d.body.appendChild(form); + d.body.appendChild(el); + + form.setAttribute('id', 'form_id'); + el.setAttribute('form', 'form_id'); + + div = d.createElement('div'); + d.body.appendChild(div); + + var s = createSR(div); + s.appendChild(form); + s.appendChild(el); + + assert_equals(el.form, form, 'Elements in shadow DOM must be accessible from ' + + 'shadow document ' + tagName + '.form attribute'); + }); +}, 'A_04_01_07_T02', PROPS(A_04_01_07, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_08.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_08.js index 805380267721e6..ed661109742012 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_08.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_08.js @@ -1,182 +1,182 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_08 = { - name:'A_04_01_08', - assert:'Upper-boundary encapsulation:' + - 'Methods Document.querySelector and Document.querySelectorAll return only not shadowed elements', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The selectors must not cross the shadow boundary from the document ' + - 'tree into the shadow tree' -}; - -//check querySelector method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e = d.createElement('span'); - e.setAttribute('id', 'span_id'); - e.setAttribute('class', 'span_class'); - d.body.appendChild(e); - s.appendChild(e); - - assert_equals(d.querySelector('span'), null, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s tag name selectors'); - - assert_equals(d.querySelector('.span_class'), null, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s .className selectors'); - - assert_equals(d.querySelector('#span_id'), null, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s #id selectors'); - -}, 'A_04_01_08_T01', PROPS(A_04_01_08, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - - -//check querySelectorAll method -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - var e1 = d.createElement('span'); - e1.setAttribute('id', 'span_id'); - e1.setAttribute('class', 'span_class'); - d.body.appendChild(e1); - s.appendChild(e1); - - var e2 = d.createElement('span'); - e2.setAttribute('id', 'span_id'); - e2.setAttribute('class', 'span_class'); - e1.appendChild(e2); - - assert_equals(d.querySelectorAll('span').length, 0, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s tag name selectors'); - - assert_equals(d.querySelectorAll('.span_class').length, 0, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s .className selectors'); - - assert_equals(d.querySelectorAll('#span_id').length, 0, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s #id selectors'); - -}, 'A_04_01_08_T02', PROPS(A_04_01_08, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -//check querySelector method various selector patterns -test(function () { - var d = newHTMLDocument(); - var divElement = d.createElement('div'); - d.body.appendChild(divElement); - - var s = createSR(divElement); - - var e1 = d.createElement('span'); - e1.setAttribute('id', 'span1_id'); - e1.setAttribute('class', 'span_class'); - e1.setAttribute('test', 'test'); - d.body.appendChild(e1); - - var e2 = d.createElement('span'); - e2.setAttribute('id', 'span2_id'); - e2.setAttribute('class', 'span_class'); - e1.setAttribute('test', 'test'); - d.body.appendChild(e2); - - s.appendChild(e2); - - assert_not_equals(d.querySelector('*'), e2, 'elements in shadow DOM must not be accessible via the ' + - 'document host\'s \'*\' selector pattern'); - - var data = ['span', e1, - 'span[test]', e1, - 'span[test=test]', e1, - '[test]', e1, - '[test=test]', e1, - '[test~=test]', e1, - '[test^=test]', e1, - '[test$=test]', e1, - '[test*=test]', e1, -// 'span:first-child', e1, - 'span:empty', e1, - '.span_class', e1, - '#span2_id', null, - 'div span', null, - 'div > span', null, - 'span + span', null - ]; - var i; - for (i=0; i', - reviewer:'' -})); - -//check querySelectorAll method various selector patterns -test(function () { - var d = newHTMLDocument(); - var divElement = d.createElement('div'); - d.body.appendChild(divElement); - - var s = createSR(divElement); - - var e1 = d.createElement('span'); - e1.setAttribute('id', 'span1_id'); - e1.setAttribute('class', 'span_class'); - e1.setAttribute('test', 'test'); - d.body.appendChild(e1); - - var e2 = d.createElement('span'); - e2.setAttribute('id', 'span2_id'); - e2.setAttribute('class', 'span_class'); - e1.setAttribute('test', 'test'); - d.body.appendChild(e2); - - s.appendChild(e2); - - var data = ['*', - 'span', - 'span[test]', - 'span[test=test]', - '[test]', - '[test=test]', - '[test~=test]', - '[test^=test]', - '[test$=test]', - '[test*=test]', - 'span:first-child', - 'span:empty', - '.span_class', - '#span2_id', - 'div span', - 'div > span', - 'span + span' - ]; - - var selected; - var i; - var k; - for (i=0; i', - reviewer:'' -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_08 = { + name:'A_04_01_08', + assert:'Upper-boundary encapsulation:' + + 'Methods Document.querySelector and Document.querySelectorAll return only not shadowed elements', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The selectors must not cross the shadow boundary from the document ' + + 'tree into the shadow tree' +}; + +//check querySelector method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e = d.createElement('span'); + e.setAttribute('id', 'span_id'); + e.setAttribute('class', 'span_class'); + d.body.appendChild(e); + s.appendChild(e); + + assert_equals(d.querySelector('span'), null, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s tag name selectors'); + + assert_equals(d.querySelector('.span_class'), null, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s .className selectors'); + + assert_equals(d.querySelector('#span_id'), null, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s #id selectors'); + +}, 'A_04_01_08_T01', PROPS(A_04_01_08, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + + +//check querySelectorAll method +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + var e1 = d.createElement('span'); + e1.setAttribute('id', 'span_id'); + e1.setAttribute('class', 'span_class'); + d.body.appendChild(e1); + s.appendChild(e1); + + var e2 = d.createElement('span'); + e2.setAttribute('id', 'span_id'); + e2.setAttribute('class', 'span_class'); + e1.appendChild(e2); + + assert_equals(d.querySelectorAll('span').length, 0, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s tag name selectors'); + + assert_equals(d.querySelectorAll('.span_class').length, 0, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s .className selectors'); + + assert_equals(d.querySelectorAll('#span_id').length, 0, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s #id selectors'); + +}, 'A_04_01_08_T02', PROPS(A_04_01_08, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +//check querySelector method various selector patterns +test(function () { + var d = newHTMLDocument(); + var divElement = d.createElement('div'); + d.body.appendChild(divElement); + + var s = createSR(divElement); + + var e1 = d.createElement('span'); + e1.setAttribute('id', 'span1_id'); + e1.setAttribute('class', 'span_class'); + e1.setAttribute('test', 'test'); + d.body.appendChild(e1); + + var e2 = d.createElement('span'); + e2.setAttribute('id', 'span2_id'); + e2.setAttribute('class', 'span_class'); + e1.setAttribute('test', 'test'); + d.body.appendChild(e2); + + s.appendChild(e2); + + assert_not_equals(d.querySelector('*'), e2, 'elements in shadow DOM must not be accessible via the ' + + 'document host\'s \'*\' selector pattern'); + + var data = ['span', e1, + 'span[test]', e1, + 'span[test=test]', e1, + '[test]', e1, + '[test=test]', e1, + '[test~=test]', e1, + '[test^=test]', e1, + '[test$=test]', e1, + '[test*=test]', e1, +// 'span:first-child', e1, + 'span:empty', e1, + '.span_class', e1, + '#span2_id', null, + 'div span', null, + 'div > span', null, + 'span + span', null + ]; + var i; + for (i=0; i', + reviewer:'' +})); + +//check querySelectorAll method various selector patterns +test(function () { + var d = newHTMLDocument(); + var divElement = d.createElement('div'); + d.body.appendChild(divElement); + + var s = createSR(divElement); + + var e1 = d.createElement('span'); + e1.setAttribute('id', 'span1_id'); + e1.setAttribute('class', 'span_class'); + e1.setAttribute('test', 'test'); + d.body.appendChild(e1); + + var e2 = d.createElement('span'); + e2.setAttribute('id', 'span2_id'); + e2.setAttribute('class', 'span_class'); + e1.setAttribute('test', 'test'); + d.body.appendChild(e2); + + s.appendChild(e2); + + var data = ['*', + 'span', + 'span[test]', + 'span[test=test]', + '[test]', + '[test=test]', + '[test~=test]', + '[test^=test]', + '[test$=test]', + '[test*=test]', + 'span:first-child', + 'span:empty', + '.span_class', + '#span2_id', + 'div span', + 'div > span', + 'span + span' + ]; + + var selected; + var i; + var k; + for (i=0; i', + reviewer:'' +})); diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_09.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_09.js index 0a2106f699b96c..c978d582e51b9c 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_09.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_09.js @@ -1,321 +1,321 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_09 = { - name:'A_04_01_09', - assert:'Upper-boundary encapsulation: no nodes other than shadow root ' + - 'descendants are accessible with shadow root DOM tree accessor methods', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'For convenience, the shadow root provides its own set of DOM tree accessor methods. ' + - '[[No nodes other than shadow root descendants are accessible with these methods.]]' -}; - -A_04_01_09.setupBlock = function (ctx, prefix, root) { - // create

like structure - // where

will be used as shadow host element - - ctx[prefix + '_div1'] = ctx.d.createElement('div'); - ctx[prefix + '_div1'].setAttribute('id', prefix + '_id1'); - ctx[prefix + '_div1'].setAttribute('class', 'cls'); - - ctx[prefix + '_p1'] = ctx.d.createElement('p'); - ctx[prefix + '_p1'].setAttribute('class', 'cls'); - ctx[prefix + '_p1'].setAttribute('test', 'A_04_01_09'); - - ctx[prefix + '_div2'] = ctx.d.createElement('div'); - ctx[prefix + '_div2'].setAttribute('id', prefix + '_id2'); - ctx[prefix + '_div2'].setAttribute('class', 'cls'); - ctx[prefix + '_div2'].setAttribute('test', 'A_04_01_09'); - - root.appendChild(ctx[prefix + '_div1']); - ctx[prefix + '_div1'].appendChild(ctx[prefix + '_p1']); - ctx[prefix + '_p1'].appendChild(ctx[prefix + '_div2']); -}; - -A_04_01_09.setup = function () { - var ctx = {}; - - ctx.d = newHTMLDocument(); - A_04_01_09.setupBlock(ctx, 'd', ctx.d.body); - - ctx.s1 = createSR(ctx.d_p1); - A_04_01_09.setupBlock(ctx, 's1', ctx.s1); - - ctx.s2 = createSR(ctx.s1_p1); - A_04_01_09.setupBlock(ctx, 's2', ctx.s2); - - assert_true(ctx.d_div1 != null, 'setup:d_div1'); - assert_true(ctx.d_div2 != null, 'setup:d_div2'); - assert_true(ctx.s1_div1 != null, 'setup: s1_div1'); - assert_true(ctx.s1_div2 != null, 'setup: s1_div2'); - assert_true(ctx.s2_div1 != null, 'setup: s2_div1'); - assert_true(ctx.s2_div2 != null, 'setup: s2_div2'); - - return ctx; -}; - -//check getElementsByTagName -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder( - ctx.s1.getElementsByTagName('div'), [ctx.s1_div1, ctx.s1_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByTagName (s1)'); - - assert_nodelist_contents_equal_noorder( - ctx.s2.getElementsByTagName('div'), [ctx.s2_div1, ctx.s2_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByTagName (s2)'); - -}, 'A_04_01_09_T01', PROPS(A_04_01_09, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// getElementsByTagNameNS -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder( - ctx.s1.getElementsByTagNameNS('*', 'div'), [ctx.s1_div1, ctx.s1_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByTagNameNS (s1)'); - - assert_nodelist_contents_equal_noorder( - ctx.s2.getElementsByTagNameNS('*', 'div'), [ctx.s2_div1, ctx.s2_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByTagNameNS (s2)'); - -}, 'A_04_01_09_T02', PROPS(A_04_01_09, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -//check getElementsByClassName -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder( - ctx.s1.getElementsByClassName('cls'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByClassName (s1)'); - - assert_nodelist_contents_equal_noorder( - ctx.s2.getElementsByClassName('cls'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], - 'nodes, other than shadow root descendants, should not be accessible with ' + - 'ShadowRoot.getElementsByClassName (s2)'); - -}, 'A_04_01_09_T03', PROPS(A_04_01_09, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -// check getElementById -test(function () { - var ctx = A_04_01_09.setup(); - - assert_equals(ctx.s1.getElementById('d_id1'), null, 'Expected no access to d_div1 from s1.getElementById()'); - assert_equals(ctx.s1.getElementById('d_id2'), null, 'Expected no access to d_div2 from s1.getElementById()'); - assert_equals(ctx.s2.getElementById('d_id1'), null, 'Expected no access to d_div1 from s2.getElementById()'); - assert_equals(ctx.s2.getElementById('d_id2'), null, 'Expected no access to d_div1 from s2.getElementById()'); - - - assert_equals(ctx.s1.getElementById('s1_id1'), ctx.s1_div1, 'Expected access to s1_div1 form s1.getElementById()'); - assert_equals(ctx.s1.getElementById('s1_id2'), ctx.s1_div2, 'Expected access to s1_div2 form s1.getElementById()'); - assert_equals(ctx.s2.getElementById('s2_id1'), ctx.s2_div1, 'Expected access to s2_div1 form s2.getElementById()'); - assert_equals(ctx.s2.getElementById('s2_id2'), ctx.s2_div2, 'Expected access to s2_div2 form s2.getElementById()'); - - - assert_equals(ctx.s1.getElementById('s2_id1'), null, 'Expected no access to s2_div1 form s1.getElementById()'); - assert_equals(ctx.s1.getElementById('s2_id2'), null, 'Expected no access to s2_div2 form s1.getElementById()'); - assert_equals(ctx.s2.getElementById('s1_id1'), null, 'Expected no access to s1_div1 form s2.getElementById()'); - assert_equals(ctx.s2.getElementById('s1_id2'), null, 'Expected no access to s1_div2 form s2.getElementById()'); - -}, 'A_04_01_09_T04', PROPS(A_04_01_09, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - - -// check querySelector for id -test(function () { - var ctx = A_04_01_09.setup(); - - assert_equals(ctx.d.querySelector('#s1_id1'), null, 'Expected no access to s1_div1 from d.querySelector()'); - assert_equals(ctx.d.querySelector('#s1_id2'), null, 'Expected no access to s1_div2 from d.querySelector()'); - assert_equals(ctx.d.querySelector('#s2_id1'), null, 'Expected no access to s2_div1 from d.querySelector()'); - assert_equals(ctx.d.querySelector('#s2_id2'), null, 'Expected no access to s2_div1 from d.querySelector()'); - - assert_equals(ctx.s1.querySelector('#d_id1'), null, 'Expected no access to d_div1 from s1.querySelector()'); - assert_equals(ctx.s1.querySelector('#d_id2'), null, 'Expected no access to d_div2 from s1.querySelector()'); - assert_equals(ctx.s2.querySelector('#d_id1'), null, 'Expected no access to d_div1 from s2.querySelector()'); - assert_equals(ctx.s2.querySelector('#d_id2'), null, 'Expected no access to d_div1 from s2.querySelector()'); - - assert_equals(ctx.d.querySelector('#d_id1'), ctx.d_div1, 'Expected access to d_div1 form d.querySelector()'); - assert_equals(ctx.d.querySelector('#d_id2'), ctx.d_div2, 'Expected access to d_div2 form d.querySelector()'); - assert_equals(ctx.s1.querySelector('#s1_id1'), ctx.s1_div1, 'Expected access to s1_div1 form s1.querySelector()'); - assert_equals(ctx.s1.querySelector('#s1_id2'), ctx.s1_div2, 'Expected access to s1_div2 form s1.querySelector()'); - assert_equals(ctx.s2.querySelector('#s2_id1'), ctx.s2_div1, 'Expected access to s2_div1 form s2.querySelector()'); - assert_equals(ctx.s2.querySelector('#s2_id2'), ctx.s2_div2, 'Expected access to s2_div2 form s2.querySelector()'); - - assert_equals(ctx.s1.querySelector('#s2_id1'), null, 'Expected no access to s2_div1 form s1.querySelector()'); - assert_equals(ctx.s1.querySelector('#s2_id2'), null, 'Expected no access to s2_div2 form s1.querySelector()'); - assert_equals(ctx.s2.querySelector('#s1_id1'), null, 'Expected no access to s1_div1 form s2.querySelector()'); - assert_equals(ctx.s2.querySelector('#s1_id2'), null, 'Expected no access to s1_div2 form s2.querySelector()'); - -}, 'A_04_01_09_T05', PROPS(A_04_01_09, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - - -//check querySelector for element -test(function () { - var ctx = A_04_01_09.setup(); - - assert_equals(ctx.d.querySelector('p'), ctx.d_p1, 'Expected access to d_p1 from d.querySelector()'); - assert_equals(ctx.s1.querySelector('p'), ctx.s1_p1, 'Expected access to s1_p1 from s1.querySelector()'); - assert_equals(ctx.s2.querySelector('p'), ctx.s2_p1, 'Expected access to s2_p1 from s2.querySelector()'); - -}, 'A_04_01_09_T06', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -// check querySelectorAll for element -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p'), [ctx.d_p1], 'Expected access to d_p1 from d.querySelectorAll()'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p'), [ctx.s1_p1], 'Expected access to s1_p1 s1.querySelectorAll'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p'), [ctx.s2_p1], 'Expected access to s2_p1 from s2.querySelectorAll'); - -}, 'A_04_01_09_T07', PROPS(A_04_01_09, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -// check querySelectorAll for class -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('.cls'), [ctx.d_div1, ctx.d_p1, ctx.d_div2], 'd.querySelectorAll() return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('.cls'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll() return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('.cls'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll() return wrong result'); - -}, 'A_04_01_09_T08', PROPS(A_04_01_09, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -//check querySelectorAll with whildcat -test(function () { - var ctx = A_04_01_09.setup(); - - //assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('*'), [ctx.d_div1, ctx.d_p1, ctx.d_div2], 'd.querySelectorAll'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('*'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll(\'*\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('*'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll(\'*\') return wrong result'); - -}, 'A_04_01_09_T09', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with attribute value -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('[test=A_04_01_09]'), [ctx.d_p1, ctx.d_div2], 'd.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('[test=A_04_01_09]'), [ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('[test=A_04_01_09]'), [ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); - -}, 'A_04_01_09_T10', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:first-child'), [ctx.d_div1, ctx.d_div2], 'd.querySelectorAll(\'div:first-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:first-child'), [ctx.s1_div2], 's1.querySelectorAll(\'div:first-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:first-child'), [ctx.s2_div2], 's2.querySelectorAll(\'div:first-child\') return wrong result'); - -}, 'A_04_01_09_T11', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:last-child'), [ctx.d_div2], 'd.querySelectorAll(\'div:last-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:last-child'), [ctx.s1_div2], 's1.querySelectorAll(\'div:last-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:last-child'), [ctx.s2_div2], 's2.querySelectorAll(\'div:last-child\') return wrong result'); - -}, 'A_04_01_09_T12', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p:only-child'), [ctx.d_p1], 'd.querySelectorAll(\'p:only-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p:only-child'), [ctx.s1_p1], 's1.querySelectorAll(\'p:only-child\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p:only-child'), [ctx.s2_p1], 's2.querySelectorAll(\'p:only-child\') return wrong result'); - -}, 'A_04_01_09_T13', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:empty'), [ctx.d_div2], 'd.querySelectorAll(\'div:empty\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:empty'), [ctx.s1_div2], 's1.querySelectorAll(\'div:empty\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:empty'), [ctx.s2_div2], 's2.querySelectorAll(\'div:empty\') return wrong result'); - -}, 'A_04_01_09_T14', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p div'), [ctx.d_div2], 'd.querySelectorAll(\'p div\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p div'), [ctx.s1_div2], 's1.querySelectorAll(\'p div\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p div'), [ctx.s2_div2], 's2.querySelectorAll(\'p div\') return wrong result'); - -}, 'A_04_01_09_T15', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); - -//check querySelectorAll with parent-child selection -test(function () { - var ctx = A_04_01_09.setup(); - - assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p > div'), [ctx.d_div2], 'd.querySelectorAll(\'p > div\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p > div'), [ctx.s1_div2], 's1.querySelectorAll(\'p > div\') return wrong result'); - assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p > div'), [ctx.s2_div2], 's2.querySelectorAll(\'p > div\') return wrong result'); - -}, 'A_04_01_09_T16', PROPS(A_04_01_09, { - author:'Aleksei Yu. Semenov ', - reviewer:'' -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_09 = { + name:'A_04_01_09', + assert:'Upper-boundary encapsulation: no nodes other than shadow root ' + + 'descendants are accessible with shadow root DOM tree accessor methods', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'For convenience, the shadow root provides its own set of DOM tree accessor methods. ' + + '[[No nodes other than shadow root descendants are accessible with these methods.]]' +}; + +A_04_01_09.setupBlock = function (ctx, prefix, root) { + // create

like structure + // where

will be used as shadow host element + + ctx[prefix + '_div1'] = ctx.d.createElement('div'); + ctx[prefix + '_div1'].setAttribute('id', prefix + '_id1'); + ctx[prefix + '_div1'].setAttribute('class', 'cls'); + + ctx[prefix + '_p1'] = ctx.d.createElement('p'); + ctx[prefix + '_p1'].setAttribute('class', 'cls'); + ctx[prefix + '_p1'].setAttribute('test', 'A_04_01_09'); + + ctx[prefix + '_div2'] = ctx.d.createElement('div'); + ctx[prefix + '_div2'].setAttribute('id', prefix + '_id2'); + ctx[prefix + '_div2'].setAttribute('class', 'cls'); + ctx[prefix + '_div2'].setAttribute('test', 'A_04_01_09'); + + root.appendChild(ctx[prefix + '_div1']); + ctx[prefix + '_div1'].appendChild(ctx[prefix + '_p1']); + ctx[prefix + '_p1'].appendChild(ctx[prefix + '_div2']); +}; + +A_04_01_09.setup = function () { + var ctx = {}; + + ctx.d = newHTMLDocument(); + A_04_01_09.setupBlock(ctx, 'd', ctx.d.body); + + ctx.s1 = createSR(ctx.d_p1); + A_04_01_09.setupBlock(ctx, 's1', ctx.s1); + + ctx.s2 = createSR(ctx.s1_p1); + A_04_01_09.setupBlock(ctx, 's2', ctx.s2); + + assert_true(ctx.d_div1 != null, 'setup:d_div1'); + assert_true(ctx.d_div2 != null, 'setup:d_div2'); + assert_true(ctx.s1_div1 != null, 'setup: s1_div1'); + assert_true(ctx.s1_div2 != null, 'setup: s1_div2'); + assert_true(ctx.s2_div1 != null, 'setup: s2_div1'); + assert_true(ctx.s2_div2 != null, 'setup: s2_div2'); + + return ctx; +}; + +//check getElementsByTagName +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder( + ctx.s1.getElementsByTagName('div'), [ctx.s1_div1, ctx.s1_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByTagName (s1)'); + + assert_nodelist_contents_equal_noorder( + ctx.s2.getElementsByTagName('div'), [ctx.s2_div1, ctx.s2_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByTagName (s2)'); + +}, 'A_04_01_09_T01', PROPS(A_04_01_09, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// getElementsByTagNameNS +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder( + ctx.s1.getElementsByTagNameNS('*', 'div'), [ctx.s1_div1, ctx.s1_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByTagNameNS (s1)'); + + assert_nodelist_contents_equal_noorder( + ctx.s2.getElementsByTagNameNS('*', 'div'), [ctx.s2_div1, ctx.s2_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByTagNameNS (s2)'); + +}, 'A_04_01_09_T02', PROPS(A_04_01_09, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +//check getElementsByClassName +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder( + ctx.s1.getElementsByClassName('cls'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByClassName (s1)'); + + assert_nodelist_contents_equal_noorder( + ctx.s2.getElementsByClassName('cls'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], + 'nodes, other than shadow root descendants, should not be accessible with ' + + 'ShadowRoot.getElementsByClassName (s2)'); + +}, 'A_04_01_09_T03', PROPS(A_04_01_09, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +// check getElementById +test(function () { + var ctx = A_04_01_09.setup(); + + assert_equals(ctx.s1.getElementById('d_id1'), null, 'Expected no access to d_div1 from s1.getElementById()'); + assert_equals(ctx.s1.getElementById('d_id2'), null, 'Expected no access to d_div2 from s1.getElementById()'); + assert_equals(ctx.s2.getElementById('d_id1'), null, 'Expected no access to d_div1 from s2.getElementById()'); + assert_equals(ctx.s2.getElementById('d_id2'), null, 'Expected no access to d_div1 from s2.getElementById()'); + + + assert_equals(ctx.s1.getElementById('s1_id1'), ctx.s1_div1, 'Expected access to s1_div1 form s1.getElementById()'); + assert_equals(ctx.s1.getElementById('s1_id2'), ctx.s1_div2, 'Expected access to s1_div2 form s1.getElementById()'); + assert_equals(ctx.s2.getElementById('s2_id1'), ctx.s2_div1, 'Expected access to s2_div1 form s2.getElementById()'); + assert_equals(ctx.s2.getElementById('s2_id2'), ctx.s2_div2, 'Expected access to s2_div2 form s2.getElementById()'); + + + assert_equals(ctx.s1.getElementById('s2_id1'), null, 'Expected no access to s2_div1 form s1.getElementById()'); + assert_equals(ctx.s1.getElementById('s2_id2'), null, 'Expected no access to s2_div2 form s1.getElementById()'); + assert_equals(ctx.s2.getElementById('s1_id1'), null, 'Expected no access to s1_div1 form s2.getElementById()'); + assert_equals(ctx.s2.getElementById('s1_id2'), null, 'Expected no access to s1_div2 form s2.getElementById()'); + +}, 'A_04_01_09_T04', PROPS(A_04_01_09, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + + +// check querySelector for id +test(function () { + var ctx = A_04_01_09.setup(); + + assert_equals(ctx.d.querySelector('#s1_id1'), null, 'Expected no access to s1_div1 from d.querySelector()'); + assert_equals(ctx.d.querySelector('#s1_id2'), null, 'Expected no access to s1_div2 from d.querySelector()'); + assert_equals(ctx.d.querySelector('#s2_id1'), null, 'Expected no access to s2_div1 from d.querySelector()'); + assert_equals(ctx.d.querySelector('#s2_id2'), null, 'Expected no access to s2_div1 from d.querySelector()'); + + assert_equals(ctx.s1.querySelector('#d_id1'), null, 'Expected no access to d_div1 from s1.querySelector()'); + assert_equals(ctx.s1.querySelector('#d_id2'), null, 'Expected no access to d_div2 from s1.querySelector()'); + assert_equals(ctx.s2.querySelector('#d_id1'), null, 'Expected no access to d_div1 from s2.querySelector()'); + assert_equals(ctx.s2.querySelector('#d_id2'), null, 'Expected no access to d_div1 from s2.querySelector()'); + + assert_equals(ctx.d.querySelector('#d_id1'), ctx.d_div1, 'Expected access to d_div1 form d.querySelector()'); + assert_equals(ctx.d.querySelector('#d_id2'), ctx.d_div2, 'Expected access to d_div2 form d.querySelector()'); + assert_equals(ctx.s1.querySelector('#s1_id1'), ctx.s1_div1, 'Expected access to s1_div1 form s1.querySelector()'); + assert_equals(ctx.s1.querySelector('#s1_id2'), ctx.s1_div2, 'Expected access to s1_div2 form s1.querySelector()'); + assert_equals(ctx.s2.querySelector('#s2_id1'), ctx.s2_div1, 'Expected access to s2_div1 form s2.querySelector()'); + assert_equals(ctx.s2.querySelector('#s2_id2'), ctx.s2_div2, 'Expected access to s2_div2 form s2.querySelector()'); + + assert_equals(ctx.s1.querySelector('#s2_id1'), null, 'Expected no access to s2_div1 form s1.querySelector()'); + assert_equals(ctx.s1.querySelector('#s2_id2'), null, 'Expected no access to s2_div2 form s1.querySelector()'); + assert_equals(ctx.s2.querySelector('#s1_id1'), null, 'Expected no access to s1_div1 form s2.querySelector()'); + assert_equals(ctx.s2.querySelector('#s1_id2'), null, 'Expected no access to s1_div2 form s2.querySelector()'); + +}, 'A_04_01_09_T05', PROPS(A_04_01_09, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + + +//check querySelector for element +test(function () { + var ctx = A_04_01_09.setup(); + + assert_equals(ctx.d.querySelector('p'), ctx.d_p1, 'Expected access to d_p1 from d.querySelector()'); + assert_equals(ctx.s1.querySelector('p'), ctx.s1_p1, 'Expected access to s1_p1 from s1.querySelector()'); + assert_equals(ctx.s2.querySelector('p'), ctx.s2_p1, 'Expected access to s2_p1 from s2.querySelector()'); + +}, 'A_04_01_09_T06', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +// check querySelectorAll for element +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p'), [ctx.d_p1], 'Expected access to d_p1 from d.querySelectorAll()'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p'), [ctx.s1_p1], 'Expected access to s1_p1 s1.querySelectorAll'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p'), [ctx.s2_p1], 'Expected access to s2_p1 from s2.querySelectorAll'); + +}, 'A_04_01_09_T07', PROPS(A_04_01_09, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +// check querySelectorAll for class +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('.cls'), [ctx.d_div1, ctx.d_p1, ctx.d_div2], 'd.querySelectorAll() return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('.cls'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll() return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('.cls'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll() return wrong result'); + +}, 'A_04_01_09_T08', PROPS(A_04_01_09, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +//check querySelectorAll with whildcat +test(function () { + var ctx = A_04_01_09.setup(); + + //assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('*'), [ctx.d_div1, ctx.d_p1, ctx.d_div2], 'd.querySelectorAll'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('*'), [ctx.s1_div1, ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll(\'*\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('*'), [ctx.s2_div1, ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll(\'*\') return wrong result'); + +}, 'A_04_01_09_T09', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with attribute value +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('[test=A_04_01_09]'), [ctx.d_p1, ctx.d_div2], 'd.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('[test=A_04_01_09]'), [ctx.s1_p1, ctx.s1_div2], 's1.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('[test=A_04_01_09]'), [ctx.s2_p1, ctx.s2_div2], 's2.querySelectorAll(\'[test=A_04_01_09]\') return wrong result'); + +}, 'A_04_01_09_T10', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:first-child'), [ctx.d_div1, ctx.d_div2], 'd.querySelectorAll(\'div:first-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:first-child'), [ctx.s1_div2], 's1.querySelectorAll(\'div:first-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:first-child'), [ctx.s2_div2], 's2.querySelectorAll(\'div:first-child\') return wrong result'); + +}, 'A_04_01_09_T11', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:last-child'), [ctx.d_div2], 'd.querySelectorAll(\'div:last-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:last-child'), [ctx.s1_div2], 's1.querySelectorAll(\'div:last-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:last-child'), [ctx.s2_div2], 's2.querySelectorAll(\'div:last-child\') return wrong result'); + +}, 'A_04_01_09_T12', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p:only-child'), [ctx.d_p1], 'd.querySelectorAll(\'p:only-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p:only-child'), [ctx.s1_p1], 's1.querySelectorAll(\'p:only-child\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p:only-child'), [ctx.s2_p1], 's2.querySelectorAll(\'p:only-child\') return wrong result'); + +}, 'A_04_01_09_T13', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('div:empty'), [ctx.d_div2], 'd.querySelectorAll(\'div:empty\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('div:empty'), [ctx.s1_div2], 's1.querySelectorAll(\'div:empty\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('div:empty'), [ctx.s2_div2], 's2.querySelectorAll(\'div:empty\') return wrong result'); + +}, 'A_04_01_09_T14', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p div'), [ctx.d_div2], 'd.querySelectorAll(\'p div\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p div'), [ctx.s1_div2], 's1.querySelectorAll(\'p div\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p div'), [ctx.s2_div2], 's2.querySelectorAll(\'p div\') return wrong result'); + +}, 'A_04_01_09_T15', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); + +//check querySelectorAll with parent-child selection +test(function () { + var ctx = A_04_01_09.setup(); + + assert_nodelist_contents_equal_noorder(ctx.d.querySelectorAll('p > div'), [ctx.d_div2], 'd.querySelectorAll(\'p > div\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s1.querySelectorAll('p > div'), [ctx.s1_div2], 's1.querySelectorAll(\'p > div\') return wrong result'); + assert_nodelist_contents_equal_noorder(ctx.s2.querySelectorAll('p > div'), [ctx.s2_div2], 's2.querySelectorAll(\'p > div\') return wrong result'); + +}, 'A_04_01_09_T16', PROPS(A_04_01_09, { + author:'Aleksei Yu. Semenov ', + reviewer:'' +})); diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_10.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_10.js index 51726b56536ca9..f1a57a8babc6ce 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_10.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_10.js @@ -1,76 +1,76 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_10 = { - name:'A_04_01_10', - assert:'Upper-boundary encapsulation: The parentNode and parentElement attributes of the shadow root object ' + - 'must always return null.', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The parentNode and parentElement attributes of the shadow root object ' + - 'must always return null.' -}; - -//check parentNode of usual shadow -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - assert_equals(s.parentNode, null, 'the parentNode attribute of the shadow ' + - 'root object must always return null'); - -}, 'A_04_01_10_T01', PROPS(A_04_01_10, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -//check parentElement of usual shadow -test(function () { - var d = newHTMLDocument(); - var s = createSR(d.body); - - assert_equals(s.parentElement, null, 'the parentElement attribute of the shadow root object ' + - 'must always return null'); - -}, 'A_04_01_10_T02', PROPS(A_04_01_10, { - author:'Sergey G. Grekhov ', - reviewer:'Mikhail Fursov ' -})); - -//check parentNode for nested shadow -test(function () { - var d = newHTMLDocument(); - var s1 = createSR(d.body); - var e1 = d.createElement('div'); - s1.appendChild(e1); - var s2 = createSR(e1); - - assert_equals(s2.parentNode, null, 'the parentNode attribute of the shadow ' + - 'root object must always return null'); - -}, 'A_04_01_10_T03', PROPS(A_04_01_10, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); - -//check parentElement for nested shadow -test(function () { - var d = newHTMLDocument(); - var s1 = createSR(d.body); - var e1 = d.createElement('div'); - s1.appendChild(e1); - var s2 = createSR(e1); - - assert_equals(s2.parentElement, null, 'the parentElement attribute of the shadow root object ' + - 'must always return null'); - -}, 'A_04_01_10_T04', PROPS(A_04_01_10, { - author:'Mikhail Fursov ', - reviewer:'Aleksei Yu. Semenov ' -})); +/* +Distributed under both the W3C Test Suite License [1] and the W3C +3-clause BSD License [2]. To contribute to a W3C Test Suite, see the +policies and contribution forms [3]. + +[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license +[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license +[3] http://www.w3.org/2004/10/27-testcases +*/ + +var A_04_01_10 = { + name:'A_04_01_10', + assert:'Upper-boundary encapsulation: The parentNode and parentElement attributes of the shadow root object ' + + 'must always return null.', + link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', + highlight:'The parentNode and parentElement attributes of the shadow root object ' + + 'must always return null.' +}; + +//check parentNode of usual shadow +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + assert_equals(s.parentNode, null, 'the parentNode attribute of the shadow ' + + 'root object must always return null'); + +}, 'A_04_01_10_T01', PROPS(A_04_01_10, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +//check parentElement of usual shadow +test(function () { + var d = newHTMLDocument(); + var s = createSR(d.body); + + assert_equals(s.parentElement, null, 'the parentElement attribute of the shadow root object ' + + 'must always return null'); + +}, 'A_04_01_10_T02', PROPS(A_04_01_10, { + author:'Sergey G. Grekhov ', + reviewer:'Mikhail Fursov ' +})); + +//check parentNode for nested shadow +test(function () { + var d = newHTMLDocument(); + var s1 = createSR(d.body); + var e1 = d.createElement('div'); + s1.appendChild(e1); + var s2 = createSR(e1); + + assert_equals(s2.parentNode, null, 'the parentNode attribute of the shadow ' + + 'root object must always return null'); + +}, 'A_04_01_10_T03', PROPS(A_04_01_10, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); + +//check parentElement for nested shadow +test(function () { + var d = newHTMLDocument(); + var s1 = createSR(d.body); + var e1 = d.createElement('div'); + s1.appendChild(e1); + var s2 = createSR(e1); + + assert_equals(s2.parentElement, null, 'the parentElement attribute of the shadow root object ' + + 'must always return null'); + +}, 'A_04_01_10_T04', PROPS(A_04_01_10, { + author:'Mikhail Fursov ', + reviewer:'Aleksei Yu. Semenov ' +})); diff --git a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_11.js b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_11.js index d8a25f1f4a77b5..51447291446927 100644 --- a/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_11.js +++ b/shadow-dom/04_01_Upper_boundary_encapsulation/A_04_01_11.js @@ -1,71 +1,71 @@ -/* -Distributed under both the W3C Test Suite License [1] and the W3C -3-clause BSD License [2]. To contribute to a W3C Test Suite, see the -policies and contribution forms [3]. - -[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license -[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license -[3] http://www.w3.org/2004/10/27-testcases -*/ - -var A_04_01_11 = { - name:'A_04_01_11', - assert:'Upper-boundary encapsulation:The style sheets, represented by the shadow nodes ' + - 'are not accessible using shadow host document\'s CSSOM extensions', - link:'http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation', - highlight:'The style sheets, represented by the nodes are not accessible using ' + - 'shadow host document\'s CSSOM extensions', - bug: ['https://bugs.webkit.org/show_bug.cgi?id=103393', 'https://bugs.webkit.org/show_bug.cgi?id=105274'] -}; - -// check that