Changeset 58385 in webkit


Ignore:
Timestamp:
Apr 28, 2010 12:09:09 AM (14 years ago)
Author:
yuzo@google.com
Message:

2010-04-27 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

Enhance CSS parser for Paged Media (Iteration 4)
Implement page property parsing as specified at http://dev.w3.org/csswg/css3-page/#using-named-pages.
https://bugs.webkit.org/show_bug.cgi?id=35853

  • printing/page-rule-css-text-expected.txt:
  • printing/page-rule-css-text.html:

2010-04-27 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

Enhance CSS parser for Paged Media (Iteration 4)
Implement page property parsing as specified at http://dev.w3.org/csswg/css3-page/#using-named-pages.
https://bugs.webkit.org/show_bug.cgi?id=35853

  • css/CSSParser.cpp: (WebCore::CSSParser::parseValue): (WebCore::CSSParser::parsePage):
  • css/CSSParser.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r58384 r58385  
     12010-04-27  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Enhance CSS parser for Paged Media (Iteration 4)
     6        Implement page property parsing as specified at http://dev.w3.org/csswg/css3-page/#using-named-pages.
     7        https://bugs.webkit.org/show_bug.cgi?id=35853
     8
     9        * printing/page-rule-css-text-expected.txt:
     10        * printing/page-rule-css-text.html:
     11
    1122010-04-27  Yuzo Fujishima  <yuzo@google.com>
    213
  • trunk/LayoutTests/printing/page-rule-css-text-expected.txt

    r58384 r58385  
    1818@page err_orientations { }
    1919@page err_too_many_params { }
     20table { page: Rotated; }
     21div { page: auto; }
     22pre { }
     23p { }
    2024
  • trunk/LayoutTests/printing/page-rule-css-text.html

    r58384 r58385  
    6464}
    6565
     66table {
     67    page: Rotated;
     68}
     69div {
     70    page: Auto;
     71}
     72pre {
     73    page: Auto Rotated; /* Invalid */
     74}
     75p {
     76    page: 1cm; /* Invalid */
     77}
     78
    6679/* FIXME: Add the following once margin at-rule is implemented.
    6780
  • trunk/WebCore/ChangeLog

    r58384 r58385  
     12010-04-27  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Enhance CSS parser for Paged Media (Iteration 4)
     6        Implement page property parsing as specified at http://dev.w3.org/csswg/css3-page/#using-named-pages.
     7        https://bugs.webkit.org/show_bug.cgi?id=35853
     8
     9        * css/CSSParser.cpp:
     10        (WebCore::CSSParser::parseValue):
     11        (WebCore::CSSParser::parsePage):
     12        * css/CSSParser.h:
     13
    1142010-04-27  Yuzo Fujishima  <yuzo@google.com>
    215
  • trunk/WebCore/css/CSSParser.cpp

    r58384 r58385  
    16951695    case CSSPropertyInvalid:
    16961696        return false;
     1697    case CSSPropertyPage:
     1698        return parsePage(propId, important);
    16971699    case CSSPropertyFontStretch:
    1698     case CSSPropertyPage:
    16991700    case CSSPropertyTextLineThrough:
    17001701    case CSSPropertyTextOverline:
     
    21112112   
    21122113    return true;
     2114}
     2115
     2116// auto | <identifier>
     2117bool CSSParser::parsePage(int propId, bool important)
     2118{
     2119    ASSERT(propId == CSSPropertyPage);
     2120
     2121    if (m_valueList->size() != 1)
     2122        return false;
     2123
     2124    CSSParserValue* value = m_valueList->current();
     2125    if (!value)
     2126        return false;
     2127
     2128    if (value->id == CSSValueAuto) {
     2129        addProperty(propId, CSSPrimitiveValue::createIdentifier(value->id), important);
     2130        return true;
     2131    } else if (value->id == 0 && value->unit == CSSPrimitiveValue::CSS_IDENT) {
     2132        addProperty(propId, CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_STRING), important);
     2133        return true;
     2134    }
     2135    return false;
    21132136}
    21142137
  • trunk/WebCore/css/CSSParser.h

    r58384 r58385  
    261261        };
    262262
     263        bool parsePage(int propId, bool important);
    263264        bool parseSize(int propId, bool important);
    264265        SizeParameterType parseSizeParameter(CSSValueList* parsedValues, CSSParserValue* value, SizeParameterType prevParamType);
Note: See TracChangeset for help on using the changeset viewer.