question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Graphic Image: Since PF 12 `ismap` attribute is rendered and causing invalid HTML

See original GitHub issue

Describe the bug

Since Primefaces 12 the Graphic Image renderes a ismap attribute with the values true or false, resulting in invalid HTML:

pf_img_ismap

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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Nov 3, 2022

This PR makes it render correctly with false and true.

	<img id="j_id_90" src="/showcase/javax.faces.resource/images/nature/nature4.jpg.xhtml?ln=demo">
	<img id="j_id_91" src="/showcase/javax.faces.resource/images/nature/nature4.jpg.xhtml?ln=demo" ismap="ismap">

ismap="ismap" is the JSF XHTML way of rendering booleans and still passes the NuHTML checker as valid.

0reactions
mellowarecommented, Nov 3, 2022

I better test the TRUE scenario I fixed the false scenario.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found