Skip to content

remove dated and old patent policy links #1963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions lib/l10n-en_GB.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,14 @@ export const messages = {
// sotd/pp
'sotd.pp.no-pp':
'Required patent policy paragraph not found. Expected text related to patent policy requirements: <blockquote>${expected}</blockquote>',
'sotd.pp.no-pp-from-charter':
'Cannot find the patent policy version from the groups charter. Please make sure the group has a current charter with a patent policy',
'sotd.pp.undefined':
"Could not determine the patent policy the WG is operating under. Check the WG's charter.",
'sotd.pp.no-pp2017':
'The WG is operating under the patent policy 2017 but the document mentions a different one, please check the text as well as the link.',
'sotd.pp.no-pp2020':
'The WG is operating under the patent policy 2020 but the document mentions a different one, please check the text as well as the link.',
'sotd.pp.no-link': 'Require link to the W3C Patent Policy not found',
'sotd.pp.no-disclosures':
'No valid HTTPS link to public list of disclosures (<code>https://www.w3.org/2004/01/pp-impl/NNNNN/status</code>).',
'No valid HTTPS link to public list of disclosures (<code>https://www.w3.org/groups/XX/YYYYY/ipr/</code>).',
'sotd.pp.no-claims':
'No valid HTTPS link to definition of essential claims (<code>${link}</code>).',
'sotd.pp.no-section6':
'No valid HTTPS link to the Disclosure section of the patent policy (<code>${link}</code>).',
'sotd.pp.joint-publication': 'Joint publication detected.',
'sotd.pp.joint-different-pp':
'This document is published by multiple groups operating under different versions of the Patent Policy. A document should be published under one and only one Patent Policy, to which all participants in contributing groups have agreed.',
'sotd.pp.wrong-pp-from-charter':
'The Working Group delivering the document operates under the patent policy "${pp_charter}", but the check is against "${pp_config}". Please select the right patent policy to match the charter\'s version.',
// sotd/charter
'sotd.charter.no-group':
'Unable to find the group(s) ID(s) (in the <code>data-deliverer</code> attribute for Note-Track documents, and in the "Status of This Document" for REC-Track documents).',
Expand Down Expand Up @@ -386,7 +375,6 @@ export const messages = {
'metadata.profile': false,
'metadata.title': false,
'metadata.errata': false,
'metadata.patent-policy': false,
'metadata.charters': false,
'metadata.sotd': false,
'metadata.abstract': false,
Expand Down
2 changes: 0 additions & 2 deletions lib/profiles/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as editorIds from '../rules/metadata/editor-ids.js';
import * as editorNames from '../rules/metadata/editor-names.js';
import * as errata from '../rules/metadata/errata.js';
import * as informative from '../rules/metadata/informative.js';
import * as patentPolicy from '../rules/metadata/patent-policy.js';
import * as process from '../rules/metadata/process.js';
import * as profile from '../rules/metadata/profile.js';
import * as title from '../rules/metadata/title.js';
Expand All @@ -22,7 +21,6 @@ export const rules = [
docDate,
dl,
deliverers,
patentPolicy,
charters,
editorIds,
editorNames,
Expand Down
16 changes: 0 additions & 16 deletions lib/rules/metadata/patent-policy.js

This file was deleted.

101 changes: 20 additions & 81 deletions lib/rules/sotd/pp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ const self = {
rule: 'patPolReq',
};

const ppLink = 'https://www.w3.org/Consortium/Patent-Policy/';
const ppLinkNew = 'https://www.w3.org/policies/patent-policy/';
const pp2020 = 'https://www.w3.org/Consortium/Patent-Policy-20200915/';
const pp2020New = 'https://www.w3.org/policies/patent-policy/20200915/';
const pp2017 = 'https://www.w3.org/Consortium/Patent-Policy-20170801/';
const ppLink = 'https://www.w3.org/policies/patent-policy/';
const ppLink2020 = 'https://www.w3.org/policies/patent-policy/20200915/';
const ppLink2025 = 'https://www.w3.org/policies/patent-policy/20250515/';

/**
* @param groups
* @param sr
* @param ppLink
*/
function buildWanted(groups, sr, ppLink) {
function buildWanted(groups, sr) {
const { config } = sr;
let wanted;
const result = {};
const isPP2017 = ppLink === pp2017;
const isRecTrack = config.track === 'Recommendation';

const ppText = isPP2017 ? ' 1 August 2017' : '( 15 September 2020)?';
const ppText = '( 15 September 2020| 15 May 2025)?';

wanted = `This document was produced by ${
groups.length === 2 ? 'groups ' : 'a group '
Expand Down Expand Up @@ -69,12 +65,12 @@ function buildWanted(groups, sr, ppLink) {
* @param sr
* @param isIGDeliverable
*/
function findPP(candidates, sr, ppLink) {
function findPP(candidates, sr) {
let pp = null;
const delivererGroups = sr.getDelivererNames();
if (delivererGroups.length > 1) sr.warning(self, 'joint-publication');

const wanted = buildWanted(delivererGroups, sr, ppLink);
const wanted = buildWanted(delivererGroups, sr);
const expected = wanted.text;
Array.prototype.some.call(candidates, p => {
const text = sr.norm(p.textContent);
Expand All @@ -97,93 +93,35 @@ export async function check(sr, done) {
// Check if the document is published by WGs only. If IG/AB/TAG(s) are involved, the document cannot be on REC-track and should have a sentence meaning 'pp does not apply'.
const publishedByWgOnly = groups.every(group => group.groupType === 'wg');

const patentPolicies = await sr.getPatentPolicies();

// If published by WG, the WGs should have living charter and operating under PP
if (publishedByWgOnly && !patentPolicies.length) {
sr.error(self, 'no-pp-from-charter');
return done();
}

// If published by WG, make sure joint publication uses the same Patent Policy.
if (publishedByWgOnly && patentPolicies.length > 1) {
patentPolicies.forEach(patentPolicyLink => {
if (patentPolicyLink !== patentPolicies[0]) {
sr.error(self, 'joint-different-pp');
return done();
}
});
}

const sotd = sr.getSotDSection();
const isRecTrack = sr.config.track === 'Recommendation';

const isPP2017 = sr.config.patentPolicy === 'pp2004';
const isPP2020 = sr.config.patentPolicy === 'pp2020';
let possiblePP = [];
if (isPP2020) {
possiblePP = [ppLink, ppLinkNew, pp2020, pp2020New];
} else if (isPP2017) {
possiblePP = [pp2017];
}
// If is joint publication and no pp is set, use latest pp
if (!publishedByWgOnly && patentPolicies.every(pp => pp === undefined)) {
possiblePP = [ppLinkNew, ppLink, pp2020New, pp2020];
}
// Make sure the pp version is consistent between the UI or the one defined in the charter.
if (
publishedByWgOnly &&
patentPolicies[0] &&
!possiblePP.includes(patentPolicies[0])
) {
sr.error(self, 'wrong-pp-from-charter', {
pp_charter: patentPolicies[0],
pp_config: isPP2017 ? 'pp2017' : 'pp2020',
});
return done();
}

if (sotd) {
if (!Array.isArray(possiblePP) || !possiblePP.length) {
sr.error(self, 'undefined');
return done();
}

const { pp, expected } = findPP(
filter(sotd, 'p').concat(...sotd.querySelectorAll('p')),
sr,
patentPolicies[0]
sr
);
if (!pp) {
sr.error(self, 'no-pp', { expected });
return done();
}

let found2017 = false;
let found2020 = false;
let foundLink = false;
let foundPublicList = false;
let foundEssentials = false;
let foundSection6 = false;
pp.querySelectorAll('a[href]').forEach(a => {
const href = a.getAttribute('href');
const text = sr.norm(a.textContent);
const possiblePPLinks = [ppLink, ppLink2020, ppLink2025];
if (
isPP2020 &&
possiblePP.includes(href) &&
/(15 September 2020 )?W3C Patent Policy/.test(text)
possiblePPLinks.includes(href) &&
/(15 September 2020|15 May 2025)?W3C Patent Policy/.test(text)
) {
found2020 = true;
foundLink = true;
return;
}

if (
isPP2017 &&
possiblePP.includes(href) &&
/1 August 2017 W3C Patent Policy/.test(text)
) {
found2017 = true;
return;
}
if (
/^https:\/\/www\.w3\.org\/(groups\/[^/]+\/[^/]+\/ipr\/?|2004\/01\/pp-impl\/\d+\/status)(#.*)?$/.test(
href
Expand All @@ -196,22 +134,23 @@ export async function check(sr, done) {
}

if (
possiblePP.map(p => `${p}#def-essential`).includes(href) &&
possiblePPLinks.map(p => `${p}#def-essential`).includes(href) &&
text === 'Essential Claim(s)'
) {
foundEssentials = true;
return;
}
if (
possiblePP.map(p => `${p}#sec-Disclosure`).includes(href) &&
possiblePPLinks
.map(p => `${p}#sec-Disclosure`)
.includes(href) &&
text === 'section 6 of the W3C Patent Policy'
) {
foundSection6 = true;
}
});

if (isPP2017 && !found2017) sr.error(self, 'no-pp2017');
else if (!isPP2017 && !found2020) sr.error(self, 'no-pp2020');
if (!foundLink) sr.error(self, 'no-link');
if (!foundPublicList && isRecTrack) sr.error(self, 'no-disclosures');
if (
(sr.config.track === 'Recommendation' ||
Expand All @@ -220,7 +159,7 @@ export async function check(sr, done) {
!foundEssentials
)
sr.error(self, 'no-claims', {
link: `${possiblePP[0]}#def-essential`,
link: `${ppLink}#def-essential`,
});
if (
(sr.config.track === 'Recommendation' ||
Expand All @@ -229,7 +168,7 @@ export async function check(sr, done) {
!foundSection6
)
sr.error(self, 'no-section6', {
link: `${possiblePP[0]}#sec-Disclosure`,
link: `${ppLink}#sec-Disclosure`,
});
return done();
}
Expand Down
6 changes: 2 additions & 4 deletions lib/rules/sotd/stability.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,17 @@ export async function check(sr, done) {
const links = sotd.querySelectorAll('a');
const licensingText = 'royalty-free licensing';
const licensingLink =
'https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements';
const licensingLinkNew =
'https://www.w3.org/policies/patent-policy/#sec-Requirements';
const licensingFound = Array.prototype.some.call(
links,
link =>
sr.norm(link.textContent) === licensingText &&
[licensingLink, licensingLinkNew].includes(link.href)
link.href === licensingLink
);
if (!licensingFound)
sr.error(self, 'no-licensing-link', {
licensingText,
licensingLinkNew,
licensingLink,
});
}
}
Expand Down
8 changes: 3 additions & 5 deletions lib/rules/sotd/submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export function check(sr, done) {
const w3cProcessNew = 'https://www.w3.org/policies/process/';
const w3cMembership =
'https://www.w3.org/Consortium/Prospectus/Joining';
const w3cPPOld =
'https://www.w3.org/Consortium/Patent-Policy/#sec-submissions';
const w3cPPNew =
const w3cPP =
'https://www.w3.org/policies/patent-policy/#sec-submissions';
const w3cSubm = 'https://www.w3.org/submissions/';
let foundW3CProcess = false;
Expand All @@ -82,7 +80,7 @@ export function check(sr, done) {
return;
}
if (
[w3cPPNew, w3cPPOld].includes(href) &&
href === w3cPP &&
text === 'section 3.3 of the W3C Patent Policy'
) {
foundPP = true;
Expand Down Expand Up @@ -121,7 +119,7 @@ export function check(sr, done) {
});
if (!foundPP)
sr.error(self, 'link-text', {
href: w3cPPNew,
href: w3cPP,
text: 'section 3.3 of the W3C Patent Policy',
});
if (!foundSubm)
Expand Down
19 changes: 0 additions & 19 deletions lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Specberus.prototype.clearCache = function () {
this.delivererIDs = undefined;
this.delivererGroups = undefined;
this.exceptions = new Exceptions();
this.patentPolicies = undefined;
this.chartersData = undefined;
this.charters = undefined;
this.headers = undefined;
Expand Down Expand Up @@ -764,24 +763,6 @@ Specberus.prototype.getCharters = async function () {
return charters;
};

Specberus.prototype.getPatentPolicies = async function () {
if (undefined !== this.patentPolicies) {
return this.patentPolicies;
}
const deliverers = await this.getDelivererIDs();
// TAG and AB are operating under the latest version of the patent policy
if (deliverers.some(d => d === TAG.id || d === AB.id)) {
return ['https://www.w3.org/policies/patent-policy/20200915/'];
}
const chartersData = await this.getChartersData();
const patentPolicies = [];
chartersData.forEach(charterData =>
patentPolicies.push(charterData['patent-policy'])
);
this.patentPolicies = patentPolicies;
return patentPolicies;
};

// check if this document is a FP document. For shortname change document, data-previous-shortname="xxx" is needed.
Specberus.prototype.isFP = async function () {
if (undefined !== this.isFirstPublic) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
"mocha": {
"colors": true,
"reporter": "spec",
"timeout": 20000
"timeout": 40000
}
}
Loading