Issue 395318 in chromium: HtmlEditorExtender in the ASP.NET AJAX Control Toolkit causes a Javascript error when the control is empty

374 views
Skip to first unread message

chro...@googlecode.com

unread,
Jul 18, 2014, 7:46:34 PM7/18/14
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Cr-Blink-JavaScript Pri-2 Via-Wizard Type-Bug OS-Windows

New issue 395318 by Cdigi...@gmail.com: HtmlEditorExtender in the ASP.NET
AJAX Control Toolkit causes a Javascript error when the control is empty
http://code.google.com/p/chromium/issues/detail?id=395318

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/36.0.1985.125 Safari/537.36

Steps to reproduce the problem:
1. Navigate to https://www.anymeeting.com/AccountManager/chrome36.aspx on
Chrome 36
2. Open Javascript console
3. Click the link "Click To Repoduce Javascript Error Google Chrome 36
HtmlEditorExtender"
4. See Javascript error "Uncaught TypeError: Failed to execute 'collapse'
on 'Selection': parameter 1 is not of type 'Node'." and the page doesn't
reload.

5. Type a character in the HtmlEditor control
6. Click the link "Click To Repoduce Javascript Error Google Chrome 36
HtmlEditorExtender"
7. See no Javascript error and the page reloads.

What is the expected behavior?
No Javascript error

What went wrong?
Javascript error
"Uncaught TypeError: Failed to execute 'collapse' on 'Selection': parameter
1 is not of type 'Node'."

Did this work before? Yes 35

Chrome version: 36.0.1985.125 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 14.0 r0

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jul 20, 2014, 12:09:03 AM7/20/14
to chromi...@chromium.org

Comment #1 on issue 395318 by advsoftw...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I have the same problem?

Monday the aplication will not work for many people.

Hope You Can Help

chro...@googlecode.com

unread,
Jul 20, 2014, 8:07:07 AM7/20/14
to chromi...@chromium.org
Updates:
Cc: yoic...@chromium.org
Labels: -Cr-Blink-JavaScript Cr-Blink-DOM

Comment #2 on issue 395318 by sigbjo...@opera.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Related to the conformance changes for selection.collapse() in
https://src.chromium.org/viewvc/blink?revision=172106&view=revision ?

chro...@googlecode.com

unread,
Jul 20, 2014, 8:16:57 AM7/20/14
to chromi...@chromium.org

Comment #3 on issue 395318 by sigbjo...@opera.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

All browsers fail if the test is run without any text in the textarea/edit
control -- with the above exception. I cannot reproduce that exception if
input is provided.

If input of length <= 2 is provided, both IE(11) and Chrome fails with an
IndexSizeError (e.g., script ending up passing in 3 as the offset
argument.) The underlying script sniffs for FF/Gecko, and it doesn't run
into that issue. Inputs with length > 2 seems to function OK.

I'd claim the script simply needs to be fixed.

chro...@googlecode.com

unread,
Jul 21, 2014, 8:19:45 AM7/21/14
to chromi...@chromium.org

Comment #4 on issue 395318 by isdesarr...@isystems.es: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Please, fix this. My web application worked well last week, but now this
error is triggering everywhere. It works fine in Firefox, so it's a Chrome
problem.

As someone just stated, I can confirm that this error is appearing when a
control does a postback with a selected value with length <= 2.

chro...@googlecode.com

unread,
Jul 21, 2014, 8:59:45 AM7/21/14
to chromi...@chromium.org

Comment #5 on issue 395318 by nmano...@gmail.com: HtmlEditorExtender in the
ASP.NET AJAX Control Toolkit causes a Javascript error when the control is
empty
http://code.google.com/p/chromium/issues/detail?id=395318

Yes, even m getting the same error on Chrome updated version ( i.e. 36)
I m gettin "Failed to execute 'collapse' on 'Selection': parameter 1 is not
of type 'Node'".
My application was working till last weekend.
what happened today ??
plz fix it ASAP or provide any alternative code to resolve the same.

chro...@googlecode.com

unread,
Jul 21, 2014, 3:47:36 PM7/21/14
to chromi...@chromium.org

Comment #6 on issue 395318 by anna.ghi...@alliancesw.it: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I confirm I've the same issue on the HtmlEditorExtender :
"Failed to execute 'collapse' on 'Selection': parameter 1 is not of
type 'Node'".

Please, help!

chro...@googlecode.com

unread,
Jul 21, 2014, 4:44:22 PM7/21/14
to chromi...@chromium.org

Comment #7 on issue 395318 by alexseve...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

i have a same problem. You have a hotfix, work around?

chro...@googlecode.com

unread,
Jul 21, 2014, 6:52:24 PM7/21/14
to chromi...@chromium.org

Comment #8 on issue 395318 by alexseve...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I have a same problem. Have u a hotfix or workaround? tks

chro...@googlecode.com

unread,
Jul 22, 2014, 8:03:44 AM7/22/14
to chromi...@chromium.org

Comment #11 on issue 395318 by isdesarr...@isystems.es: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
http://code.google.com/p/chromium/issues/detail?id=395318

But, why was that working perfectly since last week? And it is not a
problem of the ASP.NET AJAX Control Toolkit library. As I said, every
postback of an element returning a selected value with length <= 2 triggers
this error. Please, leave it as it was before the last Chrome update.

chro...@googlecode.com

unread,
Jul 22, 2014, 12:04:31 PM7/22/14
to chromi...@chromium.org

Comment #12 on issue 395318 by osterm...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I'm having the same issue.

Uncaught TypeError: Failed to execute 'collapse' on 'Selection': parameter
1 is not of type 'Node'.

This also worked fine until Chrome took the latest update a couple days
ago. My site makes use of the ASP.NET AJAX Toolkit which still works fine
in Firefox and Internet Explorer.

To break functionality like this and state that it won't be fixed and not
provide a workaround or alternate solution is unacceptable. This change
needs to be rolled back since it has broken so many sites.

chro...@googlecode.com

unread,
Jul 22, 2014, 4:10:58 PM7/22/14
to chromi...@chromium.org

Comment #13 on issue 395318 by lalchand...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

This seems to be a workaround until it is fixed. Include on the document
ready of the page.

if (Sys.Extended && Sys.Extended.UI &&
Sys.Extended.UI.HtmlEditorExtenderBehavior &&
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype &&
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit) {

Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit =
function () {
//html encode
var char = 3;
var sel = null;

setTimeout(function () {
if (this._editableDiv != null)
this._editableDiv.focus();
}, 0);
if (Sys.Browser.agent != Sys.Browser.Firefox) {
if (document.selection) {
sel = document.selection.createRange();
sel.moveStart('character', char);
sel.select();
}
else {
if (this._editableDiv.firstChild != null &&
this._editableDiv.firstChild != undefined) {
sel = window.getSelection();
sel.collapse(this._editableDiv.firstChild,
char);
}
}
}

//Encode html tags
this._textbox._element.value = this._encodeHtml();

chro...@googlecode.com

unread,
Jul 22, 2014, 6:47:03 PM7/22/14
to chromi...@chromium.org

Comment #14 on issue 395318 by advsoftw...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Thanks lalchand...

You're a genius.

chro...@googlecode.com

unread,
Jul 22, 2014, 7:48:53 PM7/22/14
to chromi...@chromium.org

Comment #15 on issue 395318 by rob.dani...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

ASP.NET 4.0 selectedindex change does not work and the site is broken.
Please fix as chrome 34.

chro...@googlecode.com

unread,
Jul 23, 2014, 11:34:41 AM7/23/14
to chromi...@chromium.org

Comment #16 on issue 395318 by philippe...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Hello, We have the same problem.
Our web sites don't work since monday.
Please send a response.....

chro...@googlecode.com

unread,
Jul 24, 2014, 4:36:31 AM7/24/14
to chromi...@chromium.org

Comment #20 on issue 395318 by philippe...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Hello,
The beta version of Chrome 37 does not solve this problem.
The problem arises seriously with databinding.
Solutions such as " Text='<%# Bind("client_info") & " " %>' " or
Text='<%# fix_bug_chrome_htmlExtender (Bind("client_info")) " are not
suitable for use databind.
A javascript solution with a htmlextender in a DetailsView in edit or
insert mode is too complex.

I regret the silence of Google on this point. The solution is it to force
users to use Firefox?

chro...@googlecode.com

unread,
Jul 24, 2014, 11:40:35 AM7/24/14
to chromi...@chromium.org

Comment #23 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I suppose the irony of Google now having a big enough market share to start
to break the web as Microsoft did, by targeting Microsoft's server side
technology first, is lost on nobody. I suppose it's too much to ask for big
companies (especially one that claims not to do evil) not to behave like
this once they have a captive audience. I just really wish users and others
trying to make a living weren't thrown under the bus as part of this feud.

chro...@googlecode.com

unread,
Jul 24, 2014, 11:56:41 AM7/24/14
to chromi...@chromium.org

Comment #24 on issue 395318 by ch.du...@samsung.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

As per https://code.google.com/p/chromium/issues/detail?id=395318#c10, the
change is according to the standard specification and is compatible with
Firefox. Unfortunately, the library is detecting Firefox and running
different code on Firefox vs Chrome. As yoichio@ suggested, please report
this bug to the developers of the library so that it gets fixed. The bug is
in the library, not in Chrome and the only reason the library works with
Firefox is because they special-case Firefox in the code.

chro...@googlecode.com

unread,
Jul 24, 2014, 12:10:41 PM7/24/14
to chromi...@chromium.org

Comment #25 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Do you not think that a change which breaks a major platform, should be at
least raised with that platform in advance to mitigate sites suddenly not
working, as security bugs are handled?

chro...@googlecode.com

unread,
Jul 24, 2014, 1:48:49 PM7/24/14
to chromi...@chromium.org

Comment #27 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

If the code is now compliant with the standard (I am not technical enough
to have a view on this, but I am sure you're right), then the obvious
inference is that it was not in accordance before. It seems the AjaxToolkit
developers wrote in an exception for Firefox, which demonstrates they
tested this feature with various browsers and acted accordingly.

So I think it's a bit simplistic to say it's a bug with their code and they
need to fix it. In reality there was a bug in Chrome which they coded for
compatibility with which has now been fixed without warning. I'd certainly
agree with being more conservative on any changes especially considering if
the bugs you're fixing have been out there for years, people will have
tested and written code around them.

chro...@googlecode.com

unread,
Jul 24, 2014, 2:31:40 PM7/24/14
to chromi...@chromium.org

Comment #28 on issue 395318 by nathan.g...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

I should note that while this particular report may be the only one
present, that does not mean the issue is not widespread. Most end users
only see 'Hey, this site is no longer working' and don't necessarily know
enough to access the console, see/identify the exact error message, and
locate/file a bug report.

Depending on a company's practices and development cycles, it could
potentially be months before they are able to correct the issue introduced
with the 36 release.

chro...@googlecode.com

unread,
Jul 24, 2014, 9:14:40 PM7/24/14
to chromi...@chromium.org

Comment #30 on issue 395318 by yoic...@chromium.org: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

What is the 'right' behavior of selection.collapse(null) ?
The previous chrome does selection.removeAllRanges() but it looks not
intended.

I don't get yet what is the problem of current behavior of
selection.collapse(null).
1. chrome throws javascript error.
2. chrome doesn't do selection.removeAllRanges().

chro...@googlecode.com

unread,
Jul 25, 2014, 5:00:27 AM7/25/14
to chromi...@chromium.org

Comment #31 on issue 395318 by bkony...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

Thanks lalchand... you saved me a lot of time!! ;)

chro...@googlecode.com

unread,
Jul 27, 2014, 9:43:07 PM7/27/14
to chromi...@chromium.org

Comment #33 on issue 395318 by yoic...@chromium.org: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
http://code.google.com/p/chromium/issues/detail?id=395318

The old behavior is that selection.collapse(null) does something like
selection.removeAllRanges().
However it just happened that way. selection.collapse(null) was virtually
undefined.
Additionally, both IE and Firefox kick a javascript error, try:
http://jsfiddle.net/GD4tZ/

Should we implement a different behavior?

chro...@googlecode.com

unread,
Jul 30, 2014, 5:41:05 AM7/30/14
to chromi...@chromium.org

Comment #35 on issue 395318 by z...@xxxlutz.at: HtmlEditorExtender in the
ASP.NET AJAX Control Toolkit causes a Javascript error when the control is
empty
http://code.google.com/p/chromium/issues/detail?id=395318

Thanks lalchand...good workaround

chro...@googlecode.com

unread,
Aug 22, 2014, 9:15:34 AM8/22/14
to chromi...@chromium.org

Comment #38 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

Bump... will chromium fix this? Seems to have gone very quiet.

chro...@googlecode.com

unread,
Aug 22, 2014, 2:26:07 PM8/22/14
to chromi...@chromium.org

Comment #39 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

Were there other 'trivial' fixes done to Chromium's javascript at the same
time? Because there are a ton of places broken and most don't
do 'collapse'. So I am thinking that Chromium has 'fixed' more than this,
and incorrectly categorized other changes as 'trivial', which evidently
they are not.

It seems now the issue is not even being debated, it's just a 'won't fix'
and everyone else has to go off and clear up the problems that a few lines
of Chromium code has caused.

chro...@googlecode.com

unread,
Aug 24, 2014, 4:25:53 PM8/24/14
to chromi...@chromium.org

Comment #40 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

The best quick fix we've found for anyone having more than just problems
with the HTMLEditorExtender is add some javascript which recognizes webkit
browsers and then sets them as 'Firefox'. Cannot guarantee this will work
for everyone, but so far it seems the best quick fix we've found which is
easy to roll out to older versions of the code too:

http://www.kartris.com/Knowledgebase/Chrome-AJAX-postback-issues-July-2014__k-56.aspx

chro...@googlecode.com

unread,
Aug 26, 2014, 10:51:12 PM8/26/14
to chromi...@chromium.org

Comment #41 on issue 395318 by advsoftw...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

New update and the solution #13 stop working....

Can any one help us!

Thanks to lalchand again...

chro...@googlecode.com

unread,
Aug 28, 2014, 6:41:15 AM8/28/14
to chromi...@chromium.org

Comment #43 on issue 395318 by avanderh...@moneywise.nl: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318

Yep, the workarounds broke on the latest chrome update, yesterday.

chro...@googlecode.com

unread,
Aug 28, 2014, 6:54:14 AM8/28/14
to chromi...@chromium.org

Comment #44 on issue 395318 by avanderh...@moneywise.nl: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318

This one is working. On the page where the HtmlEditorExtender control is
hosted add this script. (Tested on Chrome 37)

<script type="text/javascript">
Sys.Browser.agent = Sys.Browser.Firefox;
</script>

chro...@googlecode.com

unread,
Aug 28, 2014, 7:05:24 AM8/28/14
to chromi...@chromium.org

Comment #45 on issue 395318 by p...@cactusoft.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

#44, it may be safer to only apply this to webkit browsers as in our fix in
#40 above:

if (navigator.userAgent.indexOf('WebKit/') > -1) {
Sys.Browser.agent = Sys.Browser.Firefox;
}

This avoids IE being treated as Firefox too. Haven't tested how different
versions of IE react to Firefox javascript, but it seems far safer to have
the fix only apply to chrome/webkit where the problem is, and avoid
changing behaviour for IE which could well open up a whole load of further
issues there (especially considering the ajaxtoolkit code seems to do quite
extensive sniffing of different IE versions from a brief look at the source
code, suggesting it needs to treat them differently in places).

chro...@googlecode.com

unread,
Aug 28, 2014, 7:20:26 AM8/28/14
to chromi...@chromium.org

Comment #46 on issue 395318 by avanderh...@moneywise.nl: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318

#45 Super!

chro...@googlecode.com

unread,
Sep 4, 2014, 10:54:27 PM9/4/14
to chromi...@chromium.org
Updates:
Status: Assigned
Labels: -Pri-2 -OS-Windows Pri-1 M-38

Comment #47 on issue 395318 by o...@chromium.org: HtmlEditorExtender in the
ASP.NET AJAX Control Toolkit causes a Javascript error when the control is
empty
https://code.google.com/p/chromium/issues/detail?id=395318

Ugh. I'm so sorry for not chiming in here sooner. We should revert this
change and then get the spec changed. It's a bummer since this is a change
to match the (unmaintained, mostly unimplemented) spec, IE and Firefox, but
at the same time it makes us not match Safari. I expect Firefox and IE will
follow suit and it won't break any sites for them.

More importantly, the benefits of this change are really small. While it's
a tiny bit unfortunate, it's OK if collapse with a null argument clears the
selection. The web is not significantly harmed by that.

Lets try to get the fix into M38. It's a bummer we've let this go two
releases already (I'm as much to blame as anyone).

chro...@googlecode.com

unread,
Sep 5, 2014, 2:51:36 AM9/5/14
to chromi...@chromium.org
Updates:
Status: Started

Comment #48 on issue 395318 by yoic...@chromium.org: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Sep 5, 2014, 8:07:56 PM9/5/14
to chromi...@chromium.org

Comment #49 on issue 395318 by bugdro...@chromium.org: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318#c49

The following revision refers to this bug:
http://src.chromium.org/viewvc/blink?view=rev&rev=181487

------------------------------------------------------------------
r181487 | yoi...@chromium.org | 2014-09-05T23:26:09.186087Z

Changed paths:
A
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/editing/selection/collapse-null-expected.txt?r1=181487&r2=181486&pathrev=181487
M
http://src.chromium.org/viewvc/blink/trunk/Source/core/editing/DOMSelection.cpp?r1=181487&r2=181486&pathrev=181487
A
http://src.chromium.org/viewvc/blink/trunk/LayoutTests/editing/selection/collapse-null.html?r1=181487&r2=181486&pathrev=181487
M
http://src.chromium.org/viewvc/blink/trunk/Source/core/editing/Selection.idl?r1=181487&r2=181486&pathrev=181487

Editing: Let Selection.collapse with null clears selection.

The current spec says Selection.collapse(null) raises exception and the
implementation follows.
However, many web apps assume that chrome clears selection when
Selection.collapse(null) calls.
Thus we revert the behavior.

BUG=395318

Review URL: https://codereview.chromium.org/546703003
-----------------------------------------------------------------

chro...@googlecode.com

unread,
Sep 9, 2014, 9:40:27 PM9/9/14
to chromi...@chromium.org
Updates:
Labels: Merge-Requested

Comment #50 on issue 395318 by yoic...@chromium.org: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Sep 9, 2014, 9:49:28 PM9/9/14
to chromi...@chromium.org
Updates:
Labels: merge-questions-applied

Comment #51 on issue 395318 by amin...@google.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318#c51


Please note that all merge requests must have been on or rolled into trunk
for at least 24 hours to be considered for merging (to ensure full bot
coverage and give an opportunity for any necessary reverts to occur).

To help facilitate this request, if you could please answer the following:
--------------------------------------------------------------------------
1) Has this change been on trunk for at least 24 hours?

2) Has this change shipped to at least one canary release (where
applicable)?

3) Has anyone verified that these changes resolve the issue and cause no new
crashes (via chromecrash/) or regressions?

4) Why is this necessary for this milestone?

Thanks!

(this message is auto-generated each time the merge-request label is
applied; if you have previously answered these questions kindly disregard)

chro...@googlecode.com

unread,
Sep 9, 2014, 10:16:37 PM9/9/14
to chromi...@chromium.org
Updates:
Status: Verified

Comment #52 on issue 395318 by yoic...@chromium.org: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

1) Has this change been on trunk for at least 24 hours?
y

2) Has this change shipped to at least one canary release (where
applicable)?
From 39.0.2151.2 canary.

3) Has anyone verified that these changes resolve the issue and cause no new
crashes (via chromecrash/) or regressions?
Yes, I verified.

4) Why is this necessary for this milestone?
This causes a big regression that happens in real web because it have been
from M36 stable.

chro...@googlecode.com

unread,
Sep 9, 2014, 11:38:36 PM9/9/14
to chromi...@chromium.org
Updates:
Labels: -Merge-Requested Merge-Approved

Comment #53 on issue 395318 by matthewy...@chromium.org: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Sep 11, 2014, 12:37:10 AM9/11/14
to chromi...@chromium.org
Updates:
Labels: -Merge-Approved merge-merged-2125

Comment #54 on issue 395318 by bugdro...@chromium.org: HtmlEditorExtender
in the ASP.NET AJAX Control Toolkit causes a Javascript error when the
control is empty
https://code.google.com/p/chromium/issues/detail?id=395318#c54

The following revision refers to this bug:
http://src.chromium.org/viewvc/blink?view=rev&rev=181788

------------------------------------------------------------------
r181788 | yoi...@chromium.org | 2014-09-11T04:23:29.746704Z

Changed paths:
A
http://src.chromium.org/viewvc/blink/branches/chromium/2125/LayoutTests/editing/selection/collapse-null-expected.txt?r1=181788&r2=181787&pathrev=181788
M
http://src.chromium.org/viewvc/blink/branches/chromium/2125/Source/core/editing/DOMSelection.cpp?r1=181788&r2=181787&pathrev=181788
A
http://src.chromium.org/viewvc/blink/branches/chromium/2125/LayoutTests/editing/selection/collapse-null.html?r1=181788&r2=181787&pathrev=181788
M
http://src.chromium.org/viewvc/blink/branches/chromium/2125/Source/core/editing/Selection.idl?r1=181788&r2=181787&pathrev=181788

Merge 181487 "Editing: Let Selection.collapse with null clears s..."

> Editing: Let Selection.collapse with null clears selection.

> The current spec says Selection.collapse(null) raises exception and the
> implementation follows.
> However, many web apps assume that chrome clears selection when
> Selection.collapse(null) calls.
> Thus we revert the behavior.

> BUG=395318

> Review URL: https://codereview.chromium.org/546703003

TBR=yoi...@chromium.org

Review URL: https://codereview.chromium.org/560243002
-----------------------------------------------------------------

chro...@googlecode.com

unread,
Sep 16, 2014, 10:06:33 AM9/16/14
to chromi...@chromium.org

Comment #55 on issue 395318 by pouli...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

I have a workaround, use the function wrote up but in another function,
like this :

function PatchHtmlEditor()
{
if (Sys.Extended && Sys.Extended.UI &&
Sys.Extended.UI.HtmlEditorExtenderBehavior &&
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype &&
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit)
{
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit
= function ()
{
//html encode
var char = 3;
var sel = null;

setTimeout(function ()
{
if (this._editableDiv != null)
this._editableDiv.focus();
}, 0);
if (Sys.Browser.agent != Sys.Browser.Firefox)
{
if (document.selection)
{
sel = document.selection.createRange();
sel.moveStart('character', char);
sel.select();
}
else
{
if (this._editableDiv.firstChild != null &&
this._editableDiv.firstChild != undefined)
{
sel = window.getSelection();
sel.collapse(this._editableDiv.firstChild, char);
}
}
}

//Encode html tags
this._textbox._element.value = this._encodeHtml();
}
}
}

In the onload of the page call that function with a RegisterStartupScript
with Page.ClientScript or ScriptManager if it is in callback. In my project
I added that function to my BasePage to help me to register the script in
the good context:

public void RegisterStartupScript(Control control, Type type, string key,
string script, bool addScriptTags)
{
if (_currentScriptManager != null)
ScriptManager.RegisterStartupScript(control, type, key,
script, addScriptTags);
else
this.ClientScript.RegisterStartupScript(type, key, script,
addScriptTags);

chro...@googlecode.com

unread,
Nov 13, 2014, 6:05:06 AM11/13/14
to chromi...@chromium.org

Comment #56 on issue 395318 by rooske...@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

I'm having the same problem 'Uncaught IndexSizeError: Failed to
execute 'collapse' on 'Selection': There is no child at offset 3'. This
error only appears if the code behind the text error starts with an HTML
tag. If I remove the starting HTML tag in the source view then it works
fine. Any ideas?

chro...@googlecode.com

unread,
Jun 2, 2015, 12:41:29 PM6/2/15
to chromi...@chromium.org

Comment #58 on issue 395318 by fadilka....@gmail.com: HtmlEditorExtender in
the ASP.NET AJAX Control Toolkit causes a Javascript error when the control
is empty
https://code.google.com/p/chromium/issues/detail?id=395318

This issue will be fixed in the next v15.1.3 release of AJAX Control
Toolkit. Related changeset 26b8901fffe8.
Reply all
Reply to author
Forward
0 new messages