gecko-dev/dom
Masayuki Nakano 7a28856eef Bug 1304624 ContentEventHandler::GetFlatTextLengthInRange() shouldn't include a line break length caused by the end node's open tag when the given range ends before the open tag r=smaug
This must be a regression of bug 1213589.  When removing whole text from an editor, the editor removes moz-<br> after removing all nodes.  Immediately before the remove, moz-<br> becomes <br>.  So, IMEContentObserver::AttributeChanged() detects the native text length for the <br> element changing from 0 to 2 (on Windows) or 1 (on the other platforms).  However, the call of ContentEventHandler::GetFlatTextLengthInRange() in IMEContentObserver::AttributeChanged() returns 2 (on Windows) or 1 (on the other platforms).  Although, it tries to get the length from the start of the editor to before aElement, it always includes the length of the line breaker caused by the end node.

The reason is, ContentEventHandler::GetFlatTextLengthInRange() always adds the line breaker's length for the end node without checking the range includes open tag of the end node.  Therefore, this patch adds the check into ContentEventHandler::GetFlatTextLengthInRange().  So, ContentEventHandler::GetFlatTextLengthInRange() becomes to support NodePositionBefore() for the end of the range.

Additionally, this patch fixes a bug at appending text node length.  In the loop, |aEndPosition| shouldn't be referred because it may be hacked with |endPosition|.  So, detecting the last text node should be compared with |endPosition|.

For making the method code safer, this changes whole |aEndPosition| after defining |endPosition| is replaced with |endPosition|.

MozReview-Commit-ID: FUp2nxuQHnO

--HG--
extra : rebase_source : 611992faf95082ce8ae005b7bcce90a3bea4f99e
2016-09-29 14:04:15 +09:00
..
animation Bug 1302038 part 2 - Add DocumentTimelineOptions dictionary. r=birtles,smaug 2016-09-28 16:56:24 +09:00
apps
archivereader
asmjscache Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8 2016-09-14 15:47:32 +02:00
audiochannel Bug 1290467 - part7 : enable audio competing for non-audible media. r=baku 2016-09-09 09:50:40 +08:00
base Bug 1302157 - Remove images-in-menu and images-in-button code (& associated icons) since it's deprecated in GTK. r=bz,dholbert 2016-09-29 00:22:32 +01:00
battery
bindings Bug 1304970 - Check encoding of js.msg-like files. r=jandem,gps 2016-09-28 14:12:54 +09:00
bluetooth Bug 1301010 - Add missing Unused.h, StorageManager.h r=fabrice 2016-09-07 18:52:58 +02:00
broadcastchannel
browser-element merge fx-team to mozilla-central a=merge 2016-09-09 12:01:21 +02:00
cache Bug 1268726 - isolate shared worker by first party domain. r=baku 2016-09-19 21:13:00 -04:00
camera Bug 1301010 - Add missing Unused.h, StorageManager.h r=fabrice 2016-09-07 18:52:58 +02:00
canvas Merge mozilla-central to autoland 2016-09-28 16:52:13 +02:00
cellbroadcast
console Bug 1301032 - Remove a warning when Console.cpp is compiled, r=smaug 2016-09-07 18:08:23 +02:00
contacts
crypto Bug 1296180 - Replace more uses of PR_ARRAY_SIZE with mozilla::ArrayLength. r=keeler,mt 2016-09-09 13:17:52 -07:00
devicestorage
downloads
encoding
events Bug 1304624 ContentEventHandler::GetFlatTextLengthInRange() shouldn't include a line break length caused by the end node's open tag when the given range ends before the open tag r=smaug 2016-09-29 14:04:15 +09:00
fetch Bug 1288997 - memory blob should not be shared across processes - part 1 -PSendStream should use nsIContentChild, r=jld, f=bkelly 2016-09-21 12:27:26 +02:00
filehandle
filesystem Bug 1287747 - GetFilesHelper must release mFiles and mGlobal on the main-thread, r=smaug 2016-09-17 09:55:30 +02:00
flyweb Bug 1303865 - Fix shutdown leak of FlyWebService. r=mconley 2016-09-21 11:32:36 -04:00
fmradio
gamepad Bug 1299975 - Part 2: Make GamepadManager own multiple GamepadEventChannelChild; r=kip, r=lenzak800 2016-09-07 18:31:53 +08:00
geolocation Bug 1301628 - Corrects misc-argument-comment. r=dzbarsky 2016-09-09 10:45:00 +02:00
grid (no bug) Drop whitespace on blank lines in test_grid_track_state.html (no review, whitespace-only) 2016-09-23 10:53:56 -07:00
html Bug 1304134. Part 2 - per spec. fire 'playing' when autoplay is activated. r=cpearce 2016-09-23 14:05:44 +08:00
icc
identity
imptests
indexedDB merge mozilla-inbound to mozilla-central a=merge 2016-09-28 15:56:33 +02:00
inputmethod
inputport
interfaces Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap) 2016-09-16 20:35:11 -07:00
ipc Merge mozilla-central to autoland 2016-09-28 16:52:13 +02:00
json Bug 1305202 - Use NullString() more and remove superfluous Truncates(). r=smaug 2016-09-23 21:10:01 -04:00
jsurl Bug 1018486 - Part 9: Changes to account for modifications to clang plugin, r=ehsan 2016-09-07 10:50:47 -04:00
locales Backed out 13 changesets (bug 1247056) for WinXP bc7 failures in browser_decoderDoctor.js CLOSED TREE 2016-09-26 12:15:55 -07:00
manifest Bug 1290980 - Fix intermittent e10s issue with oninstall. r=mconley 2016-09-18 21:28:00 -04:00
mathml
media Bug 1305672: Prevent assertion. r=jwwang 2016-09-29 00:43:49 +10:00
messagechannel Bug 1018486 - Part 1: Changes in dom/, r=baku 2016-09-07 10:50:35 -04:00
mobileconnection
mobilemessage
network Merge mozilla-central to mozilla-inbound 2016-09-07 17:21:27 +02:00
newapps
nfc
notification Bug 1018486 - Part 1: Changes in dom/, r=baku 2016-09-07 10:50:35 -04:00
offline
performance
permission Bug 1300884 - Remove the alarms API; r=fabrice 2016-09-07 13:26:04 -04:00
phonenumberutils
plugins Bug 1245959 - Check plugin has non-zero dimensions before sending image to compositor. r=nical 2016-09-25 21:34:06 +02:00
power
presentation Bug 1268993 - Null check for mBuilder, r=smaug 2016-09-24 19:11:01 +02:00
promise Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8 2016-09-14 15:47:32 +02:00
push
quota
res
resourcestats
secureelement
security Bug 1246540 - HSTS Priming Proof of Concept. r=ckerschb, r=mayhemer, r=jld, r=smaug, r=dkeeler, r=jmaher, p=ally 2016-09-27 11:27:00 -04:00
settings
smil Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
speakermanager Bug 1300884 - Remove the alarms API; r=fabrice 2016-09-07 13:26:04 -04:00
storage
svg Bug 1301027 - Remove the matrix * point operator and replace it with TransformPoint methods. r=Bas 2016-09-08 18:26:03 +02:00
system Bug 1299454 - Round event value before creating a DeviceLightEvent. r=snorp 2016-09-08 01:07:59 -05:00
telephony
tests Backed out changeset 4bdbbae12cb3 (bug 918719) for causing webcompat issues. 2016-09-27 15:58:01 -04:00
tethering
time
tv
u2f
url
voicemail
vr
wappush
webidl Bug 1302038 part 2 - Add DocumentTimelineOptions dictionary. r=birtles,smaug 2016-09-28 16:56:24 +09:00
wifi
workers Backed out 3 changesets (bug 1301301) for crashing 2016-09-27 19:49:17 -07:00
xbl Bug 1297013 part.2 Implement some helper methods to log constants related to event handling r=smaug 2016-09-15 00:48:47 +09:00
xhr Backed out changeset 490c671f8047 (bug 1303121) for failures in test_CrossSiteXHR.html 2016-09-27 22:39:00 -07:00
xml Bug 884693 - Do not log console warnings for XHR parse failures if HTTP status is 204 or 304. r=smaug 2016-09-21 13:48:05 -04:00
xslt Bug 1301254 - nsINode::GetBaseURI() should be fallible, r=smaug 2016-09-20 14:02:33 +02:00
xul Bug 1301251 - Handle GetSpec() failure in nsContentUtils::GetWrapperSafeScriptFilename(), r=smaug 2016-09-19 15:50:22 +02:00
jar.mn
moz.build Bug 1300884 - Remove the alarms API; r=fabrice 2016-09-07 13:26:04 -04:00