[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #10396(reviewing unknown)

Opened 15 months ago

Last modified 5 months ago

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

Reported by: kristi Owned by: tbishop
Component: survey Data Locale:
Phase: dsub Review: mark
Weeks: Data Xpath:
Xref:

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.

Attachments

Change History

comment:1 Changed 15 months ago by kristi

  • Owner changed from anybody to kristi
  • Status changed from new to design

comment:2 Changed 15 months ago by kristi

  • Component changed from unknown to survey
  • Milestone changed from UNSCH to 33

comment:3 Changed 10 months ago by kristi

  • Owner changed from kristi to frontend

comment:4 Changed 7 months ago by mark

  • Milestone changed from 33 to 34

comment:5 Changed 7 months ago by kristi

  • Keywords BrowerCompat added

comment:6 Changed 5 months ago by tbishop

This is the first ticket referenced under Priorities for UI Improvement Goals at:

http://cldr.unicode.org/index/cldr-engineer/sow

TRAC keyword “BrowserCompat” - The following 4 browsers need to be supported: Chrome, Firefox, Safari, Edge - Updated browsers (no older than 6 months)

Testing on localhost I've reproduced both the incorrect behavior using Edge, and the correct behavior on Firefox, Chrome, and Safari. I propose to make a branch cldr/branches/tbishop/t10396 for this ticket. A solution might involve some or all of the following: further study and testing; updating Dojo to a newer version; revising legacy usages of Dojo; using Asynchronous Module Definition (AMD) where appropriate; addressing warnings such as "XMLHttpRequest with the synchronous flag set to true is deprecated" and errors reported by validator.w3.org such as "Attribute execute not allowed on element div at this point" and "Duplicate ID stchanged_btn".

comment:7 Changed 5 months ago by tbishop

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

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

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.

Last edited 5 months ago by tbishop (previous) (diff)

comment:8 Changed 5 months ago by tbishop

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.

comment:9 Changed 5 months ago by tbishop

  • Review set to kristi

comment:10 Changed 5 months ago by tbishop

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.

comment:11 Changed 5 months ago by tbishop

  • Keywords BrowserCompat added; BrowerCompat removed

comment:12 Changed 5 months ago by tbishop

  • Owner changed from frontend to tbishop
  • Status changed from design to accepted

comment:13 Changed 5 months ago by tbishop

  • Status changed from accepted to reviewing

comment:14 Changed 5 months ago by kristi

  • Review changed from kristi to mark

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

View

Add a comment

Modify Ticket

Action
as reviewing
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.