Skip to content

Commit

Permalink
Merge pull request #210 from summerwind/submission/summerwind
Browse files Browse the repository at this point in the history
shadow-dom: Fixed indent style and performance improvement
  • Loading branch information
hayatoito committed Jun 9, 2013
2 parents f597dc1 + b8f40fe commit 21b7965
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@
};
}

var inner_html = 'div::x-thumb { font-size: 30px; } '
+ 'div::xthumb { font-size: 30px; } '
+ 'div::-thumb { font-size: 30px; } '
+ 'div::thumb { font-size: 30px; }';

style = d.createElement('style');
style.innerHTML = '';
style.innerHTML += 'div::x-thumb { font-size: 30px; }';
style.innerHTML += 'div::xthumb { font-size: 30px; }';
style.innerHTML += 'div::-thumb { font-size: 30px; }';
style.innerHTML += 'div::thumb { font-size: 30px; }';
style.innerHTML = inner_html;
d.body.appendChild(style);

for (var val in elems) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@
<div id="log"></div>
<script>
test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
var d = newRenderedHTMLDocument(ctx);

var host = d.createElement('div');
host.contentEditable = "true";
d.body.appendChild(host);
var host = d.createElement('div');
host.contentEditable = "true";
d.body.appendChild(host);

var s = createSR(host);
var s = createSR(host);

assert_equals(host.contentEditable, "true");
assert_equals(host.contentEditable, "true");
assert_equals(s.contentEditable, undefined);
}), 'contentEditable of shadow trees must be undefined when contentEditable attribute of shadow host is "true"');

test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
var d = newRenderedHTMLDocument(ctx);

var host = d.createElement('div');
host.contentEditable = "false";
d.body.appendChild(host);
var host = d.createElement('div');
host.contentEditable = "false";
d.body.appendChild(host);

var s = createSR(host);
var s = createSR(host);

assert_equals(host.contentEditable, 'false');
assert_equals(host.contentEditable, 'false');
assert_equals(s.contentEditable, undefined);
}), 'contentEditable of shadow trees must be undefined when contentEditable of shadow host is "false"');

test(unit(function (ctx) {
var d = newRenderedHTMLDocument(ctx);
var d = newRenderedHTMLDocument(ctx);

var host = d.createElement('div');
d.body.appendChild(host);
d.body.contentEditable = "true";
var host = d.createElement('div');
d.body.appendChild(host);
d.body.contentEditable = "true";

var s = createSR(host);
assert_equals(host.contentEditable, 'inherit');
var s = createSR(host);

assert_equals(host.contentEditable, 'inherit');
assert_equals(s.contentEditable, undefined);
}), 'contentEditable of shadow trees must be undefined when contentEditable attribute of shadow host is "inherit"');
</script>
Expand Down

0 comments on commit 21b7965

Please sign in to comment.