Re: [w3c/screen-orientation] Visit each nested document once for an orientation change (PR #285)

@marcoscaceres commented on this pull request.



>          The <dfn class="export">screen orientation change steps</dfn> for
-        {{Document}} |document:Document| are as follows:
+        {{Document}} |document:Document|, given an optional boolean
+        |notifyDescendants| (default true), are as follows:

A boolean argument hides what `false` means at the call site. Could the per-document steps become their own algorithm, so the exported one needs no extra argument? The next suggestion makes the matching change.

```suggestion
        To <dfn>update the screen orientation</dfn> of {{Document}}
        |document:Document|, run these steps:
```

> +        <li>If |notifyDescendants| is false, return.
+        </li>
         <li>Let |descendantDocs| be an [=ordered set=] consisting of
         |document|'s [=Document/descendant navigables=]'s [=navigable/active
         documents=], if any, in tree order.
         </li>
         <li>[=Set/For each=] |doc:Document| in |descendantDocs|, run the
-        [=screen orientation change steps=] with |doc|.
+        [=screen orientation change steps=] with |doc| and false.
         </li>
       </ol>

The exported algorithm now lists the document and its descendants, then runs the per-document steps on each. Each document is still visited once. One difference: a descendant now runs its own checks even when the top document's orientation is already current.

```suggestion
      </ol>
      <p>
        The <dfn class="export">screen orientation change steps</dfn> for
        {{Document}} |document:Document| are as follows:
      </p>
      <ol class="algorithm">
        <li>Let |documents| be an [=ordered set=] consisting of |document|
        followed by |document|'s [=Document/descendant navigables=]'s
        [=navigable/active documents=], if any, in tree order.
        </li>
        <li>[=Set/For each=] |doc:Document| in |documents|, [=update the
        screen orientation=] of |doc|.
        </li>
      </ol>
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/pull/285#pullrequestreview-5933802046
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/screen-orientation/pull/285/review/5933802046@github.com>

Received on Tuesday, 17 November 2026 06:07:44 UTC