This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11991 - Document should state that percentage heights and widths are not valid
Summary: Document should state that percentage heights and widths are not valid
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 differences from HTML4 (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-06 13:09 UTC by Nicholas Stimpson
Modified: 2011-03-30 18:30 UTC (History)
5 users (show)

See Also:


Attachments

Description Nicholas Stimpson 2011-02-06 13:09:37 UTC
HTML 4 allowed height and width attribute values for img, iframe and object to be in percentages. HTML5 only allows these values to be in CSS pixels. The differences document should mention this change.
Comment 1 Julian Reschke 2011-02-06 13:21:49 UTC
Could you elaborate why?
Comment 2 Nicholas Stimpson 2011-02-06 21:20:01 UTC
(In reply to comment #1)
> Could you elaborate why?

Why the HTML4/HTML5 differences document should document a difference between HTML4 and HTML5? I'm not sure how to answer that.

There was a question on StackOverflow - http://stackoverflow.com/questions/4911085/why-does-the-w3c-validator-show-error-messages-for-these-img-attributes 

Looking at the relevant W3Schools page ( http://www.w3schools.com/html5/tag_img.asp ) which, despite it's many errors, is still widely referred to by web authors, they had failed to pick up the change, and state that percentages are still allowed in HTML5. 

It would seem helpful to web authors and tutorial writers alike to point the change out in the differences document, to reduce the number of errors of this kind.

Does that help?
Comment 3 Julian Reschke 2011-02-06 21:28:05 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Could you elaborate why?
> 
> Why the HTML4/HTML5 differences document should document a difference between
> HTML4 and HTML5? I'm not sure how to answer that.

I misread the bug. You are right that the differences document should mention this.

That being said: why are percent values disallowed? (can somebody shed some light on this?)
Comment 4 Simon Pieters 2011-03-30 18:30:58 UTC
Percentages are not allowed because they would be presentational. width/height are intended to have a placeholder of the right size while the image is loading so that the text doesn't move around.

EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the tracker issue; or you may create a tracker issue
yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: added "The width and height attributes on img and other elements are no longer allowed to contain percentages."
Rationale: Concurred with reporter's comments.