Closed Bug 1755647 Opened 3 years ago Closed 2 months ago

RDM doesn't fire change event of screen.orientation

Categories

(DevTools :: Responsive Design Mode, defect, P3)

defect

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: m_kato, Assigned: rubicon)

References

()

Details

Attachments

(1 file, 1 obsolete file)

What were you doing?

  1. https://makotokato.github.io/demo/orientation.html
  2. Use RDM in devtools
  3. Click rotation icon

What happened?

orientationchange event on window object is fired, but change event on screen.orientation object isn't fired.

What should have happened?

change event on screen.orientation object isn't fired.

I guess that we should simulate change event in simulateScreenOrientationChange or _setRDMPaneOrientation

Nicolas, for investigation

Flags: needinfo?(nchevobbe)

So I guess we should call dom/base/ScreenOrientation.cpp#576-592 from docshell/base/BrowsingContext.h#608.

Micah, I see you modified BrowsingContext.h not too long ago , do you think you could take care of this issue ? If not, do you know we should ask for this (maybe calu) ? Thanks!

Flags: needinfo?(nchevobbe) → needinfo?(mtigley)

I can take a look into this. Thanks Nicolas!

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

nsGlobalWindowInner::Orientation seems like it won't look at the BrowsingContext orientation either.

Can we do the browsingcontext orientation thing as a sort-of override rather than keeping the values stored in the browsing context for all documents? That might be simpler.

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

nsGlobalWindowInner::Orientation seems like it won't look at the BrowsingContext orientation either.

Can we do the browsingcontext orientation thing as a sort-of override rather than keeping the values stored in the browsing context for all documents? That might be simpler.

If I remember correctly, the orientation values were stored on the browsing context so that they persisted across refreshes while in RDM. I'm not entirely sure if there's now/already another way to do this.

Sure, and that's totally fine. My point is that right now we're treating the BrowsingContext values as the source of truth even when RDM is disabled. It'd be slightly easier to follow if this worked like other overrides, e.g.:

if (Maybe<uint16_t> angle = bc->GetOverrideAngle()) {
  return *angle;
}
return ScreenAngle();

But anyways I guess that's sort of an implementation detail that can be changed at any time :)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: mtigley → nobody
Status: ASSIGNED → NEW

The change event is fired in ResponseActor.dispatchOrientationChangeEvent, along side the orientationchange event.

Assignee: nobody → l1589002388
Status: NEW → ASSIGNED
Attachment #9439990 - Attachment description: Bug 1755647: fire change event on window.screen.orientation. r=jdescottes → Bug 1755647 - Fire change event on window.screen.orientation. r=jdescottes
Attachment #9440263 - Attachment description: Bug 1755647: Test for firing screen orientation change event. r=nchevobbe → Bug 1755647 - Fire change event on window.screen.orientation. r=nchevobbe.
Attachment #9439990 - Attachment description: Bug 1755647 - Fire change event on window.screen.orientation. r=jdescottes → Bug 1755647 - Fire change event on window.screen.orientation. r=nchevobbe.
Attachment #9440263 - Attachment is obsolete: true
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4188f5eb8240 Fire change event on window.screen.orientation. r=devtools-reviewers,nchevobbe.
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: