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 11488 - drawImage(img), where img is SVG image with % height/width
Summary: drawImage(img), where img is SVG image with % height/width
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 11819
  Show dependency treegraph
 
Reported: 2010-12-07 00:33 UTC by Jatinder Mann [MSFT]
Modified: 2011-08-04 05:04 UTC (History)
10 users (show)

See Also:


Attachments

Description Jatinder Mann [MSFT] 2010-12-07 00:33:43 UTC
The Canvas spec states that when using the drawImage() call, If the sx, sy, sw, and sh arguments are omitted, they must default to 0, 0, the image's intrinsic width in image pixels, and the image's intrinsic height in image pixels, respectively. However, for the case that the drawImage(img) is called with img, such that img is a SVG image with a percent height and width, the spec is not clear on what the intrinsic dimension should be.

Considering it may be difficult to determine what the intentions of the SVG image creator was, in this case, I recommend the spec indicate that the Canvas width and height should be used.
Comment 1 Tab Atkins Jr. 2010-12-07 05:36:28 UTC
I believe that the CSSWG recently agreed that percentage dimensions on the SVG root wouldn't create any intrinsic dimensions at all; I don't know whether or not it would create an intrinsic aspect-ratio (depends on what the %s are supposed to be relative to - if they're relative to the same thing, then it can define an intrinsic aspect-ratio).
Comment 2 Ian 'Hixie' Hickson 2011-01-11 00:56:10 UTC
If such images don't have intrinsic dimensions, what should I say the default intrinsic dimensions are? How about the case of intrinsic ration but no intrinsic dimensions?
Comment 3 Tab Atkins Jr. 2011-01-11 01:46:28 UTC
I have a general algorithm for resolving intrinsic dimensions into definite dimensions in the Image Values spec <http://dev.w3.org/csswg/css3-images/#sizing>.  Figure out just what intrinsic dimensions/ratio are present, and then resolve them using a "default background sizing area" equal to the size of the canvas.
Comment 4 Ian 'Hixie' Hickson 2011-02-11 01:26:31 UTC
Is there some terminology I can use to just invoke the existing algorithm? I'd rather not duplicate it...
Comment 5 Ian 'Hixie' Hickson 2011-02-12 00:12:22 UTC
http://krijnhoetmer.nl/irc-logs/whatwg/20110212#l-86
Comment 6 Ian 'Hixie' Hickson 2011-04-29 19:35:11 UTC
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: see diff given below
Rationale: Concurred with reporter's comments.
Comment 7 contributor 2011-04-29 19:35:39 UTC
Checked in as WHATWG revision r6044.
Check-in comment: Define how an SVG image gets sized in drawImage()
http://html5.org/tools/web-apps-tracker?from=6043&to=6044
Comment 8 Michael[tm] Smith 2011-08-04 05:04:15 UTC
mass-move component to LC1