Changeset 207111 in webkit
- Timestamp:
- Oct 11, 2016 5:52:28 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207086 r207111 1 2016-10-11 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Buttons container 4 https://bugs.webkit.org/show_bug.cgi?id=163238 5 <rdar://problem/28701864> 6 7 Reviewed by Dean Jackson. 8 9 Adding tests for the new ButtonsContainer class. 10 11 * media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt: Added. 12 * media/modern-media-controls/buttons-container/buttons-container-buttons-property.html: Added. 13 * media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt: Added. 14 * media/modern-media-controls/buttons-container/buttons-container-constructor.html: Added. 15 * media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt: Added. 16 * media/modern-media-controls/buttons-container/buttons-container-layout.html: Added. 17 1 18 2016-10-11 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r207086 r207111 1 2016-10-11 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Buttons container 4 https://bugs.webkit.org/show_bug.cgi?id=163238 5 <rdar://problem/28701864> 6 7 Reviewed by Dean Jackson. 8 9 We add a new ButtonsContainer class which contains a group of Button objects 10 and positions them based on the provided padding and margin between buttons. 11 Buttons that aren't enabled or marked as dropped are not added to the tree of 12 LayoutNodes, and thus the DOM. 13 14 Additionally, we fix a few issues we found while working on tests for ButtonsContainer 15 where LayoutNodes would schedule layout callbacks even when they would not do any work 16 during the layout callback due to not resetting the `needsLayout` flag to false and 17 removing any scheduled tasks when a layout was completed. 18 19 Finally, we fix a few style issues that had not been caught so far and an unused 20 `size` property on IconButton. 21 22 Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html 23 media/modern-media-controls/buttons-container/buttons-container-constructor.html 24 media/modern-media-controls/buttons-container/buttons-container-layout.html 25 26 * Modules/modern-media-controls/controls/airplay-button.js: 27 (AirplayButton.prototype.set on): 28 (AirplayButton): 29 * Modules/modern-media-controls/controls/buttons-container.css: 30 (.buttons-container): 31 * Modules/modern-media-controls/controls/buttons-container.js: 32 (ButtonsContainer.prototype.get buttons): 33 (ButtonsContainer.prototype.set buttons): 34 (ButtonsContainer.prototype.layout): 35 * Modules/modern-media-controls/controls/icon-button.js: 36 * Modules/modern-media-controls/controls/layout-node.js: 37 (LayoutNode.prototype.set needsLayout): 38 (LayoutNode.prototype.markDirtyProperty): 39 (LayoutNode.prototype._markNodeManipulation): 40 (LayoutNode.prototype._updateDirtyState): 41 (performScheduledLayout): 42 (elementFromString): 43 * Modules/modern-media-controls/controls/scheduler.js: 44 (const.scheduler.new.prototype.unscheduleLayout): 45 1 46 2016-10-11 Youenn Fablet <youenn@apple.com> 2 47 -
trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-button.js
r207015 r207111 40 40 if (!!iconName) 41 41 this.iconName = iconName; 42 43 this.size = { width: 0, height: 0 };44 42 } 45 43 -
trunk/Source/WebCore/Modules/modern-media-controls/controls/layout-node.js
r206686 r207111 96 96 return; 97 97 98 this._needsLayout = true;98 this._needsLayout = flag; 99 99 this._updateDirtyState(); 100 100 } … … 168 168 } 169 169 170 markDirtyProperty(propertyName) { 170 markDirtyProperty(propertyName) 171 { 171 172 const hadProperty = this._dirtyProperties.has(propertyName); 172 173 this._dirtyProperties.add(propertyName); … … 218 219 // Private 219 220 220 _markNodeManipulation(manipulation) { 221 _markNodeManipulation(manipulation) 222 { 221 223 this._pendingDOMManipulation = manipulation; 222 224 this._updateDirtyState(); 223 225 } 224 226 225 _updateDirtyState() { 227 _updateDirtyState() 228 { 226 229 if (this.needsLayout) { 227 230 dirtyNodes.add(this); 228 231 scheduler.scheduleLayout(performScheduledLayout); 229 } else 230 dirtyNodes.delete(node); 232 } else { 233 dirtyNodes.delete(this); 234 if (dirtyNodes.size === 0) 235 scheduler.unscheduleLayout(performScheduledLayout); 236 } 231 237 } 232 238 … … 256 262 }; 257 263 258 function performScheduledLayout() { 259 dirtyNodes.forEach(node => node.layout()); 264 function performScheduledLayout() 265 { 266 dirtyNodes.forEach(node => { 267 node.needsLayout = false; 268 node.layout() 269 }); 260 270 dirtyNodes.clear(); 271 scheduler.unscheduleLayout(performScheduledLayout); 261 272 262 273 nodesRequiringChildrenUpdate.forEach(node => node._updateChildren()); … … 264 275 } 265 276 266 function elementFromString(elementString) { 277 function elementFromString(elementString) 278 { 267 279 const element = document.createElement("div"); 268 280 element.innerHTML = elementString; -
trunk/Source/WebCore/Modules/modern-media-controls/controls/scheduler.js
r206606 r207111 18 18 this._layoutCallbacks.add(callback); 19 19 this._requestFrameIfNeeded(); 20 } 21 22 unscheduleLayout(callback) 23 { 24 if (typeof callback !== "function") 25 return; 26 27 this._layoutCallbacks.delete(callback); 20 28 } 21 29
Note: See TracChangeset
for help on using the changeset viewer.