Skip to content

Commit

Permalink
Allow rel=modulepreload for the link element
Browse files Browse the repository at this point in the history
Fixes #733 Thanks @SimonSiefke
  • Loading branch information
sideshowbarker committed Nov 28, 2018
1 parent 268ce0e commit a597846
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,12 @@ With a few exceptions, this is a record of mainly just user-facing
changes—that is, either changes to the actual behavior of the checker, or
changes to any options/interfaces the checker exposes for developers.

# N.N.N
05 November 2018
NN XXX NNNN
- Disallow `accept-charset` values other than `UTF-8`
- Allow `rel=modulepreload` for the `link` element

# 18.11.5
05 November 2018
- Fix bugs that can cause the command-line checker to emit broken JSON output
Expand Down
6 changes: 5 additions & 1 deletion src/nu/validator/checker/schematronequiv/Assertions.java
Expand Up @@ -2688,7 +2688,9 @@ else if ("bdo" == localName && atts.getIndex("", "dir") < 0) {
.toLowerCase().split("\\s+"));
}
if (atts.getIndex("", "as") > -1
&& ((relList != null && !relList.contains("preload")
&& ((relList != null //
&& !(relList.contains("preload")
|| relList.contains("modulepreload"))
|| !hasRel))) {
err("A \u201Clink\u201D element with an"
+ " \u201Cas\u201D attribute must have a"
Expand Down Expand Up @@ -2753,6 +2755,7 @@ else if ("bdo" == localName && atts.getIndex("", "dir") < 0) {
if ((ancestorMask & BODY_MASK) != 0
&& (relList != null
&& !(relList.contains("dns-prefetch")
|| relList.contains("modulepreload")
|| relList.contains("pingback")
|| relList.contains("preconnect")
|| relList.contains("prefetch")
Expand All @@ -2767,6 +2770,7 @@ else if ("bdo" == localName && atts.getIndex("", "dir") < 0) {
+ " \u201Citemprop\u201D attribute or has a"
+ " \u201Crel\u201D attribute whose value contains"
+ " \u201Cdns-prefetch\u201D,"
+ " \u201Cmodulepreload\u201D,"
+ " \u201Cpingback\u201D,"
+ " \u201Cpreconnect\u201D,"
+ " \u201Cprefetch\u201D,"
Expand Down
3 changes: 2 additions & 1 deletion src/nu/validator/datatype/LinkRel.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2017 Mozilla Foundation
* Copyright (c) 2013-2018 Mozilla Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -48,6 +48,7 @@ public final class LinkRel extends AbstractRel {
registeredValues.add("icon");
registeredValues.add("license");
registeredValues.add("mask-icon");
registeredValues.add("modulepreload");
registeredValues.add("next");
registeredValues.add("pingback");
registeredValues.add("preconnect");
Expand Down

0 comments on commit a597846

Please sign in to comment.