Changeset 58301 in webkit
- Timestamp:
- Apr 27, 2010 3:54:45 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58299 r58301 1 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 3 Unreviewed, fix build breakage by reverting r58299. 4 5 https://bugs.webkit.org/show_bug.cgi?id=35329 6 7 * fast/css/parsing-page-rule-expected.txt: Removed. 8 * fast/css/parsing-page-rule.html: Removed. 9 1 10 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 11 -
trunk/WebCore/ChangeLog
r58300 r58301 1 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 3 Unreviewed, fix build breakage by reverting r58299. 4 5 * css/CSSGrammar.y: 6 * css/CSSParser.cpp: 7 (WebCore::CSSParser::CSSParser): 8 (WebCore::CSSParser::clearProperties): 9 * css/CSSParser.h: 10 * css/CSSSelector.cpp: 11 (WebCore::CSSSelector::pseudoId): 12 (WebCore::nameToPseudoTypeMap): 13 (WebCore::CSSSelector::extractPseudoType): 14 * css/CSSSelector.h: 15 (WebCore::CSSSelector::): 16 * css/tokenizer.flex: 17 1 18 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 19 -
trunk/WebCore/css/CSSGrammar.y
r58299 r58301 71 71 CSSSelector* selector; 72 72 Vector<CSSSelector*>* selectorList; 73 CSSSelector::MarginBoxType marginBox;74 73 CSSSelector::Relation relation; 75 74 MediaList* mediaList; … … 99 98 %} 100 99 101 %expect 5 5100 %expect 54 102 101 103 102 %nonassoc LOWEST_PREC … … 144 143 %token VARIABLES_FOR 145 144 %token WEBKIT_VARIABLES_DECLS_SYM 146 %token <marginBox> TOPLEFTCORNER_SYM147 %token <marginBox> TOPLEFT_SYM148 %token <marginBox> TOPCENTER_SYM149 %token <marginBox> TOPRIGHT_SYM150 %token <marginBox> TOPRIGHTCORNER_SYM151 %token <marginBox> BOTTOMLEFTCORNER_SYM152 %token <marginBox> BOTTOMLEFT_SYM153 %token <marginBox> BOTTOMCENTER_SYM154 %token <marginBox> BOTTOMRIGHT_SYM155 %token <marginBox> BOTTOMRIGHTCORNER_SYM156 %token <marginBox> LEFTTOP_SYM157 %token <marginBox> LEFTMIDDLE_SYM158 %token <marginBox> LEFTBOTTOM_SYM159 %token <marginBox> RIGHTTOP_SYM160 %token <marginBox> RIGHTMIDDLE_SYM161 %token <marginBox> RIGHTBOTTOM_SYM162 163 145 %token ATKEYWORD 164 146 … … 207 189 %type <rule> namespace 208 190 %type <rule> page 209 %type <rule> margin_box210 191 %type <rule> font_face 211 192 %type <rule> keyframes … … 229 210 %type <string> medium 230 211 %type <string> hexcolor 231 %type <marginBox> margin_sym232 212 233 213 %type <string> media_feature … … 258 238 %type <selector> attrib 259 239 %type <selector> pseudo 260 %type <selector> page_selector261 240 262 241 %type <boolean> declaration_list … … 751 730 ; 752 731 732 /* 753 733 page: 754 PAGE_SYM maybe_space page_selector maybe_space 755 '{' maybe_space declarations_and_margins closing_brace { 756 CSSParser* p = static_cast<CSSParser*>(parser); 757 $$ = p->createPageRule(p->sinkFloatingSelector($3)); 758 } 759 | PAGE_SYM error invalid_block { 734 PAGE_SYM maybe_space IDENT? pseudo_page? maybe_space 735 '{' maybe_space declaration [ ';' maybe_space declaration ]* '}' maybe_space 736 ; 737 738 pseudo_page 739 : ':' IDENT 740 ; 741 */ 742 743 page: 744 PAGE_SYM error invalid_block { 760 745 $$ = 0; 761 746 } 762 747 | PAGE_SYM error ';' { 763 748 $$ = 0; 764 }765 ;766 767 page_selector:768 IDENT {769 CSSParser* p = static_cast<CSSParser*>(parser);770 $$ = p->createFloatingSelector();771 $$->m_tag = QualifiedName(nullAtom, $1, p->m_defaultNamespace);772 }773 | IDENT pseudo {774 CSSParser* p = static_cast<CSSParser*>(parser);775 $$ = $2;776 if ($$)777 $$->m_tag = QualifiedName(nullAtom, $1, p->m_defaultNamespace);778 }779 | pseudo {780 $$ = $1;781 }782 | /* empty */ {783 CSSParser* p = static_cast<CSSParser*>(parser);784 $$ = p->createFloatingSelector();785 }786 ;787 788 declarations_and_margins:789 declaration_list790 | declarations_and_margins margin_box maybe_space declaration_list791 ;792 793 margin_box:794 margin_sym {795 static_cast<CSSParser*>(parser)->startDeclarationsForMarginBox();796 } maybe_space '{' maybe_space declaration_list closing_brace {797 $$ = static_cast<CSSParser*>(parser)->createMarginAtRule($1);798 }799 ;800 801 margin_sym :802 TOPLEFTCORNER_SYM {803 $$ = CSSSelector::TopLeftCornerMarginBox;804 }805 | TOPLEFT_SYM {806 $$ = CSSSelector::TopLeftMarginBox;807 }808 | TOPCENTER_SYM {809 $$ = CSSSelector::TopCenterMarginBox;810 }811 | TOPRIGHT_SYM {812 $$ = CSSSelector::TopRightMarginBox;813 }814 | TOPRIGHTCORNER_SYM {815 $$ = CSSSelector::TopRightCornerMarginBox;816 }817 | BOTTOMLEFTCORNER_SYM {818 $$ = CSSSelector::BottomLeftCornerMarginBox;819 }820 | BOTTOMLEFT_SYM {821 $$ = CSSSelector::BottomLeftMarginBox;822 }823 | BOTTOMCENTER_SYM {824 $$ = CSSSelector::BottomCenterMarginBox;825 }826 | BOTTOMRIGHT_SYM {827 $$ = CSSSelector::BottomRightMarginBox;828 }829 | BOTTOMRIGHTCORNER_SYM {830 $$ = CSSSelector::BottomRightCornerMarginBox;831 }832 | LEFTTOP_SYM {833 $$ = CSSSelector::LeftTopMarginBox;834 }835 | LEFTMIDDLE_SYM {836 $$ = CSSSelector::LeftMiddleMarginBox;837 }838 | LEFTBOTTOM_SYM {839 $$ = CSSSelector::LeftBottomMarginBox;840 }841 | RIGHTTOP_SYM {842 $$ = CSSSelector::RightTopMarginBox;843 }844 | RIGHTMIDDLE_SYM {845 $$ = CSSSelector::RightMiddleMarginBox;846 }847 | RIGHTBOTTOM_SYM {848 $$ = CSSSelector::RightBottomMarginBox;849 749 } 850 750 ; -
trunk/WebCore/css/CSSParser.cpp
r58299 r58301 70 70 #include "WebKitCSSKeyframesRule.h" 71 71 #include "WebKitCSSTransformValue.h" 72 #include <limits.h>73 72 #include <wtf/dtoa.h> 74 73 … … 92 91 93 92 namespace WebCore { 94 95 static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;96 93 97 94 static bool equal(const CSSParserString& a, const char* b) … … 139 136 , m_numParsedProperties(0) 140 137 , m_maxParsedProperties(32) 141 , m_numParsedPropertiesBeforeMarginBox(INVALID_NUM_PARSED_PROPERTIES)142 138 , m_inParseShorthand(0) 143 139 , m_currentShorthand(0) … … 401 397 delete m_parsedProperties[i]; 402 398 m_numParsedProperties = 0; 403 m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;404 399 m_hasFontFaceOnlyValues = false; 405 400 } … … 5199 5194 #endif 5200 5195 5201 CSSRule* CSSParser::createPageRule(CSSSelector* /* pageSelector */)5202 {5203 // FIXME: Create page rule here, using:5204 // - pageSelector->pseudoType(): the page pseudo-class, i.e., :left, :right, or :first5205 // - pageSelector->m_tag: the page name5206 // - m_parsedProperties: the page properties5207 5208 clearProperties();5209 return 0; // until this method is implemented.5210 }5211 5212 CSSRule* CSSParser::createMarginAtRule(CSSSelector::MarginBoxType /* marginBox */)5213 {5214 // FIXME: Implement margin at-rule here, using:5215 // - marginBox: margin box5216 // - m_parsedProperties: properties at [m_numParsedPropertiesBeforeMarginBox, m_numParsedProperties) are for this at-rule.5217 5218 endDeclarationsForMarginBox();5219 return 0; // until this method is implemented.5220 }5221 5222 void CSSParser::startDeclarationsForMarginBox()5223 {5224 m_numParsedPropertiesBeforeMarginBox = m_numParsedProperties;5225 }5226 5227 void CSSParser::endDeclarationsForMarginBox()5228 {5229 ASSERT(m_numParsedPropertiesBeforeMarginBox != INVALID_NUM_PARSED_PROPERTIES);5230 rollbackLastProperties(m_numParsedProperties - m_numParsedPropertiesBeforeMarginBox);5231 m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;5232 }5233 5234 5196 void CSSParser::clearVariables() 5235 5197 { -
trunk/WebCore/css/CSSParser.h
r58299 r58301 180 180 CSSRule* createFontFaceRule(); 181 181 CSSRule* createVariablesRule(MediaList*, bool variablesKeyword); 182 CSSRule* createPageRule(CSSSelector* pageSelector);183 CSSRule* createMarginAtRule(CSSSelector::MarginBoxType marginBox);184 void startDeclarationsForMarginBox();185 void endDeclarationsForMarginBox();186 182 187 183 MediaQueryExp* createFloatingMediaQueryExp(const AtomicString&, CSSParserValueList*); … … 217 213 unsigned m_numParsedProperties; 218 214 unsigned m_maxParsedProperties; 219 unsigned m_numParsedPropertiesBeforeMarginBox;220 215 221 216 int m_inParseShorthand; -
trunk/WebCore/css/CSSSelector.cpp
r58300 r58301 204 204 case PseudoSingleButton: 205 205 case PseudoNoButton: 206 case PseudoFirstPage:207 case PseudoLeftPage:208 case PseudoRightPage:209 206 return NOPSEUDO; 210 207 case PseudoNotParsed: … … 309 306 DEFINE_STATIC_LOCAL(AtomicString, noButton, ("no-button")); 310 307 DEFINE_STATIC_LOCAL(AtomicString, cornerPresent, ("corner-present")); 311 // Paged Media pseudo-classes312 DEFINE_STATIC_LOCAL(AtomicString, firstPage, ("first"));313 DEFINE_STATIC_LOCAL(AtomicString, leftPage, ("left"));314 DEFINE_STATIC_LOCAL(AtomicString, rightPage, ("right"));315 308 316 309 static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0; … … 407 400 nameToPseudoType->set(target.impl(), CSSSelector::PseudoTarget); 408 401 nameToPseudoType->set(visited.impl(), CSSSelector::PseudoVisited); 409 nameToPseudoType->set(firstPage.impl(), CSSSelector::PseudoFirstPage);410 nameToPseudoType->set(leftPage.impl(), CSSSelector::PseudoLeftPage);411 nameToPseudoType->set(rightPage.impl(), CSSSelector::PseudoRightPage);412 402 } 413 403 return nameToPseudoType; … … 526 516 case PseudoNoButton: 527 517 case PseudoNotParsed: 528 case PseudoFirstPage:529 case PseudoLeftPage:530 case PseudoRightPage:531 518 break; 532 519 } -
trunk/WebCore/css/CSSSelector.h
r58299 r58301 189 189 PseudoOuterSpinButton, 190 190 PseudoProgressBarValue, 191 PseudoLeftPage,192 PseudoRightPage,193 PseudoFirstPage,194 };195 196 enum MarginBoxType {197 TopLeftCornerMarginBox,198 TopLeftMarginBox,199 TopCenterMarginBox,200 TopRightMarginBox,201 TopRightCornerMarginBox,202 BottomLeftCornerMarginBox,203 BottomLeftMarginBox,204 BottomCenterMarginBox,205 BottomRightMarginBox,206 BottomRightCornerMarginBox,207 LeftTopMarginBox,208 LeftMiddleMarginBox,209 LeftBottomMarginBox,210 RightTopMarginBox,211 RightMiddleMarginBox,212 RightBottomMarginBox,213 191 }; 214 192 -
trunk/WebCore/css/tokenizer.flex
r58299 r58301 54 54 "@import" {BEGIN(mediaquery); yyTok = IMPORT_SYM; return yyTok;} 55 55 "@page" {yyTok = PAGE_SYM; return yyTok;} 56 "@top-left-corner" {yyTok = TOPLEFTCORNER_SYM; return yyTok;}57 "@top-left" {yyTok = TOPLEFT_SYM; return yyTok;}58 "@top-center" {yyTok = TOPCENTER_SYM; return yyTok;}59 "@top-right" {yyTok = TOPRIGHT_SYM; return yyTok;}60 "@top-right-corner" {yyTok = TOPRIGHTCORNER_SYM; return yyTok;}61 "@bottom-left-corner" {yyTok = BOTTOMLEFTCORNER_SYM; return yyTok;}62 "@bottom-left" {yyTok = BOTTOMLEFT_SYM; return yyTok;}63 "@bottom-center" {yyTok = BOTTOMCENTER_SYM; return yyTok;}64 "@bottom-right" {yyTok = BOTTOMRIGHT_SYM; return yyTok;}65 "@bottom-right-corner" {yyTok = BOTTOMRIGHTCORNER_SYM; return yyTok;}66 "@left-top" {yyTok = LEFTTOP_SYM; return yyTok;}67 "@left-middle" {yyTok = LEFTMIDDLE_SYM; return yyTok;}68 "@left-bottom" {yyTok = LEFTBOTTOM_SYM; return yyTok;}69 "@right-top" {yyTok = RIGHTTOP_SYM; return yyTok;}70 "@right-middle" {yyTok = RIGHTMIDDLE_SYM; return yyTok;}71 "@right-bottom" {yyTok = RIGHTBOTTOM_SYM; return yyTok;}72 56 "@media" {BEGIN(mediaquery); yyTok = MEDIA_SYM; return yyTok;} 73 57 "@font-face" {yyTok = FONT_FACE_SYM; return yyTok;}
Note: See TracChangeset
for help on using the changeset viewer.