Closed Bug 1524956 Opened 6 years ago Closed 3 years ago

Formatting shortucts not working after update 65.0

Categories

(Web Compatibility :: Desktop, defect, P1)

Firefox 65
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: manngeim, Unassigned)

References

Details

(Keywords: regression, webcompat:site-wait)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Formatting shortcuts (CTRL+B and CTRL-I) no longer work on some old forums, like vBulletin (3.8.8 prior to 4.0) after update from 64.0.2 to 65.0. Some additioonal info and forum example on https://www.myth-weavers.com/showthread.php?t=462280

  1. Open forum.
  2. Go to any thread and try to use shortcuts (CTRL+B or CTRL-I) in any editor (WYSIWYG оr BB-code) while replying.

Actual results:

Bookmarks sidebar appears.

Expected results:

Selected text formatted as bold or italic.

Seems duplication of Bug 1500682

(In reply to manngeim from comment #0)

Some additioonal info and forum example on https://www.myth-weavers.com/showthread.php?t=462280

Lots of confusing reports there. OP says the problem is common to both Firefox and Chrome. Another says no issue in Firefox. Others still say the problem is new in Firefox 65.

Please check if you can reproduce the issue in a brand new profile. If it goes away, then it's caused by one of your add-ons or settings.
https://support.mozilla.com/kb/profile-manager-create-and-remove-firefox-profiles

If the problem persists, it would be very useful if you could find the regression range.
https://mozilla.github.io/mozregression/quickstart.html

(In reply to Alice0775 White from comment #1)

Seems duplication of Bug 1500682

That was filed for Firefox 60, while this is apparently a regression in Firefox 65.

Has Regression Range: --- → no
Component: Untriaged → Event Handling
Product: Firefox → Core

Issue can be reproduced on new profile.

Full bisection log can be found here https://pastebin.com/Yzv9LSd9

2019-02-04T22:35:13: DEBUG : Using url: https://hg.mozilla.org/integration/autoland/json-pushes?changeset=2ab582bacc98fecfc3cc52b3f275a23ff40a683f&full=1
2019-02-04T22:35:15: DEBUG : Found commit message:
Bug 1440189 - Stop dispatching keypress event to the default event group in web content (only Nightly and early Beta) unless web page isn't in blacklist r=smaug

UI Events declares that keypress event should be fired only when the keydown
sequence produces some characters. For conforming to UI Events and
compatibility with the other browsers, we should stop dispatching keypress
events for non-printable keys.

For getting regression reports, we should enable this new behavior only
on Nightly.

However, some web apps actually broken with the standardized behavior. For
protecting testers from known broken web apps, this patch introduces a
blacklist to take the traditional behavior under specific domain (and path in
it, optionally). Currently, docs.google.com and mail.google.com are set by
default.

MozReview-Commit-ID: HSrYX8LUB0p

Blocks: 1440189
Has Regression Range: no → yes
Flags: needinfo?(masayuki)

In vbulletein_textedit.js,

> // =============================================================================
> // Mozilla WYSIWYG only
> // =============================================================================
> if (is_moz)
> {
> 	/**
> 	* Set editor contents
> 	*/
> 	this._set_editor_contents = this.set_editor_contents;
> 	this.set_editor_contents = function(initial_text)
> 	{
> 		this._set_editor_contents(initial_text);
> 		this.editdoc.addEventListener('keypress', vB_Text_Editor_Events.prototype.editdoc_onkeypress, true);
> 	};

It listens to "keypress" event on Firefox.

And also doing same thing here:

> /**
> * Init Editor Functions
> */
> this.set_editor_functions = function()
> {
> 	if (this.editdoc.addEventListener)
> 	{
> 		this.editdoc.addEventListener('keypress', vB_Text_Editor_Events.prototype.editdoc_onkeypress, false);
> 	}
> 	else if (is_ie)
> 	{
> 		this.editdoc.onkeydown = vB_Text_Editor_Events.prototype.editdoc_onkeypress;
> 	}
> 
> 	this.editwin.onfocus = vB_Text_Editor_Events.prototype.editwin_onfocus;
> 	this.editwin.onblur = vB_Text_Editor_Events.prototype.editwin_onblur;
> };

Then, the method does:

> vB_Text_Editor_Events.prototype.editdoc_onkeypress = function(e)
> {
> 	if (!e)
> 	{
> 		e = window.event;
> 	}
> 
> 	if (e.ctrlKey)
> 	{
> 		if (vB_Editor[this.editorid].allowbasicbbcode == false)
> 		{
> 			return;
> 		}
> 		var code = e.charCode ? e.charCode : e.keyCode;
> 		var cmd;
> 		switch (String.fromCharCode(code).toLowerCase())
> 		{
> 			case 'b': cmd = 'bold'; break;
> 			case 'i': cmd = 'italic'; break;
> 			case 'u': cmd = 'underline'; break;
> 			default: return;
> 		}
> 
> 		e = do_an_e(e);
> 		vB_Editor[this.editorid].apply_format(cmd, false, null);
> 		return false;
> 	}
> 	else if (e.keyCode == 9)
> 	{
> 		if (e.shiftKey || (e.modifiers && (e.modifiers & 4)))
> 		{
> 			// shift-tab, let the browser handle
> 			return;
> 		}
> 
> 		if (is_opera)
> 		{
> 			// can't supress tab events in Opera
> 			return;
> 		}
> 
> 		// first lets try tag, then post icon, then submit, then just let it proceed the browser doing the tab
> 		if (fetch_object('tag_add_input') != null)
> 		{
> 			fetch_object('tag_add_input').focus();
> 		}
> 		else if (fetch_object('rb_iconid_0') != null)
> 		{
> 			fetch_object('rb_iconid_0').focus();
> 		}
> 		else if (fetch_object(this.editorid + '_save') != null)
> 		{
> 			fetch_object(this.editorid + '_save').focus();
> 		}
> 		else if (fetch_object('qr_submit') != null)
> 		{
> 			fetch_object('qr_submit').focus();
> 		}
> 		else
> 		{
> 			return;
> 		}
> 		e = do_an_e(e);
> 		return;
> 	}
> };

So, Ctrl + foo and Tab should be handled in keypress. I think that they should switch using keypress event to keydown event (Perhaps, switching listening event won't break Firefox ESR 60 in this case).

Status: UNCONFIRMED → NEW
Component: Event Handling → Desktop
Ever confirmed: true
Flags: needinfo?(masayuki)
OS: Unspecified → All
Product: Core → Tech Evangelism
Hardware: Unspecified → All
Version: 65 Branch → Firefox 65

And also, users can prevent the new behavior in myth-weavers.com with the following settings (until the website fixes their bug).

  1. Open about:config.
  2. Find dom.keyboardevent.keypress.hack.dispatch_non_printable_keys.
  3. Edit its value including www.myth-weavers.com.
  4. Then, reload the page.
Product: Tech Evangelism → Web Compatibility
Priority: -- → P1
Flags: needinfo?(miket)

I left a comment in the forum pointing to the workaround, but we need to get in touch with vBulletin.

I've attempted to contact someone from vBulletin on LinkedIn. Will update here if I heard back.

Flags: needinfo?(miket)
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE

I was able to reproduce the issue on Firefox, Ctrl+B brings the "Bookmarks" panel and "Ctrl+I" brings the "Page Info" popup. Using Ctrl+B/Ctrl+I, does not trigger anything in Chrome.

Adding the value www.myth-weavers.com to dom.keyboardevent.keypress.hack.dispatch_non_printable_keys in about:config does the trick.
https://prnt.sc/WLn8L4iy5SeN
https://prnt.sc/8O3_JHgWUoKX

Tested with:
Browser / Version: Firefox Nightly 103.0a1 (2022-06-07)
Operating System: Windows 10 Pro

You need to log in before you can comment on or make changes to this bug.