<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>169610</bug_id>
          
          <creation_ts>2008-08-22 20:53:44 +0000</creation_ts>
          <short_desc>[CSS 2.1 Conformance] font shorthand and inherit incorrectly parsed</short_desc>
          <delta_ts>2014-06-13 17:29:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konqueror</product>
          <component>khtml renderer</component>
          <version>4.7.3</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>testcase</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gérard Talbot (no longer involved)">browserbugs2</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>maksim</cc>
          
          <cf_commitlink>http://commits.kde.org/kdelibs/f563cf1608ab820d7357fbdbae7ea4886352bf70</cf_commitlink>
          <cf_versionfixedin>4.13.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>640057</commentid>
    <comment_count>0</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-22 20:53:44 +0000</bug_when>
    <thetext>Version:            (using KDE 4.1.0)
Compiler:          cc 
OS:                Linux
Installed from:    Debian stable Packages


Bug entry:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/#bug159

  h1 {font-size: 32px;}

  h1 {font: 96px inherit;}
  &lt;/style&gt;

  &lt;h1&gt;This text should be using a  font-size of 32px and not a font-size of 96px.&lt;/h1&gt;

CSS validator reports that the 2nd rule has a Parse error, should be rejected; therefore only 
h1 {font-size: 32px;}
should be accepted and rendered.

Testcase:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/font-shorthand-inherit.html

Regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640151</commentid>
    <comment_count>1</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-23 03:26:10 +0000</bug_when>
    <thetext>Also reported :
https://bugs.webkit.org/show_bug.cgi?id=20181</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640292</commentid>
    <comment_count>2</comment_count>
    <who name="Maksim Orlovich">maksim</who>
    <bug_when>2008-08-23 17:25:48 +0000</bug_when>
    <thetext>Hi... I am a bit confused here (but I am not an expert in CSS parsing): 
isn&apos;t &apos;inherit&apos; a valid value for fant-family?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640360</commentid>
    <comment_count>3</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-23 22:06:22 +0000</bug_when>
    <thetext>&gt; isn&apos;t &apos;inherit&apos; a valid value for fant-family?

Hello Maksin,

Yes, inherit is a correct and valid value for font-family:

h1 {font-family: inherit;}

is clear, without ambiguity or source of interpretation. But when the CSS parser meets

h1 {font: 96px inherit;}

the CSS parser has no way to know for sure which other font subproperty is actually explicitly being inherited. On the other hand, 

h1 {font: inherit;}

is clear because it applies to all font subproperties (*) and it meets, honors the font shorthand syntax.

The font shorthand can take several font subproperties. The problem for the CSS parser is that it wouldn&apos;t be able to figure out which font subproperty. Imagine this situation:

h1 {font: inherit inherit;}

Which pair of font sub-properties have now inherited from its parent? font-size and font-family? font-weight and font-family? font-size and font-style? font-variant and font-style?

The CSS 2.1 spec. is a bit implicit, equivocal on this issue. All the 15.8 section had to say explicitly is that inherit keyword has to apply to all font subproperties when it is involved, used for the font shorthand. Just like it is said for system font reserved keywords:

&quot;System fonts may only be set as a whole; that is, the font family, size, weight, style, etc. are all set at the same time.&quot;

It does however states in its syntax that inherit must occur only once. And that is what the CSS validator message is about:

&quot;Value Error : font  Too many values or values are not recognized :  96px inherit &quot;

One last thing. The last paragraph of section 15.8 says:
&quot;the &apos;font&apos; shorthand property resets any [sub]property not explicitly given a value to its initial value&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640363</commentid>
    <comment_count>4</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-23 22:13:44 +0000</bug_when>
    <thetext>&gt; inherit must occur only once.

[ [ &lt;&apos;font-style&apos;&gt; || &lt;&apos;font-variant&apos;&gt; || &lt;&apos;font-weight&apos;&gt; ]? &lt;&apos;font-size&apos;&gt; [ /
&lt;&apos;line-height&apos;&gt; ]? &lt;&apos;font-family&apos;&gt; ] | caption | icon | menu | message-box |
small-caption | status-bar | inherit

&quot;A bar (|) separates two or more alternatives: exactly one of them must occur.&quot;
http://www.w3.org/TR/CSS21/about.html#value-defs
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640364</commentid>
    <comment_count>5</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-23 22:32:09 +0000</bug_when>
    <thetext>&gt; Hello Maksin,

Sorry! Maksim :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>665463</commentid>
    <comment_count>6</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-11-15 19:04:17 +0000</bug_when>
    <thetext>&quot;
consider the declaration
font: inherit 100% Arial;
Does &apos;inherit&apos; set font-style, or font-variant, or font-weight? They are
allowed in any order, and they are all optional, so which one is it?
&quot;

coming from
Newsgroup: comp.infosystems.www.authoring.stylesheets
Date: Mon, Nov 24 2003
Subject: font-family: inherit -- does not work with shorthand?
http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/msg/d933e2c079cdb3e4?hl=en</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>751239</commentid>
    <comment_count>7</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2009-05-02 20:02:38 +0000</bug_when>
    <thetext>From CSS 2.1, Candidate Recommendation 23 April 2009, Appendix C. Changes

{
C.3.1 Shorthand properties

Shorthand properties take a list of subproperty values or the value &apos;inherit&apos;. One cannot mix &apos;inherit&apos; with other subproperty values as it would not be possible to specify the subproperty to which &apos;inherit&apos; applied. The definitions of a number of shorthand properties did not enforce this rule: &apos;border-top&apos;, &apos;border-right&apos;, &apos;border-bottom&apos;, &apos;border-left&apos;, &apos;border&apos;, &apos;background&apos;, &apos;font&apos;, &apos;list-style&apos;, &apos;cue&apos;, and &apos;outline&apos;. 
}
http://www.w3.org/TR/CSS21/changes.html#q142

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>863296</commentid>
    <comment_count>8</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2009-11-16 23:55:47 +0000</bug_when>
    <thetext>I submitted a precise test regarding this issue to be included in the upcoming CSS 2.1 test suite and it was reviewed and approved by Microsoft (Arron Eicholz):

http://test.csswg.org/source/contributors/gtalbot/submitted/font-002.html

also at

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/font-002.html

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>892102</commentid>
    <comment_count>9</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2010-01-04 22:04:03 +0000</bug_when>
    <thetext>Due to filename numbering conflicts, the URL for the test cases had to be changed. So now, correct URLs:

http://test.csswg.org/source/contributors/gtalbot/submitted/font-045.html

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/font-045.html

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920588</commentid>
    <comment_count>10</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2010-02-19 20:53:05 +0000</bug_when>
    <thetext>Correct URLs for the testcases:

http://test.csswg.org/source/contributors/gtalbot/submitted/font-045.xhtml

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/font-045.html

Testcase in current CSS 2.1 test suite snapshot:
http://www.w3.org/Style/CSS/Test/CSS2.1/20100127/html4/font-045.htm

For each and all of those testcases, the tester needs to install the Ahem font, downloadable here:

http://www.w3.org/Style/CSS/Test/Ahem/

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>945022</commentid>
    <comment_count>11</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2010-04-05 04:24:21 +0000</bug_when>
    <thetext>Correct URLs (served as text/html only):

http://test.csswg.org/source/contributors/gtalbot/submitted/font-045.htm

Current snapshot of CSS 2.1 test suite:
http://www.w3.org/Style/CSS/Test/CSS2.1/20100316/html4/font-045.htm

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1209563</commentid>
    <comment_count>12</comment_count>
    <who name="Andrea Iacovitti">aiacovitti</who>
    <bug_when>2012-01-05 07:55:29 +0000</bug_when>
    <thetext>Confirmed on linux systems too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216709</commentid>
    <comment_count>13</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2012-01-20 04:56:19 +0000</bug_when>
    <thetext>Latest snapshot (served as text/html):
http://test.csswg.org/suites/css2.1/latest/html4/font-045.htm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447450</commentid>
    <comment_count>14</comment_count>
    <who name="Andrea Iacovitti">aiacovitti</who>
    <bug_when>2014-05-10 23:57:59 +0000</bug_when>
    <thetext>Git commit f563cf1608ab820d7357fbdbae7ea4886352bf70 by Andrea Iacovitti.
Committed on 10/05/2014 at 23:56.
Pushed by aiacovitti into branch &apos;KDE/4.13&apos;.

Reject font shorthand property when inherit value is present in font-family subproperty.
FIXED-IN: 4.13.2

M  +16   -8    khtml/css/cssparser.cpp

http://commits.kde.org/kdelibs/f563cf1608ab820d7357fbdbae7ea4886352bf70</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447456</commentid>
    <comment_count>15</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2014-05-11 00:59:55 +0000</bug_when>
    <thetext>Andrea,

You may want to check your patch with/against this meta-test:

http://test.csswg.org/source/contributors/gtalbot/submitted/font-family-rule-004a.htm

because it involves 9 sub-tests on inherit (as identifier or not).

You need to have installed the fonts &quot;CSSTest Fallback&quot;, &quot;CSSTest FamilyName&quot; and &quot;CSSTest Verify&quot; available at/downloadable from
http://www.w3.org/Style/CSS/Test/Fonts/

Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447457</commentid>
    <comment_count>16</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2014-05-11 01:02:11 +0000</bug_when>
    <thetext>
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/font-family-rule-004a.htm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1455028</commentid>
    <comment_count>17</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2014-06-13 17:29:12 +0000</bug_when>
    <thetext>Tests
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/font-shorthand-inherit.html
and
http://test.csswg.org/suites/css2.1/latest/html4/font-045.htm
now pass in Konqueror 4.13.2 

I may create another bug report for sub-test cases in
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/font-family-rule-004a.htm
that Konqueror currently fails.

Status -&gt; VERIFIED

Thank you Andrea !! :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>