Changeset 66296 in webkit
- Timestamp:
- Aug 27, 2010 8:06:14 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66294 r66296 1 2010-08-27 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Darin Adler. 4 5 Implement symbolic CSS3 list-style-types 6 https://bugs.webkit.org/show_bug.cgi?id=36734 7 8 Tests that all of the symbolic CSS3 list-style-types are supported. 9 10 * fast/lists/w3-css3-list-styles-symbolic-expected.txt: Added. 11 * fast/lists/w3-css3-list-styles-symbolic.html: Added. 12 1 13 2010-08-27 Matthew Delaney <mdelaney@apple.com> 2 14 -
trunk/WebCore/ChangeLog
r66295 r66296 1 2010-08-27 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Darin Adler. 4 5 Implement symbolic CSS3 list-style-types 6 https://bugs.webkit.org/show_bug.cgi?id=36734 7 8 Implements all of the symbolic CSS3 list-style-types as per 9 section 4.5 of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#symbolic>. 10 11 Test: fast/lists/w3-css3-list-styles-symbolic.html 12 13 * css/CSSPrimitiveValueMappings.h: 14 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added list style types Asterisks and Footnotes. 15 * css/CSSValueKeywords.in: Ditto. 16 * inspector/front-end/SourceCSSTokenizer.re2js: Ditto. 17 * rendering/RenderListMarker.cpp: 18 (WebCore::toAlphabeticOrNumeric): Changed type of parameter sequenceSize from int to unsigned. 19 (WebCore::toSymbolic): Added. 20 (WebCore::toAlphabetic): Changed type of parameter alphabetSize from int to unsigned. 21 (WebCore::toNumeric): Changed type of parameter numeralsSize from int to unsigned. 22 (WebCore::effectiveListMarkerType): Added. 23 (WebCore::listMarkerSuffix): Added list style types Asterisks and Footnotes. 24 (WebCore::listMarkerText): Ditto. 25 (WebCore::RenderListMarker::paint): Ditto. 26 (WebCore::RenderListMarker::calcPrefWidths): Ditto. 27 (WebCore::RenderListMarker::getRelativeMarkerRect): Ditto. 28 * rendering/style/RenderStyleConstants.h: Ditto. 29 (WebCore::): 30 1 31 2010-08-27 Vincent Scheib <scheib@chromium.org> 2 32 -
trunk/WebCore/css/CSSPrimitiveValueMappings.h
r66251 r66296 1009 1009 m_value.ident = CSSValueArmenian; 1010 1010 break; 1011 case Asterisks: 1012 m_value.ident = CSSValueAsterisks; 1013 break; 1011 1014 case BinaryListStyle: 1012 1015 m_value.ident = CSSValueBinary; … … 1089 1092 case EthiopicHalehameTig: 1090 1093 m_value.ident = CSSValueEthiopicHalehameTig; 1094 break; 1095 case Footnotes: 1096 m_value.ident = CSSValueFootnotes; 1091 1097 break; 1092 1098 case Georgian: -
trunk/WebCore/css/CSSValueKeywords.in
r66251 r66296 289 289 upper-greek 290 290 upper-norwegian 291 asterisks 292 footnotes 291 293 hebrew 292 294 armenian -
trunk/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
r65942 r66296 49 49 this._valueKeywords = [ 50 50 "above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll", 51 "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian", 51 "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian", "asterisks", 52 52 "auto", "avoid", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "black", "blink", 53 53 "block", "block-axis", "blue", "bold", "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button", … … 62 62 "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", 63 63 "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded", 64 "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "fo rwards", "from", "fuchsia", "geometricPrecision",64 "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", "forwards", "from", "fuchsia", "geometricPrecision", 65 65 "georgian", "gray", "graytext", "green", "grey", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help", 66 66 "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", -
trunk/WebCore/rendering/RenderListMarker.cpp
r65969 r66296 80 80 } 81 81 82 static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, intsequenceSize, SequenceType type)82 static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, unsigned sequenceSize, SequenceType type) 83 83 { 84 84 ASSERT(sequenceSize >= 2); … … 116 116 } 117 117 118 static String toAlphabetic(int number, const UChar* alphabet, int alphabetSize) 118 static String toSymbolic(int number, const UChar* symbols, unsigned symbolsSize) 119 { 120 ASSERT(number > 0); 121 ASSERT(symbolsSize >= 1); 122 unsigned numberShadow = number; 123 --numberShadow; 124 125 // The asterisks list-style-type is the worst case; we show |numberShadow| asterisks. 126 Vector<UChar> letters; 127 letters.append(symbols[numberShadow % symbolsSize]); 128 unsigned numSymbols = numberShadow / symbolsSize; 129 while (numSymbols--) 130 letters.append(symbols[numberShadow % symbolsSize]); 131 return String::adopt(letters); 132 } 133 134 static String toAlphabetic(int number, const UChar* alphabet, unsigned alphabetSize) 119 135 { 120 136 return toAlphabeticOrNumeric(number, alphabet, alphabetSize, AlphabeticSequence); 121 137 } 122 138 123 static String toNumeric(int number, const UChar* numerals, intnumeralsSize)139 static String toNumeric(int number, const UChar* numerals, unsigned numeralsSize) 124 140 { 125 141 return toAlphabeticOrNumeric(number, numerals, numeralsSize, NumericSequence); … … 134 150 { 135 151 return toNumeric(number, alphabet, size); 152 } 153 154 template <size_t size> static inline String toSymbolic(int number, const UChar(&alphabet)[size]) 155 { 156 return toSymbolic(number, alphabet, size); 136 157 } 137 158 … … 420 441 case Amharic: 421 442 case AmharicAbegede: 443 case Asterisks: 422 444 case CjkEarthlyBranch: 423 445 case CjkHeavenlyStem: … … 438 460 case EthiopicHalehameTiEt: 439 461 case EthiopicHalehameTig: 462 case Footnotes: 440 463 case Hangul: 441 464 case HangulConsonant: … … 476 499 // grouped by list-style-type suffix. 477 500 switch (effectiveType) { 501 case Asterisks: 502 case Circle: 503 case Disc: 504 case Footnotes: 478 505 case NoneListStyle: 479 case Disc:480 case Circle:481 506 case Square: 482 507 ASSERT_NOT_REACHED(); … … 571 596 return ""; 572 597 598 case Asterisks: { 599 static const UChar asterisksSymbols[1] = { 600 0x002A 601 }; 602 return toSymbolic(value, asterisksSymbols); 603 } 573 604 // We use the same characters for text security. 574 605 // See RenderText::setInternalString. … … 577 608 case Disc: 578 609 return String(&bullet, 1); 610 case Footnotes: { 611 static const UChar footnotesSymbols[4] = { 612 0x002A, 0x2051, 0x2020, 0x2021 613 }; 614 return toSymbolic(value, footnotesSymbols); 615 } 579 616 case Square: 580 617 // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE … … 1111 1148 EListStyleType type = style()->listStyleType(); 1112 1149 switch (type) { 1150 case Asterisks: 1151 case Footnotes: 1152 context->drawText(style()->font(), TextRun(m_text), marker.location()); 1153 return; 1113 1154 case Disc: 1114 1155 context->drawEllipse(marker); … … 1291 1332 switch (type) { 1292 1333 case NoneListStyle: 1334 break; 1335 case Asterisks: 1336 case Footnotes: 1337 m_text = listMarkerText(type, m_listItem->value()); 1338 width = font.width(m_text); // no suffix for these types 1293 1339 break; 1294 1340 case Circle: … … 1490 1536 EListStyleType type = style()->listStyleType(); 1491 1537 switch (type) { 1538 case Asterisks: 1539 case Footnotes: { 1540 const Font& font = style()->font(); 1541 return IntRect(x(), y() + font.ascent(), font.width(m_text), font.height()); 1542 } 1492 1543 case Disc: 1493 1544 case Circle: -
trunk/WebCore/rendering/style/RenderStyleConstants.h
r66251 r66296 278 278 UpperGreek, 279 279 UpperNorwegian, 280 Asterisks, 281 Footnotes, 280 282 Hebrew, 281 283 Armenian,
Note: See TracChangeset
for help on using the changeset viewer.