Skip to content

Remove code to support out-of-process iframes in Firefox which is no longer necessary.#16746

Merged
seanbudd merged 4 commits into
nvaccess:masterfrom
jcsteh:rmFission
Jun 27, 2024
Merged

Remove code to support out-of-process iframes in Firefox which is no longer necessary.#16746
seanbudd merged 4 commits into
nvaccess:masterfrom
jcsteh:rmFission

Conversation

@jcsteh

@jcsteh jcsteh commented Jun 26, 2024

Copy link
Copy Markdown
Contributor

Link to issue number:

Reverts #10707.

Summary of the issue:

Firefox moved most iframes into different processes (AKA out-of-process iframes or project "Fission") in 2020. This necessitated some changes to NVDA because with Firefox's older multi-process architecture, objects in one process were unaware of objects in another. However, with the new "Cache the World" architecture released in Firefox 113 (just over a year ago in May 2023), this special handling is no longer necessary, since all objects are served from the parent process and the parent process is aware of all of them.

While removing this code likely doesn't have any discernible user benefit, I think it's worthwhile to remove unnecessary complexity.

There is no supported version of Firefox (even ESR) which depends on this code.

Description of user facing changes

None. There might be a slight performance benefit, but I doubt this is perceivable.

Description of development approach

Reverted #10707, adjusting for non-substantive changes that were made since #10707 was merged (code style, moved constants, etc.).

Note that this moves back to using accChild instead of getNVDAObjectFromEvent. At the time, there didn't appear to be a performance benefit to using accChild and using getNVDAObjectFromEvent made it easier to implement #10707. However, I have since then discovered (through Firefox profiling) that at least in-process, AccessibleObjectFromWindow can be rather slow relative to direct COM calls. This probably isn't noticeable for NVDA's use case, especially given that we're doing this across processes, but any performance boost is probably worthwhile here.

I didn't add a change log entry because there is no user visible change here.

Testing strategy:

Tested pages with and without iframes in both Firefox and Chrome. Everything worked as expected.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Summary by CodeRabbit

  • Refactor
    • Improved internal logic and error handling for better performance and stability.

@jcsteh jcsteh requested a review from a team as a code owner June 26, 2024 06:13
@jcsteh jcsteh requested a review from michaelDCurran June 26, 2024 06:13
@coderabbitai

coderabbitai Bot commented Jun 26, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in gecko_ia2.py involve significant updates to the class Gecko_ia2, including removing the _framesCache weak reference dictionary, restructuring the _getEmbedderFrame method, and simplifying and updating the logic and error handling in both the __contains__ and getNVDAObjectFromIdentifier methods for improved reliability and maintainability.

Changes

File Change Summary
source/virtualBuffers/... Removed the _framesCache weak reference dictionary from the Gecko_ia2 class.
source/virtualBuffers/... Restructured the _getEmbedderFrame method in the Gecko_ia2 class.
source/virtualBuffers/... Simplified logic and updated error handling in the __contains__ method of the Gecko_ia2 class.
source/virtualBuffers/... Adjusted error handling and return values in the getNVDAObjectFromIdentifier method of Gecko_ia2.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Comment thread source/virtualBuffers/gecko_ia2.py Outdated
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 55fbf64eb2

Comment thread source/virtualBuffers/gecko_ia2.py Outdated
Comment thread source/virtualBuffers/gecko_ia2.py Outdated
@seanbudd seanbudd marked this pull request as draft June 26, 2024 23:18
@jcsteh jcsteh marked this pull request as ready for review June 27, 2024 00:32
Comment thread source/virtualBuffers/gecko_ia2.py Outdated
@seanbudd seanbudd merged commit 9afb6fc into nvaccess:master Jun 27, 2024
@jcsteh

jcsteh commented Jun 27, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for the code style fix. I did run this by the linter and it didn't pick this up. Is that something worth fixing if this is the preferred style?

@jcsteh jcsteh deleted the rmFission branch June 27, 2024 01:32
@seanbudd

seanbudd commented Jun 27, 2024

Copy link
Copy Markdown
Member

we'll be working on automated linting using ruff in the next week so I won't worry about it. soon manual linting will mostly be a thing of the past 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants