diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index cbd96fd4e9a..68bbc20bfe0 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index bb216fd4d82..2a38a2a0053 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,13 +19,13 @@ - + - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 526f40f6587..0314d0efb1f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,10 +17,10 @@ - + - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 11fab548642..b2a467bfa76 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index bb216fd4d82..2a38a2a0053 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,13 +19,13 @@ - + - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d7a1f77589a..d34a8a9436a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 65662db8315..9b87b78020d 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,10 +17,10 @@ - + - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d42f8ea36e8..ed6304d26e3 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3f1ebdadd4043e68d2f6ebf295651e0d4cc5c93f", + "revision": "5e3f9375165bca64a0066f51fbd79bd32e380a6b", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 70d8e585728..1f9b54920b0 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,11 +17,11 @@ - + - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9e176acfa6e..270d65ef832 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 91cc08b8a81..ef1ed782031 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,10 +17,10 @@ - + - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 8e85450ef7c..1cae410d30b 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,12 +17,12 @@ - + - + diff --git a/dom/nfc/nsNfc.js b/dom/nfc/nsNfc.js index 8bd2cf349e8..857ebc1bf0d 100644 --- a/dom/nfc/nsNfc.js +++ b/dom/nfc/nsNfc.js @@ -98,6 +98,15 @@ NfcCallback.prototype = { Ci.nsINfcRequestCallback]), }; +// Should be mapped to the NFCTagType defined in MozNFCTag.webidl. +let TagType = { + TYPE1: "Type1", + TYPE2: "Type2", + TYPE3: "Type3", + TYPE4: "Type4", + MIFARE_CLASSIC: "MIFARE-Classic" +}; + /** * Implementation of NFCTag. * @@ -120,8 +129,9 @@ function MozNFCTagImpl(window, sessionToken, tagInfo, ndefInfo) { this.maxNDEFSize = ndefInfo.maxNDEFSize; this.isReadOnly = ndefInfo.isReadOnly; this.isFormatable = ndefInfo.isFormatable; - this.canBeMadeReadOnly = this.type == "type1" || this.type == "type2" || - this.type == "mifare_classic"; + this.canBeMadeReadOnly = this.type == TagType.TYPE1 || + this.type == TagType.TYPE2 || + this.type == TagType.MIFARE_CLASSIC; } } MozNFCTagImpl.prototype = { diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index 408e473fabb..e00ef858418 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -584,28 +584,16 @@ SelectionCarets::SelectWord() nsPoint ptInFrame = mDownPoint; nsLayoutUtils::TransformPoint(rootFrame, ptFrame, ptInFrame); - nsIFrame* currFrame = ptFrame; - nsIContent* newFocusContent = nullptr; - while (currFrame) { - int32_t tabIndexUnused = 0; - if (currFrame->IsFocusable(&tabIndexUnused, true)) { - newFocusContent = currFrame->GetContent(); - nsCOMPtr domElement(do_QueryInterface(newFocusContent)); - if (domElement) - break; - } - currFrame = currFrame->GetParent(); - } - - - // If target frame is focusable, we should move focus to it. If target frame - // isn't focusable, and our previous focused content is editable, we should + // If target frame is editable, we should move focus to targe frame. If + // target frame isn't editable and our focus content is editable, we should // clear focus. nsFocusManager* fm = nsFocusManager::GetFocusManager(); nsIContent* editingHost = ptFrame->GetContent()->GetEditingHost(); - if (newFocusContent && currFrame) { - nsCOMPtr domElement(do_QueryInterface(newFocusContent)); - fm->SetFocus(domElement,0); + if (editingHost) { + nsCOMPtr elt = do_QueryInterface(editingHost->GetParent()); + if (elt) { + fm->SetFocus(elt, 0); + } if (!nsContentUtils::HasNonEmptyTextContent( editingHost, nsContentUtils::eRecurseIntoChildren)) { diff --git a/layout/base/tests/marionette/test_selectioncarets.py b/layout/base/tests/marionette/test_selectioncarets.py index 082d1071235..50e89e0cee2 100644 --- a/layout/base/tests/marionette/test_selectioncarets.py +++ b/layout/base/tests/marionette/test_selectioncarets.py @@ -39,32 +39,17 @@ class SelectionCaretsTest(MarionetteTestCase): self._contenteditable = self.marionette.find_element(*self._contenteditable_selector) self._content = self.marionette.find_element(*self._content_selector) - def _first_word_location(self, el): - '''Get the location (x, y) of the first word in el. - - Note: this function has a side effect which changes focus to the - target element el. - - ''' - sel = SelectionManager(el) - - # Move caret behind the first character to get the location of the first - # word. + def _long_press_to_select_first_word(self, el, sel): + # Move caret inside the first word. el.tap() sel.move_caret_to_front() sel.move_caret_by_offset(1) + x, y = sel.caret_location() - return sel.caret_location() - - def _long_press_to_select(self, el, x, y): - '''Long press the location (x, y) to select a word. - - SelectionCarets should appear. On Windows, those spaces after the - word will also be selected. - - ''' - long_press_without_contextmenu(self.marionette, el, self._long_press_time, - x, y) + # Long press the caret position. Selection carets should appear, and the + # first word will be selected. On Windows, those spaces after the word + # will also be selected. + long_press_without_contextmenu(self.marionette, el, self._long_press_time, x, y) def _test_long_press_to_select_a_word(self, el, assertFunc): sel = SelectionManager(el) @@ -74,8 +59,7 @@ class SelectionCaretsTest(MarionetteTestCase): target_content = words[0] # Goal: Select the first word. - x, y = self._first_word_location(el) - self._long_press_to_select(el, x, y) + self._long_press_to_select_first_word(el, sel) # Ignore extra spaces selected after the word. assertFunc(target_content, sel.selected_content.rstrip()) @@ -95,8 +79,7 @@ class SelectionCaretsTest(MarionetteTestCase): sel.select_all() (_, _), (end_caret_x, end_caret_y) = sel.selection_carets_location() - x, y = self._first_word_location(el) - self._long_press_to_select(el, x, y) + self._long_press_to_select_first_word(el, sel) # Move the right caret to the end of the content. (caret1_x, caret1_y), (caret2_x, caret2_y) = sel.selection_carets_location() @@ -108,8 +91,7 @@ class SelectionCaretsTest(MarionetteTestCase): # Ignore extra spaces at the beginning of the content in comparison. assertFunc(target_content.lstrip(), sel.selected_content.lstrip()) - def _test_minimum_select_one_character(self, el, assertFunc, - x=None, y=None): + def _test_minimum_select_one_character(self, el, assertFunc): sel = SelectionManager(el) original_content = sel.content words = original_content.split() @@ -118,13 +100,7 @@ class SelectionCaretsTest(MarionetteTestCase): # Goal: Select the first character. target_content = original_content[0] - if x and y: - # If we got x and y from the arguments, use it as a hint of the - # location of the first word - pass - else: - x, y = self._first_word_location(el) - self._long_press_to_select(el, x, y) + self._long_press_to_select_first_word(el, sel) # Move the right caret to the position of the left caret. (caret1_x, caret1_y), (caret2_x, caret2_y) = sel.selection_carets_location() @@ -132,24 +108,6 @@ class SelectionCaretsTest(MarionetteTestCase): assertFunc(target_content, sel.selected_content) - def _test_focus_obtained_by_long_press(self, el1, el2): - '''Test the focus could be changed from el1 to el2 by long press. - - If the focus is changed to e2 successfully, SelectionCarets should - appear and could be dragged. - - ''' - # Goal: Tap to focus el1, and then select the first character on - # el2. - - # We want to collect the location of the first word in el2 here - # since self._first_word_location() has the side effect which would - # change the focus. - x, y = self._first_word_location(el2) - el1.tap() - self._test_minimum_select_one_character(el2, self.assertEqual, - x=x, y=y) - ######################################################################## # test cases with selection carets enabled ######################################################################## @@ -165,18 +123,6 @@ class SelectionCaretsTest(MarionetteTestCase): self.openTestHtml(enabled=True) self._test_minimum_select_one_character(self._input, self.assertEqual) - def test_input_focus_obtained_by_long_press_from_textarea(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._textarea, self._input) - - def test_input_focus_obtained_by_long_press_from_contenteditable(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._contenteditable, self._input) - - def test_input_focus_obtained_by_long_press_from_content_non_editable(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._content, self._input) - ######################################################################## # test cases with selection carets disabled ######################################################################## @@ -203,18 +149,6 @@ class SelectionCaretsTest(MarionetteTestCase): self.openTestHtml(enabled=True) self._test_minimum_select_one_character(self._textarea, self.assertEqual) - def test_textarea_focus_obtained_by_long_press_from_input(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._input, self._textarea) - - def test_textarea_focus_obtained_by_long_press_from_contenteditable(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._contenteditable, self._textarea) - - def test_textarea_focus_obtained_by_long_press_from_content_non_editable(self): - self.openTestHtml(enabled=True) - self._test_focus_obtained_by_long_press(self._content, self._textarea) - ######################################################################## #