[html5] r3515 - [e] (0) Clarify 'font' serialisation.

whatwg at whatwg.org whatwg at whatwg.org
Fri Jul 31 16:00:28 PDT 2009


Author: ianh
Date: 2009-07-31 16:00:26 -0700 (Fri, 31 Jul 2009)
New Revision: 3515

Modified:
   index
   source
Log:
[e] (0) Clarify 'font' serialisation.

Modified: index
===================================================================
--- index	2009-07-31 22:52:55 UTC (rev 3514)
+++ index	2009-07-31 23:00:26 UTC (rev 3515)
@@ -24662,8 +24662,22 @@
 
   <p>On getting, the <code title=dom-context-2d-font><a href=#dom-context-2d-font>font</a></code>
   attribute must return the serialized form of the current font of the
-  context. <a href=#refsCSSOM>[CSSOM]</a></p>
+  context (with no 'line-height' component). <a href=#refsCSSOM>[CSSOM]</a></p>
 
+  <div class=example>
+
+   <p>For example, after the following statement:</p>
+
+   <pre>context.font = 'italic 400 12px/2 Unknown Font, sans-serif';</pre>
+
+   <p>...the expression <code title="">context.font</code> would
+   evaluate to the string "<code title="">italic 12px Unknown Font, sans-serif</code>". The
+   "400" font-weight doesn't appear because that is the default
+   value. The line-height doesn't appear because it is forced to
+   "normal", the default value.</p>
+
+  </div>
+
   <p>When the context is created, the font of the context must be set
   to 10px sans-serif. When the 'font-size' component is set to lengths
   using percentages, 'em' or 'ex' units, or the 'larger' or 'smaller'

Modified: source
===================================================================
--- source	2009-07-31 22:52:55 UTC (rev 3514)
+++ source	2009-07-31 23:00:26 UTC (rev 3515)
@@ -26938,8 +26938,24 @@
 
   <p>On getting, the <code title="dom-context-2d-font">font</code>
   attribute must return the serialized form of the current font of the
-  context. <a href="#refsCSSOM">[CSSOM]</a></p>
+  context (with no 'line-height' component). <a
+  href="#refsCSSOM">[CSSOM]</a></p>
 
+  <div class="example">
+
+   <p>For example, after the following statement:</p>
+
+   <pre>context.font = 'italic 400 12px/2 Unknown Font, sans-serif';</pre>
+
+   <p>...the expression <code title="">context.font</code> would
+   evaluate to the string "<code
+   title="">italic 12px Unknown Font, sans-serif</code>". The
+   "400" font-weight doesn't appear because that is the default
+   value. The line-height doesn't appear because it is forced to
+   "normal", the default value.</p>
+
+  </div>
+
   <p>When the context is created, the font of the context must be set
   to 10px sans-serif. When the 'font-size' component is set to lengths
   using percentages, 'em' or 'ex' units, or the 'larger' or 'smaller'




More information about the Commit-Watchers mailing list