OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 installClass('HTMLMarqueeElement', function(HTMLMarqueeElementPrototype) { | 7 installClass('HTMLMarqueeElement', function(HTMLMarqueeElementPrototype) { |
8 | 8 |
9 var kDefaultScrollAmount = 6; | 9 var kDefaultScrollAmount = 6; |
10 var kDefaultScrollDelayMS = 85; | 10 var kDefaultScrollDelayMS = 85; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 reflectAttribute(HTMLMarqueeElementPrototype, 'behavior', 'behavior'); | 84 reflectAttribute(HTMLMarqueeElementPrototype, 'behavior', 'behavior'); |
85 reflectAttribute(HTMLMarqueeElementPrototype, 'bgcolor', 'bgColor'); | 85 reflectAttribute(HTMLMarqueeElementPrototype, 'bgcolor', 'bgColor'); |
86 reflectAttribute(HTMLMarqueeElementPrototype, 'direction', 'direction'); | 86 reflectAttribute(HTMLMarqueeElementPrototype, 'direction', 'direction'); |
87 reflectAttribute(HTMLMarqueeElementPrototype, 'height', 'height'); | 87 reflectAttribute(HTMLMarqueeElementPrototype, 'height', 'height'); |
88 reflectAttribute(HTMLMarqueeElementPrototype, 'hspace', 'hspace'); | 88 reflectAttribute(HTMLMarqueeElementPrototype, 'hspace', 'hspace'); |
89 reflectAttribute(HTMLMarqueeElementPrototype, 'vspace', 'vspace'); | 89 reflectAttribute(HTMLMarqueeElementPrototype, 'vspace', 'vspace'); |
90 reflectAttribute(HTMLMarqueeElementPrototype, 'width', 'width'); | 90 reflectAttribute(HTMLMarqueeElementPrototype, 'width', 'width'); |
91 reflectBooleanAttribute(HTMLMarqueeElementPrototype, 'truespeed', 'trueSpeed
'); | 91 reflectBooleanAttribute(HTMLMarqueeElementPrototype, 'truespeed', 'trueSpeed
'); |
92 | 92 |
93 HTMLMarqueeElementPrototype.createdCallback = function() { | 93 HTMLMarqueeElementPrototype.createdCallback = function() { |
94 var shadow = this.createShadowRoot(); | 94 var shadow = this.createUserAgentShadowRoot(); |
95 var style = document.createElement('style'); | 95 var style = document.createElement('style'); |
96 style.textContent = ':host { display: inline-block; width: -webkit-fill-
available; overflow: hidden; text-align: initial; }' | 96 style.textContent = ':host { display: inline-block; width: -webkit-fill-
available; overflow: hidden; text-align: initial; }' |
97 + ':host([direction="up"]), :host([direction="down"]) { overflow: in
itial; overflow-y: hidden; }'; | 97 + ':host([direction="up"]), :host([direction="down"]) { overflow: in
itial; overflow-y: hidden; }'; |
98 shadow.appendChild(style); | 98 shadow.appendChild(style); |
99 | 99 |
100 var mover = document.createElement('div'); | 100 var mover = document.createElement('div'); |
101 shadow.appendChild(mover); | 101 shadow.appendChild(mover); |
102 | 102 |
103 mover.appendChild(document.createElement('content')); | 103 mover.appendChild(document.createElement('content')); |
104 | 104 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 cancelAnimationFrame(this.continueCallback_); | 388 cancelAnimationFrame(this.continueCallback_); |
389 this.continueCallback_ = null; | 389 this.continueCallback_ = null; |
390 return; | 390 return; |
391 } | 391 } |
392 | 392 |
393 if (this.player_) { | 393 if (this.player_) { |
394 this.player_.pause(); | 394 this.player_.pause(); |
395 } | 395 } |
396 }; | 396 }; |
397 }); | 397 }); |
OLD | NEW |