Graphic Image: Since PF 12 `ismap` attribute is rendered and causing invalid HTML
See original GitHub issueDescribe the bug
Since Primefaces 12 the Graphic Image renderes a ismap
attribute with the values true
or false
, resulting in invalid HTML:
While the ismap
attribute is allowed on the image-tag and it is a boolean type, the correct syntax is to only add ismap
when the image is a server side map and don’t use it, when the image is not map, see this example from W3C:
<a href="/action_page.php">
<img src="w3html.gif" alt="W3Schools.com" width="100" height="132" ismap>
</a>
If I’ve read the commit history right, the change was introduced with commit f08ba1e3d57cc82b1a07f3a4ebb2098eec532e15 in PR #8772 to fix #7943.
Reproducer
Check showcase of Graphic Image
Expected behavior
- The
ismap
attribute is only rendered when true - The
ismap
attribute is rendered as definied by the W3C, meaning without a value
PrimeFaces edition
Community
PrimeFaces version
12.0.0
Theme
No response
JSF implementation
All
JSF version
2.2
Java version
8
Browser(s)
all
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
GraphicImage: Add clientbehavior support · Issue #7943 - GitHub
I noticed that p:graphicImage as well as h:graphicImage claim to support the ... Graphic Image: Since PF 12 ismap attribute is rendered and...
Read more >4.8 Embedded content - HTML 5
The image given by the src attribute is the embedded content, and the value of the alt attribute is the img element's fallback...
Read more >Embedded content - 4.8.1 - The picture element - HTML
The contents of img elements, if any, are ignored for the purposes of rendering. The usemap attribute, if present, can indicate that the...
Read more >title - HTML: HyperText Markup Language - MDN Web Docs
The title global attribute contains text representing advisory information related to the element it belongs to.
Read more >HTML 3.2 Reference Specification
When the IMG element appears as part of a hypertext link, the user agent will generally indicate this by drawing a colored border...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This PR makes it render correctly with false and true.
ismap="ismap"
is the JSF XHTML way of rendering booleans and still passes the NuHTML checker as valid.I better test the TRUE scenario I fixed the false scenario.