Giter Club home page Giter Club logo

test-suite-for-shadow-dom's People

Contributors

alsemenov avatar omo avatar

Watchers

James Cloos avatar  avatar

test-suite-for-shadow-dom's Issues

Styles in shadow element present in document.styleSheets collection

Styles added to shadow element are visible via the document.styleSheet 
collection. The following test fails:

var t1 = async_test('05_01_A10_T01', {
            help: "http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation",
            assert: 'Upper-boundary encapsulation: The style sheets, represented by the nodes '
                    + 'are not accessible using shadow host document\'s CSSOM extensions',
            author: "Sergey G. Grekhov ([email protected])",
            reviewer: ""    
        });

t1.step(function () {
    var iframe = document.createElement('iframe');
    iframe.src = 'resources/blank.html';
    document.body.appendChild(iframe);
    iframe.onload = t1.step_func(function () {
        try {
            var d = iframe.contentDocument;
            var s = new SR(d.head);
            var style = d.createElement('style');
            s.appendChild(style);
            assert_equals(d.styleSheets.length, 0,
                     'style elements in shadow DOM must not be exposed via ' +
                     'the document.styleSheets collection');            
        } finally {
            iframe.parentNode.removeChild(iframe);
        }
        t1.done();
    });
});


blank.html in the test above is the simple page with the following HTML:

<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>


Please note that the similar tests for links (instead of style link to the css 
file is being created) works well. Exact code is:

            var link = d.createElement('link');
            link.setAttribute('rel', 'stylesheet');
            link.setAttribute('href', 'testharness.css');
            s.appendChild(link);

The link from the above is not visible via document.styleSheets

Original issue reported on code.google.com by [email protected] on 22 Oct 2012 at 5:14

Specification is not complete about nodes types & shadow insertion points

It's not clear from the specification if any node (like text/comment node) can 
be an insertion point for shadow or Element node only.

The only text that contains node type info is "The elements that host shadow 
DOM subtrees are called shadow hosts, and the root nodes of the shadow DOM 
subtrees are called shadow roots". But this text does not asserts that only 
Element nodes can be shadow hosts.

I would propose asserting this directly.

Original issue reported on code.google.com by [email protected] on 22 Oct 2012 at 6:27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.