Quantum/DOM: Difference between revisions

Jump to navigation Jump to search
Tweak that
(Clarify that "runnable" does specifically refer to nsIRunnable)
(Tweak that)
Line 9: Line 9:
To more precisely specify when one runnable can observe state from another runnable, we need to define some terminology.
To more precisely specify when one runnable can observe state from another runnable, we need to define some terminology.


A <b>runnable</b> in this context specifically refers to nsIRunnable.
A <b>runnable</b> in this context specifically refers to nsIRunnable. However, note that other common things such an nsITimer implementations use nsIRunnable under the hood. Code that indirectly (and possibly without the authors knowledge) uses nsIRunnable also needs to be modified as discussed below.


A <b>TabGroup</b> is the set of tabs that are related by window.opener. In a session with four tabs, where T1 opens T2 and T3 opens T4, the TabGroups are {T1, T2} and {T3, T4}. <span style="color: red">(XXX Is this specifically about sharing the same opener, or about being reachable through an opener chain? That is, if T5 opens T6 which opens T7, are they all in the same TabGroup? And what if a tab is opened using rel=noopener? Does that start a new group?)</span> Once a tab joins a TabGroup, it never leaves it. TabGroups have the property that two tabs from different TabGroups can never observe each other's state. So a runnable from one TabGroup can run while a runnable from a different TabGroup is paused.
A <b>TabGroup</b> is the set of tabs that are related by window.opener. In a session with four tabs, where T1 opens T2 and T3 opens T4, the TabGroups are {T1, T2} and {T3, T4}. <span style="color: red">(XXX Is this specifically about sharing the same opener, or about being reachable through an opener chain? That is, if T5 opens T6 which opens T7, are they all in the same TabGroup? And what if a tab is opened using rel=noopener? Does that start a new group?)</span> Once a tab joins a TabGroup, it never leaves it. TabGroups have the property that two tabs from different TabGroups can never observe each other's state. So a runnable from one TabGroup can run while a runnable from a different TabGroup is paused.
Line 19: Line 19:
= Labeling =
= Labeling =


A major task for the Quantum DOM project is to label runnables with a DocGroup, TabGroup, or the SystemGroup. Using a DocGroup is preferred over using a TabGroup since TabGroup is less specific, but for some runnables the best we can do is give it a TabGroup. Runnables that do not affect web content at all should be labeled using the <b>SystemGroup</b>. However, only use the system group if you are absolutely sure that the runnable will not run any content JS code or have any affect on content DOM or layout.
A major task for the Quantum DOM project is to "label" runnableswith a DocGroup, TabGroup, or the SystemGroup. Using a DocGroup is preferred over using a TabGroup since TabGroup is less specific, but for some runnables the best we can do is give it a TabGroup. Runnables that do not affect web content at all should be labeled using the <b>SystemGroup</b>. However, only use the system group if you are absolutely sure that the runnable will not run any content JS code or have any affect on content DOM or layout.


In addition to labeling runnables with a group, it is preferred to name them at the same time to aid in debugging.
In addition to labeling runnables with a group, it is preferred to name them at the same time to aid in debugging.
Confirmed users, Bureaucrats and Sysops emeriti
969

edits

Navigation menu