Open Bug 1983538 Opened 10 months ago Updated 4 months ago

incontrol.landrover.com - Dropdowns are not working on page

Categories

(Web Compatibility :: Site Reports, defect, P2)

Desktop
Windows 10

Tracking

(Webcompat Priority:P3, Webcompat Score:1)

ASSIGNED
Webcompat Priority P3
Webcompat Score 1

People

(Reporter: railioaie, Assigned: twisniewski)

References

(Regression, )

Details

(4 keywords, Whiteboard: [webcompat-source:web-bugs])

User Story

platform:windows,mac,linux,android
impact:site-broken
configuration:general
affects:all
branch:release
diagnosis-team:dom
user-impact-score:0

Attachments

(2 files, 1 obsolete file)

Environment:
Operating system: Windows 10
Firefox version: Firefox 141.0

Preconditions:
Clean profile

Steps to reproduce:

  1. Navigate to: https://incontrol.landrover.com/jlr-portal-owner-web/select-locale
  2. Click on : Select a market-> Select a language
  3. Observe

Expected Behavior:
Dropdowns are working

Actual Behavior:
Dropdowns are not working

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in firefox-nightly, and firefox-release
  • Does not reproduce in chrome

Created from https://github.com/webcompat/web-bugs/issues/172106

Attached video firefox
<a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">

so I'm honestly not even sure why it works in Chrome.

Severity: -- → S2
User Story: (updated)
Webcompat Priority: --- → P2
Webcompat Score: --- → 6
Priority: -- → P2

Their select2 implementation is reliant on DOM Mutation Events. Enabling dom.mutation_events.enabled makes this website functional again.

Steps to reproduce:

  1. Visit about:config
  2. Search for dom.mutation_events.enabled and ensure it is enabled (true)
  3. Navigate to: https://incontrol.landrover.com/jlr-portal-owner-web/select-locale
  4. Click on : Select a market, then Select a language
  5. Observe site is functioning correctly.
Flags: needinfo?(smaug)
Keywords: regression

Does the site work in Safari?

Does it help to add string pref dom.mutation_events.forceEnable and add incontrol.landrover.com to it?
(Or should it be https://incontrol.landrover.com, or *.landrover.com)

dom.mutation_events.forceEnable="*.landrover.com" seems to help locally

Adding the value of incontrol.landrover.com to dom.mutation_events.forceEnable suffices in making the site usable again.

Safari works because WebKitMutationObserver exists, and the website has a check for this. The relevant code:

           // mozilla and IE
            el.on("propertychange.select2 DOMAttrModified.select2", sync);


            // hold onto a reference of the callback to work around a chromium bug
            if (this.mutationCallback === undefined) {
                this.mutationCallback = function (mutations) {
                    mutations.forEach(sync);
                }
            }

            // safari and chrome
            if (typeof WebKitMutationObserver !== "undefined") {
                if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
                this.propertyObserver = new WebKitMutationObserver(this.mutationCallback);
                this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
            }

I think the code could be patched to use MutationObserver proper, so the above block of code could simply be:

            if (this.mutationCallback === undefined) {
                this.mutationCallback = function (mutations) {
                    mutations.forEach(sync);
                }
            }

            let MO = window.MutationObserver || window.WebKitMutationObserver;

            // safari and chrome
            if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
            this.propertyObserver = new WebKitMutationObserver(this.mutationCallback);
            this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });

Alternatively we could add an intervention for this site, which I have confirmed works:

window.WebkitMutationObserver = MutationObserver
Flags: needinfo?(smaug)

Wow...

Looks like Window.WebkitMutationObserver is just an alias of MutationObserver.
https://searchfox.org/wubkat/source/__GENERATED__/WebCore/DerivedSources/DOMWindowConstructors.idl#451

    attribute MutationObserverConstructor MutationObserver;
    attribute MutationObserverConstructor WebKitMutationObserver; // Legacy Window alias.

So, adding the alias might be better? I'm not sure.

The reported website detects MutationObserver with the alias.
Therefore, it's required to make the website work on Firefox.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Attachment #9510575 - Attachment is obsolete: true
Assignee: masayuki → twisniewski
Webcompat Score: 6 → 5
Pushed by twisniewski@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6b2d322db1e1 https://hg.mozilla.org/integration/autoland/rev/2029551f0c1f add a webcompat JS intervention for incontrol.landrover.com to un-break their locale selector's dropdowns; r=denschub,webcompat-reviewers
User Story: (updated)
Webcompat Score: 5 → 1
Webcompat Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: