ST: on Edge or IE copy "English" or "Winning" doesn't work

Description

Using Edge or IE click on + and then "English" or "Winning"

Actual: the page refreshes and goes back to Locale selection (first entry point).
You are no longer on the page you were working on.

xpath

None

locale

None

Activity

Show:
TracBot
May 9, 2019, 10:07 PM
Trac Comment 15 by —2018-10-03T14:01:37.255Z

Resetting to srl, since he is better at JS.

TracBot
May 9, 2019, 10:07 PM
Trac Comment 14 by —2018-05-01T18:23:45.536Z

Test the functionality from the UI side and it works great!
Mark or Steven, could you please do the code review?

TracBot
May 9, 2019, 10:07 PM
Trac Comment 10 by —2018-04-24T13:23:34.486Z

I've checked the changes (only the two lines in survey.js) into trunk, and tested on SmokeTest with Firefox on macOS and Edge on Windows 10. It all looks OK to me.

TracBot
May 9, 2019, 10:07 PM
Trac Comment 8 by —2018-04-18T02:34:04.469Z

The bug can evidently be fixed by changing '''submit''' to '''button''' in these two lines in survey.js:

copyWinning.type = "submit";

copyEnglish.type = "submit";

The '''type''' attribute of the '''button''' element can have the values '''button|submit|reset'''. A submit button submits form-data. With Edge, submit causes a page reload which isn't appropriate for these buttons.

TracBot
May 9, 2019, 10:07 PM
Trac Comment 7 by —2018-04-16T12:43:39.917Z

Here's a report on some of what I've learned so far about JavaScript libraries/frameworks used by CLDR and their possible relation to the Edge incompatibility bug.

'''Dojo'''

''[SurveyConsole uses Dojo 1.7.2, but that's unrelated to this bug, which is in cldr-apps, not SurveyConsole.|Note:]''

This file links to Dojo 1.5 on ajax.googleapis.com:

cldr/tools/cldr-apps/WebContent/WEB-INF/jspf/dojoheader.jspf

These files link to Dojo 1.10.4 on ajax.googleapis.com:

cldr/tools/cldr-apps/WebContent/about.jsp
cldr/tools/cldr-apps/WebContent/browse.jsp
cldr/tools/cldr-apps/WebContent/WEB-INF/tmpl/ajax_status.jsp

Removing WebContent/js/dojo, and changing 1.5 and 1.10.4 to 1.13.0 (the latest version other than 2.x) appears to cause no change: ST still works on Firefox and fails on Edge. Still, linking to different Dojo versions, and hard-coding the version number in multiple places, isn't optimal. I propose to encapsulate the dependency by specifying the Dojo version and options in one place only, namely dojoheader.jspf, which can be included by about.jsp, browse.jsp, and ajax_status.jsp.

Using the Edge debugging tools, including the profiler, there are clues suggesting that Dojo may be involved in causing an unwanted reload that goes back to the locale selection stage. However, the clues are hard to read since Dojo is minified. I plan to install the human-legible source for Dojo 1.13.0. That should make it clearer what's going on with Dojo when the bug occurs. There might be a bug in Dojo related to Edge compatibility. Or, we may need to revise our usage of Dojo to follow recommended current practices, such as AMD, async true. Even if the bug turns out not to be related to Dojo, modernizing is needed in the long run. Possibly related is this warning: "Use of XMLHttpRequest with the synchronous flag set to true is deprecated due to its impact on user-perceived site performance." I'm not sure what relation there is, if any, between async as in AMD, and async as in ajax. In the long run, we should get away from deprecated and legacy usages.

'''jQuery and jQuery UI'''

These files link to jQuery 1.11.0 (latest version of jQuery is 3.3.1):

cldr/tools/cldr-apps/WebContent/WEB-INF/tmpl/js_include.jsp
cldr/tools/cldr-apps/WebContent/WEB-INF/tags/base.tag

Updating jQuery to 3.3.1 appears to cause no change: ST still works on Firefox and fails on Edge.

This file links to jQuery UI 1.10.4 (latest version of jQuery UI is 1.12.1):

cldr/tools/cldr-apps/WebContent/WEB-INF/tmpl/js_include.jsp

Updating jQuery UI to 1.12.1 results in "ERROR: multipleDefine" in Edge console. The order in which Dojo and jQuery UI are loaded is important, and there are recommended ways to combine them as dependencies. I don't see evidence that jQuery UI is involved in the bug; still I'd like to enable updating to the latest jQuery UI, and to clarify what it's used for in ST.

'''Autosize'''

These files link to jquery.autosize.min.js:

cldr/tools/cldr-apps/WebContent/v.jsp
cldr/tools/cldr-apps/WebContent/WEB-INF/tmpl/js_include.jsp

The file jquery.autosize.min.js itself is here:

cldr/tools/cldr-apps/WebContent/js/jquery.autosize.min.js

It appears only to be called here, with "postModal.find('textarea').autosize()":

cldr/tools/cldr-apps/WebContent/js/review.js

In my testing for the "English" bug on Firefox and Edge, autosize is never called. I doubt it's related to the bug.

'''Bootstrap'''

cldr tools/cldr-apps/WebContent/js/bootstrap.min.js

Bootstrap 3.1.1 appears to play crucial role in the style and layout of ST. I don't see any evidence that Bootstrap is involved in the bug. Still, updating to the latest version 4.1.0 (see http://getbootstrap.com) may be worth trying at some point.


I've been manually testing the graphical interface in the browser. For test-driven development of the frontend, ideally we should have automated tests with full coverage. The cross-platform WebDriver API is made for this purpose, and seems worth looking into, though I'm not planning on setting it up for testing the current bug.

I'm hoping the non-minified Dojo function names, and the ability to step through the Dojo code, will show where the bug is and how to solve it. I plan to create a branch cldr/branches/tbishop/t10396 today and start checking in changes involving dojoheader.jspf and dojo-release-1.13.0-src.

Priority

assess

Assignee

Thomas Bishop

Reporter

Kristi Lee

Reviewer

Steven R. Loomis

Components

Fix versions

Phase

dsub