Closed Bug 922931 Opened 11 years ago Closed 11 years ago

Broken images should be discoverable if alt is unset (NOT empty string), even in standard-mode

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: emk, Assigned: emk)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The HTML spec recommends displaying something to indicate the user.[1] It does not depend on the rendering mode.
We don't have to care if the alt text is clipped because the alt text is not present :)

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#the-img-element
The current workaround:
img { -moz-force-broken-image-icon: 1 }
img[alt] { -moz-force-broken-image-icon: 0 }
Attached patch patchSplinter Review
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #813846 - Flags: review?(bzbarsky)
Hmm.  So the actual spec requirement for the layout here is at http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#rendering and says:

  When an img element might be a key part of the content, but neither the image nor any 
  kind of alternative text is available, and the user agent does not expect this to
  change, the element is expected to be treated as a non-replaced phrasing element whose
  content is an icon indicating that an image is missing.

That's not what this patch does, and might well not be web-compatible (e.g. in cases when the current sized box is smaller than the icon size).  Do we need to get the spec changed here?
Flags: needinfo?(VYV03354)
(In reply to Boris Zbarsky [:bz] from comment #4)
> That's not what this patch does, and might well not be web-compatible (e.g.
> in cases when the current sized box is smaller than the icon size).  Do we
> need to get the spec changed here?

I'm for changing the spec.
Flags: needinfo?(VYV03354)
OK.  Do you want to file the spec issue, then?
Comment on attachment 813846 [details] [diff] [review]
patch

>+++ b/dom/imptests/failures/editing/conformancetest/test_runtest.html.json

Hmm.  Why was the change to this file needed?

r=me for the rest.
Attachment #813846 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bz] from comment #8)
> >+++ b/dom/imptests/failures/editing/conformancetest/test_runtest.html.json
> 
> Hmm.  Why was the change to this file needed?

Because otherwise the test "passed" unexpectedly.
Looks like our |document.execCommand("forwarddelete", ...);| ignores img elements which represent nothing. So it removed the character "b" instead of the broken img without this patch.
Ah, I see.  Thanks!
https://hg.mozilla.org/mozilla-central/rev/8434bf06134c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Note - this suspected to be the root cause of bug 985173.
Depends on: 1205027
Depends on: 1267906
No longer depends on: 1267906
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: