Commit 6d0a8336 authored by estade's avatar estade Committed by Commit bot

Get rid of some <label for> misuse in browser_options.html

Two main cases:
1. <label> not wrapping input + span
2. for accessibility -- for=<selector-id> should instead use aria-labelledby

BUG=409938

Review URL: https://codereview.chromium.org/536703002

Cr-Commit-Position: refs/heads/master@{#293215}
parent 8ecc3071
...@@ -120,8 +120,8 @@ cr.define('options', function() { ...@@ -120,8 +120,8 @@ cr.define('options', function() {
if (buttonId != '') { if (buttonId != '') {
var button = document.createElement('button'); var button = document.createElement('button');
button.setAttribute('id', buttonId); button.id = buttonId;
button.setAttribute('class', 'link-button'); button.className = 'link-button';
button.textContent = footerFragments[i + 1]; button.textContent = footerFragments[i + 1];
footer.appendChild(button); footer.appendChild(button);
i += 3; i += 3;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
-webkit-box-align: center; -webkit-box-align: center;
-webkit-box-flex: 1; -webkit-box-flex: 1;
-webkit-margin-start: 0.6em; -webkit-margin-start: 0.6em;
-webkit-user-select: none;
display: -webkit-box; display: -webkit-box;
} }
......
...@@ -158,8 +158,8 @@ class SharedOptionsTest : public LoginManagerTest { ...@@ -158,8 +158,8 @@ class SharedOptionsTest : public LoginManagerTest {
"var success = false;" "var success = false;"
"if (input) {" "if (input) {"
" success = input.disabled == %d;" " success = input.disabled == %d;"
" var indicator = document.querySelector(input.tagName +" " var indicator = input.parentNode.parentNode.querySelector("
" prefSelector + ' + span span.controlled-setting-indicator');" " '.controlled-setting-indicator');"
" if (controlledBy) {" " if (controlledBy) {"
" success = success && indicator &&" " success = success && indicator &&"
" indicator.getAttribute('controlled-by') == controlledBy;" " indicator.getAttribute('controlled-by') == controlledBy;"
......
...@@ -99,7 +99,8 @@ GEN('#endif // defined(OS_MACOSX)'); ...@@ -99,7 +99,8 @@ GEN('#endif // defined(OS_MACOSX)');
TEST_F('OptionsWebUITest', 'MAYBE_testSetBooleanPrefTriggers', function() { TEST_F('OptionsWebUITest', 'MAYBE_testSetBooleanPrefTriggers', function() {
// TODO(dtseng): make generic to click all buttons. // TODO(dtseng): make generic to click all buttons.
var showHomeButton = $('show-home-button'); var showHomeButton =
document.querySelector('input[pref="browser.show_home_button"]');
var trueListValue = [ var trueListValue = [
'browser.show_home_button', 'browser.show_home_button',
true, true,
......
...@@ -256,7 +256,7 @@ input:disabled:-webkit-any([type='password'], ...@@ -256,7 +256,7 @@ input:disabled:-webkit-any([type='password'],
* Resolve this by using 'inherit'. */ * Resolve this by using 'inherit'. */
font: inherit; font: inherit;
margin: 0; margin: 0;
padding: 0 4px; padding: 0;
} }
.link-button:hover { .link-button:hover {
...@@ -295,7 +295,9 @@ input:disabled:-webkit-any([type='password'], ...@@ -295,7 +295,9 @@ input:disabled:-webkit-any([type='password'],
} }
:-webkit-any(.checkbox, .radio) label input ~ span { :-webkit-any(.checkbox, .radio) label input ~ span {
-webkit-margin-end: 0.3em;
-webkit-margin-start: 0.6em; -webkit-margin-start: 0.6em;
-webkit-user-select: none;
/* Make sure long spans wrap at the same horizontal position they start. */ /* Make sure long spans wrap at the same horizontal position they start. */
display: block; display: block;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment