Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Set frame index immediately when tab inserted to window tab strip. #14295

Merged
merged 1 commit into from
May 31, 2018

Conversation

petemill
Copy link
Member

@petemill petemill commented May 31, 2018

Fix #14281
A recent change in muon (between 6.0.9 and 6.0.11) has meant that certain tabs (usually with opener tabs) have an invalid index (-1) before they are added to the window tab strip. In such a case, we add the frame at the last index in the frame state. When the tab received a valid window tab strip, the window was notified and the tab UI shown. However, the index change event was notified separately, causing a delay, and a flash of the tab at the last index of the tab strip, followed by a move to the correct index.
Instead, with this change, we set the frame index immediately, as soon as we set the property that informs the tab has been inserted to the window's tab strip.

Validates input just in case we receive an invalid index (e.g. -1). However, there is no known scenario where this could happen at the moment.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

Fix brave#14281
A recent change in muon (between 6.0.9 and 6.0.11) has meant that certain tabs (usually with opener tabs) have an invalid index (-1) before they are added to the window tab strip. In such a case, we add the frame at the last index in the frame state. When the tab received a valid window tab strip, the window was notified and the tab UI shown. However, the index change event was notified separately, causing a delay, and a flash of the tab at the last index of the tab strip, followed by a move to the correct index.
Instead, with this change, we set the frame index immediately, as soon as we set the property that informs the tab has been inserted to the window's tab strip.

Validates input just in case we receive an invalid index (e.g. -1). However, there is no known scenario where this could happen at the moment.
@petemill petemill self-assigned this May 31, 2018
@petemill petemill requested a review from bsclifton May 31, 2018 06:57
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Changes works great- nice tests too 😄 👍

@bsclifton bsclifton merged commit 201c1cf into brave:master May 31, 2018
bsclifton added a commit that referenced this pull request May 31, 2018
Set frame index immediately when tab inserted to window tab strip.
bsclifton added a commit that referenced this pull request May 31, 2018
Set frame index immediately when tab inserted to window tab strip.
@bsclifton
Copy link
Member

master 201c1cf
0.23.x f464a34
0.22.x 86ddd55

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants