diff options
Diffstat (limited to 'WebCore/css')
29 files changed, 196 insertions, 85 deletions
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp index 06779a9..c4ccdb3 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -691,9 +691,13 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper if (!style) return 0; +<<<<<<< HEAD #ifdef ANDROID_LAYOUT const Settings * settings = node->document()->frame() ? node->document()->frame()->settings() : 0; #endif +======= + propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction()); +>>>>>>> webkit.org at r63173 switch (static_cast<CSSPropertyID>(propertyID)) { case CSSPropertyInvalid: @@ -1480,6 +1484,14 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyTextUnderlineWidth: break; + /* Directional properties are resolved by resolveDirectionAwareProperty() before the switch. */ + case CSSPropertyWebkitMarginEnd: + case CSSPropertyWebkitMarginStart: + case CSSPropertyWebkitPaddingEnd: + case CSSPropertyWebkitPaddingStart: + ASSERT_NOT_REACHED(); + break; + /* Unimplemented @font-face properties */ case CSSPropertyFontStretch: case CSSPropertySrc: @@ -1505,13 +1517,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyWebkitColumns: case CSSPropertyWebkitColumnRule: case CSSPropertyWebkitMarginCollapse: - case CSSPropertyWebkitMarginStart: case CSSPropertyWebkitMarquee: case CSSPropertyWebkitMarqueeSpeed: case CSSPropertyWebkitMask: case CSSPropertyWebkitMaskRepeatX: case CSSPropertyWebkitMaskRepeatY: - case CSSPropertyWebkitPaddingStart: case CSSPropertyWebkitPerspectiveOriginX: case CSSPropertyWebkitPerspectiveOriginY: case CSSPropertyWebkitTextStroke: diff --git a/WebCore/css/CSSComputedStyleDeclaration.h b/WebCore/css/CSSComputedStyleDeclaration.h index a2e8ba7..816d15a 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.h +++ b/WebCore/css/CSSComputedStyleDeclaration.h @@ -22,14 +22,17 @@ #define CSSComputedStyleDeclaration_h #include "CSSStyleDeclaration.h" -#include "Node.h" +#include "PlatformString.h" #include "RenderStyleConstants.h" +#include <wtf/RefPtr.h> namespace WebCore { class Color; class CSSMutableStyleDeclaration; class CSSPrimitiveValue; +class Node; +class RenderStyle; class ShadowData; enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp index 921b149..00dfcba 100644 --- a/WebCore/css/CSSFontFaceSource.cpp +++ b/WebCore/css/CSSFontFaceSource.cpp @@ -42,6 +42,7 @@ #include "HTMLNames.h" #include "SVGFontData.h" #include "SVGFontElement.h" +#include "SVGFontFaceElement.h" #include "SVGURIReference.h" #endif @@ -187,9 +188,10 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri fontData.set(new SimpleFontData(tempData->platformData(), true, true)); } - m_fontDataTable.set(hashKey, fontData.get()); - return fontData.release(); -} + SimpleFontData* fontDataRawPtr = fontData.leakPtr(); + m_fontDataTable.set(hashKey, fontDataRawPtr); + return fontDataRawPtr; } +} diff --git a/WebCore/css/CSSFontFaceSource.h b/WebCore/css/CSSFontFaceSource.h index c6baef2..278ba72 100644 --- a/WebCore/css/CSSFontFaceSource.h +++ b/WebCore/css/CSSFontFaceSource.h @@ -31,10 +31,6 @@ #include "CachedResourceHandle.h" #include <wtf/HashMap.h> -#if ENABLE(SVG_FONTS) -#include "SVGFontFaceElement.h" -#endif - namespace WebCore { class CachedFont; @@ -42,6 +38,11 @@ class CSSFontFace; class CSSFontSelector; class FontDescription; class SimpleFontData; +#if ENABLE(SVG_FONTS) +class SVGFontElement; +class SVGFontFaceElement; +#endif + class CSSFontFaceSource : public CachedResourceClient { public: diff --git a/WebCore/css/CSSHelper.cpp b/WebCore/css/CSSHelper.cpp index a0daebd..e0ce7c3 100644 --- a/WebCore/css/CSSHelper.cpp +++ b/WebCore/css/CSSHelper.cpp @@ -79,8 +79,10 @@ String deprecatedParseURL(const String& url) // Optimize for the likely case there there is nothing to strip. if (l == length) { int k; + // If the URL has any control characters in it, we have to strip them. + // '\r' (ascii value 13) is the largest control character. for (k = 0; k < length; k++) { - if (characters[k] > '\r') + if (characters[k] <= '\r') break; } if (k == length) diff --git a/WebCore/css/CSSImportRule.idl b/WebCore/css/CSSImportRule.idl index 8e60905..05654fe 100644 --- a/WebCore/css/CSSImportRule.idl +++ b/WebCore/css/CSSImportRule.idl @@ -23,7 +23,7 @@ module css { // Introduced in DOM Level 2: interface CSSImportRule : CSSRule { readonly attribute [ConvertNullStringTo=Null] DOMString href; - readonly attribute stylesheets::MediaList media; + readonly attribute MediaList media; readonly attribute CSSStyleSheet styleSheet; }; diff --git a/WebCore/css/CSSMediaRule.idl b/WebCore/css/CSSMediaRule.idl index 813bd70..4b75f49 100644 --- a/WebCore/css/CSSMediaRule.idl +++ b/WebCore/css/CSSMediaRule.idl @@ -22,7 +22,7 @@ module css { // Introduced in DOM Level 2: interface CSSMediaRule : CSSRule { - readonly attribute stylesheets::MediaList media; + readonly attribute MediaList media; readonly attribute CSSRuleList cssRules; [OldStyleObjC] unsigned long insertRule(in DOMString rule, diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index 087018b..be410b4 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -155,8 +155,8 @@ CSSParser::CSSParser(bool strictParsing) , m_ruleRanges(0) , m_data(0) , yy_start(1) - , m_line(0) - , m_lastSelectorLine(0) + , m_lineNumber(0) + , m_lastSelectorLineNumber(0) , m_allowImportRules(true) , m_allowVariablesRules(true) , m_allowNamespaceDeclarations(true) @@ -235,7 +235,7 @@ void CSSParser::setupParser(const char* prefix, const String& string, const char resetRuleBodyMarks(); } -void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, StyleRuleRanges* ruleRangeMap) +void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, int startLineNumber, StyleRuleRanges* ruleRangeMap) { #ifdef ANDROID_INSTRUMENT android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); @@ -244,6 +244,7 @@ void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string, StyleRule m_defaultNamespace = starAtom; // Reset the default namespace. m_ruleRanges = ruleRangeMap; + m_lineNumber = startLineNumber; setupParser("", string, ""); cssyyparse(this); m_ruleRanges = 0; @@ -318,21 +319,21 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int id, cons // possible to set up a default color. bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict) { + // First try creating a color specified by name, rgb() or "#" syntax. + if (parseColor(string, color, strict)) + return true; + CSSParser parser(true); + RefPtr<CSSMutableStyleDeclaration> dummyStyleDeclaration = CSSMutableStyleDeclaration::create(); - // First try creating a color specified by name or the "#" syntax. - if (!parser.parseColor(string, color, strict)) { - RefPtr<CSSMutableStyleDeclaration> dummyStyleDeclaration = CSSMutableStyleDeclaration::create(); + // Now try to create a color from rgba() syntax. + if (!parser.parseColor(dummyStyleDeclaration.get(), string)) + return false; - // Now try to create a color from the rgb() or rgba() syntax. - if (parser.parseColor(dummyStyleDeclaration.get(), string)) { - CSSValue* value = parser.m_parsedProperties[0]->value(); - if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE) { - CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); - color = primitiveValue->getRGBA32Value(); - } - } else - return false; + CSSValue* value = parser.m_parsedProperties[0]->value(); + if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE) { + CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); + color = primitiveValue->getRGBA32Value(); } return true; @@ -439,9 +440,9 @@ void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool importa if (m_maxParsedProperties > UINT_MAX / sizeof(CSSProperty*)) return; m_parsedProperties = static_cast<CSSProperty**>(fastRealloc(m_parsedProperties, - m_maxParsedProperties * sizeof(CSSProperty*))); + m_maxParsedProperties * sizeof(CSSProperty*))); } - m_parsedProperties[m_numParsedProperties++] = prop.release(); + m_parsedProperties[m_numParsedProperties++] = prop.leakPtr(); } void CSSParser::rollbackLastProperties(int num) @@ -1038,6 +1039,7 @@ bool CSSParser::parseValue(int propId, bool important) case CSSPropertyPaddingBottom: // <length> | <percentage> case CSSPropertyPaddingLeft: //// case CSSPropertyWebkitPaddingStart: + case CSSPropertyWebkitPaddingEnd: validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict)); break; @@ -1098,6 +1100,7 @@ bool CSSParser::parseValue(int propId, bool important) case CSSPropertyMarginBottom: // <length> | <percentage> | auto | inherit case CSSPropertyMarginLeft: //// case CSSPropertyWebkitMarginStart: + case CSSPropertyWebkitMarginEnd: if (id == CSSValueAuto) validPrimitive = true; else @@ -3644,7 +3647,14 @@ bool CSSParser::parseFontFaceUnicodeRange() { RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated(); bool failed = false; - while (m_valueList->current()) { + bool operatorExpected = false; + for (; m_valueList->current(); m_valueList->next(), operatorExpected = !operatorExpected) { + if (operatorExpected) { + if (m_valueList->current()->unit == CSSParserValue::Operator && m_valueList->current()->iValue == ',') + continue; + failed = true; + break; + } if (m_valueList->current()->unit != CSSPrimitiveValue::CSS_UNICODE_RANGE) { failed = true; break; @@ -3719,7 +3729,6 @@ bool CSSParser::parseFontFaceUnicodeRange() } if (from <= to) values->append(CSSUnicodeRangeValue::create(from, to)); - m_valueList->next(); } if (failed || !values->length()) return false; @@ -3768,13 +3777,23 @@ static inline bool parseColorInt(const UChar*& string, const UChar* end, UChar t bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict) { - if (!strict && Color::parseHexColor(name, rgb)) - return true; + const UChar* characters = name.characters(); + unsigned length = name.length(); + + if (!strict && length >= 3) { + if (name[0] == '#') { + if (Color::parseHexColor(characters + 1, length - 1, rgb)) + return true; + } else { + if (Color::parseHexColor(characters, length, rgb)) + return true; + } + } // Try rgb() syntax. if (name.startsWith("rgb(")) { - const UChar* current = name.characters() + 4; - const UChar* end = name.characters() + name.length(); + const UChar* current = characters + 4; + const UChar* end = characters + length; int red; int green; int blue; @@ -5167,7 +5186,7 @@ void CSSParser::countLines() { for (UChar* current = yytext; current < yytext + yyleng; ++current) { if (*current == '\n') - ++m_line; + ++m_lineNumber; } } @@ -5341,7 +5360,7 @@ CSSRule* CSSParser::createStyleRule(Vector<CSSSelector*>* selectors) CSSStyleRule* result = 0; markRuleBodyEnd(); if (selectors) { - RefPtr<CSSStyleRule> rule = CSSStyleRule::create(m_styleSheet, m_lastSelectorLine); + RefPtr<CSSStyleRule> rule = CSSStyleRule::create(m_styleSheet, m_lastSelectorLineNumber); rule->adoptSelectorVector(*selectors); if (m_hasFontFaceOnlyValues) deleteFontFaceOnlyValues(); @@ -5447,7 +5466,7 @@ CSSRule* CSSParser::createPageRule(CSSSelector* pageSelector) m_allowImportRules = m_allowNamespaceDeclarations = m_allowVariablesRules = false; CSSPageRule* pageRule = 0; if (pageSelector) { - RefPtr<CSSPageRule> rule = CSSPageRule::create(m_styleSheet, pageSelector, m_lastSelectorLine); + RefPtr<CSSPageRule> rule = CSSPageRule::create(m_styleSheet, pageSelector, m_lastSelectorLineNumber); rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties)); pageRule = rule.get(); m_parsedStyleObjects.append(rule.release()); @@ -5601,7 +5620,7 @@ void CSSParser::invalidBlockHit() void CSSParser::updateLastSelectorLineAndPosition() { - m_lastSelectorLine = m_line; + m_lastSelectorLineNumber = m_lineNumber; markRuleBodyStart(); } diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h index 81b1ae2..5d76a41 100644 --- a/WebCore/css/CSSParser.h +++ b/WebCore/css/CSSParser.h @@ -60,7 +60,7 @@ namespace WebCore { CSSParser(bool strictParsing = true); ~CSSParser(); - void parseSheet(CSSStyleSheet*, const String&, StyleRuleRanges* ruleRangeMap = 0); + void parseSheet(CSSStyleSheet*, const String&, int startLineNumber = 0, StyleRuleRanges* ruleRangeMap = 0); PassRefPtr<CSSRule> parseRule(CSSStyleSheet*, const String&); PassRefPtr<CSSRule> parseKeyframeRule(CSSStyleSheet*, const String&); bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important); @@ -288,8 +288,8 @@ namespace WebCore { int yyleng; int yyTok; int yy_start; - int m_line; - int m_lastSelectorLine; + int m_lineNumber; + int m_lastSelectorLineNumber; bool m_allowImportRules; bool m_allowVariablesRules; diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h index baa1ab8..9533f68 100644 --- a/WebCore/css/CSSPrimitiveValueMappings.h +++ b/WebCore/css/CSSPrimitiveValueMappings.h @@ -36,7 +36,6 @@ #include "FontSmoothingMode.h" #include "GraphicsTypes.h" #include "Path.h" -#include "RenderStyleConstants.h" #include "SVGRenderStyleDefs.h" #include "TextDirection.h" #include "TextRenderingMode.h" @@ -253,6 +252,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) case MediaVolumeSliderPart: m_value.ident = CSSValueMediaVolumeSlider; break; + case MediaVolumeSliderMuteButtonPart: + m_value.ident = CSSValueMediaVolumeSliderMuteButton; + break; case MediaVolumeSliderThumbPart: m_value.ident = CSSValueMediaVolumeSliderthumb; break; diff --git a/WebCore/css/CSSProperty.cpp b/WebCore/css/CSSProperty.cpp index d7f2175..777c0c0 100644 --- a/WebCore/css/CSSProperty.cpp +++ b/WebCore/css/CSSProperty.cpp @@ -38,4 +38,20 @@ bool operator==(const CSSProperty& a, const CSSProperty& b) return a.m_id == b.m_id && a.m_important == b.m_important && a.m_value == b.m_value; } +int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection direction) +{ + switch (static_cast<CSSPropertyID>(propertyID)) { + case CSSPropertyWebkitMarginEnd: + return direction == LTR ? CSSPropertyMarginRight : CSSPropertyMarginLeft; + case CSSPropertyWebkitMarginStart: + return direction == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight; + case CSSPropertyWebkitPaddingEnd: + return direction == LTR ? CSSPropertyPaddingRight : CSSPropertyPaddingLeft; + case CSSPropertyWebkitPaddingStart: + return direction == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight; + default: + return propertyID; + } +} + } // namespace WebCore diff --git a/WebCore/css/CSSProperty.h b/WebCore/css/CSSProperty.h index 4505f33..7a3da68 100644 --- a/WebCore/css/CSSProperty.h +++ b/WebCore/css/CSSProperty.h @@ -22,6 +22,7 @@ #define CSSProperty_h #include "CSSValue.h" +#include "TextDirection.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> @@ -58,6 +59,8 @@ public: String cssText() const; + static int resolveDirectionAwareProperty(int propertyID, TextDirection); + friend bool operator==(const CSSProperty&, const CSSProperty&); // Make sure the following fits in 4 bytes. Really. diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in index 9c65971..a330abe 100644 --- a/WebCore/css/CSSPropertyNames.in +++ b/WebCore/css/CSSPropertyNames.in @@ -19,6 +19,7 @@ font-size font-style font-variant font-weight +text-rendering -webkit-text-size-adjust zoom @@ -134,7 +135,6 @@ text-overline-color text-overline-mode text-overline-style text-overline-width -text-rendering text-shadow text-transform text-underline @@ -215,6 +215,7 @@ z-index -webkit-line-clamp -webkit-margin-bottom-collapse -webkit-margin-collapse +-webkit-margin-end -webkit-margin-start -webkit-margin-top-collapse -webkit-marquee @@ -239,6 +240,7 @@ z-index -webkit-mask-size -webkit-match-nearest-mail-blockquote-color -webkit-nbsp-mode +-webkit-padding-end -webkit-padding-start -webkit-perspective -webkit-perspective-origin diff --git a/WebCore/css/CSSSegmentedFontFace.cpp b/WebCore/css/CSSSegmentedFontFace.cpp index c3e3fd0..b13dd9c 100644 --- a/WebCore/css/CSSSegmentedFontFace.cpp +++ b/WebCore/css/CSSSegmentedFontFace.cpp @@ -110,15 +110,15 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti FontTraitsMask traitsMask = m_fontFaces[i]->traitsMask(); bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)); bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask); - if (const FontData* faceFontData = m_fontFaces[i]->getFontData(fontDescription, syntheticBold, syntheticItalic)) { + if (const SimpleFontData* faceFontData = m_fontFaces[i]->getFontData(fontDescription, syntheticBold, syntheticItalic)) { ASSERT(!faceFontData->isSegmented()); const Vector<CSSFontFace::UnicodeRange>& ranges = m_fontFaces[i]->ranges(); unsigned numRanges = ranges.size(); if (!numRanges) - fontData->appendRange(FontDataRange(0, 0x7FFFFFFF, static_cast<const SimpleFontData*>(faceFontData))); + fontData->appendRange(FontDataRange(0, 0x7FFFFFFF, faceFontData)); else { for (unsigned j = 0; j < numRanges; ++j) - fontData->appendRange(FontDataRange(ranges[j].from(), ranges[j].to(), static_cast<const SimpleFontData*>(faceFontData))); + fontData->appendRange(FontDataRange(ranges[j].from(), ranges[j].to(), faceFontData)); } } } diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp index ddf1737..47ead5f 100644 --- a/WebCore/css/CSSSelector.cpp +++ b/WebCore/css/CSSSelector.cpp @@ -3,7 +3,7 @@ * 1999 Waldo Bastian (bastian@kde.org) * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch) * 2001-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2008 David Smith (catfish.man@gmail.com) * Copyright (C) 2010 Google Inc. All rights reserved. * @@ -140,6 +140,8 @@ PseudoId CSSSelector::pseudoId(PseudoType type) return MEDIA_CONTROLS_TIMELINE; case PseudoMediaControlsVolumeSlider: return MEDIA_CONTROLS_VOLUME_SLIDER; + case PseudoMediaControlsVolumeSliderMuteButton: + return MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON; case PseudoMediaControlsSeekBackButton: return MEDIA_CONTROLS_SEEK_BACK_BUTTON; case PseudoMediaControlsSeekForwardButton: @@ -324,6 +326,7 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( DEFINE_STATIC_LOCAL(AtomicString, mediaControlsPlayButton, ("-webkit-media-controls-play-button")); DEFINE_STATIC_LOCAL(AtomicString, mediaControlsTimeline, ("-webkit-media-controls-timeline")); DEFINE_STATIC_LOCAL(AtomicString, mediaControlsVolumeSlider, ("-webkit-media-controls-volume-slider")); + DEFINE_STATIC_LOCAL(AtomicString, mediaControlsVolumeSliderMuteButton, ("-webkit-media-controls-volume-slider-mute-button")); DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekBackButton, ("-webkit-media-controls-seek-back-button")); DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekForwardButton, ("-webkit-media-controls-seek-forward-button")); DEFINE_STATIC_LOCAL(AtomicString, mediaControlsRewindButton, ("-webkit-media-controls-rewind-button")); @@ -437,6 +440,7 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( nameToPseudoType->set(mediaControlsTimeRemainingDisplay.impl(), CSSSelector::PseudoMediaControlsTimeRemainingDisplay); nameToPseudoType->set(mediaControlsTimeline.impl(), CSSSelector::PseudoMediaControlsTimeline); nameToPseudoType->set(mediaControlsVolumeSlider.impl(), CSSSelector::PseudoMediaControlsVolumeSlider); + nameToPseudoType->set(mediaControlsVolumeSliderMuteButton.impl(), CSSSelector::PseudoMediaControlsVolumeSliderMuteButton); nameToPseudoType->set(mediaControlsSeekBackButton.impl(), CSSSelector::PseudoMediaControlsSeekBackButton); nameToPseudoType->set(mediaControlsSeekForwardButton.impl(), CSSSelector::PseudoMediaControlsSeekForwardButton); nameToPseudoType->set(mediaControlsRewindButton.impl(), CSSSelector::PseudoMediaControlsRewindButton); @@ -541,6 +545,7 @@ void CSSSelector::extractPseudoType() const case PseudoMediaControlsTimeRemainingDisplay: case PseudoMediaControlsTimeline: case PseudoMediaControlsVolumeSlider: + case PseudoMediaControlsVolumeSliderMuteButton: case PseudoMediaControlsSeekBackButton: case PseudoMediaControlsSeekForwardButton: case PseudoMediaControlsRewindButton: diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h index d55fafc..fc0dd7b 100644 --- a/WebCore/css/CSSSelector.h +++ b/WebCore/css/CSSSelector.h @@ -1,7 +1,7 @@ /* * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) * 1999 Waldo Bastian (bastian@kde.org) - * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -26,6 +26,7 @@ #include "QualifiedName.h" #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> namespace WebCore { @@ -176,6 +177,7 @@ namespace WebCore { PseudoMediaControlsPlayButton, PseudoMediaControlsTimelineContainer, PseudoMediaControlsVolumeSliderContainer, + PseudoMediaControlsVolumeSliderMuteButton, PseudoMediaControlsCurrentTimeDisplay, PseudoMediaControlsTimeRemainingDisplay, PseudoMediaControlsToggleClosedCaptions, @@ -283,11 +285,10 @@ namespace WebCore { void extractPseudoType() const; struct RareData : Noncopyable { - RareData(CSSSelector* tagHistory) + RareData(PassOwnPtr<CSSSelector> tagHistory) : m_a(0) , m_b(0) , m_tagHistory(tagHistory) - , m_simpleSelector(0) , m_attribute(anyQName()) , m_argument(nullAtom) { @@ -308,7 +309,7 @@ namespace WebCore { { if (m_hasRareData) return; - m_data.m_rareData = new RareData(m_data.m_tagHistory); + m_data.m_rareData = new RareData(adoptPtr(m_data.m_tagHistory)); m_hasRareData = true; } diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp index 750988e..44d9e66 100644 --- a/WebCore/css/CSSStyleSelector.cpp +++ b/WebCore/css/CSSStyleSelector.cpp @@ -1038,7 +1038,7 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n) if (classesMatch) { bool mappedAttrsMatch = true; if (s->hasMappedAttributes()) - mappedAttrsMatch = s->mappedAttributes()->mappedMapsEquivalent(m_styledElement->mappedAttributes()); + mappedAttrsMatch = s->attributeMap()->mappedMapsEquivalent(m_styledElement->attributeMap()); if (mappedAttrsMatch) { if (s->isLink()) { if (m_elementLinkState != style->insideLink()) @@ -1258,7 +1258,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl // Ask if the HTML element has mapped attributes. if (m_styledElement->hasMappedAttributes()) { // Walk our attribute list and add in each decl. - const NamedNodeMap* map = m_styledElement->mappedAttributes(); + const NamedNodeMap* map = m_styledElement->attributeMap(); for (unsigned i = 0; i < map->length(); i++) { Attribute* attr = map->attributeItem(i); if (attr->isMappedAttribute() && attr->decl()) { @@ -2920,7 +2920,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e if (applyFirst) { COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property); - COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 10, CSS_zoom_is_end_of_first_prop_range); + COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 11, CSS_zoom_is_end_of_first_prop_range); COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyZoom + 1, CSS_line_height_is_after_zoom); // give special priority to font-xxx, color properties, etc @@ -3108,11 +3108,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) bool isInherit = m_parentNode && valueType == CSSValue::CSS_INHERIT; bool isInitial = valueType == CSSValue::CSS_INITIAL || (!m_parentNode && valueType == CSSValue::CSS_INHERIT); - // These properties are used to set the correct margins/padding on RTL lists. - if (id == CSSPropertyWebkitMarginStart) - id = m_style->direction() == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight; - else if (id == CSSPropertyWebkitPaddingStart) - id = m_style->direction() == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight; + id = CSSProperty::resolveDirectionAwareProperty(id, m_style->direction()); if (m_checker.m_matchVisitedPseudoClass && !isValidVisitedLinkProperty(id)) { // Limit the properties that can be applied to only the ones honored by :visited. @@ -5502,7 +5498,9 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) case CSSPropertyTextUnderlineStyle: case CSSPropertyTextUnderlineWidth: case CSSPropertyWebkitFontSizeDelta: + case CSSPropertyWebkitMarginEnd: case CSSPropertyWebkitMarginStart: + case CSSPropertyWebkitPaddingEnd: case CSSPropertyWebkitPaddingStart: case CSSPropertyWebkitTextDecorationsInEffect: case CSSPropertyWebkitTextStroke: diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp index 227d37c..1ef1c2b 100644 --- a/WebCore/css/CSSStyleSheet.cpp +++ b/WebCore/css/CSSStyleSheet.cpp @@ -183,9 +183,14 @@ const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix bool CSSStyleSheet::parseString(const String &string, bool strict) { + return parseStringAtLine(string, strict, 0); +} + +bool CSSStyleSheet::parseStringAtLine(const String& string, bool strict, int startLineNumber) +{ setStrictParsing(strict); CSSParser p(strict); - p.parseSheet(this, string); + p.parseSheet(this, string, startLineNumber); return true; } diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h index 4c59144..fe82794 100644 --- a/WebCore/css/CSSStyleSheet.h +++ b/WebCore/css/CSSStyleSheet.h @@ -81,6 +81,8 @@ public: virtual bool parseString(const String&, bool strict = true); + bool parseStringAtLine(const String&, bool strict, int startLineNumber); + virtual bool isLoading(); virtual void checkLoaded(); diff --git a/WebCore/css/CSSStyleSheet.idl b/WebCore/css/CSSStyleSheet.idl index e180217..e488657 100644 --- a/WebCore/css/CSSStyleSheet.idl +++ b/WebCore/css/CSSStyleSheet.idl @@ -21,7 +21,7 @@ module css { // Introduced in DOM Level 2: - interface CSSStyleSheet : stylesheets::StyleSheet { + interface CSSStyleSheet : StyleSheet { readonly attribute CSSRule ownerRule; readonly attribute CSSRuleList cssRules; diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in index 3439878..d302990 100644 --- a/WebCore/css/CSSValueKeywords.in +++ b/WebCore/css/CSSValueKeywords.in @@ -583,6 +583,7 @@ media-sliderthumb media-volume-slider-container media-volume-slider media-volume-sliderthumb +media-volume-slider-mute-button media-controls-background media-current-time-display media-time-remaining-display diff --git a/WebCore/css/CSSVariablesRule.idl b/WebCore/css/CSSVariablesRule.idl index 780e84d..b7559f6 100644 --- a/WebCore/css/CSSVariablesRule.idl +++ b/WebCore/css/CSSVariablesRule.idl @@ -26,7 +26,7 @@ module css { interface CSSVariablesRule : CSSRule { - readonly attribute stylesheets::MediaList media; + readonly attribute MediaList media; readonly attribute CSSVariablesDeclaration variables; }; diff --git a/WebCore/css/MediaQuery.cpp b/WebCore/css/MediaQuery.cpp index 187a33d..b71706c 100644 --- a/WebCore/css/MediaQuery.cpp +++ b/WebCore/css/MediaQuery.cpp @@ -78,7 +78,7 @@ static bool expressionCompare(const MediaQueryExp* a, const MediaQueryExp* b) MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<Vector<MediaQueryExp*> > exprs) : m_restrictor(r) , m_mediaType(mediaType.lower()) - , m_expressions(exprs.release()) + , m_expressions(exprs) , m_ignored(false) { if (!m_expressions) { @@ -108,7 +108,6 @@ MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<Vector< MediaQuery::~MediaQuery() { deleteAllValues(*m_expressions); - delete m_expressions; } // http://dev.w3.org/csswg/cssom/#compare-media-queries diff --git a/WebCore/css/MediaQuery.h b/WebCore/css/MediaQuery.h index ccc59ac..3eea3b2 100644 --- a/WebCore/css/MediaQuery.h +++ b/WebCore/css/MediaQuery.h @@ -43,11 +43,11 @@ public: Only, Not, None }; - MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<Vector<MediaQueryExp*> > exprs); + MediaQuery(Restrictor, const String& mediaType, PassOwnPtr<Vector<MediaQueryExp*> > exprs); ~MediaQuery(); Restrictor restrictor() const { return m_restrictor; } - const Vector<MediaQueryExp*>* expressions() const { return m_expressions; } + const Vector<MediaQueryExp*>* expressions() const { return m_expressions.get(); } String mediaType() const { return m_mediaType; } bool operator==(const MediaQuery& other) const; String cssText() const; @@ -56,7 +56,7 @@ public: private: Restrictor m_restrictor; String m_mediaType; - Vector<MediaQueryExp*>* m_expressions; + OwnPtr<Vector<MediaQueryExp*> > m_expressions; bool m_ignored; String m_serializationCache; diff --git a/WebCore/css/StyleMedia.h b/WebCore/css/StyleMedia.h index 761e6a3..82c9eba 100644 --- a/WebCore/css/StyleMedia.h +++ b/WebCore/css/StyleMedia.h @@ -27,10 +27,12 @@ #ifndef StyleMedia_h #define StyleMedia_h -#include "DOMWindow.h" +#include "PlatformString.h" namespace WebCore { +class Frame; + class StyleMedia : public RefCounted<StyleMedia> { public: static PassRefPtr<StyleMedia> create(Frame* frame) diff --git a/WebCore/css/mathml.css b/WebCore/css/mathml.css index 7a9b348..ca9d7b0 100644 --- a/WebCore/css/mathml.css +++ b/WebCore/css/mathml.css @@ -5,6 +5,7 @@ math { display: inline-block; padding: 0px; margin: 0px; + text-align: left; vertical-align: baseline; line-height: 1.0; padding-left: 1px; @@ -17,10 +18,6 @@ math[display="block"] { margin-bottom: 1em; } -math * { - text-align: left; -} - math > * { vertical-align: baseline; } @@ -32,7 +29,7 @@ mrow, mfenced { padding-right: 1px; } -mi, mtext { +mi{ font-style: italic; padding-right: 0.1em; } @@ -97,15 +94,15 @@ math > mo, mrow > mo, mfenced > mo { padding-right: 0.05em; } -mo[mathsize="small"], mn[mathsize="small"], mi[mathsize="small"] { +math[mathsize="small"], mstyle[mathsize="small"], mo[mathsize="small"], mn[mathsize="small"], mi[mathsize="small"], mtext[mathsize="small"], mspace[mathsize="small"], ms[mathsize="small"]{ font-size: 0.75em; } -mo[mathsize="normal"],mn[mathsize="normal"],mi[mathsize="normal"] { +math[mathsize="normal"], mstyle[mathsize="normal"], mo[mathsize="normal"], mn[mathsize="normal"], mi[mathsize="normal"], mtext[mathsize="normal"], mspace[mathsize="normal"], ms[mathsize="normal"]{ font-size: 1em; } -mo[mathsize="big"], mn[mathsize="big"], mi[mathsize="big"] { +math[mathsize="big"], mstyle[mathsize="big"], mo[mathsize="big"], mn[mathsize="big"], mi[mathsize="big"], mtext[mathsize="big"], mspace[mathsize="big"], ms[mathsize="big"]{ font-size: 1.5em; } diff --git a/WebCore/css/mediaControls.css b/WebCore/css/mediaControls.css index de2c2fe..6a0f14b 100644 --- a/WebCore/css/mediaControls.css +++ b/WebCore/css/mediaControls.css @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -131,3 +131,8 @@ audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-medi width: 16px; height: 16px; } + +audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button { + -webkit-appearance: media-volume-slider-mute-button; + display: none; +} diff --git a/WebCore/css/mediaControlsQuickTime.css b/WebCore/css/mediaControlsQuickTime.css index 965685d..d2c731f 100644 --- a/WebCore/css/mediaControlsQuickTime.css +++ b/WebCore/css/mediaControlsQuickTime.css @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,7 @@ audio { audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel { /* In mediaControls.css */ -webkit-appearance: media-controls-background; + overflow: visible; height: 25px; } @@ -41,10 +42,11 @@ video:-webkit-full-page-media::-webkit-media-controls-panel { audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button { -webkit-box-ordinal-group: 2; /* Before the fullscreen button */ - width: 15px; - height: 14px; + + width: 14px; + height: 12px; margin-left: 2px; - margin-right: 8px; + margin-right: 9px; } audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button { @@ -185,3 +187,38 @@ audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-medi margin-right: 7px; -webkit-box-ordinal-group: 3; /* between mute and fullscreen */ } + +audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container { + -webkit-appearance: media-volume-slider-container; + position: absolute; + + top: 0; + left: 0; + + width: 22px; + height: 114px; +} + +audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider { + -webkit-appearance: media-volume-slider; + display: inline; + position: absolute; + + top: 7px; + left: 6px; + + width: 10px; + height: 80px; +} + +audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button { + -webkit-appearance: media-volume-slider-mute-button; + display: inline; + position: absolute; + + bottom: 5px; + left: 4px; + + width: 14px; + height: 12px; +} diff --git a/WebCore/css/themeWin.css b/WebCore/css/themeWin.css index a0170ac..f2ad669 100644 --- a/WebCore/css/themeWin.css +++ b/WebCore/css/themeWin.css @@ -78,8 +78,7 @@ input[type="search"]::-webkit-search-results-button { } input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button { - /* Matches Firefox */ - padding: 0 6px; + padding: 1px 6px; } /* Windows selects are not rounded. Custom borders for them shouldn't be either. */ |