Attach (recommended) or Link to PDF file here:
[mytestfile.pdf](https://github.com/mozilla/pdf.js/files/7190033/mytestfile.pdf)

Configuration:
- Web browser and its version: Firefox nightly
- Operating system and its version: linux debian

Steps to reproduce the problem:
1. Open the pdf  
2. Click on the yellow area

What is the expected behavior? (add screenshot)
The text layout should be RTL.

What went wrong? (add screenshot)
The text layout is LTR.

It works correctly in evince and in acrobat.
I added a `dir="rtl"` on the `p` element in using devtools and the rendering is the same as in acrobat.

it("should get field object for usage in JS sandbox", async function () {
      const textWidgetRef = Ref.get(123, 0
      const xDictRef = Ref.get(141, 0
      const dDictRef = Ref.get(262, 0
      const next0Ref = Ref.get(314, 0
      const next1Ref = Ref.get(271, 0
      const next2Ref = Ref.get(577, 0
      const next00Ref = Ref.get(413, 0
      const xDict = new Dict(
      const dDict = new Dict(
      const next0Dict = new Dict(
      const next1Dict = new Dict(
      const next2Dict = new Dict(
      const next00Dict = new Dict(
      const xref = new XRefMock([
        { ref: textWidgetRef, data: textWidgetDict },
        { ref: xDictRef, data: xDict },
        { ref: dDictRef, data: dDict },
        { ref: next0Ref, data: next0Dict },
        { ref: next00Ref, data: next00Dict },
        { ref: next1Ref, data: next1Dict },
        { ref: next2Ref, data: next2Dict },
      ]
      const JS = Name.get("JavaScript"
      const additionalActionsDict = new Dict(
      const eDict = new Dict(
      eDict.set("JS", "hello()"
      eDict.set("S", JS
      additionalActionsDict.set("E", eDict
      // Test the cycle detection here.