Skip to content
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

Embed-tag for svg-images, avoid event-forwarding if hyperlink is in use (#1924) #1925

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,11 @@ protected void outputSVGImage(IImageContent image, StringBuffer styleBuffer, int

// build style
htmlEmitter.buildImageStyle(image, styleBuffer, display);

// hyperlink: avoid forwarded events of the embed-tag
if (image.getHyperlinkAction() != null) {
styleBuffer.append(HTMLTags.ATTR_POINTER_EVENTS + ":none;");
}
writer.attribute(HTMLTags.ATTR_STYLE, styleBuffer.toString());
writer.closeTag(HTMLTags.TAG_EMBED);
}
Expand All @@ -2982,22 +2987,22 @@ protected void resetImageDefaultBorders(IImageContent image, StringBuffer styleB
// border color, use the default
// color.
if (style.getBorderTopColor() == null) {
styleBuffer.append("border-top-color:black");
styleBuffer.append("border-top-color:black;");
}
if (style.getBorderBottomStyle() == null) {
styleBuffer.append("border-bottom-style:none;");
} else if (style.getBorderBottomColor() == null) {
styleBuffer.append("border-bottom-color:black");
styleBuffer.append("border-bottom-color:black;");
}
if (style.getBorderLeftStyle() == null) {
styleBuffer.append("border-left-style:none;");
} else if (style.getBorderLeftColor() == null) {
styleBuffer.append("border-left-color:black");
styleBuffer.append("border-left-color:black;");
}
if (style.getBorderRightStyle() == null) {
styleBuffer.append("border-right-style:none;");
} else if (style.getBorderRightColor() == null) {
styleBuffer.append("border-right-color:black");
styleBuffer.append("border-right-color:black;");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2007, 2008 Actuate Corporation.
* Copyright (c) 2004, 2007, 2008, 2024 Actuate Corporation and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -185,6 +185,8 @@ public class HTMLTags {
public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
/** html tag attribute: span */
public static final String ATTR_SPAN = "span"; //$NON-NLS-1$
/** html tag attribute: embedded images */
public static final String ATTR_POINTER_EVENTS = "pointer-events"; //$NON-NLS-1$

/** html tag attribute: colspan */
public static final String ATTR_COLSPAN = "colspan"; //$NON-NLS-1$
Expand Down
Loading