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

Side by Side Diff: Source/core/html/HTMLMarqueeElement.js

Issue 393543002: Reflected attributes should be removed when 'null', 'undefined' or 'false' is specified (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/html/marquee-element-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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(global) { 7 installClass('HTMLMarqueeElement', function(global) {
8 8
9 var kDefaultScrollAmount = 6; 9 var kDefaultScrollAmount = 6;
10 var kDefaultScrollDelayMS = 85; 10 var kDefaultScrollDelayMS = 85;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 enumerable: true, 55 enumerable: true,
56 }); 56 });
57 } 57 }
58 58
59 function reflectBooleanAttribute(prototype, attributeName, propertyName) { 59 function reflectBooleanAttribute(prototype, attributeName, propertyName) {
60 Object.defineProperty(prototype, propertyName, { 60 Object.defineProperty(prototype, propertyName, {
61 get: function() { 61 get: function() {
62 return this.hasAttribute(attributeName); 62 return this.hasAttribute(attributeName);
63 }, 63 },
64 set: function(value) { 64 set: function(value) {
65 if (value.valueOf() === false) 65 if (value)
66 this.setAttribute(attributeName, '');
67 else
66 this.removeAttribute(attributeName); 68 this.removeAttribute(attributeName);
67 else
68 this.setAttribute(attributeName, value ? '' : null);
69 }, 69 },
70 }); 70 });
71 } 71 }
72 72
73 function defineInlineEventHandler(prototype, eventName) { 73 function defineInlineEventHandler(prototype, eventName) {
74 var propertyName = 'on' + eventName; 74 var propertyName = 'on' + eventName;
75 // FIXME: We should use symbols here instead. 75 // FIXME: We should use symbols here instead.
76 var functionPropertyName = propertyName + 'Function_'; 76 var functionPropertyName = propertyName + 'Function_';
77 var eventHandlerPropertyName = propertyName + 'EventHandler_'; 77 var eventHandlerPropertyName = propertyName + 'EventHandler_';
78 Object.defineProperty(prototype, propertyName, { 78 Object.defineProperty(prototype, propertyName, {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 }; 400 };
401 401
402 // FIXME: We have to inject this HTMLMarqueeElement as a custom element in o rder to make 402 // FIXME: We have to inject this HTMLMarqueeElement as a custom element in o rder to make
403 // createdCallback, attachedCallback, detachedCallback and attributeChangedC allback workable. 403 // createdCallback, attachedCallback, detachedCallback and attributeChangedC allback workable.
404 // global.document.registerElement('i-marquee', { 404 // global.document.registerElement('i-marquee', {
405 // prototype: HTMLMarqueeElementPrototype, 405 // prototype: HTMLMarqueeElementPrototype,
406 // }); 406 // });
407 407
408 return HTMLMarqueeElementPrototype; 408 return HTMLMarqueeElementPrototype;
409 }); 409 });
OLDNEW
« no previous file with comments | « LayoutTests/fast/html/marquee-element-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698