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

Unified Diff: Source/web/resources/listPicker.js

Issue 1193813002: New SELECT Popup: Reduce the size of JSON data. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/web/PopupMenuImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/resources/listPicker.js
diff --git a/Source/web/resources/listPicker.js b/Source/web/resources/listPicker.js
index b9b093a83e462d04455c57ee6b25d7f51cd939c5..843d35a1a9559daeeaa411e55653f13cc63e0e88 100644
--- a/Source/web/resources/listPicker.js
+++ b/Source/web/resources/listPicker.js
@@ -315,10 +315,10 @@ ListPicker.prototype._applyItemStyle = function(element, styleConfig) {
if (!styleConfig)
return;
var style = element.style;
- style.visibility = styleConfig.visibility;
- style.display = styleConfig.display;
- style.direction = styleConfig.direction;
- style.unicodeBidi = styleConfig.unicodeBidi;
+ style.visibility = styleConfig.visibility ? styleConfig.visibility : "";
+ style.display = styleConfig.display ? styleConfig.display : "";
+ style.direction = styleConfig.direction ? styleConfig.direction : "";
+ style.unicodeBidi = styleConfig.unicodeBidi ? styleConfig.unicodeBidi : "";
if (!styleConfig.color)
return;
style.color = styleConfig.color;
@@ -335,9 +335,15 @@ ListPicker.prototype._configureItem = function(element, config, inGroup) {
if (config.type === "option") {
element.label = config.label;
element.value = config.value;
- element.title = config.title;
- element.disabled = config.disabled;
- element.setAttribute("aria-label", config.ariaLabel);
+ if (config.title)
+ element.title = config.title;
+ else
+ element.removeAttribute("title");
+ element.disabled = !!config.disabled
+ if (config.ariaLabel)
+ element.setAttribute("aria-label", config.ariaLabel);
+ else
+ element.removeAttribute("aria-label");
element.style.webkitPaddingStart = this._config.paddingStart + "px";
if (inGroup) {
element.style.webkitMarginStart = (- this._config.paddingStart) + "px";
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698