mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
8b160783a8
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. |
||
---|---|---|
.. | ||
unit | ||
bug586713_window.xul | ||
chrome_context_menus_win.xul | ||
chrome.ini | ||
empty_window.xul | ||
mochitest.ini | ||
moz.build | ||
native_menus_window.xul | ||
native_mouse_mac_window.xul | ||
standalone_native_menu_window.xul | ||
taskbar_previews.xul | ||
test_assign_event_data.html | ||
test_bug343416.xul | ||
test_bug413277.html | ||
test_bug428405.xul | ||
test_bug429954.xul | ||
test_bug444800.xul | ||
test_bug466599.xul | ||
test_bug478536.xul | ||
test_bug485118.xul | ||
test_bug517396.xul | ||
test_bug522217.xul | ||
test_bug538242.xul | ||
test_bug565392.html | ||
test_bug586713.xul | ||
test_bug593307.xul | ||
test_bug596600.xul | ||
test_bug673301.xul | ||
test_bug760802.xul | ||
test_bug1123480.xul | ||
test_bug1151186.html | ||
test_chrome_context_menus_win.xul | ||
test_clipboard.xul | ||
test_composition_text_querycontent.xul | ||
test_imestate.html | ||
test_input_events_on_deactive_window.xul | ||
test_key_event_counts.xul | ||
test_keycodes.xul | ||
test_mouse_scroll.xul | ||
test_native_key_bindings_mac.html | ||
test_native_menus.xul | ||
test_native_mouse_mac.xul | ||
test_panel_mouse_coords.xul | ||
test_picker_no_crash.html | ||
test_platform_colors.xul | ||
test_plugin_input_event.html | ||
test_plugin_scroll_consistency.html | ||
test_position_on_resize.xul | ||
test_secure_input.html | ||
test_sizemode_events.xul | ||
test_standalone_native_menu.xul | ||
test_system_status_bar.xul | ||
test_taskbar_progress.xul | ||
test_wheeltransaction.xul | ||
TestAppShellSteadyState.cpp | ||
TestChromeMargin.cpp | ||
utils.js | ||
window_bug429954.xul | ||
window_bug478536.xul | ||
window_bug522217.xul | ||
window_bug538242.xul | ||
window_bug593307_centerscreen.xul | ||
window_bug593307_offscreen.xul | ||
window_composition_text_querycontent.xul | ||
window_imestate_iframes.html | ||
window_mouse_scroll_win.html | ||
window_picker_no_crash_child.html | ||
window_state_windows.xul | ||
window_wheeltransaction.xul |