diff options
Diffstat (limited to 'WebCore/css')
-rw-r--r-- | WebCore/css/CSSComputedStyleDeclaration.cpp | 2 | ||||
-rw-r--r-- | WebCore/css/CSSParser.cpp | 59 | ||||
-rw-r--r-- | WebCore/css/CSSPropertyNames.in | 1 | ||||
-rw-r--r-- | WebCore/css/CSSStyleSelector.cpp | 31 | ||||
-rw-r--r-- | WebCore/css/CSSStyleSelector.h | 3 | ||||
-rw-r--r-- | WebCore/css/makeprop.pl | 14 |
6 files changed, 32 insertions, 78 deletions
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp index 418251f..cbb9ca8 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -893,8 +893,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper } case CSSPropertyFontSize: return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX); - case CSSPropertyWebkitBinding: - break; case CSSPropertyFontStyle: if (style->fontDescription().italic()) return CSSPrimitiveValue::createIdentifier(CSSValueItalic); diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index 7528cd8..f511507 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -1201,40 +1201,6 @@ bool CSSParser::parseValue(int propId, bool important) validPrimitive = true; break; - case CSSPropertyWebkitBinding: -#if ENABLE(XBL) - if (id == CSSValueNone) - validPrimitive = true; - else { - RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); - CSSParserValue* val; - RefPtr<CSSValue> parsedValue; - while ((val = m_valueList->current())) { - if (val->unit == CSSPrimitiveValue::CSS_URI && m_styleSheet) { - // FIXME: The completeURL call should be done when using the CSSPrimitiveValue, - // not when creating it. - parsedValue = CSSPrimitiveValue::create(m_styleSheet->completeURL(val->string), CSSPrimitiveValue::CSS_URI); - } - if (!parsedValue) - break; - - // FIXME: We can't use release() here since we might hit this path twice - // but that logic seems wrong to me to begin with, we convert all non-uri values - // into the last seen URI value!? - // -webkit-binding: url(foo.xml), 1, 2; (if that were valid) is treated as: - // -webkit-binding: url(foo.xml), url(foo.xml), url(foo.xml); !? - values->append(parsedValue.get()); - m_valueList->next(); - } - if (!values->length()) - return false; - - addProperty(propId, values.release(), important); - m_valueList->next(); - return true; - } -#endif - break; case CSSPropertyWebkitBorderImage: case CSSPropertyWebkitMaskBoxImage: if (id == CSSValueNone) @@ -3887,6 +3853,27 @@ static inline bool parseAlphaValue(const UChar*& string, const UChar* end, UChar return *foundTerminator == terminator; } +static inline bool mightBeRGBA(const UChar* characters, unsigned length) +{ + if (length < 5) + return false; + return characters[4] == '(' + && (characters[0] | 0x20) == 'r' + && (characters[1] | 0x20) == 'g' + && (characters[2] | 0x20) == 'b' + && (characters[3] | 0x20) == 'a'; +} + +static inline bool mightBeRGB(const UChar* characters, unsigned length) +{ + if (length < 4) + return false; + return characters[3] == '(' + && (characters[0] | 0x20) == 'r' + && (characters[1] | 0x20) == 'g' + && (characters[2] | 0x20) == 'b'; +} + bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict) { const UChar* characters = name.characters(); @@ -3903,7 +3890,7 @@ bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict) } // Try rgba() syntax. - if (name.startsWith("rgba(")) { + if (mightBeRGBA(characters, length)) { const UChar* current = characters + 5; const UChar* end = characters + length; int red; @@ -3925,7 +3912,7 @@ bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict) } // Try rgb() syntax. - if (name.startsWith("rgb(")) { + if (mightBeRGB(characters, length)) { const UChar* current = characters + 4; const UChar* end = characters + length; int red; diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in index d236b45..0216ae1 100644 --- a/WebCore/css/CSSPropertyNames.in +++ b/WebCore/css/CSSPropertyNames.in @@ -172,7 +172,6 @@ z-index # a single value: -webkit-background-size: l; is equivalent to background-size: l l; # whereas background-size: l; is equivalent to background-size: l auto; -webkit-background-size --webkit-binding -webkit-border-end -webkit-border-end-color -webkit-border-end-style diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp index fd411d9..aa724a3 100644 --- a/WebCore/css/CSSStyleSelector.cpp +++ b/WebCore/css/CSSStyleSelector.cpp @@ -4687,37 +4687,6 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) m_style->setAppearance(*primitiveValue); return; } - case CSSPropertyWebkitBinding: { -#if ENABLE(XBL) - if (isInitial || (primitiveValue && primitiveValue->getIdent() == CSSValueNone)) { - m_style->deleteBindingURIs(); - return; - } - else if (isInherit) { - if (m_parentStyle->bindingURIs()) - m_style->inheritBindingURIs(m_parentStyle->bindingURIs()); - else - m_style->deleteBindingURIs(); - return; - } - - if (!value->isValueList()) return; - CSSValueList* list = static_cast<CSSValueList*>(value); - bool firstBinding = true; - for (unsigned int i = 0; i < list->length(); i++) { - CSSValue *item = list->itemWithoutBoundsCheck(i); - CSSPrimitiveValue *val = static_cast<CSSPrimitiveValue*>(item); - if (val->primitiveType() == CSSPrimitiveValue::CSS_URI) { - if (firstBinding) { - firstBinding = false; - m_style->deleteBindingURIs(); - } - m_style->addBindingURI(val->getStringValue()); - } - } -#endif - return; - } case CSSPropertyWebkitBorderImage: case CSSPropertyWebkitMaskBoxImage: { diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h index ad801da..b0d977e 100644 --- a/WebCore/css/CSSStyleSelector.h +++ b/WebCore/css/CSSStyleSelector.h @@ -50,6 +50,7 @@ class CSSStyleSheet; class CSSValue; class CSSVariableDependentValue; class CSSVariablesRule; +class ContainerNode; class DataGridColumn; class Document; class Element; @@ -298,7 +299,7 @@ public: Element* m_element; StyledElement* m_styledElement; EInsideLink m_elementLinkState; - Node* m_parentNode; + ContainerNode* m_parentNode; CSSValue* m_lineHeightValue; bool m_fontDirty; bool m_matchAuthorAndUserStyles; diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl index 0fd1f08..8810e8d 100644 --- a/WebCore/css/makeprop.pl +++ b/WebCore/css/makeprop.pl @@ -95,6 +95,12 @@ print HEADER "const int firstCSSProperty = $first;\n"; print HEADER "const int numCSSProperties = $num;\n"; print HEADER "const size_t maxCSSPropertyNameLength = $maxLen;\n"; +print HEADER "const char* const propertyNameStrings[$num] = {\n"; +foreach my $name (@names) { + print HEADER "\"$name\",\n"; +} +print HEADER "};\n"; + print HEADER << "EOF"; const char* getPropertyName(CSSPropertyID); @@ -108,14 +114,8 @@ close HEADER; system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?"; open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing"; -print C "static const char * const propertyNameStrings[$num] = {\n"; - -foreach my $name (@names) { - print C "\"$name\",\n"; -} - print C << "EOF"; -}; + const char* getPropertyName(CSSPropertyID id) { if (id < firstCSSProperty) |