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

Commit

Permalink
Merge pull request #27821 from arcturus/bug-1058790
Browse files Browse the repository at this point in the history
Bug 1058790 - [RTL] International numbers are not correctly handled in Contacts r=jmcf
  • Loading branch information
arcturus committed Feb 3, 2015
2 parents e7880a6 + d2072f4 commit ed2b99f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
4 changes: 3 additions & 1 deletion apps/communications/contacts/elements/form.html
Expand Up @@ -22,7 +22,9 @@ <h1 id='contact-form-title' data-l10n-id="addContact">Add contact</h1>
</div>
<section class="second-row">
<p class="setbox-item">
<input placeholder="Phone" data-field="value" data-l10n-id="tel" name="tel[#i#][value]" class="textfield" type="tel" value="#value#" id="number_#i#">
<bdi>
<input placeholder="Phone" data-field="value" data-l10n-id="tel" name="tel[#i#][value]" class="textfield" type="tel" value="#value#" id="number_#i#">
</bdi>
<button type="reset">Clear</button>
</p>
</section>
Expand Down
8 changes: 4 additions & 4 deletions apps/communications/contacts/js/views/ice_settings.js
Expand Up @@ -170,11 +170,11 @@ contacts.ICE = (function() {
iceContactCheckboxes[index].checked = active;
iceContactButtons[index].disabled = !active;

var span = document.createElement('span');
span.classList.add('ice-contact');
span.textContent = label;
var bdi = document.createElement('bdi');
bdi.classList.add('ice-contact');
bdi.textContent = label;
iceContactButtons[index].innerHTML = '';
iceContactButtons[index].appendChild(span);
iceContactButtons[index].appendChild(bdi);
iceContactButtons[index].dataset.contactId = contactId;
}

Expand Down
11 changes: 7 additions & 4 deletions apps/communications/contacts/js/views/list.js
Expand Up @@ -638,6 +638,7 @@ contacts.List = (function() {
ele = document.createElement('p');
}
ele.classList.add('contact-text');
var bdi = document.createElement('bdi');
var givenName = (contact.givenName && contact.givenName[0]) || '';
var familyName = (contact.familyName && contact.familyName[0]) || '';

Expand All @@ -648,12 +649,14 @@ contacts.List = (function() {
}

if (orderByLastName) {
ele.appendChild(document.createTextNode(givenName + ' '));
ele.appendChild(createStrongTag(familyName));
bdi.appendChild(document.createTextNode(givenName + ' '));
bdi.appendChild(createStrongTag(familyName));
} else {
ele.appendChild(createStrongTag(givenName));
ele.appendChild(document.createTextNode(' ' + familyName));
bdi.appendChild(createStrongTag(givenName));
bdi.appendChild(document.createTextNode(' ' + familyName));
}

ele.appendChild(bdi);
return ele;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/communications/contacts/style/contacts.css
Expand Up @@ -340,7 +340,7 @@ form p textarea + button[type="reset"].hide {
margin-left: 0 !important;
}

#contact-detail p > strong,
#contact-detail bdi > strong,
.action-block b,
.comment-notes {
font-size: 1.6rem;
Expand Down
4 changes: 2 additions & 2 deletions apps/communications/contacts/test/unit/views/list_test.js
Expand Up @@ -1058,7 +1058,7 @@ suite('Render contacts list', function() {
assert.equal(node.dataset.order,
Normalizer.escapeHTML(expected, true));

var printed = node.querySelector('p');
var printed = node.querySelector('bdi');

// Check as well the correct highlight
// familyName to be in bold
Expand Down Expand Up @@ -1090,7 +1090,7 @@ suite('Render contacts list', function() {
assert.equal(
node.dataset.order, Normalizer.escapeHTML(expected, true));

var name = node.querySelector('p');
var name = node.querySelector('bdi');

// Check highlight
// Given name to be in bold
Expand Down
4 changes: 2 additions & 2 deletions tests/python/gaia-ui-tests/gaiatest/apps/contacts/app.py
Expand Up @@ -128,8 +128,8 @@ def is_no_contacts_message_displayed(self):

class Contact(PageRegion):

_name_locator = (By.CSS_SELECTOR, 'p > strong')
_full_name_locator = (By.CSS_SELECTOR, 'p.contact-text')
_name_locator = (By.CSS_SELECTOR, 'bdi > strong')
_full_name_locator = (By.CSS_SELECTOR, 'p.contact-text bdi')
_image_locator = (By.CSS_SELECTOR, 'span[data-type="img"]')

@property
Expand Down

0 comments on commit ed2b99f

Please sign in to comment.