Merge b2g-inbound to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen 2015-01-14 16:26:57 -05:00
Родитель e6b8f3a849 228f7e0dbd
Коммит 85f72d42db
16 изменённых файлов: 53 добавлений и 146 удалений

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

Просмотреть файл

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

Просмотреть файл

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "3f1ebdadd4043e68d2f6ebf295651e0d4cc5c93f",
"revision": "5e3f9375165bca64a0066f51fbd79bd32e380a6b",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,11 +17,11 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="1a2a32eda22ef2cd18f57f423a5e7b22a105a6f8"/>

Просмотреть файл

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -17,12 +17,12 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c9b72d863c80c842c65acf3b040baf4901a97"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bcc76f93f5659ac1eb8a769167109fd2d7ca4fbd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="049c281ad212bf528b2af8fc246b0dd0c9f97415"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3f4cd30032f7d9002421bdb78860c28c78760888"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

Просмотреть файл

@ -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 = {

Просмотреть файл

@ -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<nsIDOMElement> 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<nsIDOMElement> domElement(do_QueryInterface(newFocusContent));
fm->SetFocus(domElement,0);
if (editingHost) {
nsCOMPtr<nsIDOMElement> elt = do_QueryInterface(editingHost->GetParent());
if (elt) {
fm->SetFocus(elt, 0);
}
if (!nsContentUtils::HasNonEmptyTextContent(
editingHost, nsContentUtils::eRecurseIntoChildren)) {

Просмотреть файл

@ -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)
########################################################################
# <input> 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)
########################################################################
# <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)
########################################################################
# <textarea> test cases with selection carets disabled
########################################################################
@ -267,18 +201,6 @@ class SelectionCaretsTest(MarionetteTestCase):
self.openTestHtml(enabled=True)
self._test_minimum_select_one_character(self._contenteditable, self.assertEqual)
def test_contenteditable_focus_obtained_by_long_press_from_input(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._input, self._contenteditable)
def test_contenteditable_focus_obtained_by_long_press_from_textarea(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._textarea, self._contenteditable)
def test_contenteditable_focus_obtained_by_long_press_from_content_non_editable(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._content, self._contenteditable)
########################################################################
# <div> contenteditable test cases with selection carets disabled
########################################################################
@ -296,16 +218,3 @@ class SelectionCaretsTest(MarionetteTestCase):
def test_content_non_editable_minimum_select_one_character_by_selection(self):
self.openTestHtml(enabled=True)
self._test_minimum_select_one_character(self._content, self.assertEqual)
def test_content_non_editable_focus_obtained_by_long_press_from_input(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._input, self._content)
def test_content_non_editable_focus_obtained_by_long_press_from_textarea(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._textarea, self._content)
def test_content_non_editable_focus_obtained_by_long_press_from_contenteditable(self):
self.openTestHtml(enabled=True)
self._test_focus_obtained_by_long_press(self._contenteditable, self._content)

Просмотреть файл

@ -105,7 +105,7 @@ class SelectionManager(object):
last_rect_list = self.selection_rect_list(range_count - 1)
last_list_length = last_rect_list['length']
first_rect, last_rect = first_rect_list['0'], last_rect_list[str(last_list_length - 1)]
origin_x, origin_y = self.element.rect['x'], self.element.rect['y']
origin_x, origin_y = self.element.location['x'], self.element.location['y']
if self.element.get_attribute('dir') == 'rtl': # such as Arabic
start_pos, end_pos = 'right', 'left'