GeezerVison is showing github.com — feat: remove checks related to deprecated bindings feature · w3c/epubcheck@7ca1edf
File treeExpand file treeCollapse file tree Open diff view settings resources/com/adobe/epubcheck
test/resources/epub3/05-package-document package-bindings-handler-duplicate-error package-bindings-handler-not-scripted-error
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -200,8 +200,8 @@ private void initialize() | 200 | 200 | severities.put(MessageId.OPF_007, Severity.WARNING); | 201 | 201 | severities.put(MessageId.OPF_007a, Severity.ERROR); | 202 | 202 | severities.put(MessageId.OPF_007b, Severity.ERROR); | 203 | | - severities.put(MessageId.OPF_008, Severity.ERROR); | 204 | | - severities.put(MessageId.OPF_009, Severity.ERROR); | | 203 | + severities.put(MessageId.OPF_008, Severity.SUPPRESSED); | | 204 | + severities.put(MessageId.OPF_009, Severity.SUPPRESSED); | 205 | 205 | severities.put(MessageId.OPF_010, Severity.ERROR); | 206 | 206 | severities.put(MessageId.OPF_011, Severity.ERROR); | 207 | 207 | severities.put(MessageId.OPF_012, Severity.ERROR); | @@ -236,7 +236,7 @@ private void initialize() | 236 | 236 | severities.put(MessageId.OPF_043, Severity.ERROR); | 237 | 237 | severities.put(MessageId.OPF_044, Severity.ERROR); | 238 | 238 | severities.put(MessageId.OPF_045, Severity.ERROR); | 239 | | - severities.put(MessageId.OPF_046, Severity.ERROR); | | 239 | + severities.put(MessageId.OPF_046, Severity.SUPPRESSED); | 240 | 240 | severities.put(MessageId.OPF_047, Severity.USAGE); | 241 | 241 | severities.put(MessageId.OPF_048, Severity.ERROR); | 242 | 242 | severities.put(MessageId.OPF_049, Severity.ERROR); | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/opf/OPFChecker.java -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -129,7 +129,6 @@ protected boolean checkPackage() | 129 | 129 | } | 130 | 130 |
| 131 | 131 | checkGuide(); | 132 | | - checkBindings(); | 133 | 132 |
| 134 | 133 | // Check items content (publication resources) | 135 | 134 | for (OPFItem item : items) | @@ -156,10 +155,6 @@ protected void checkItemAfterResourceValidation(OPFItem item) | 156 | 155 | { | 157 | 156 | } | 158 | 157 |
| 159 | | - protected void checkBindings() | 160 | | - { | 161 | | - } | 162 | | - | 163 | 158 | protected void checkGuide() | 164 | 159 | { | 165 | 160 | int refCount = opfHandler.getReferenceCount(); | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java -19Lines changed: 0 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 |
| 23 | 23 | package com.adobe.epubcheck.opf; | 24 | 24 |
| 25 | | -import java.util.Iterator; | 26 | 25 | import java.util.Set; | 27 | 26 |
| 28 | 27 | import org.w3c.epubcheck.url.URLFragment; | @@ -218,24 +217,6 @@ else if (!new FallbackChecker().checkItemFallbacks(item, opfHandler, false)) | 218 | 217 | } | 219 | 218 | } | 220 | 219 |
| 221 | | - @Override | 222 | | - protected void checkBindings() | 223 | | - { | 224 | | - Set<String> mimeTypes = context.xrefChecker.get().getBindingsMimeTypes(); | 225 | | - Iterator<String> it = mimeTypes.iterator(); | 226 | | - String mimeType; | 227 | | - while (it.hasNext()) | 228 | | - { | 229 | | - mimeType = it.next(); | 230 | | - String handlerId = context.xrefChecker.get().getBindingHandlerId(mimeType); | 231 | | - OPFItem handler = opfHandler.getItemById(handlerId).get(); | 232 | | - if (!handler.isScripted()) | 233 | | - { | 234 | | - report.message(MessageId.OPF_046, handler.getLocation()); | 235 | | - } | 236 | | - } | 237 | | - } | 238 | | - | 239 | 220 | // protected boolean checkItemFallbacks(OPFItem item, OPFHandler opfHandler) { | 240 | 221 | // String fallback = item.getFallback(); | 241 | 222 | // if (fallback != null) { | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/opf/OPFHandler30.java -32Lines changed: 0 additions & 32 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -233,10 +233,6 @@ else if (name.equals("itemref")) | 233 | 233 | processItemrefProperties(itemBuilder, e.getAttribute("properties")); | 234 | 234 | } | 235 | 235 | } | 236 | | - else if (name.equals("mediaType")) | 237 | | - { | 238 | | - processBinding(); | 239 | | - } | 240 | 236 | else if (name.equals("collection")) | 241 | 237 | { | 242 | 238 | collectionBuilders.addFirst( | @@ -371,34 +367,6 @@ public ResourceCollections getCollections() | 371 | 367 | return (collections == null) ? ResourceCollections.builder().build() : collections; | 372 | 368 | } | 373 | 369 |
| 374 | | - private void processBinding() | 375 | | - { | 376 | | - String mimeType = currentElement().getAttribute("media-type"); | 377 | | - String handlerId = currentElement().getAttribute("handler"); | 378 | | - | 379 | | - if ((mimeType != null) && (handlerId != null)) | 380 | | - { | 381 | | - if (OPFChecker30.isCoreMediaType(mimeType)) | 382 | | - { | 383 | | - report.message(MessageId.OPF_008, location(), mimeType); | 384 | | - return; | 385 | | - } | 386 | | - | 387 | | - if (context.xrefChecker.isPresent() | 388 | | - && context.xrefChecker.get().getBindingHandlerId(mimeType) != null) | 389 | | - { | 390 | | - report.message(MessageId.OPF_009, location(), mimeType, | 391 | | - context.xrefChecker.get().getBindingHandlerId(mimeType)); | 392 | | - return; | 393 | | - } | 394 | | - | 395 | | - if (itemBuilders.containsKey(handlerId) && context.xrefChecker.isPresent()) | 396 | | - { | 397 | | - context.xrefChecker.get().registerBinding(mimeType, handlerId); | 398 | | - } | 399 | | - } | 400 | | - } | 401 | | - | 402 | 370 | private List<String> processCollectionRole(String roleAtt) | 403 | 371 | { | 404 | 372 | ImmutableList.Builder<String> rolesBuilder = ImmutableList.builder(); | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/opf/XRefChecker.java -19Lines changed: 0 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 44 | 44 | import com.adobe.epubcheck.ocf.OCFContainer; | 45 | 45 | import com.adobe.epubcheck.util.EPUBVersion; | 46 | 46 | import com.adobe.epubcheck.util.FeatureEnum; | 47 | | -import com.adobe.epubcheck.vocab.PackageVocabs; | 48 | 47 | import com.google.common.base.Optional; | 49 | 48 | import com.google.common.base.Preconditions; | 50 | 49 | import com.google.common.collect.ImmutableSet; | @@ -246,8 +245,6 @@ public boolean isInSpine() | 246 | 245 |
| 247 | 246 | private final List<URLReference> references = new LinkedList<URLReference>(); | 248 | 247 |
| 249 | | - private final Map<String, String> bindings = new HashMap<String, String>(); | 250 | | - | 251 | 248 | private final Report report; | 252 | 249 |
| 253 | 250 | private final OCFContainer container; | @@ -304,22 +301,6 @@ public Set<Type> getTypes(URL resource) | 304 | 301 | return types.build(); | 305 | 302 | } | 306 | 303 |
| 307 | | - // FIXME 2022 move binding registration to OPFHandler | 308 | | - public Set<String> getBindingsMimeTypes() | 309 | | - { | 310 | | - return bindings.keySet(); | 311 | | - } | 312 | | - | 313 | | - public String getBindingHandlerId(String mimeType) | 314 | | - { | 315 | | - return bindings.get(mimeType); | 316 | | - } | 317 | | - | 318 | | - public void registerBinding(String mimeType, String handlerId) | 319 | | - { | 320 | | - bindings.put(mimeType, handlerId); | 321 | | - } | 322 | | - | 323 | 304 | public void registerResource(URL url, String mimetype) | 324 | 305 | { | 325 | 306 | Preconditions.checkArgument(url != null); | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java -6Lines changed: 0 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -684,12 +684,6 @@ protected void processObject() | 684 | 684 | { | 685 | 685 | return; | 686 | 686 | } | 687 | | - // check bindings | 688 | | - if (xrefChecker.isPresent() && type != null | 689 | | - && xrefChecker.get().getBindingHandlerId(type) != null) | 690 | | - { | 691 | | - hasValidFallback = true; | 692 | | - } | 693 | 687 | } | 694 | 688 | } | 695 | 689 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -186,8 +186,8 @@ OPF_006=Invalid prefix declaration: URI "%1$s" is not a valid URI. | 186 | 186 | OPF_007=Re-declaration of reserved prefix "%1$s". | 187 | 187 | OPF_007a=Invalid prefix mapping: prefix "_" must not be declared. | 188 | 188 | OPF_007b=Invalid prefix mapping: default vocabulary "%1$s" must not be re-declared. | 189 | | -OPF_008=Handler binding for core Media-type "%1$s" is not allowed. | 190 | | -OPF_009=The media-type "%1$s" has already been assigned a handler, with ID "%2$s". | | 189 | +OPF_008= | | 190 | +OPF_009= | 191 | 191 | OPF_010=Error resolving reference: "%1$s". | 192 | 192 | OPF_011=itemref can’t have both page-spread-right and page-spread-left properties. | 193 | 193 | OPF_012=Item property "%1$s" is not defined for media type "%2$s". | @@ -224,7 +224,7 @@ OPF_042="%1$s" is not a permissible spine media-type. | 224 | 224 | OPF_043=Spine item with non-standard media-type "%1$s" has no fallback. | 225 | 225 | OPF_044=Spine item with non-standard media-type "%1$s" has a fallback to non-standard media-type. | 226 | 226 | OPF_045=Encountered circular reference in fallback chain. | 227 | | -OPF_046=Scripted property is not set on mediaType handler. | | 227 | +OPF_046= | 228 | 228 | OPF_047=OPF file is using OEBPS 1.2 syntax allowing backwards compatibility. | 229 | 229 | OPF_048=Package tag is missing its required unique-identifier attribute and value. | 230 | 230 | OPF_049=Item id "%1$s" was not found in the manifest. | |
Collapse file Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch -12Lines changed: 0 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 197 | 197 | </rule> | 198 | 198 | </pattern> | 199 | 199 |
| 200 | | - <pattern id="opf.bindings.handler"> | 201 | | - <rule context="opf:bindings/opf:mediaType"> | 202 | | - <let name="ref" value="./normalize-space(@handler)"/> | 203 | | - <let name="item" value="//opf:manifest/opf:item[normalize-space(@id) = $ref]"/> | 204 | | - <let name="item-media-type" value="normalize-space($item/@media-type)"/> | 205 | | - <assert test="$item-media-type = 'application/xhtml+xml'">manifest items referenced from | 206 | | - the handler attribute of a bindings mediaType element must be of the | 207 | | - "application/xhtml+xml" type (given type was "<value-of select="$item-media-type" | 208 | | - />")</assert> | 209 | | - </rule> | 210 | | - </pattern> | 211 | | - | 212 | 200 | <pattern id="opf.toc.ncx"> | 213 | 201 | <rule context="opf:spine[@toc]"> | 214 | 202 | <let name="ref" value="./normalize-space(@toc)"/> | |
Collapse file Copy file name to clipboardExpand all lines: src/test/resources/epub3/05-package-document/files/bindings-for-image-error.opf -19Lines changed: 0 additions & 19 deletions Collapse file Copy file name to clipboardExpand all lines: src/test/resources/epub3/05-package-document/files/bindings-handler-not-xhtml-error.opf -22Lines changed: 0 additions & 22 deletions
|