Skip to content
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
5 changes: 4 additions & 1 deletion src/main/java/org/verapdf/parser/PDFFlavour.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public enum PDFFlavour {
WCAG_2_1(Specification.WCAG_2_1),
WCAG_2_2_MACHINE(Specification.WCAG_2_2),
WCAG_2_2_HUMAN(Specification.WCAG_2_2),
WCAG_2_2_PDF_2_0_MACHINE(Specification.WCAG_2_2_PDF_2_0),
WCAG_2_2_PDF_2_0_HUMAN(Specification.WCAG_2_2_PDF_2_0),
NO_ARLINGTON_FLAVOUR(Specification.NO_STANDARD),
ARLINGTON1_0(Specification.PDF_1_0),
ARLINGTON1_1(Specification.PDF_1_1),
Expand Down Expand Up @@ -73,7 +75,8 @@ public enum Specification {
ISO_19005_4(SpecificationFamily.PDF_A, PDFSpecification.ISO_32000_2_0),
WTPDF_1_0(SpecificationFamily.WTPDF, PDFSpecification.ISO_32000_2_0),
WCAG_2_1(SpecificationFamily.WCAG, PDFSpecification.ISO_32000_2_0),
WCAG_2_2(SpecificationFamily.WCAG, PDFSpecification.ISO_32000_2_0),
WCAG_2_2(SpecificationFamily.WCAG, PDFSpecification.ISO_32000_1_7),
WCAG_2_2_PDF_2_0(SpecificationFamily.WCAG, PDFSpecification.ISO_32000_2_0),
PDF_1_0(SpecificationFamily.ARLINGTON, PDFSpecification.PDF_REFERENCE_1_0),
PDF_1_1(SpecificationFamily.ARLINGTON, PDFSpecification.PDF_REFERENCE_1_1),
PDF_1_2(SpecificationFamily.ARLINGTON, PDFSpecification.PDF_REFERENCE_1_2),
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/org/verapdf/pd/structure/PDStructElem.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static StructureType getStructureTypeStandardStructureType(StructureType
return defaultStructureType;
}
}
if (!PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0) || PDFFlavour.isFlavourFamily(flavour, PDFFlavour.SpecificationFamily.WCAG)) {
if (!PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0)) {
if (type != null) {
return StructureType.createStructureType(ASAtom.getASAtom(
StaticResources.getRoleMapHelper().getStandardType(type.getType())), type.getNameSpace());
Expand All @@ -159,11 +159,8 @@ public static boolean isStandardStructureType(StructureType type) {
boolean isStandard = false;
if (PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0)) {
isStandard = TaggedPDFHelper.isStandardType(type);
}
if (!PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0) || PDFFlavour.isFlavourFamily(flavour, PDFFlavour.SpecificationFamily.WCAG)) {
if (type != null) {
isStandard |= TaggedPDFRoleMapHelper.isStandardType(type);
}
} else if (type != null) {
isStandard |= TaggedPDFRoleMapHelper.isStandardType(type);
}
return isStandard;
}
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/org/verapdf/tools/TaggedPDFHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class TaggedPDFHelper {
private static final Set<String> PDF_1_4_STANDARD_ROLE_TYPES;
private static final Set<String> PDF_1_7_STANDARD_ROLE_TYPES;
private static final Set<String> PDF_2_0_STANDARD_ROLE_TYPES;
private static final Set<String> WCAG_STANDARD_ROLE_TYPES;

static {
Set<String> tempSet = new HashSet<>();
Expand Down Expand Up @@ -127,10 +126,6 @@ public class TaggedPDFHelper {
pdf_1_7.addAll(tempSet);
pdf_2_0.addAll(tempSet);

Set<String> wcag = new HashSet<>(pdf_1_7);
wcag.add(TaggedPDFConstants.ARTIFACT);
wcag.add(TaggedPDFConstants.TITLE);

pdf_2_0.add(TaggedPDFConstants.DOCUMENT_FRAGMENT);
pdf_2_0.add(TaggedPDFConstants.ASIDE);
pdf_2_0.add(TaggedPDFConstants.TITLE);
Expand All @@ -143,7 +138,6 @@ public class TaggedPDFHelper {
PDF_1_4_STANDARD_ROLE_TYPES = Collections.unmodifiableSet(pdf_1_4);
PDF_1_7_STANDARD_ROLE_TYPES = Collections.unmodifiableSet(pdf_1_7);
PDF_2_0_STANDARD_ROLE_TYPES = Collections.unmodifiableSet(pdf_2_0);
WCAG_STANDARD_ROLE_TYPES = Collections.unmodifiableSet(wcag);
}

private static final Set<String> inlineStructureTypes = new HashSet<>(Arrays.asList(TaggedPDFConstants.SPAN,
Expand Down Expand Up @@ -294,11 +288,6 @@ public static boolean isStandardType(StructureType type) {
}
}

public static boolean isWCAGStandardType(StructureType type) {
String structureType = type.getType().getValue();
return WCAG_STANDARD_ROLE_TYPES.contains(structureType);
}

private static void addVisited(StructureType type) {
ASAtom structType = type.getType();
PDStructureNameSpace nameSpace = type.getNameSpace();
Expand Down Expand Up @@ -492,10 +481,6 @@ public static Set<String> getPdf17StandardRoleTypes() {
public static Set<String> getPdf20StandardRoleTypes() {
return PDF_2_0_STANDARD_ROLE_TYPES;
}

public static Set<String> getWcagStandardRoleTypes() {
return WCAG_STANDARD_ROLE_TYPES;
}

public static boolean isInlineStructureType(String standardType) {
return inlineStructureTypes.contains(standardType);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/verapdf/tools/TaggedPDFRoleMapHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ private static Set<String> getCurrentStandardTypes() {
if (PDFFlavour.isFlavourPart(StaticResources.getFlavour(), PDFFlavour.Specification.ISO_19005_1)) {
return TaggedPDFHelper.getPdf14StandardRoleTypes();
}
if (PDFFlavour.isFlavourFamily(StaticResources.getFlavour(), PDFFlavour.SpecificationFamily.WCAG)) {
return TaggedPDFHelper.getWcagStandardRoleTypes();
}
return TaggedPDFHelper.getPdf17StandardRoleTypes();
}

Expand Down