[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
dbates at webkit.org
dbates at webkit.org
Wed Dec 22 12:44:45 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ab35e2941ceceface481ca7f1cf4e300706b9aaa
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Aug 28 03:06:14 2010 +0000
2010-08-27 Daniel Bates <dbates at rim.com>
Reviewed by Darin Adler.
Implement symbolic CSS3 list-style-types
https://bugs.webkit.org/show_bug.cgi?id=36734
Implements all of the symbolic CSS3 list-style-types as per
section 4.5 of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#symbolic>.
Test: fast/lists/w3-css3-list-styles-symbolic.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added list style types Asterisks and Footnotes.
* css/CSSValueKeywords.in: Ditto.
* inspector/front-end/SourceCSSTokenizer.re2js: Ditto.
* rendering/RenderListMarker.cpp:
(WebCore::toAlphabeticOrNumeric): Changed type of parameter sequenceSize from int to unsigned.
(WebCore::toSymbolic): Added.
(WebCore::toAlphabetic): Changed type of parameter alphabetSize from int to unsigned.
(WebCore::toNumeric): Changed type of parameter numeralsSize from int to unsigned.
(WebCore::effectiveListMarkerType): Added.
(WebCore::listMarkerSuffix): Added list style types Asterisks and Footnotes.
(WebCore::listMarkerText): Ditto.
(WebCore::RenderListMarker::paint): Ditto.
(WebCore::RenderListMarker::calcPrefWidths): Ditto.
(WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
* rendering/style/RenderStyleConstants.h: Ditto.
(WebCore::):
2010-08-27 Daniel Bates <dbates at rim.com>
Reviewed by Darin Adler.
Implement symbolic CSS3 list-style-types
https://bugs.webkit.org/show_bug.cgi?id=36734
Tests that all of the symbolic CSS3 list-style-types are supported.
* fast/lists/w3-css3-list-styles-symbolic-expected.txt: Added.
* fast/lists/w3-css3-list-styles-symbolic.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5f6e659..ec37047 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-27 Daniel Bates <dbates at rim.com>
+
+ Reviewed by Darin Adler.
+
+ Implement symbolic CSS3 list-style-types
+ https://bugs.webkit.org/show_bug.cgi?id=36734
+
+ Tests that all of the symbolic CSS3 list-style-types are supported.
+
+ * fast/lists/w3-css3-list-styles-symbolic-expected.txt: Added.
+ * fast/lists/w3-css3-list-styles-symbolic.html: Added.
+
2010-08-27 Matthew Delaney <mdelaney at apple.com>
Reviewed by Oliver Hunt.
diff --git a/LayoutTests/fast/lists/w3-css3-list-styles-symbolic-expected.txt b/LayoutTests/fast/lists/w3-css3-list-styles-symbolic-expected.txt
new file mode 100644
index 0000000..890f87b
--- /dev/null
+++ b/LayoutTests/fast/lists/w3-css3-list-styles-symbolic-expected.txt
@@ -0,0 +1,37 @@
+CSS3 Symbolic list-style-type
+
+asterisks
+
+PASS list marker is *.
+PASS list marker is **.
+PASS list marker is ***.
+PASS list marker is ****.
+PASS list marker is *****.
+PASS list marker is ******.
+PASS list marker is *******.
+PASS list marker is ********.
+PASS list marker is *********.
+PASS list marker is **********.
+PASS list marker is 0.
+PASS list marker is -2.
+PASS list marker is -1.
+footnotes
+
+PASS list marker is *.
+PASS list marker is ⁑.
+PASS list marker is †.
+PASS list marker is ‡.
+PASS list marker is **.
+PASS list marker is ⁑⁑.
+PASS list marker is ††.
+PASS list marker is ‡‡.
+PASS list marker is ***.
+PASS list marker is ⁑⁑⁑.
+PASS list marker is †††.
+PASS list marker is ‡‡‡.
+PASS list marker is ****.
+PASS list marker is ⁑⁑⁑⁑.
+PASS list marker is 0.
+PASS list marker is -2.
+PASS list marker is -1.
+
diff --git a/LayoutTests/fast/lists/w3-css3-list-styles-symbolic.html b/LayoutTests/fast/lists/w3-css3-list-styles-symbolic.html
new file mode 100644
index 0000000..a237631
--- /dev/null
+++ b/LayoutTests/fast/lists/w3-css3-list-styles-symbolic.html
@@ -0,0 +1,83 @@
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <style>
+ .test ol { padding-left: 300px; }
+
+ /*
+ The following styles are ordered as they appear in section 4.5. of the
+ Draft 7 November 2002 draft of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#symbolic>.
+ */
+
+ ol.asterisks { list-style-type: asterisks; }
+
+ ol.footnotes { list-style-type: footnotes; }
+ </style>
+ <script src="resources/dump-list.js"></script>
+ <script>
+ function runTest()
+ {
+ if (!window.layoutTestController)
+ return;
+
+ layoutTestController.dumpAsText();
+ filterListsWithReplacement(document.querySelectorAll(".test ol"), testListItemMarkerEqualsListItemText);
+ document.body.removeChild(document.getElementById("description")); // Remove description when running in DRT.
+ }
+ window.onload = runTest;
+ </script>
+</head>
+<body>
+ <h1>CSS3 Symbolic list-style-type</h1>
+ <p id="description">This tests that all of the symbolic CSS3 list-style-types are supported as per <a href="http://www.w3.org/TR/css3-lists/#symbolic">section 4.5 of the spec. CSS3 Lists module</a> (Draft 7 November 2002). This test PASSED if the list item matches its bullet for every list item (below). For example, for the asterisks symbolic system the second <li> (which corresponds to 2 in the standard ordering of the positive integers) should be rendered as: ** **</p>
+ <div class="test">
+ <h2>asterisks</h2>
+ <ol class="asterisks">
+ <li>*</li>
+ <li>**</li>
+ <li>***</li>
+ <li>****</li>
+ <li>*****</li>
+ <li>******</li>
+ <li>*******</li>
+ <li>********</li>
+ <li>*********</li>
+ <li>**********</li>
+ </ol>
+ <ol class="asterisks" start="0">
+ <li>0</li>
+ </ol>
+ <ol class="asterisks" start="-2">
+ <li>-2</li>
+ <li>-1</li>
+ </ol>
+ </div>
+
+ <div class="test">
+ <h2>footnotes</h2>
+ <ol class="footnotes">
+ <li>*</li>
+ <li>⁑</li>
+ <li>†</li>
+ <li>‡</li>
+ <li>**</li>
+ <li>⁑⁑</li>
+ <li>††</li>
+ <li>‡‡</li>
+ <li>***</li>
+ <li>⁑⁑⁑</li>
+ <li>†††</li>
+ <li>‡‡‡</li>
+ <li>****</li>
+ <li>⁑⁑⁑⁑</li>
+ </ol>
+ <ol class="footnotes" start="0">
+ <li>0</li>
+ </ol>
+ <ol class="footnotes" start="-2">
+ <li>-2</li>
+ <li>-1</li>
+ </ol>
+ </div>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e8fd5ee..882112c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-08-27 Daniel Bates <dbates at rim.com>
+
+ Reviewed by Darin Adler.
+
+ Implement symbolic CSS3 list-style-types
+ https://bugs.webkit.org/show_bug.cgi?id=36734
+
+ Implements all of the symbolic CSS3 list-style-types as per
+ section 4.5 of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#symbolic>.
+
+ Test: fast/lists/w3-css3-list-styles-symbolic.html
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added list style types Asterisks and Footnotes.
+ * css/CSSValueKeywords.in: Ditto.
+ * inspector/front-end/SourceCSSTokenizer.re2js: Ditto.
+ * rendering/RenderListMarker.cpp:
+ (WebCore::toAlphabeticOrNumeric): Changed type of parameter sequenceSize from int to unsigned.
+ (WebCore::toSymbolic): Added.
+ (WebCore::toAlphabetic): Changed type of parameter alphabetSize from int to unsigned.
+ (WebCore::toNumeric): Changed type of parameter numeralsSize from int to unsigned.
+ (WebCore::effectiveListMarkerType): Added.
+ (WebCore::listMarkerSuffix): Added list style types Asterisks and Footnotes.
+ (WebCore::listMarkerText): Ditto.
+ (WebCore::RenderListMarker::paint): Ditto.
+ (WebCore::RenderListMarker::calcPrefWidths): Ditto.
+ (WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
+ * rendering/style/RenderStyleConstants.h: Ditto.
+ (WebCore::):
+
2010-08-27 Vincent Scheib <scheib at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 8bfa93c..1cebf39 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1008,6 +1008,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
case Armenian:
m_value.ident = CSSValueArmenian;
break;
+ case Asterisks:
+ m_value.ident = CSSValueAsterisks;
+ break;
case BinaryListStyle:
m_value.ident = CSSValueBinary;
break;
@@ -1089,6 +1092,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
case EthiopicHalehameTig:
m_value.ident = CSSValueEthiopicHalehameTig;
break;
+ case Footnotes:
+ m_value.ident = CSSValueFootnotes;
+ break;
case Georgian:
m_value.ident = CSSValueGeorgian;
break;
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 56c6cc2..7a9b9c7 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -288,6 +288,8 @@ tigrinya-et-abegede
ethiopic-abegede-ti-et
upper-greek
upper-norwegian
+asterisks
+footnotes
hebrew
armenian
georgian
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
index b4d3eef..f4628d2 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
@@ -48,7 +48,7 @@ WebInspector.SourceCSSTokenizer = function()
this._valueKeywords = [
"above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll",
- "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian",
+ "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian", "asterisks",
"auto", "avoid", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "black", "blink",
"block", "block-axis", "blue", "bold", "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button",
"button-bevel", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", "capitalize", "caps-lock-indicator",
@@ -61,7 +61,7 @@ WebInspector.SourceCSSTokenizer = function()
"ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et",
"ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et",
"ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded",
- "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "forwards", "from", "fuchsia", "geometricPrecision",
+ "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", "forwards", "from", "fuchsia", "geometricPrecision",
"georgian", "gray", "graytext", "green", "grey", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help",
"hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline",
diff --git a/WebCore/rendering/RenderListMarker.cpp b/WebCore/rendering/RenderListMarker.cpp
index 6ff1709..7b33c3d 100644
--- a/WebCore/rendering/RenderListMarker.cpp
+++ b/WebCore/rendering/RenderListMarker.cpp
@@ -79,7 +79,7 @@ static String toRoman(int number, bool upper)
return String(&letters[lettersSize - length], length);
}
-static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, int sequenceSize, SequenceType type)
+static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, unsigned sequenceSize, SequenceType type)
{
ASSERT(sequenceSize >= 2);
@@ -115,12 +115,28 @@ static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, in
return String(&letters[lettersSize - length], length);
}
-static String toAlphabetic(int number, const UChar* alphabet, int alphabetSize)
+static String toSymbolic(int number, const UChar* symbols, unsigned symbolsSize)
+{
+ ASSERT(number > 0);
+ ASSERT(symbolsSize >= 1);
+ unsigned numberShadow = number;
+ --numberShadow;
+
+ // The asterisks list-style-type is the worst case; we show |numberShadow| asterisks.
+ Vector<UChar> letters;
+ letters.append(symbols[numberShadow % symbolsSize]);
+ unsigned numSymbols = numberShadow / symbolsSize;
+ while (numSymbols--)
+ letters.append(symbols[numberShadow % symbolsSize]);
+ return String::adopt(letters);
+}
+
+static String toAlphabetic(int number, const UChar* alphabet, unsigned alphabetSize)
{
return toAlphabeticOrNumeric(number, alphabet, alphabetSize, AlphabeticSequence);
}
-static String toNumeric(int number, const UChar* numerals, int numeralsSize)
+static String toNumeric(int number, const UChar* numerals, unsigned numeralsSize)
{
return toAlphabeticOrNumeric(number, numerals, numeralsSize, NumericSequence);
}
@@ -135,6 +151,11 @@ template <size_t size> static inline String toNumeric(int number, const UChar(&a
return toNumeric(number, alphabet, size);
}
+template <size_t size> static inline String toSymbolic(int number, const UChar(&alphabet)[size])
+{
+ return toSymbolic(number, alphabet, size);
+}
+
static int toHebrewUnder1000(int number, UChar letters[5])
{
// FIXME: CSS3 mentions various refinements not implemented here.
@@ -419,6 +440,7 @@ static EListStyleType effectiveListMarkerType(EListStyleType type, int value)
case Afar:
case Amharic:
case AmharicAbegede:
+ case Asterisks:
case CjkEarthlyBranch:
case CjkHeavenlyStem:
case Ethiopic:
@@ -437,6 +459,7 @@ static EListStyleType effectiveListMarkerType(EListStyleType type, int value)
case EthiopicHalehameTiEr:
case EthiopicHalehameTiEt:
case EthiopicHalehameTig:
+ case Footnotes:
case Hangul:
case HangulConsonant:
case Hiragana:
@@ -475,9 +498,11 @@ static UChar listMarkerSuffix(EListStyleType type, int value)
// Note, the following switch statement has been explicitly
// grouped by list-style-type suffix.
switch (effectiveType) {
- case NoneListStyle:
- case Disc:
+ case Asterisks:
case Circle:
+ case Disc:
+ case Footnotes:
+ case NoneListStyle:
case Square:
ASSERT_NOT_REACHED();
return ' ';
@@ -570,12 +595,24 @@ String listMarkerText(EListStyleType type, int value)
case NoneListStyle:
return "";
+ case Asterisks: {
+ static const UChar asterisksSymbols[1] = {
+ 0x002A
+ };
+ return toSymbolic(value, asterisksSymbols);
+ }
// We use the same characters for text security.
// See RenderText::setInternalString.
case Circle:
return String(&whiteBullet, 1);
case Disc:
return String(&bullet, 1);
+ case Footnotes: {
+ static const UChar footnotesSymbols[4] = {
+ 0x002A, 0x2051, 0x2020, 0x2021
+ };
+ return toSymbolic(value, footnotesSymbols);
+ }
case Square:
// The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE
// instead, but I think this looks better.
@@ -1110,6 +1147,10 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
EListStyleType type = style()->listStyleType();
switch (type) {
+ case Asterisks:
+ case Footnotes:
+ context->drawText(style()->font(), TextRun(m_text), marker.location());
+ return;
case Disc:
context->drawEllipse(marker);
return;
@@ -1291,6 +1332,11 @@ void RenderListMarker::calcPrefWidths()
switch (type) {
case NoneListStyle:
break;
+ case Asterisks:
+ case Footnotes:
+ m_text = listMarkerText(type, m_listItem->value());
+ width = font.width(m_text); // no suffix for these types
+ break;
case Circle:
case Disc:
case Square:
@@ -1489,6 +1535,11 @@ IntRect RenderListMarker::getRelativeMarkerRect()
EListStyleType type = style()->listStyleType();
switch (type) {
+ case Asterisks:
+ case Footnotes: {
+ const Font& font = style()->font();
+ return IntRect(x(), y() + font.ascent(), font.width(m_text), font.height());
+ }
case Disc:
case Circle:
case Square: {
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index 286357d..68c8113 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -277,6 +277,8 @@ enum EListStyleType {
EthiopicAbegedeTiEt,
UpperGreek,
UpperNorwegian,
+ Asterisks,
+ Footnotes,
Hebrew,
Armenian,
Georgian,
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list