8000 Account for User-Agent not starting with Mozilla/ in appVersion getter · whatwg/html@a93c6fa · GitHub
[go: up one dir, main page]

Skip to content

Commit a93c6fa

Browse files
authored
Account for User-Agent not starting with Mozilla/ in appVersion getter
Also remove some obsolete comments and whitespace in this section. Fixes #11630.
1 parent c6314c8 commit a93c6fa

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed

source

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -120966,47 +120966,44 @@ interface <dfn interface>Navigator</dfn> {
120966120966
data-x="dom-navigator-appCodeName">appCodeName</code></dfn> getter steps are to return
120967120967
"<code data-x="">Mozilla</code>".</p>
120968120968

120969-
<!-- appMinorVersion: IE only. In IE8b1, returns " Beta" (with the space) -->
120970-
120971120969
<p>The <dfn attribute for="NavigatorID"><code data-x="dom-navigator-appName">appName</code></dfn>
120972120970
getter steps are to return "<code data-x="">Netscape</code>".</p>
120973120971

120974120972
<p>The <dfn attribute for="NavigatorID"><code
120975-
data-x="dom-navigator-appVersion">appVersion</code></dfn> getter steps are to return the
120976-
appropriate string that starts with "<code data-x="">5.0 (</code>", as
120977-
follows:</p>
120973+
data-x="dom-navigator-appVersion">appVersion</code></dfn> getter steps are:</p>
120978120974

120979120975
<ol>
120980-
<li>Let <var>trail</var> be the substring of <span data-x="default-user-agent-value">default
120981-
`<code>User-Agent</code>` value</span> that follows the "<code data-x="">Mozilla/</code>"
120982-
prefix.</li>
120983-
<!-- Fetch doesn't actually require the value to start with "Mozilla/5.0 (". -->
120976+
<li><p>If the <span data-x="default-user-agent-value">default `<code>User-Agent</code>`
120977+
value</span> does not start with `<code data-x="">Mozilla/5.0 (</code>`, then return the empty
120978+
string.</p></li>
120984120979

120985-
<li>
120986-
<dl class="switch"> <dt>If the <span data-x="concept-navigator-compatibility-mode">navigator
120987-
compatibility mode</span> is <i>Chrome</i> or <i>WebKit</i></dt>
120988-
<dd><p>Return <var>trail</var>.</p></dd>
120980+
<li><p>Let <var>trail</var> be the substring of the <span
120981+
data-x="default-user-agent-value">default `<code>User-Agent</code>` value</span>, <span
120982+
data-x="isomorphic decode">isomorphic decoded</span>, that follows the "<code
120983+
data-x="">Mozilla/</code>" prefix.</p></li>
120989120984

120990-
<dt>If the <span data-x="concept-navigator-compatibility-mode">navigator compatibility
120991-
mode</span> is <i>Gecko</i></dt>
120992-
<dd>
120993-
<p>If <var>trail</var> starts with "<code data-x="">5.0 (Windows</code>", then return "<code
120994-
data-x="">5.0 (Windows)</code>".</p>
120985+
<li>
120986+
<dl class="switch">
120987+
<dt>If the <span data-x="concept-navigator-compatibility-mode">navigator compatibility
120988+
mode</span> is <i>Chrome</i> or <i>WebKit</i></dt>
120989+
<dd><p>Return <var>trail</var>.</p></dd>
120995120990

120996-
<p>Otherwise, return the prefix of <var>trail</var> up to but not including the first U+003B
120997-
(;), concatenated with the character U+0029 RIGHT PARENTHESIS. For example, "<code
120998-
data-x="">5.0 (Macintosh)</code>", "<code data-x="">5.0 (Android 10)</code>", or "<code
120999-
data-x="">5.0 (X11)</code>".</p> <!-- Unclear if Gecko mode returning a shorter string that
121000-
doesn't contain the whole trail is needed for Web compat. -->
120991+
<dt>If the <span data-x="concept-navigator-compatibility-mode">navigator compatibility
120992+
mode</span> is <i>Gecko</i></dt>
120993+
<dd>
120994+
<p>If <var>trail</var> starts with "<code data-x="">5.0 (Windows</code>", then return "<code
120995+
data-x="">5.0 (Windows)</code>".</p>
120996+
120997+
<p>Otherwise, return the prefix of <var>trail</var> up to but not including the first U+003B
120998+
(;), concatenated with the character U+0029 RIGHT PARENTHESIS. For example, "<code
120999+
data-x="">5.0 (Macintosh)</code>", "<code data-x="">5.0 (Android 10)</code>", or "<code
121000+
data-x="">5.0 (X11)</code>".</p> <!-- Unclear if Gecko mode returning a shorter string that
121001+
doesn't contain the whole trail is needed for Web compat. -->
121001121002
</dd>
121002121003
</dl>
121003121004
</li>
121004121005
</ol>
121005121006

121006-
<!-- buildID: Mozilla only -->
121007-
121008-
<!-- oscpu: Mozilla only -->
121009-
121010121007
<p>The <dfn attribute for="NavigatorID"><code data-x="dom-navigator-platform">platform</code></dfn>
121011121008
getter steps are to return a string representing the platform on which the
121012121009
browser is executing (e.g. "<code data-x="">MacIntel</code>", "<code data-x="">Win32</code>",
@@ -121021,7 +121018,6 @@ interface <dfn interface>Navigator</dfn> {
121021121018
getter steps are to return the appropriate string from the following list:</p>
121022121019

121023121020
<dl class="switch">
121024-
121025121021
<dt>If the <span data-x="concept-navigator-compatibility-mode">navigator compatibility
121026121022
mode</span> is <i>Chrome</i> or <i>WebKit</i></dt>
121027121023
<dd><p>The string "<code data-x="">20030107</code>".</p></dd>
@@ -121031,8 +121027,6 @@ interface <dfn interface>Navigator</dfn> {
121031121027
<dd><p>The string "<code data-x="">20100101</code>".</p></dd>
121032121028
</dl>
121033121029

121034-
<!-- securityPolicy: Mozilla only; always returns "" -->
121035-
121036121030
<p>The <dfn attribute for="NavigatorID"><code data-x="dom-navigator-userAgent">userAgent</code></dfn>
121037121031
getter steps are to return the <span data-x="default-user-agent-value">default `<code>User-Agent</code>`
121038121032
value</span>.</p>
@@ -121041,7 +121035,6 @@ interface <dfn interface>Navigator</dfn> {
121041121035
getter steps are to return the appropriate string from the following list:</p>
121042121036

121043121037
<dl class="switch">
121044-
121045121038
<dt>If the <span data-x="concept-navigator-compatibility-mode">navigator compatibility
121046121039
mode</span> is <i>Chrome</i></dt>
121047121040
<dd><p>The string "<code data-x="">Google Inc.</code>".</p></dd>
@@ -121113,7 +121106,6 @@ interface <dfn interface>Navigator</dfn> {
121113121106

121114121107
<div w-nodev>
121115121108

121116-
<!-- at time of testing, this was supported by Opera, Safari, and Mozilla only -->
121117121109
<p>The <dfn attribute for="NavigatorLanguage"><code
121118121110
data-x="dom-navigator-language">language</code></dfn> getter steps are to return a valid BCP 47
121119121111
language tag representing either <span>a plausible language</span> or the user's most preferred

0 commit comments

Comments
 (0)
0