Commit 00974eb7 authored by ddkilzer's avatar ddkilzer

LayoutTests:

        Reviewed by mjs.

        testcases for http://bugzilla.opendarwin.org/show_bug.cgi?id=5564
        'font' shorthand parsing should be more tolerant in quirks mode

        * fast/css/font_property_compatibility-expected.checksum: Added.
        * fast/css/font_property_compatibility-expected.png: Added.
        * fast/css/font_property_compatibility-expected.txt: Added.
        * fast/css/font_property_compatibility.html: Added.
        * fast/css/font_property_normal-expected.checksum: Added.
        * fast/css/font_property_normal-expected.png: Added.
        * fast/css/font_property_normal-expected.txt: Added.
        * fast/css/font_property_normal.html: Added.

WebCore:

        Reviewed by mjs.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=5564
        'font' shorthand parsing should be more tolerant in quirks mode

        When not in strict mode accept font property specifications
        lacking a font family part, like WinIE does.

        * css/cssparser.cpp:
        (WebCore::CSSParser::parseFont):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent af5f98b2
2006-06-05 Rob Buis <buis@kde.org>
Reviewed by mjs.
testcases for http://bugzilla.opendarwin.org/show_bug.cgi?id=5564
'font' shorthand parsing should be more tolerant in quirks mode
* fast/css/font_property_compatibility-expected.txt: Added.
* fast/css/font_property_compatibility.html: Added.
* fast/css/font_property_normal-expected.txt: Added.
* fast/css/font_property_normal.html: Added.
2006-06-05 David Kilzer <ddkilzer@kilzer.net>
Reviewed by ggaren.
60ba056b4fb7a61726520c1a05877b26
\ No newline at end of file
layer at (0,0) size 785x608
RenderView at (0,0) size 785x600
layer at (0,0) size 785x608
RenderBlock {HTML} at (0,0) size 785x608
RenderBody {BODY} at (8,8) size 769x584
RenderBlock {P} at (0,0) size 769x18
RenderText {#text} at (0,0) size 465x18
text run at (0,0) width 465: "Fails indicate that the font property specification is invalid in quirks mode."
RenderBlock {P} at (0,50) size 769x37
RenderText {#text} at (0,0) size 220x37
text run at (0,0) width 220: "24pt italic = 24pt"
RenderBlock {P} at (0,119) size 769x37
RenderText {#text} at (0,0) size 294x37
text run at (0,0) width 294: "24pt italic Arial = 24pt"
RenderBlock {P} at (0,188) size 769x37
RenderText {#text} at (0,0) size 394x36
text run at (0,0) width 394: "24pt italic 'Arial' = 24pt Arial"
RenderBlock {P} at (0,257) size 769x37
RenderText {#text} at (0,0) size 131x37
text run at (0,0) width 131: "italic 24pt"
RenderBlock {P} at (0,326) size 769x37
RenderText {#text} at (0,0) size 457x36
text run at (0,0) width 457: "italic 24pt Arial = 24pt Arial Italic"
RenderBlock {P} at (0,395) size 769x37
RenderText {#text} at (0,0) size 469x36
text run at (0,0) width 469: "italic 24pt 'Arial' = 24pt Arial Italic"
RenderBlock {P} at (0,464) size 769x18
RenderText {#text} at (0,0) size 141x18
text run at (0,0) width 141: "Arial 24pt italic = fails"
RenderBlock {P} at (0,498) size 769x18
RenderText {#text} at (0,0) size 147x18
text run at (0,0) width 147: "'Arial' 24pt italic = fails"
RenderBlock {P} at (0,532) size 769x18
RenderText {#text} at (0,0) size 141x18
text run at (0,0) width 141: "Arial italic 24pt = fails"
RenderBlock {P} at (0,566) size 769x18
RenderText {#text} at (0,0) size 147x18
text run at (0,0) width 147: "'Arial' italic 24pt = fails"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Testing WinIE compatibility of font property specification</TITLE>
<STYLE type="text/css">
.one {font: 24pt italic;"}
.two {font: 24pt italic Arial;}
.three {font: 24pt italic 'Arial';}
.four {font: italic 24pt;}
.five {font: italic 24pt Arial;"}
.six {font: italic 24pt 'Arial';}
.seven {font: Arial 24pt italic;}
.eight {font: 'Arial' 24pt italic;}
.nine {font: Arial italic 24pt;}
.ten {font: 'Arial' italic 24pt;}
</STYLE>
</HEAD>
<BODY>
<P>
Fails indicate that the font property specification is invalid in quirks mode.
</P>
<P class="one"> 24pt italic = 24pt </P>
<P class="two"> 24pt italic Arial = 24pt </P>
<P class="three"> 24pt italic 'Arial' = 24pt Arial </P>
<P class="four"> italic 24pt </P>
<P class="five"> italic 24pt Arial = 24pt Arial Italic </P>
<P class="six"> italic 24pt 'Arial' = 24pt Arial Italic </P>
<P class="seven"> Arial 24pt italic = fails </P>
<P class="eight"> 'Arial' 24pt italic = fails </P>
<P class="nine"> Arial italic 24pt = fails </P>
<P class="ten"> 'Arial' italic 24pt = fails </P>
</BODY>
</HTML>
0edc49045738dc7c5b151c06e68abc3c
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x597
RenderBlock {HTML} at (0,0) size 800x597
RenderBody {BODY} at (8,16) size 784x565
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 456x18
text run at (0,0) width 456: "Fails indicate that the font property specification is invalid in strict mode."
RenderBlock {P} at (0,50) size 784x37
RenderText {#text} at (0,0) size 220x37
text run at (0,0) width 220: "24pt italic = 24pt"
RenderBlock {P} at (0,119) size 784x37
RenderText {#text} at (0,0) size 294x37
text run at (0,0) width 294: "24pt italic Arial = 24pt"
RenderBlock {P} at (0,188) size 784x37
RenderText {#text} at (0,0) size 394x36
text run at (0,0) width 394: "24pt italic 'Arial' = 24pt Arial"
RenderBlock {P} at (0,257) size 784x18
RenderText {#text} at (0,0) size 105x18
text run at (0,0) width 105: "italic 24pt = fails"
RenderBlock {P} at (0,307) size 784x37
RenderText {#text} at (0,0) size 457x36
text run at (0,0) width 457: "italic 24pt Arial = 24pt Arial Italic"
RenderBlock {P} at (0,376) size 784x37
RenderText {#text} at (0,0) size 469x36
text run at (0,0) width 469: "italic 24pt 'Arial' = 24pt Arial Italic"
RenderBlock {P} at (0,445) size 784x18
RenderText {#text} at (0,0) size 141x18
text run at (0,0) width 141: "Arial 24pt italic = fails"
RenderBlock {P} at (0,479) size 784x18
RenderText {#text} at (0,0) size 147x18
text run at (0,0) width 147: "'Arial' 24pt italic = fails"
RenderBlock {P} at (0,513) size 784x18
RenderText {#text} at (0,0) size 141x18
text run at (0,0) width 141: "Arial italic 24pt = fails"
RenderBlock {P} at (0,547) size 784x18
RenderText {#text} at (0,0) size 147x18
text run at (0,0) width 147: "'Arial' italic 24pt = fails"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Testing valid font property specification</TITLE>
<STYLE type="text/css">
.one {font: 24pt italic;"}
.two {font: 24pt italic Arial;}
.three {font: 24pt italic 'Arial';}
.four {font: italic 24pt;}
.five {font: italic 24pt Arial;"}
.six {font: italic 24pt 'Arial';}
.seven {font: Arial 24pt italic;}
.eight {font: 'Arial' 24pt italic;}
.nine {font: Arial italic 24pt;}
.ten {font: 'Arial' italic 24pt;}
</STYLE>
</HEAD>
<BODY>
<P>
Fails indicate that the font property specification is invalid in strict mode.
</P>
<P class="one"> 24pt italic = 24pt </P>
<P class="two"> 24pt italic Arial = 24pt </P>
<P class="three"> 24pt italic 'Arial' = 24pt Arial </P>
<P class="four"> italic 24pt = fails </P>
<P class="five"> italic 24pt Arial = 24pt Arial Italic </P>
<P class="six"> italic 24pt 'Arial' = 24pt Arial Italic </P>
<P class="seven"> Arial 24pt italic = fails </P>
<P class="eight"> 'Arial' 24pt italic = fails </P>
<P class="nine"> Arial italic 24pt = fails </P>
<P class="ten"> 'Arial' italic 24pt = fails </P>
</BODY>
</HTML>
2006-06-05 Rob Buis <buis@kde.org>
Reviewed by mjs.
http://bugzilla.opendarwin.org/show_bug.cgi?id=5564
'font' shorthand parsing should be more tolerant in quirks mode
When not in strict mode accept font property specifications
lacking a font family part, like WinIE does.
* css/cssparser.cpp:
(WebCore::CSSParser::parseFont):
2006-06-05 Beth Dakin <bdakin@apple.com>
Reviewed by Darin.
......
......@@ -2032,7 +2032,7 @@ bool CSSParser::parseFont(bool important)
break;
value = valueList->next();
}
if (!value)
if (strict && !value)
goto invalid;
// set undefined values to default
......@@ -2050,10 +2050,10 @@ bool CSSParser::parseFont(bool important)
else if (validUnit(value, FLength|FPercent, strict))
font->size = new CSSPrimitiveValue(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
value = valueList->next();
if (!font->size || !value)
if (!font->size || (strict && !value))
goto invalid;
if (value->unit == Value::Operator && value->iValue == '/') {
if (value && value->unit == Value::Operator && value->iValue == '/') {
// line-height
value = valueList->next();
if (!value)
......@@ -2075,7 +2075,9 @@ bool CSSParser::parseFont(bool important)
// font family must come now
font->family = parseFontFamily();
if (valueList->current() || !font->family)
if (!strict && !font->family)
font->family = new CSSValueList;
else if (valueList->current() || !font->family)
goto invalid;
addProperty(CSS_PROP_FONT, font, important);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment