Tab key is used to steer the focus into and from the editor.
User expects that:
If the focusable element directly preceding the editor in the page’s focus order is focused, pressing Tab key MUST move the focus inside the editable area.
If the element directly succeeding the editor in the page’s focus order is focused, pressing Shift+Tab key combination MUST move the focus inside the editable area.
If the editor is outside the current visible area of the page, the editor MUST be scrolled inside the current visible area of the page.
When the focus is moved inside the editable area, the previous selection state, if it exists, MUST be restored.
If the editable area is focused, pressing Tab key MUST move the focus to the focusable element directly succeeding the editor in the page’s focus order.
If the editable area is focused, pressing Shift+Tab key combination MUST move the focus to the focusable element directly preceding the editor in the page’s focus order.
When the focus is about to be moved away from the editable area, the current selection state MUST be saved to be restored when the editable area regains focus.