Closed Bug 1935609 Opened 2 months ago Closed 13 days ago

c.spotler.com - Clicking the highlighted button does not work

Categories

(Core :: DOM: Navigation, defect, P3)

Firefox 135
Desktop
Windows 10
defect

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- affected
firefox133 --- wontfix
firefox134 --- wontfix
firefox135 --- fixed
firefox136 --- fixed

People

(Reporter: ctanase, Assigned: farre, NeedInfo)

References

(Regression, )

Details

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

User Story

platform:windows,mac,linux,android
impact:feature-broken
configuration:general
affects:all
branch:release
diagnosis-team:dom

Attachments

(5 files)

Environment:
Operating system: Windows 10
Firefox version: Firefox 134.0/133/135

Steps to reproduce:

  1. Go to https://c.spotler.com/ct/m9/k1/bQwqrDDSYmkgqatJmeWL-J5ZnedEvwmcKJ3SMb3ITn6CwLhxmZjVQG4BXQCviO_Z/Shu4AAW4Jd9mDVt
  2. Click on the highlighted button (orange).

Expected Behavior:
Link opens in a new tab.

Actual Behavior:
Nothing happens.

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

Attached video FF vs Chrome.mp4
Version: unspecified → Firefox 135

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

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=962f5bdec7f48c7bcf4c317934e299f5a97d9b4d&tochange=3c40aaebf025a776c32b497507d579b0bc86c127

Suspect: Bug 1595491

<a style=" text-decoration: none; text-decoration-color: rgb(0, 0, 238); text-decoration-style: solid;" rel="noopener noreferrer" href="https://c.spotler.com/ct/m9/k1/mFc6haoxFuPcZTFrFMO2jK2v8cMwgjmC7xvLqaazF0Y/7E3cIT4ZpSjf4tL" target="_blank">
  <object data="https://content.mailplus.nl/m9/images/ts/scoutshop/2024___Decemberkalender/images/cd-06-12-2024-F.jpg" width="140" height="140"></object>
</a>
Keywords: regression
Regressed by: 1595491

Set release status flags based on info from the regressing bug 1595491

:sefeng, since you are the author of the regressor, bug 1595491, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(sefeng)

If you disable fission does this work?

(In reply to Timothy Nikkel (:tnikkel) from comment #5)

If you disable fission does this work?

yes, set fission.autostart to false, it works as expected.

The <a> doesn't have a height, but this seems unrelated. If I manually specify dimensions, I still can't click. But if I remove the <object>, I can click.

Severity: -- → S2
User Story: (updated)
Priority: -- → P3

FWIW if you replace <object data= with <img src= the entire site works. They seem to be using an <object> to load an image to change the background color of a table cell.

I am pretty sure Andreas knows more about these, so delegating to him :)

(Thanks Andreas!)

Flags: needinfo?(sefeng) → needinfo?(afarre)
Assignee: nobody → afarre
Status: NEW → ASSIGNED
Flags: needinfo?(afarre)

I guess that the problem is that it's not just an <object> loading an image, it's an <object> loading a cross origin image :/. I'll start with throwing together a wpt test for this.

The same issue happens with:

<a href="https://example.com">
  <iframe src="http://elg.no/elg.jpg"></iframe>
</a>

and the reason seems to be that the document ends up in a layer on top of the anchor. And this is basically how <object>/<embed> works with cross origin images. Emilio, this is a bit out of my league, do you have a quick solution or pointers?

Flags: needinfo?(emilio)

(In reply to Dennis Schubert [:denschub] from comment #7)

The <a> doesn't have a height, but this seems unrelated. If I manually specify dimensions, I still can't click.

Can you elaborate? Clicking works fine here if I set height: 140px; width: 140px; display: inline-block. You need to set display because otherwise width/height don't applies to bare inlines.

(In reply to Andreas Farre [:farre] from comment #11)

and the reason seems to be that the document ends up in a layer on top of the anchor. And this is basically how <object>/<embed> works with cross origin images. Emilio, this is a bit out of my league, do you have a quick solution or pointers?

Well, so this seems basically bug 1909584, but with an extra caveat which is that somehow we are not hitting the remote iframe background when remote, right?

So first thing I'd try is nerfing this condition here. I'm not sure it's needed anymore but Tim or someone on the webrender side would probably know. If removing that fixes it, then great.

Otherwise, I'd look into the apz code, maybe this is not doing the right thing in this case or something.

Flags: needinfo?(emilio)
Flags: needinfo?(dschubert)
Flags: needinfo?(afarre)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #12)

Otherwise, I'd look into the apz code, maybe this is not doing the right thing in this case or something.

Yeah, this is my bet. I'm not really sure how to proceed here, though. Having <object>/<embed> behave like <iframe>s were bound to trigger unknown behaviour. It only happens for cross origin images. That is, with same origin images it works fine. Interestingly enough I discovered that Chrome doesn't handle this, and neither the intrinsic size.

Emilio, do you have a candidate for someone to take this, I'm unfortunately clueless when it comes to apz. Or maybe you know Hsin-Yi?

Flags: needinfo?(htsai)
Flags: needinfo?(emilio)
Flags: needinfo?(afarre)
Attached file Test-case

So looking a bit deeper into it I think it's actually not an APZ bug. In this test-case nsSubDocumentFrame::ContentReactsToPointerEvents returns true, because IsSyntheticImageDocument() returns false, because mContentType is text/html here.

Andreas, tweaking that check fixes it for me. Do you know what the right thing to do there is? Checking mOriginalContentType? Or add some more extra state around here?

Flags: needinfo?(htsai)
Flags: needinfo?(emilio)
Flags: needinfo?(afarre)

I forgot to mention that I'd actually tried this, but my solution was:

--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -1269,12 +1269,10 @@ bool nsSubDocumentFrame::ContentReactsToPointerEvents() const {
   if (Style()->PointerEvents() == StylePointerEvents::None) {
     return false;
   }
-  if (mIsInObjectOrEmbed) {
-    if (nsCOMPtr<nsIObjectLoadingContent> iolc = do_QueryInterface(mContent)) {
-      const auto* olc = static_cast<nsObjectLoadingContent*>(iolc.get());
-      if (olc->IsSyntheticImageDocument()) {
-        return false;
-      }
+  if (mIsInObjectOrEmbed && mFrameLoader) {
+    if (BrowsingContext* browsingContext = mFrameLoader->GetBrowsingContext();
+        browsingContext && browsingContext->GetSyntheticDocumentContainer()) {
+      return false;
     }
   }
   return true;

which essentially is the same thing. I actually agree with you though that this test should be in nsObjectLoadingContent::IsSyntheticImageDocument. I'll attach a WIP patch here for that. But the thing is, it only half-works (or actually three quarters work). The image in the <objectg> element becomes clickable (as in that the <a> gets clickable). But in the attached video you'll see that the pointer only changes if you enter the image from below.

Flags: needinfo?(afarre)

(In reply to Andreas Farre [:farre] from comment #15)

The image in the <object> element becomes clickable (as in that the <a> gets clickable). But in the attached video you'll see that the pointer only changes if you enter the image from below.

Yeah I can see that too. I think that's probably a separate bug... Can you file a follow-up for that? I think it's also a lot less severe

Should this patch be landing under another bug? IIUC, Firefox patches shouldn't be landing under the Web Compat product.

Flags: needinfo?(afarre)
Attachment #9459545 - Attachment description: Bug 1935609 - Use browsing context's synthetic document status. r=emilio! → Bug 1935609 - Part 2: Use browsing context's synthetic document status. r=emilio!
Flags: needinfo?(afarre)
See Also: → 1942016
Blocks: 1942018
Pushed by afarre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/73c9808d9d62 Part 1: Rename synced field to IsSyntheticDocumentContainer. r=emilio https://hg.mozilla.org/integration/autoland/rev/7badd7f689d2 Part 2: Use browsing context's synthetic document status. r=emilio https://hg.mozilla.org/integration/autoland/rev/39d33e72d8b4 apply code formatting via Lando

Does this need Beta approval requests? Please nominate if yes.

Also moving this bug into to the correct component since a platform fix landed in it rather than a dependent bug. NI Honza to make sure this gets the appropriate webcompat flags set on it.

Component: Site Reports → DOM: Navigation
Flags: needinfo?(odvarko)
Flags: needinfo?(avandolder)
Product: Web Compatibility → Core
Target Milestone: --- → 136 Branch

The patch landed in nightly and beta is affected.
:farre, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox135 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(afarre)
Flags: needinfo?(odvarko)

Comment on attachment 9459860 [details]
Bug 1935609 - Part 1: Rename synced field to IsSyntheticDocumentContainer. r=emilio!

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Images embedded in object or embed elements can't be used in anchor elements.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small and only related to object/embed elements.
  • String changes made/needed:
  • Is Android affected?: Yes
Flags: needinfo?(afarre)
Attachment #9459860 - Flags: approval-mozilla-beta?

Comment on attachment 9459545 [details]
Bug 1935609 - Part 2: Use browsing context's synthetic document status. r=emilio!

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Images embedded in object or embed elements can't be used in anchor elements.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small and only related to object/embed elements.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9459545 - Flags: approval-mozilla-beta?

Both parts are needed, since 2 depends on 1.

Flags: needinfo?(avandolder)

Comment on attachment 9459860 [details]
Bug 1935609 - Part 1: Rename synced field to IsSyntheticDocumentContainer. r=emilio!

Approved for 135.0b8.

Attachment #9459860 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9459545 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: