gecko-dev/mobile/android
Jim Chen 8b160783a8 Bug 1319660 - Fix possible crash when editing contentEditable; r=esawin r=masayuki r=smaug
Bug 1319660 - 1. Don't take shortcut if old replacement ranges don't match; r=esawin

The block at [1] is a shortcut we take when we reconcile Java text
changes with Gecko text changes. However, we only checked that the new
ranges are the same, i.e. that the new Gecko text is the same as the new
Java text. We should also be checking that the old ranges are the same,
i.e. that the replaced Gecko text is the same as the replaced Java text.

[1] https://dxr.mozilla.org/mozilla-central/rev/bbbd2f7539f224a482cc6d2dd10e6a5f31c8baf3/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditable.java#1233

Bug 1319660 - 2. Use previous node instead of sibling when adjusting last node; r=masayuki r=smaug

nsContentIterator in pre mode adjusts its last node if the node is a
childless node like <br>. However, right now it's using GetPrevSibling,
which can lead to error in some edge cases such as:

<p></p><div><br></div>

In this case, if the last node is <br> with offset 0, GetPrevSibling
will return <p> because <p> is <br>'s parent's previous sibling, and the
last node will be set to <p>. However, the correct last node in this
case is <div>, because <br> with offset 0 refers to the position to the
left of <br>, which is <div> with offset 0. In this case, PrevNode
returns the correct <div> value, so we should set the last node to the
result of PrevNode.

For the first node, for a childless node in pre mode, GetNextSibling and
NextNode are the same, so there is no bug in this case. Nevertheless,
this patch changes the call to NextNode to be consistent with calling
PrevNode for the last node.

Bug 1319660 - 3. Add test for correctly adjusting last node in content iterator; r=masayuki

Add a test for the previous patch that makes sure querying selected text
in an edge case works correctly.

Bug 1319660 - 4. Add test for start node regression; r=me

Add a new test case for the NextNode() regression. r=me for trivial
test-only patch.

Bug 1319660 - 5. Restore GetNextSibling call for first node of pre-content-iterator; r=smaug

The last patch changed the `GetNextSibling()` call to `NextNode()`
because I assumed they're equivalent in this case. That turned out to
not be the case because we can reach this line even if the node has
children -- the index just has to be after the last child. So this patch
restores the `GetNextSibling` call to restore the correct behavior.

I also added some comment to clarify that we can reach this line due to
one of two conditions: 1) the node has no children; 2) the node has
children but the index is after the last child.

This patch also replaces the `HasChildren()` check when setting
`cChild`.  If the index is after the last child (i.e. index ==
childCount), `GetChildAt()` fails and we erroneously log an assertion
warning, even though the input was valid. The new check handles all
cases whether start node has children or not.
2017-01-23 14:35:04 -05:00
..
app Backed out changeset d8c85b0ed424 (bug 1311555) 2017-01-19 19:46:40 +01:00
base Bug 1317632 - If the bookmark to add is a reader mode page, defer db action till it cache completely and save the same url in bookmarks and uriannotations table to avoid URL chagne between two http requests. r=sebastian 2017-01-14 12:05:48 +08:00
bouncer
branding Bug 1312421 - Rename of the aurora version in the app launcher r=sebastian 2016-10-24 16:12:40 +02:00
build/classycle
chrome Bug 1320900 - Do not show Reader View icon on error pages. r=sebastian 2016-12-30 11:11:09 +08:00
components Bug 1275662 - Close all tabs and clean up session files when "Open Tabs" is selected in "Clear private data on exit" or "Clear private data" pref. r=JanH,sebastian 2016-12-29 14:22:45 +08:00
config Bug 1330986 - Override proguard config to fix VectorDrawable corruption on Android 4 r=sebastian 2017-01-17 12:16:42 +01:00
docs Bug 1331169 - Fix Android ActivityStream docs. r=gkruglov 2017-01-14 15:12:29 +07:00
extensions Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws. 2017-01-17 11:50:25 +01:00
fonts
geckoview Bug 1319660 - Fix possible crash when editing contentEditable; r=esawin r=masayuki r=smaug 2017-01-23 14:35:04 -05:00
geckoview_example Bug 1322585 - [1.0] Remove GeckoView.Browser. r=snorp 2016-12-15 20:22:11 +01:00
gradle Bug 1291363 - Add geckoview and geckoview_example Gradle projects. r=jchen,sebastian 2016-10-05 20:23:38 -07:00
installer Bug 1331968: Implement the moz: protocol handler to redirect to a fixed website. r=gijs 2017-01-18 14:10:46 -08:00
javaaddons
locales bug 1280683, keep a pristine copy of en-US installer for repacks, r=glandium 2016-11-23 22:19:19 +01:00
modules Bug 1275662 - Close all tabs and clean up session files when "Open Tabs" is selected in "Clear private data on exit" or "Clear private data" pref. r=JanH,sebastian 2016-12-29 14:22:45 +08:00
search Bug 1320072 - Support direct search from intent, r=sebastian 2016-11-30 20:25:32 +08:00
services Backed out changeset 82753b1778fa (bug 1316011) 2016-12-21 10:41:36 +01:00
stumbler Bug 1316008: Use explicit charset encoding r=nechen,sebastian 2016-11-29 20:42:08 +02:00
tests Bug 1322114 - Add test cases for MediaControlService r=sebastian 2017-01-12 15:44:19 +08:00
themes/core Bug 1298904 [RTL] Change the Search field and Add button locations in about:config r=sebastian 2016-12-08 19:15:57 +02:00
thirdparty Bug 1291363 - Add geckoview and geckoview_example Gradle projects. r=jchen,sebastian 2016-10-05 20:23:38 -07:00
.eslintrc
app.mozbuild
build.mk
confvars.sh Bug 1330875 - Remove MOZ_APP_STATIC_INI. r=mshal 2017-01-13 14:51:07 +09:00
debug_sign_tool.py
gradle.configure Bug 1314894 - Avoid path changes from b6be0e9e3e1e. r=chmanchester 2016-11-04 06:50:43 +09:00
LICENSE
mach_commands.py
Makefile.in
moz.build
moz.configure Bug 1267884 - Upgrade support libraries to 23.4 r=sebastian 2016-09-30 09:16:23 -07:00