Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: Source/core/html/HTMLMarqueeElement.js

Issue 466623002: Refactor PrivateScriptRunner.js to reduce the number of globally exposed variables (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/PrivateScriptRunner.js ('k') | Source/core/testing/PartialPrivateScriptTest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMarqueeElement.js
diff --git a/Source/core/html/HTMLMarqueeElement.js b/Source/core/html/HTMLMarqueeElement.js
index f867151b39e10c121dc26640cf79f4174de90816..142e2f2553bfb44cb5042e52651cd43dc6617be9 100644
--- a/Source/core/html/HTMLMarqueeElement.js
+++ b/Source/core/html/HTMLMarqueeElement.js
@@ -4,7 +4,7 @@
'use strict';
-installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype) {
+installClass('HTMLMarqueeElement', function(HTMLMarqueeElementPrototype) {
var kDefaultScrollAmount = 6;
var kDefaultScrollDelayMS = 85;
@@ -122,15 +122,15 @@ installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype)
HTMLMarqueeElementPrototype.createdCallback = function() {
var shadow = this.createShadowRoot();
- var style = global.document.createElement('style');
+ var style = document.createElement('style');
style.textContent = ':host { display: inline-block; width: -webkit-fill-available; overflow: hidden; text-align: initial; }' +
':host([direction="up"]), :host([direction="down"]) { height: 200px; }';
shadow.appendChild(style);
- var mover = global.document.createElement('div');
+ var mover = document.createElement('div');
shadow.appendChild(mover);
- mover.appendChild(global.document.createElement('content'));
+ mover.appendChild(document.createElement('content'));
this.loopCount_ = 0;
this.mover_ = mover;
@@ -234,8 +234,8 @@ installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype)
HTMLMarqueeElementPrototype.getGetMetrics_ = function() {
this.mover_.style.width = '-webkit-max-content';
- var moverStyle = global.getComputedStyle(this.mover_);
- var marqueeStyle = global.getComputedStyle(this);
+ var moverStyle = getComputedStyle(this.mover_);
+ var marqueeStyle = getComputedStyle(this);
var metrics = {};
metrics.contentWidth = parseInt(moverStyle.width);
@@ -391,7 +391,7 @@ installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype)
HTMLMarqueeElementPrototype.start = function() {
if (this.continueCallback_ || this.player_)
return;
- this.continueCallback_ = global.requestAnimationFrame(function() {
+ this.continueCallback_ = requestAnimationFrame(function() {
this.continueCallback_ = null;
this.continue_();
}.bind(this));
@@ -403,7 +403,7 @@ installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype)
return;
if (this.continueCallback_) {
- global.cancelAnimationFrame(this.continueCallback_);
+ cancelAnimationFrame(this.continueCallback_);
this.continueCallback_ = null;
return;
}
@@ -420,7 +420,7 @@ installClass('HTMLMarqueeElement', function(global, HTMLMarqueeElementPrototype)
// FIXME: We have to inject this HTMLMarqueeElement as a custom element in order to make
// createdCallback, attachedCallback, detachedCallback and attributeChangedCallback workable.
- // global.document.registerElement('i-marquee', {
+ // document.registerElement('i-marquee', {
// prototype: HTMLMarqueeElementPrototype,
// });
});
« no previous file with comments | « Source/bindings/core/v8/PrivateScriptRunner.js ('k') | Source/core/testing/PartialPrivateScriptTest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698