[webkit-dev] Question on font property value "inherit" in HTML Canvas

Mustafizur Rahaman mustaf.here at gmail.com
Fri May 20 05:35:02 PDT 2011


I am analyzing the following issue
https://bugs.webkit.org/show_bug.cgi?id=48575 (the attachment in the issue
description contains multiple issues) & I was particularly looking into *
passes in FF but NOT working in Safari(5.0.3)/Winlauncher setup

After going through the HTML5 Canvas spec (
http://www.w3.org/TR/2dcontext/#dom-context-2d-font), my understanding is
that if any of inherit/initial/default are used in the font property
assignment statement (e.g., "20px inherit" OR "inherit 20px"), then it must
ignore the font value assignment & continue with the previous font value
assigned. This is in contrast to the CSS2.1 specification which allows the
usage of "inherit" (The values initial/default are reserved for future use).
Is this understanding correct?

After debugging CSSParser & CSSGrammer.y I have found that:
=> for normal HTML/CSS the code flows through CSSParser::parseSheet() =>
cssyyparse() => CSSParser::parseValue()
=> for HTML5 Canvas, the code flows through CSSParser::parseDeclaration() =>
cssyyparse() => CSSParser::parseValue()
In the CSSParser::parseValue(), the handling is same for normal HTML/CSS as
well as for HTML5 Canvas, i.e., it is handling the "inherit" in the same

However, if my understanding as mentioned above is correct, the handling
within the parser should be different (reason: CSS2.1 spec & the HTML Canvas
2D Context spec expects "inherit" to be handled differently).

Can somebody help share thoughts/perspective on this...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110520/d89c2291/attachment.html>

More information about the webkit-dev mailing list