Skip to content

Commit 4b8ed20

Browse files
Mark content if tagging is enabled on renderers drawing regardless of whether the model element is accessible
DEVSIX-1652
1 parent 11d2827 commit 4b8ed20

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/AbstractRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public void drawBackground(DrawContext drawContext) {
493493
BackgroundImage backgroundImage = this.<BackgroundImage>getProperty(Property.BACKGROUND_IMAGE);
494494
if (background != null || backgroundImage != null) {
495495
Rectangle bBox = getOccupiedAreaBBox();
496-
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement;
496+
boolean isTagged = drawContext.isTaggingEnabled();
497497
if (isTagged) {
498498
drawContext.getCanvas().openTag(new CanvasArtifact());
499499
}
@@ -872,7 +872,7 @@ public void drawBorder(DrawContext drawContext) {
872872
float x2 = bBox.getX() + bBox.getWidth();
873873
float y2 = bBox.getY() + bBox.getHeight();
874874

875-
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement;
875+
boolean isTagged = drawContext.isTaggingEnabled();
876876
PdfCanvas canvas = drawContext.getCanvas();
877877
if (isTagged) {
878878
canvas.openTag(new CanvasArtifact());

layout/src/main/java/com/itextpdf/layout/renderer/TableRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ private void drawBorders(DrawContext drawContext, boolean hasHeader, boolean has
12381238
}
12391239
}
12401240

1241-
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement; // TODO contetn should be marked regardless element is accessible or not
1241+
boolean isTagged = drawContext.isTaggingEnabled();
12421242
if (isTagged) {
12431243
drawContext.getCanvas().openTag(new CanvasArtifact());
12441244
}

layout/src/main/java/com/itextpdf/layout/renderer/TextRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ public void drawBackground(DrawContext drawContext) {
778778
float bottomBBoxY = backgroundArea.getY();
779779
float leftBBoxX = backgroundArea.getX();
780780
if (background != null) {
781-
boolean isTagged = drawContext.isTaggingEnabled() && getModelElement() instanceof IAccessibleElement;
781+
boolean isTagged = drawContext.isTaggingEnabled();
782782
PdfCanvas canvas = drawContext.getCanvas();
783783
if (isTagged) {
784784
canvas.openTag(new CanvasArtifact());

0 commit comments

Comments
 (0)