kenjibaheux / test-suite-for-shadow-dom Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/test-suite-for-shadow-dom
Automatically exported from code.google.com/p/test-suite-for-shadow-dom
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.