Skip to content

Commit

Permalink
Processing a manifest: Moved defaults into individual processing steps.
Browse files Browse the repository at this point in the history
This keeps the relevant info about the default values of members closely
related to the other relevant material about that member. It's also
consistent with how the rest of the members (e.g. scope) treat default
values. And prevents possible errors where the incorrect default value
is used by an intermediate step in between assigning the default and
assigning the actual value.
  • Loading branch information
mgiuca committed Jan 23, 2023
1 parent 56be071 commit aa2a052
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ <h3>
|json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>Set |manifest|["dir"] to "auto".
</li>
<li>If |json|["dir"] doesn't [=map/exist=] or if |json|["dir"] is not
a [=string=], return.
</li>
Expand Down Expand Up @@ -679,6 +681,8 @@ <h3>
|json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>Set |manifest|["display"] to "browser".
</li>
<li>If |json|["display"] doesn't [=map/exist=] or |json|["display"]
is not a a [=string=], return.
</li>
Expand Down Expand Up @@ -773,6 +777,8 @@ <h3>
|manifest URL:URL|, and [=URL=] |document URL:URL|:
</p>
<ol class="algorithm">
<li>Set |manifest|["start_url"] to |document URL|.
</li>
<li>If |json|["start_url"] doesn't [=map/exist=] or
|json|["start_url"] is not a [=string=], return.
</li>
Expand All @@ -784,8 +790,8 @@ <h3>
</li>
<li>If |start URL| is failure, return.
</li>
<li>If |start URL| is not <a>same origin</a> as <var>document
URL</var>, return.
<li>If |start URL| is not <a>same origin</a> as |document URL|,
return.
</li>
<li>Otherwise, set |manifest|["start_url"] to |start URL|.
</li>
Expand Down Expand Up @@ -1267,9 +1273,7 @@ <h3>
</li>
</ol>
</li>
<li>Let |manifest:ordered map| be a new [=ordered map=] «[
"display" → "browser", "dir" → "auto", "start_url" → |document URL|
]».
<li>Let |manifest:ordered map| be an empty [=ordered map=].
</li>
<li>[=Process the `dir` member=] passing |json| and |manifest|.
</li>
Expand Down

0 comments on commit aa2a052

Please sign in to comment.