OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <meta name="transition-elements" content="#transitionElement,#boxTransitionEleme
nt;*"> | 3 <meta name="transition-elements" content="#transitionElement,#boxTransitionEleme
nt;*"> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 description('Tests for the HTML markup serializer used for transition elements')
; | 7 description('Tests for the HTML markup serializer used for transition elements a
nd transition element names and rects'); |
8 jsTestIsAsync = true; | 8 jsTestIsAsync = true; |
9 | 9 |
10 window.onload = function() { | 10 window.onload = function() { |
11 if (window.internals) { | 11 if (window.internals) { |
12 var serializedHTML = internals.serializeNavigationMarkup(); | 12 var serializedHTML = internals.serializeNavigationMarkup(); |
13 var testiframe = document.getElementById('testiframe'); | 13 var testiframe = document.getElementById('testiframe'); |
14 testiframe.contentDocument.write(serializedHTML); | 14 testiframe.contentDocument.write(serializedHTML); |
15 | 15 |
16 transitionElement = document.getElementById('transitionElement'); | 16 transitionElement = document.getElementById('transitionElement'); |
17 sourceElement = document.getElementById('boxTransitionElement'); | 17 sourceElement = document.getElementById('boxTransitionElement'); |
(...skipping 16 matching lines...) Expand all Loading... |
34 shouldBe('sourceElementRect.height', 'destElement.offsetHeight'); | 34 shouldBe('sourceElementRect.height', 'destElement.offsetHeight'); |
35 shouldBe('sourceElementRect.width', 'destElement.offsetWidth'); | 35 shouldBe('sourceElementRect.width', 'destElement.offsetWidth'); |
36 | 36 |
37 shouldBeTrue('preHidingTransitionElementOpacity == 1'); | 37 shouldBeTrue('preHidingTransitionElementOpacity == 1'); |
38 shouldBeTrue('postHidingTransitionElementOpacity == 0'); | 38 shouldBeTrue('postHidingTransitionElementOpacity == 0'); |
39 | 39 |
40 // Hiding transition elements should not shift any other elements on the
page. | 40 // Hiding transition elements should not shift any other elements on the
page. |
41 shouldBe('preHidingBottomElementRect.top', 'postHidingBottomElementRect.
top'); | 41 shouldBe('preHidingBottomElementRect.top', 'postHidingBottomElementRect.
top'); |
42 shouldBe('preHidingBottomElementRect.left', 'postHidingBottomElementRect
.left'); | 42 shouldBe('preHidingBottomElementRect.left', 'postHidingBottomElementRect
.left'); |
43 | 43 |
| 44 transitionElementIds = internals.getTransitionElementIds(); |
| 45 shouldBeEqualToString('transitionElementIds[0]', 'transitionElement'); |
| 46 shouldBeEqualToString('transitionElementIds[1]', 'boxTransitionElement')
; |
| 47 |
| 48 transitionElementRects = internals.getTransitionElementRects(); |
| 49 transitionElementBounds = internals.boundsInRootViewSpace(transitionElem
ent); |
| 50 boxTransitionElementBounds = internals.boundsInRootViewSpace(sourceEleme
nt); |
| 51 shouldBeTrue('transitionElementRects[0].left == transitionElementBounds.
left'); |
| 52 shouldBeTrue('transitionElementRects[0].top == transitionElementBounds.t
op'); |
| 53 shouldBeTrue('transitionElementRects[0].width == transitionElementBounds
.width'); |
| 54 shouldBeTrue('transitionElementRects[0].height == transitionElementBound
s.height'); |
| 55 shouldBeTrue('transitionElementRects[1].left == boxTransitionElementBoun
ds.left'); |
| 56 shouldBeTrue('transitionElementRects[1].top == boxTransitionElementBound
s.top'); |
| 57 shouldBeTrue('transitionElementRects[1].width == boxTransitionElementBou
nds.width'); |
| 58 shouldBeTrue('transitionElementRects[1].height == boxTransitionElementBo
unds.height'); |
| 59 |
44 finishJSTest(); | 60 finishJSTest(); |
45 } | 61 } |
46 } | 62 } |
47 </script> | 63 </script> |
48 | 64 |
49 <style> | 65 <style> |
50 | 66 |
51 body { | 67 body { |
52 background: white; | 68 background: white; |
53 margin-height: 0px; | 69 margin-height: 0px; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 <div id="transitionElement">Header</div> | 108 <div id="transitionElement">Header</div> |
93 | 109 |
94 <div id="boxTransitionElement"> | 110 <div id="boxTransitionElement"> |
95 <img id="blueBox" src="resources/images/blue.png"> | 111 <img id="blueBox" src="resources/images/blue.png"> |
96 </div> | 112 </div> |
97 | 113 |
98 <div id="bottomElement">Footer</div> | 114 <div id="bottomElement">Footer</div> |
99 </div> | 115 </div> |
100 | 116 |
101 <iframe id="testiframe"></iframe> | 117 <iframe id="testiframe"></iframe> |
OLD | NEW |