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 21944 - Security on measureText is unneccessary
Summary: Security on measureText is unneccessary
Status: NEW
Alias: None
Product: HTML WG
Classification: Unclassified
Component: CR HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL: http://www.w3.org/TR/2dcontext/#dom-c...
Whiteboard:
Keywords:
Depends on: 21943
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-06 21:30 UTC by rcabanie
Modified: 2015-07-10 14:38 UTC (History)
6 users (show)

See Also:


Attachments

Description rcabanie 2013-05-06 21:30:01 UTC
+++ This bug was initially created as a clone of Bug #21943 +++

The canvas 2d spec currently states that a font has to be local in order for measureText to work: 
If doing these measurements requires using a font that has an origin that is not the same as that of the Document object that owns the canvas element (even if "using a font" means just checking if that font has a particular glyph in it before falling back to another font), then the method must throw a SecurityError exception.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-measuretext
http://www.w3.org/TR/2dcontext/#dom-context-2d-measuretext

After a small discussion on the mailing list, we agreed that the spec should not have this text. Instead it should be silent and rely on the general font loading algorithm that CSS specifies.
Comment 1 Ian 'Hixie' Hickson 2013-05-28 22:05:37 UTC
It definitely shouldn't be silent, but if the font loading infrastructure elsewhere in the platform defines this better, then yeah, we should just have a non-normative note here instead.

In any case, it should be the same text as we use elsewhere in the HTML spec for using fonts.

Where is font loading defined? (i.e. what can we rely on to make this just work?)
Comment 2 rcabanie 2013-05-28 22:15:56 UTC
 
> Where is font loading defined? (i.e. what can we rely on to make this just
> work?)

I'm unsure. From the discussion, it sounds like Anne is going to define this.

http://dev.w3.org/csswg/css-fonts/#same-origin-restriction was also mentioned but I'm unclear if that will be the official definition.