diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/css | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/css')
-rw-r--r-- | WebCore/css/CSSComputedStyleDeclaration.cpp | 12 | ||||
-rw-r--r-- | WebCore/css/CSSPageRule.idl | 3 | ||||
-rw-r--r-- | WebCore/css/CSSParser.cpp | 10 | ||||
-rw-r--r-- | WebCore/css/CSSPrimitiveValueMappings.h | 2 | ||||
-rw-r--r-- | WebCore/css/CSSPropertyLonghand.cpp | 2 | ||||
-rw-r--r-- | WebCore/css/CSSPropertyNames.in | 4 | ||||
-rw-r--r-- | WebCore/css/CSSStyleRule.cpp | 33 | ||||
-rw-r--r-- | WebCore/css/CSSStyleRule.h | 2 | ||||
-rw-r--r-- | WebCore/css/CSSStyleRule.idl | 3 | ||||
-rw-r--r-- | WebCore/css/CSSStyleSelector.cpp | 39 | ||||
-rw-r--r-- | WebCore/css/CSSStyleSelector.h | 2 | ||||
-rw-r--r-- | WebCore/css/CSSValueKeywords.in | 2 | ||||
-rw-r--r-- | WebCore/css/SVGCSSStyleSelector.cpp | 34 | ||||
-rw-r--r-- | WebCore/css/html.css | 7 | ||||
-rw-r--r-- | WebCore/css/makeprop.pl | 48 | ||||
-rw-r--r-- | WebCore/css/makevalues.pl | 50 | ||||
-rw-r--r-- | WebCore/css/themeQtMobile.css (renamed from WebCore/css/themeQtMaemo5.css) | 33 |
17 files changed, 217 insertions, 69 deletions
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp index 3746464..1d574ab 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -196,8 +196,8 @@ static const int computedProperties[] = { CSSPropertyWebkitHighlight, CSSPropertyWebkitLineBreak, CSSPropertyWebkitLineClamp, - CSSPropertyWebkitMarginBottomCollapse, - CSSPropertyWebkitMarginTopCollapse, + CSSPropertyWebkitMarginBeforeCollapse, + CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarqueeDirection, CSSPropertyWebkitMarqueeIncrement, CSSPropertyWebkitMarqueeRepetition, @@ -1416,10 +1416,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyWebkitFontSizeDelta: // Not a real style property -- used by the editing engine -- so has no computed value. break; - case CSSPropertyWebkitMarginBottomCollapse: - return CSSPrimitiveValue::create(style->marginBottomCollapse()); - case CSSPropertyWebkitMarginTopCollapse: - return CSSPrimitiveValue::create(style->marginTopCollapse()); + case CSSPropertyWebkitMarginAfterCollapse: + return CSSPrimitiveValue::create(style->marginAfterCollapse()); + case CSSPropertyWebkitMarginBeforeCollapse: + return CSSPrimitiveValue::create(style->marginBeforeCollapse()); case CSSPropertyWebkitPerspective: if (!style->hasPerspective()) return CSSPrimitiveValue::createIdentifier(CSSValueNone); diff --git a/WebCore/css/CSSPageRule.idl b/WebCore/css/CSSPageRule.idl index 6b50b6d..989fd8d 100644 --- a/WebCore/css/CSSPageRule.idl +++ b/WebCore/css/CSSPageRule.idl @@ -23,8 +23,7 @@ module css { // Introduced in DOM Level 2: interface CSSPageRule : CSSRule { - attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText - setter raises(DOMException); + attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText; readonly attribute CSSStyleDeclaration style; diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index 502bc77..5f3fb7d 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -62,6 +62,7 @@ #include "FloatConversion.h" #include "FontFamilyValue.h" #include "FontValue.h" +#include "HashTools.h" #include "MediaList.h" #include "MediaQueryExp.h" #include "Pair.h" @@ -89,6 +90,7 @@ extern int cssyyparse(void* parser); using namespace std; using namespace WTF; +<<<<<<< HEAD #include "CSSPropertyNames.cpp" #include "CSSValueKeywords.cpp" @@ -96,6 +98,8 @@ using namespace WTF; #include "TimeCounter.h" #endif +======= +>>>>>>> webkit.org at r68651 namespace WebCore { static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX; @@ -1488,8 +1492,8 @@ bool CSSParser::parseValue(int propId, bool important) return false; } case CSSPropertyWebkitMarginCollapse: { - const int properties[2] = { CSSPropertyWebkitMarginTopCollapse, - CSSPropertyWebkitMarginBottomCollapse }; + const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse, + CSSPropertyWebkitMarginAfterCollapse }; if (num == 1) { ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse); if (!parseValue(properties[0], important)) @@ -1506,6 +1510,8 @@ bool CSSParser::parseValue(int propId, bool important) } return false; } + case CSSPropertyWebkitMarginBeforeCollapse: + case CSSPropertyWebkitMarginAfterCollapse: case CSSPropertyWebkitMarginTopCollapse: case CSSPropertyWebkitMarginBottomCollapse: if (id == CSSValueCollapse || id == CSSValueSeparate || id == CSSValueDiscard) diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h index a452733..14afdf6 100644 --- a/WebCore/css/CSSPrimitiveValueMappings.h +++ b/WebCore/css/CSSPrimitiveValueMappings.h @@ -352,7 +352,7 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) break; case InputSpeechButtonPart: #if ENABLE(INPUT_SPEECH) - m_value.ident = CSSValueInputSpeechButton; + m_value.ident = CSSValueWebkitInputSpeechButton; #endif break; } diff --git a/WebCore/css/CSSPropertyLonghand.cpp b/WebCore/css/CSSPropertyLonghand.cpp index a4b3325..acca036 100644 --- a/WebCore/css/CSSPropertyLonghand.cpp +++ b/WebCore/css/CSSPropertyLonghand.cpp @@ -98,7 +98,7 @@ static void initShorthandMap(ShorthandMap& shorthandMap) }; SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyMargin, marginProperties); - static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBottomCollapse }; + static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse }; SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitMarginCollapse, marginCollapseProperties); static const int marqueeProperties[] = { diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in index addecca..8584e5f 100644 --- a/WebCore/css/CSSPropertyNames.in +++ b/WebCore/css/CSSPropertyNames.in @@ -232,13 +232,15 @@ z-index -webkit-line-clamp -webkit-logical-width -webkit-logical-height +-webkit-margin-after-collapse +-webkit-margin-before-collapse -webkit-margin-bottom-collapse +-webkit-margin-top-collapse -webkit-margin-collapse -webkit-margin-after -webkit-margin-before -webkit-margin-end -webkit-margin-start --webkit-margin-top-collapse -webkit-marquee -webkit-marquee-direction -webkit-marquee-increment diff --git a/WebCore/css/CSSStyleRule.cpp b/WebCore/css/CSSStyleRule.cpp index 1036e8f..faf60b0 100644 --- a/WebCore/css/CSSStyleRule.cpp +++ b/WebCore/css/CSSStyleRule.cpp @@ -23,7 +23,11 @@ #include "CSSStyleRule.h" #include "CSSMutableStyleDeclaration.h" +#include "CSSParser.h" #include "CSSSelector.h" +#include "CSSStyleSheet.h" +#include "Document.h" +#include "StyleSheet.h" namespace WebCore { @@ -50,9 +54,34 @@ String CSSStyleRule::selectorText() const return str; } -void CSSStyleRule::setSelectorText(const String& /*selectorText*/, ExceptionCode& /*ec*/) +void CSSStyleRule::setSelectorText(const String& selectorText) { - // FIXME: Implement! + Document* doc = 0; + StyleSheet* ownerStyleSheet = m_style->stylesheet(); + if (ownerStyleSheet) { + if (ownerStyleSheet->isCSSStyleSheet()) + doc = static_cast<CSSStyleSheet*>(ownerStyleSheet)->document(); + if (!doc) + doc = ownerStyleSheet->ownerNode() ? ownerStyleSheet->ownerNode()->document() : 0; + } + if (!doc) + doc = m_style->node() ? m_style->node()->document() : 0; + + if (!doc) + return; + + CSSParser p; + CSSSelectorList selectorList; + p.parseSelector(selectorText, doc, selectorList); + if (!selectorList.first()) + return; + + String oldSelectorText = this->selectorText(); + m_selectorList.adopt(selectorList); + if (this->selectorText() == oldSelectorText) + return; + + doc->styleSelectorChanged(DeferRecalcStyle); } String CSSStyleRule::cssText() const diff --git a/WebCore/css/CSSStyleRule.h b/WebCore/css/CSSStyleRule.h index d797c73..171b636 100644 --- a/WebCore/css/CSSStyleRule.h +++ b/WebCore/css/CSSStyleRule.h @@ -41,7 +41,7 @@ public: virtual ~CSSStyleRule(); virtual String selectorText() const; - void setSelectorText(const String&, ExceptionCode&); + void setSelectorText(const String&); CSSMutableStyleDeclaration* style() const { return m_style.get(); } diff --git a/WebCore/css/CSSStyleRule.idl b/WebCore/css/CSSStyleRule.idl index 862acd8..4abfbfc 100644 --- a/WebCore/css/CSSStyleRule.idl +++ b/WebCore/css/CSSStyleRule.idl @@ -23,8 +23,7 @@ module css { // Introduced in DOM Level 2: interface CSSStyleRule : CSSRule { - attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText - setter raises(DOMException); + attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectorText; readonly attribute CSSStyleDeclaration style; diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp index 9b51fdb..bf95877 100644 --- a/WebCore/css/CSSStyleSelector.cpp +++ b/WebCore/css/CSSStyleSelector.cpp @@ -1106,6 +1106,10 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document) documentStyle->setVisuallyOrdered(document->visuallyOrdered()); documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1); + Element* docElement = document->documentElement(); + if (docElement && docElement->renderer()) + documentStyle->setBlockFlow(docElement->renderer()->style()->blockFlow()); + FontDescription fontDescription; fontDescription.setUsePrinterFont(document->printing()); if (Settings* settings = document->settings()) { @@ -1344,7 +1348,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl updateFont(); // Clean up our style object's display and text decorations (among other fixups). - adjustRenderStyle(style(), e); + adjustRenderStyle(style(), m_parentStyle, e); // Start loading images referenced by this style. loadPendingImages(); @@ -1562,7 +1566,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo, updateFont(); // Clean up our style object's display and text decorations (among other fixups). - adjustRenderStyle(style(), 0); + adjustRenderStyle(style(), parentStyle, 0); // Start loading images referenced by this style. loadPendingImages(); @@ -1646,7 +1650,7 @@ static void addIntrinsicMargins(RenderStyle* style) } } -void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e) +void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, RenderStyle* parentStyle, Element *e) { // Cache our original display. style->setOriginalDisplay(style->display()); @@ -1716,6 +1720,11 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e) style->setDisplay(BLOCK); } + // FIXME: Don't support this mutation for pseudo styles like first-letter or first-line, since it's not completely + // clear how that should work. + if (style->display() == INLINE && style->styleType() == NOPSEUDO && parentStyle && style->blockFlow() != parentStyle->blockFlow()) + style->setDisplay(INLINE_BLOCK); + // After performing the display mutation, check table rows. We do not honor position:relative on // table rows or cells. This has been established in CSS2.1 (and caused a crash in containingBlock() // on some sites). @@ -1723,6 +1732,16 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e) style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL) && style->position() == RelativePosition) style->setPosition(StaticPosition); + + // FIXME: Since we don't support block-flow on either tables or flexible boxes yet, disallow setting + // of block-flow to anything other than TopToBottomBlockFlow. + // https://bugs.webkit.org/show_bug.cgi?id=46417 - Tables support + // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. + if (style->blockFlow() != TopToBottomBlockFlow && (style->display() == TABLE || style->display() == INLINE_TABLE + || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_ROW_GROUP + || style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL + || style->display() == BOX || style->display() == INLINE_BOX)) + style->setBlockFlow(TopToBottomBlockFlow); } // Make sure our z-index value is only applied if the object is positioned. @@ -5139,21 +5158,23 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) } case CSSPropertyWebkitMarginCollapse: { if (isInherit) { - m_style->setMarginTopCollapse(m_parentStyle->marginTopCollapse()); - m_style->setMarginBottomCollapse(m_parentStyle->marginBottomCollapse()); + m_style->setMarginBeforeCollapse(m_parentStyle->marginBeforeCollapse()); + m_style->setMarginAfterCollapse(m_parentStyle->marginAfterCollapse()); } else if (isInitial) { - m_style->setMarginTopCollapse(MCOLLAPSE); - m_style->setMarginBottomCollapse(MCOLLAPSE); + m_style->setMarginBeforeCollapse(MCOLLAPSE); + m_style->setMarginAfterCollapse(MCOLLAPSE); } return; } + case CSSPropertyWebkitMarginBeforeCollapse: case CSSPropertyWebkitMarginTopCollapse: - HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginTopCollapse, MarginTopCollapse) + HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBeforeCollapse, MarginBeforeCollapse) return; + case CSSPropertyWebkitMarginAfterCollapse: case CSSPropertyWebkitMarginBottomCollapse: - HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBottomCollapse, MarginBottomCollapse) + HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginAfterCollapse, MarginAfterCollapse) return; case CSSPropertyWebkitLineClamp: { HANDLE_INHERIT_AND_INITIAL(lineClamp, LineClamp) diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h index b77f23c..2bca2f4 100644 --- a/WebCore/css/CSSStyleSelector.h +++ b/WebCore/css/CSSStyleSelector.h @@ -181,7 +181,7 @@ public: void checkForZoomChange(RenderStyle*, RenderStyle* parentStyle); void checkForTextSizeAdjust(); - void adjustRenderStyle(RenderStyle*, Element*); + void adjustRenderStyle(RenderStyle* styleToAdjust, RenderStyle* parentStyle, Element*); void addMatchedRule(CSSRuleData* rule) { m_matchedRules.append(rule); } void addMatchedDeclaration(CSSMutableStyleDeclaration* decl); diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in index 990bb36..556d0bc 100644 --- a/WebCore/css/CSSValueKeywords.in +++ b/WebCore/css/CSSValueKeywords.in @@ -568,7 +568,7 @@ button button-bevel default-button inner-spin-button -input-speech-button +-webkit-input-speech-button list-button listbox listitem diff --git a/WebCore/css/SVGCSSStyleSelector.cpp b/WebCore/css/SVGCSSStyleSelector.cpp index b8cc4f7..5ddaf99 100644 --- a/WebCore/css/SVGCSSStyleSelector.cpp +++ b/WebCore/css/SVGCSSStyleSelector.cpp @@ -48,15 +48,17 @@ #define HANDLE_INHERIT(prop, Prop) \ if (isInherit) \ -{\ - svgstyle->set##Prop(m_parentStyle->svgStyle()->prop());\ - return;\ +{ \ + svgstyle->set##Prop(m_parentStyle->svgStyle()->prop()); \ + return; \ } #define HANDLE_INHERIT_AND_INITIAL(prop, Prop) \ HANDLE_INHERIT(prop, Prop) \ -else if (isInitial) \ - svgstyle->set##Prop(SVGRenderStyle::initial##Prop()); +if (isInitial) { \ + svgstyle->set##Prop(SVGRenderStyle::initial##Prop()); \ + return; \ +} namespace WebCore { @@ -90,15 +92,13 @@ static int angleToGlyphOrientation(float angle) return -1; } -static Color colorFromSVGColorCSSValue(CSSValue* value, const Color& fgColor) +static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const Color& fgColor) { - ASSERT(value->isSVGColor()); - SVGColor* c = static_cast<SVGColor*>(value); Color color; - if (c->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR) + if (svgColor->colorType() == SVGColor::SVG_COLORTYPE_CURRENTCOLOR) color = fgColor; else - color = c->color(); + color = svgColor->color(); return color; } @@ -468,13 +468,15 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value) case CSSPropertyStopColor: { HANDLE_INHERIT_AND_INITIAL(stopColor, StopColor); - svgstyle->setStopColor(colorFromSVGColorCSSValue(value, m_style->color())); + if (value->isSVGColor()) + svgstyle->setStopColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color())); break; } case CSSPropertyLightingColor: { HANDLE_INHERIT_AND_INITIAL(lightingColor, LightingColor); - svgstyle->setLightingColor(colorFromSVGColorCSSValue(value, m_style->color())); + if (value->isSVGColor()) + svgstyle->setLightingColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color())); break; } case CSSPropertyFloodOpacity: @@ -497,11 +499,9 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value) } case CSSPropertyFloodColor: { - if (isInitial) { - svgstyle->setFloodColor(SVGRenderStyle::initialFloodColor()); - return; - } - svgstyle->setFloodColor(colorFromSVGColorCSSValue(value, m_style->color())); + HANDLE_INHERIT_AND_INITIAL(floodColor, FloodColor); + if (value->isSVGColor()) + svgstyle->setFloodColor(colorFromSVGColorCSSValue(static_cast<SVGColor*>(value), m_style->color())); break; } case CSSPropertyGlyphOrientationHorizontal: diff --git a/WebCore/css/html.css b/WebCore/css/html.css index d65acb0..5399c1c 100644 --- a/WebCore/css/html.css +++ b/WebCore/css/html.css @@ -301,6 +301,11 @@ button { -webkit-appearance: button; } +/* Form controls don't go vertical. */ +input, textarea, keygen, select, button, isindex, meter, progress { + -webkit-block-flow: tb !important; +} + input, textarea, keygen, select, button, isindex, datagrid { margin: 0__qem; font: -webkit-small-control; @@ -373,7 +378,7 @@ input::-webkit-outer-spin-button { } input::-webkit-input-speech-button { - -webkit-appearance: input-speech-button; + -webkit-appearance: -webkit-input-speech-button; display: inline-block; } diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl index 8810e8d..64f5a6b 100644 --- a/WebCore/css/makeprop.pl +++ b/WebCore/css/makeprop.pl @@ -41,15 +41,14 @@ print GPERF << "EOF"; #include \"CSSPropertyNames.h\" %} %struct-type -struct Property { - const char* name; - int id; -}; -%language=ANSI-C +struct Property; +%omit-struct-type +%language=C++ %readonly-tables %global-table %compare-strncmp -%define lookup-function-name findProperty +%define class-name CSSPropertyNamesHash +%define lookup-function-name findPropertyImpl %define hash-function-name propery_hash_function %define word-array-name property_wordlist %includes @@ -72,6 +71,10 @@ print HEADER << "EOF"; #ifndef CSSPropertyNames_h #define CSSPropertyNames_h +#include <string.h> + +namespace WebCore { + enum CSSPropertyID { CSSPropertyInvalid = 0, EOF @@ -105,17 +108,41 @@ print HEADER << "EOF"; const char* getPropertyName(CSSPropertyID); +} // namespace WebCore + #endif // CSSPropertyNames_h EOF close HEADER; -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?"; +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?"; -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing"; +open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing"; print C << "EOF"; +EOF + +close C; + +my $propertyNamesImpl = "CSSPropertyNames.cpp"; + +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing"; +print PROPERTYNAMES << "EOF"; +/* This file is automatically generated by make-hash-tools.pl, do not edit */ + + +#include "CSSPropertyNames.h" +#include "HashTools.h" + +namespace WebCore { +#include "CSSPropertyNamesHash.h" + +const Property* findProperty (register const char* str, register unsigned int len) +{ + return CSSPropertyNamesHash::findPropertyImpl(str, len); +} + const char* getPropertyName(CSSPropertyID id) { if (id < firstCSSProperty) @@ -125,7 +152,10 @@ const char* getPropertyName(CSSPropertyID id) return 0; return propertyNameStrings[index]; } + +} // namespace WebCore + EOF -close C; +close PROPERTYNAMES; diff --git a/WebCore/css/makevalues.pl b/WebCore/css/makevalues.pl index 421e470..c9f7f70 100644 --- a/WebCore/css/makevalues.pl +++ b/WebCore/css/makevalues.pl @@ -42,14 +42,13 @@ print GPERF << "EOF"; #include \"CSSValueKeywords.h\" %} %struct-type -struct Value { - const char* name; - int id; -}; -%language=ANSI-C +struct Value; +%omit-struct-type +%language=C++ %readonly-tables %compare-strncmp -%define lookup-function-name findValue +%define class-name CSSValueKeywordsHash +%define lookup-function-name findValueImpl %define hash-function-name value_hash_function %define word-array-name value_word_list %includes @@ -72,6 +71,10 @@ print HEADER << "EOF"; #ifndef CSSValueKeywords_h #define CSSValueKeywords_h +#include <string.h> + +namespace WebCore { + const int CSSValueInvalid = 0; EOF @@ -92,13 +95,16 @@ print HEADER << "EOF"; const char* getValueName(unsigned short id); +} // namespace WebCore + #endif // CSSValueKeywords_h + EOF close HEADER; -system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?"; +system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?"; -open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing"; +open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing"; print C "static const char * const valueList[] = {\n"; print C "\"\",\n"; foreach my $name (@names) { @@ -107,12 +113,38 @@ foreach my $name (@names) { print C << "EOF"; 0 }; + +EOF + +close C; + +my $valueKeywordsImpl = "CSSValueKeywords.cpp"; + +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing"; +print VALUEKEYWORDS << "EOF"; +/* This file is automatically generated by make-hash-tools.pl, do not edit */ + +#include "CSSValueKeywords.h" +#include "HashTools.h" + +namespace WebCore { +#include "CSSValueKeywordsHash.h" + +const Value* findValue (register const char* str, register unsigned int len) +{ + return CSSValueKeywordsHash::findValueImpl(str, len); +} + const char* getValueName(unsigned short id) { if (id >= numCSSValueKeywords || id <= 0) return 0; return valueList[id]; } + +} // namespace WebCore + EOF -close C; +close VALUEKEYWORDS; + diff --git a/WebCore/css/themeQtMaemo5.css b/WebCore/css/themeQtMobile.css index c568d5d..ef2d182 100644 --- a/WebCore/css/themeQtMaemo5.css +++ b/WebCore/css/themeQtMobile.css @@ -66,21 +66,46 @@ select:active:disabled { input:not([type]), input[type="text"], input[type="password"], +input[type="email"], +input[type="tel"], +input[type="color"], +input[type="search"], +input[type="date"], +input[type="number"], +input[type="url"], textarea { - border: 1px solid black; + border: 1px solid gray; + background: -webkit-gradient(linear, left top, left 30, color-stop(0.0, #bfbfbf), color-stop(0.2, #ffffff)); + color: #3e3e3e; + -webkit-border-radius:5px; } input:not([type]):disabled, input[type="text"]:disabled, input[type="password"]:disabled, +input[type="email"]:disabled, +input[type="tel"]:disabled, +input[type="color"]:disabled, +input[type="search"]:disabled, +input[type="date"]:disabled, +input[type="number"]:disabled, +input[type="url"]:disabled, textarea:disabled { - border: 1px solid grey; - background-color:ButtonHighlight; + border: 1px solid gray; + background: -webkit-gradient(linear, left top, left 30, color-stop(0.0, #e5e5e5), color-stop(0.2, #ffffff)); + color: #e5e5e5; } input:not([type]):active, input[type="text"]:active, input[type="password"]:active, +input[type="email"]:active, +input[type="tel"]:active, +input[type="color"]:active, +input[type="search"]:active, +input[type="date"]:active, +input[type="number"]:active, +input[type="url"]:active, textarea:active { - background-color:ButtonShadow; + background: ButtonShadow; } |