Closed Bug 2022763 Opened 3 months ago Closed 1 month ago

www.linkedin.com - PDF file upload fails when creating a new post

Categories

(Core :: DOM: Core & HTML, defect, P1)

Desktop
Windows 10
defect

Tracking

()

VERIFIED FIXED
151 Branch
Webcompat Priority P1
Webcompat Score 10
Tracking Status
firefox148 --- wontfix
firefox149 --- wontfix
firefox150 --- wontfix
firefox151 --- verified

People

(Reporter: bfarkas, Assigned: emilio)

References

()

Details

(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs][webcompat:sightline][webcompat:core])

User Story

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

Attachments

(2 files, 2 obsolete files)

Environment:
Operating system: Mac OS X 10.15 / Windows 10
Firefox version: Firefox 148.0 / Firefox Nightly 150a1 (2026-03-11)

Preconditions:
Valid user credentials

Steps to reproduce:

  1. Access: https://www.linkedin.com/
  2. Log in to reach the Homepage
  3. Click on "Start a post"
  4. Select "Add a document" icon
  5. Click on "Choose file" and select any PDF file
  6. Observe the page

Expected Behavior:
The PDF file is not uploaded

Actual Behavior:
The PDF file is uploaded accordingly and can be previewed in order to proceed further with the post

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/211734

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.

Whiteboard: [webcompat-source:web-bugs] → [webcompat-source:web-bugs][webcompat:sightline][webcompat:core]
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: --- → 1
Severity: -- → S2
User Story: (updated)
Webcompat Priority: P3 → P1
Webcompat Score: 1 → 9
Priority: -- → P1
User Story: (updated)
Webcompat Score: 9 → 10

It's about the realm of event.target.files[0]. The input element is inside the main page, but created from an iframe, so e.target instanceof Element is true inside iframe. But as we transplant the element to the parent page, we also change the prototype of the element (see bug 1470017).

We call the event listener within the iframe realm. The problem is that Chrome makes the realm of event.target and event.target.files[0] be same (using the realm of the iframe page) but on Firefox we use the realm of the main page. So instanceof check in the iframe fails against instanceof File.

User Story: (updated)
See Also: → 1470017, 1502814

Should probably be in bug 1470017.

Depends on: 1470017
See Also: 1470017

Comment on attachment 9553656 [details]
WIP: Bug 2022763 - Don't reparent prototype chains.

Revision D288165 was moved to bug 1470017. Setting attachment 9553656 [details] to obsolete.

Attachment #9553656 - Attachment is obsolete: true
Assignee: nobody → emilio
Attachment #9553657 - Attachment description: WIP: Bug 2022763 - Propagate owner global from input element to DOM files properly. → Bug 2022763 - Propagate owner global from input element to DOM files properly. r=#dom-core
Status: NEW → ASSIGNED

After the previous commit it doesn't need a browsing context argument.

It doesn't build:

18:43.43 W In file included from D:/firefox-2/widget/windows/nsFilePicker.cpp:6:
18:43.44 E D:/firefox-2/widget/windows\nsFilePicker.h(72,14): error: 'Init' marked 'override' but does not override any member functions
18:43.44 E    72 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:43.44 E       |              ^
18:43.45 W D:/firefox-2/widget/windows\nsFilePicker.h(72,14): warning: 'nsFilePicker::Init' hides overloaded virtual function [-Woverloaded-virtual]
18:43.45 W D:/firefox-2/widget\nsBaseFilePicker.h(28,14): note: hidden overloaded virtual function 'nsBaseFilePicker::Init' declared here: different number of parameters (4 vs 3)
18:43.46 W    28 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:43.46 W       |              ^
18:44.57 js/xpconnect/shell
18:46.38 E D:/firefox-2/xpcom/components\../../widget/windows/nsFilePicker.h(72,14): error: 'Init' marked 'override' but does not override any member functions
18:46.38 E    72 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:46.39 E       |              ^
18:46.39 W D:/firefox-2/xpcom/components\../../widget/windows/nsFilePicker.h(72,14): warning: 'nsFilePicker::Init' hides overloaded virtual function [-Woverloaded-virtual]
18:46.39 W D:/firefox-2/xpcom/components\../../widget\nsBaseFilePicker.h(28,14): note: hidden overloaded virtual function 'nsBaseFilePicker::Init' declared here: different number of parameters (4 vs 3)
18:46.39 W    28 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:46.39 W       |              ^
18:50.95 W In file included from D:/firefox-2/widget/windows/nsWidgetFactory.cpp:23:
18:50.95 E D:/firefox-2/widget/windows\nsFilePicker.h(72,14): error: 'Init' marked 'override' but does not override any member functions
18:50.95 E    72 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:50.95 E       |              ^
18:50.95 W D:/firefox-2/widget/windows\nsFilePicker.h(72,14): warning: 'nsFilePicker::Init' hides overloaded virtual function [-Woverloaded-virtual]
18:50.95 W D:/firefox-2/widget\nsBaseFilePicker.h(28,14): note: hidden overloaded virtual function 'nsBaseFilePicker::Init' declared here: different number of parameters (4 vs 3)
18:50.96 W    28 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:50.96 W       |              ^
18:50.96 W 1 warning and 1 error generated.
18:51.14 E mozmake[4]: *** [D:/firefox-2/config/rules.mk:668: StaticComponents.obj] Error 1
18:51.16 E mozmake[3]: *** [D:/firefox-2/config/recurse.mk:72: xpcom/components/target-objects] Error 2
18:51.17 E mozmake[3]: *** Waiting for unfinished jobs....
18:53.40 E D:/firefox-2/widget/windows/nsFilePicker.cpp(114,64): error: too few arguments to function call, expected 4, have 3
18:53.40 E   114 |   return nsBaseFilePicker::Init(aBrowsingContext, aTitle, aMode);
18:53.40 E       |          ~~~~~~~~~~~~~~~~~~~~~~                                ^
18:53.40 E D:/firefox-2/widget\nsBaseFilePicker.h(28,14): note: 'Init' declared here
18:53.40 E    28 |   NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
18:53.40 E       |              ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:53.40 E    29 |                   const nsAString& aTitle, nsIFilePicker::Mode aMode,
18:53.41 E       |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:53.41 E    30 |                   nsISupports* aGlobal) override;
18:53.41 E       |                   ~~~~~~~~~~~~~~~~~~~~
18:54.78 E 1 warning and 1 error generated.
18:54.85 E mozmake[4]: *** [D:/firefox-2/config/rules.mk:666: nsWidgetFactory.obj] Error 1
18:54.85 E mozmake[4]: *** Waiting for unfinished jobs....
18:56.08 E 1 warning and 2 errors generated.
18:56.17 E mozmake[4]: *** [D:/firefox-2/config/rules.mk:666: nsFilePicker.obj] Error 1
19:45.54 E mozmake[3]: *** [D:/firefox-2/config/recurse.mk:72: widget/windows/target-objects] Error 2
19:45.54 E mozmake[2]: *** [D:/firefox-2/config/recurse.mk:34: compile] Error 2
19:45.55 E mozmake[1]: *** [D:/firefox-2/config/rules.mk:357: default] Error 2
19:45.56 E mozmake: *** [client.mk:58: build] Error 2
19:45.67 W 1 compiler warnings present.
Flags: needinfo?(emilio)

Oh, of course, windows overrides Init() ;)

Fixed

Flags: needinfo?(emilio)

I can confirm it works

Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ff40c521b24c https://hg.mozilla.org/integration/autoland/rev/8e0a5644398f Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/85b2d0d3dd20 https://hg.mozilla.org/integration/autoland/rev/bc230c66081d Clean up existing usages of MockFilePicker.init(). r=dom-core,mtigley,extension-reviewers,credential-management-reviewers,devtools-reviewers,omc-reviewers,migration-reviewers,profiles-reviewers,layout-reviewers,emz,fchasen,nchevobbe,mconley,smaug,mossop,robwu,hanna_a,jwatt
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ffcaa992e692 https://hg.mozilla.org/integration/autoland/rev/2eee2bdcb278 Revert "Bug 2022763 - Clean up existing usages of MockFilePicker.init(). r=dom-core,mtigley,extension-reviewers,credential-management-reviewers,devtools-reviewers,omc-reviewers,migration-reviewers,profiles-reviewers,layout-reviewers,emz,fchasen,nchevobbe,mconley,smaug,mossop,robwu,hanna_a,jwatt" for causing multiple failures.
Attachment #9553657 - Attachment description: Bug 2022763 - Propagate owner global from input element to DOM files properly. r=#dom-core → Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0f7505426190 https://hg.mozilla.org/integration/autoland/rev/f56824147146 Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes
Pushed by rperta@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2b400e7aa3c5 https://hg.mozilla.org/integration/autoland/rev/30b95bf978ba Revert "Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes" for causing bc failures at browser_screenshots_test_downloads.js This reverts commit 0f75054261903a570c74d3b4f30d5dbd599c305d.

Backed out for causing bc failures at browser_screenshots_test_downloads.js
Backout link
Failure log(s)

Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch

Comment 19 was actually backed out in comment 18. It's a bugherder bug.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 151 Branch → ---
Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 151 Branch → ---

Gah, thanks, must've missed that because it was already filed as an intermittent (bug 1970555).

See Also: → 1970555
Attachment #9553657 - Attachment description: Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll → Bug 2022763 - Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f097472815c1 https://hg.mozilla.org/integration/autoland/rev/73923083bb68 Propagate owner global from input element to DOM files properly. r=dom-core,win-reviewers,smaug,gstoll,devtools-reviewers,jdescottes
Regressions: 2033206
See Also: 1502814
Component: Site Reports → DOM: Core & HTML
Product: Web Compatibility → Core
Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
See Also: → 2033301
Blocks: 2033405

Comment on attachment 9554711 [details]
Bug 2022763 - Clean up existing usages of MockFilePicker.init(). r=#dom-core

Revision D288559 was moved to bug 2033405. Setting attachment 9554711 [details] to obsolete.

Attachment #9554711 - Attachment is obsolete: true
QA Whiteboard: [qa-triage-done-c152/b151] [qa-ver-needed-c152/b151]
Flags: qe-verify+
No longer regressions: 2033206

Verified, the issue no longer reproduces. The PDF file can be uploaded accordingly and can be previewed correctly in order to proceed further with the post.

Tested with:

  • Browser / Version: Firefox 151.0-candidate build 1
  • Operating System: Windows 10
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: