Skip to content

Commit

Permalink
Merge pull request #2093 from TakayoshiKochi/events
Browse files Browse the repository at this point in the history
Fix createTestMediaPlayer
  • Loading branch information
hayatoito committed Aug 18, 2015
2 parents 524b1d3 + 56c6c43 commit 885ed83
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
36 changes: 18 additions & 18 deletions shadow-dom/events/event-dispatch/test-001.html
Expand Up @@ -35,7 +35,7 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-slider-thumb relative target #volume-slider-thumb
//For #volume-slider-thumb relative target #volume-slider-thumb
roots.volumeShadowRoot.querySelector('#volume-slider-thumb').addEventListener('click',
A_05_05_01_T01.step_func(function(event) {
invoked = true;
Expand Down Expand Up @@ -68,7 +68,7 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-shadow-root relative target #volume-slider-thumb
//For #volume-shadow-root relative target #volume-slider-thumb
roots.volumeShadowRoot.addEventListener('click',
A_05_05_01_T02.step_func(function(event) {
invoked = true;
Expand Down Expand Up @@ -101,13 +101,13 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-slider relative target #volume-slider
//For #volume-slider relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
A_05_05_01_T03.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider',
'Wrong currentTarget');
}), false);

Expand Down Expand Up @@ -135,13 +135,13 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-slider-container relative target #volume-slider
//For #volume-slider-container relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
A_05_05_01_T04.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider-container',
'Wrong currentTarget');
}), false);

Expand All @@ -168,13 +168,13 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #controls relative target #volume-slider
//For #controls relative target #volume-shadow-host
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
A_05_05_01_T05.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'controls',
'Wrong currentTarget');
}), false);

Expand All @@ -201,13 +201,13 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #player-shadow-root relative target #volume-slider
roots.playerShadowRoot.addEventListener('click',
//For #player-shadow-host relative target #player-shadow-host
d.querySelector('#player-shadow-host').addEventListener('click',
A_05_05_01_T06.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
assert_equals(event.currentTarget.getAttribute('id'), 'player-shadow-host',
'Wrong currentTarget');
}), false);

Expand Down Expand Up @@ -235,13 +235,13 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #player relative target #player
//For #player relative target #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_05_01_T07.step_func(function(event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong target');
assert_true(event.currentTarget.getAttribute('id'), 'player',
assert_equals(event.currentTarget.getAttribute('id'), 'player',
'Wrong currentTarget');
}), false);

Expand Down
30 changes: 15 additions & 15 deletions shadow-dom/events/event-retargeting/test-004.html
Expand Up @@ -60,11 +60,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-shadow-root relative target is #volume-slider-thumb
roots.volumeShadowRoot.addEventListener('click',
//For #volume-shadow-host relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-shadow-host').addEventListener('click',
A_05_01_04_T02.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider-thumb',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);

Expand All @@ -90,11 +90,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-slider relative target is #volume-slider
//For #volume-slider relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
A_05_01_04_T03.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);

Expand All @@ -118,11 +118,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #volume-slider-container relative target is #volume-slider
//For #volume-slider-container relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
A_05_01_04_T04.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);

Expand All @@ -146,11 +146,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #controls relative target is #volume-slider
//For #controls relative target is #volume-shadow-host
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
A_05_01_04_T05.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);

Expand All @@ -174,11 +174,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #player-shadow-root relative target is #volume-slider
//For #player-shadow-host relative target is #player-shadow-host
roots.playerShadowRoot.addEventListener('click',
A_05_01_04_T06.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'volume-slider',
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
'Wrong related target');
}), false);

Expand All @@ -203,11 +203,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #player relative target is #player
//For #player relative target is #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_01_04_T07.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong related target');
}), false);

Expand Down Expand Up @@ -344,11 +344,11 @@
//expected result of what relative target should be see
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example

//For #player relative target is #player
//For #player relative target is #player-shadow-host
d.querySelector('#player').addEventListener('click',
A_05_01_04_T12.step_func(function (event) {
invoked = true;
assert_equals(event.target.getAttribute('id'), 'player',
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
'Wrong related target');
}), false);

Expand Down
20 changes: 10 additions & 10 deletions shadow-dom/testcommon.js
Expand Up @@ -228,30 +228,30 @@ function createTestMediaPlayer(d) {
d.body.innerHTML = '' +
'<div id="player">' +
'<input type="checkbox" id="outside-control">' +
'<div id="player-shadow-root">' +
'<div id="player-shadow-host">' +
'</div>' +
'</div>';

var playerShadowRoot = d.querySelector('#player-shadow-root').createShadowRoot();
var playerShadowRoot = d.querySelector('#player-shadow-host').createShadowRoot();
playerShadowRoot.innerHTML = '' +
'<div id="controls">' +
'<button class="play-button">PLAY</button>' +
'<input type="range" id="timeline">' +
'<div id="timeline-shadow-root">' +
'<div tabindex="0" id="timeline">' +
'<div id="timeline-shadow-host">' +
'</div>' +
'</input>' +
'</div>' +
'<div class="volume-slider-container" id="volume-slider-container">' +
'<input type="range" class="volume-slider" id="volume-slider">' +
'<div id="volume-shadow-root">' +
'<div tabindex="0" class="volume-slider" id="volume-slider">' +
'<div id="volume-shadow-host">' +
'</div>' +
'</input>' +
'</div>' +
'</div>' +
'</div>';

var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-root').createShadowRoot();
var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-host').createShadowRoot();
timeLineShadowRoot.innerHTML = '<div class="slider-thumb" id="timeline-slider-thumb"></div>';

var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-root').createShadowRoot();
var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-host').createShadowRoot();
volumeShadowRoot.innerHTML = '<div class="slider-thumb" id="volume-slider-thumb"></div>';

return {
Expand Down

0 comments on commit 885ed83

Please sign in to comment.