Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Merge pull request #22254 from #24469

Merged
merged 1 commit into from Sep 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 3 additions & 9 deletions apps/keyboard/js/imes/latin/latin.js
Expand Up @@ -893,23 +893,17 @@
//
// 1) If the cursor is at the start of the field: uppercase
//
// 2) If there are two uppercase chars before the cursor: uppercase
//
// 3) If there is a non space character immediately before the cursor:
// 2) If there is a non space character immediately before the cursor:
// lowercase
//
// 4) If the first non-space character before the cursor is . ? or !:
// 3) If the first non-space character before the cursor is . ? or !:
// uppercase
//
// 5) Otherwise: lowercase
// 4) Otherwise: lowercase
//
if (cursor === 0) {
keyboard.setUpperCase(true);
}
else if (cursor >= 2 &&
isUpperCase(inputText.substring(cursor - 2, cursor))) {
keyboard.setUpperCase(true);
}
else if (!isWhiteSpace(inputText.substring(cursor - 1, cursor))) {
keyboard.setUpperCase(false);
}
Expand Down
9 changes: 3 additions & 6 deletions apps/keyboard/test/unit/latin_test.js
Expand Up @@ -229,10 +229,6 @@ suite('latin input method capitalization and punctuation', function() {
if (cursor === 0)
return capitalize(input);

// If inserting in an all caps word, use uppercase
if (cursor >= 2 && isUppercase(value.substring(cursor - 2, cursor)))
return input.toUpperCase();

// if the character before the cursor is not a space, don't capitalize
if (!/\s/.test(value[cursor - 1]))
return input;
Expand Down Expand Up @@ -535,8 +531,9 @@ suite('latin input method capitalization and punctuation', function() {
im.deactivate();
assert.equal(output, expected,
'expected "' + expected + '" for input "' + input + '"');
next();
});
}, function() {
assert.ok(false, 'should not reject');
}).then(next, next);
} else {
// Send the input one character at a time, converting
// the input to uppercase if the IM has set uppercase
Expand Down