Summary: | TextMetrics::width is an integer, but the member is a float | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Evan Martin <evan> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, hyatt, jamesr, mitz | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 51551 | ||||||
Attachments: |
|
Description
Evan Martin
2010-12-23 15:20:43 PST
CC hyatt, original author of the code (correct bug this time) in LayoutTests/fast/canvas/canvas-text-baseline.html if I dump out all the widths found by ctx.measureText(text).width they are always integers. Not sure if it's intentional (or perhaps in Chrome we always have integer width fonts for other reasons) I tried changing it to a float and still got integers out. Spec says the width should be "CSS pixels", which I think can be floating point. I'll upload a patch and see what y'all think. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-measuretext Created attachment 77385 [details]
Patch
I tried modifying the test to use text of width 32.1 pixels, but even after this change the "width" field came out as an integer. Again, this could be due to some other code in Chrome rounding text widths. The commit-queue encountered the following flaky tests while processing attachment 77385 [details]: inspector/elements-panel-styles.html bug 50987 (author: pfeldman@chromium.org) The commit-queue is continuing to process your patch. Comment on attachment 77385 [details] Patch Clearing flags on attachment: 77385 Committed r74628: <http://trac.webkit.org/changeset/74628> All reviewed patches have been landed. Closing bug. |