From 54cdeeebc7adcbcd900e8b6a141a8cae27d9a631 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 10 Jun 2011 16:52:27 +0100 Subject: Merge WebKit at branches/chromium/742 r88085: Initial merge by git. Change-Id: I0501b484b9528e31b0026e5ad64416dd6541cdde --- Source/WebCore/css/CSSComputedStyleDeclaration.h | 8 +--- Source/WebCore/css/CSSMutableStyleDeclaration.cpp | 12 ----- Source/WebCore/css/CSSMutableStyleDeclaration.h | 2 - Source/WebCore/css/CSSMutableValue.h | 54 ---------------------- Source/WebCore/css/CSSParser.cpp | 11 +++-- Source/WebCore/css/CSSStyleDeclaration.cpp | 26 +---------- Source/WebCore/css/CSSValue.h | 2 - .../WebCore/css/SVGCSSComputedStyleDeclaration.cpp | 19 ++------ Source/WebCore/css/SVGCSSStyleSelector.cpp | 33 +++---------- Source/WebCore/css/mediaControlsChromium.css | 11 ++++- 10 files changed, 33 insertions(+), 145 deletions(-) delete mode 100644 Source/WebCore/css/CSSMutableValue.h (limited to 'Source/WebCore/css') diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.h b/Source/WebCore/css/CSSComputedStyleDeclaration.h index 4bf5a03..718eb2d 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.h +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.h @@ -22,9 +22,9 @@ #define CSSComputedStyleDeclaration_h #include "CSSStyleDeclaration.h" +#include "PlatformString.h" #include "RenderStyleConstants.h" #include -#include namespace WebCore { @@ -34,7 +34,6 @@ class CSSPrimitiveValue; class Node; class RenderStyle; class ShadowData; -class SVGPaint; enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; @@ -77,10 +76,7 @@ private: PassRefPtr valueForShadow(const ShadowData*, int, RenderStyle*) const; PassRefPtr currentColorOrValidColor(RenderStyle*, const Color&) const; -#if ENABLE(SVG) - PassRefPtr adjustSVGPaintForCurrentColor(PassRefPtr, RenderStyle*) const; -#endif - + RefPtr m_node; PseudoId m_pseudoElementSpecifier; bool m_allowVisitedStyle; diff --git a/Source/WebCore/css/CSSMutableStyleDeclaration.cpp b/Source/WebCore/css/CSSMutableStyleDeclaration.cpp index 8c8d5ba..ba3332d 100644 --- a/Source/WebCore/css/CSSMutableStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSMutableStyleDeclaration.cpp @@ -23,7 +23,6 @@ #include "CSSMutableStyleDeclaration.h" #include "CSSImageValue.h" -#include "CSSMutableValue.h" #include "CSSParser.h" #include "CSSPropertyLonghand.h" #include "CSSPropertyNames.h" @@ -97,17 +96,6 @@ CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CS } } -CSSMutableStyleDeclaration::~CSSMutableStyleDeclaration() -{ - const CSSMutableStyleDeclarationConstIterator end = this->end(); - for (CSSMutableStyleDeclarationConstIterator it = begin(); it != end; ++it) { - CSSValue* value = it->value(); - if (!value || !value->isMutableValue()) - continue; - static_cast(value)->setNode(0); - } -} - CSSMutableStyleDeclaration& CSSMutableStyleDeclaration::operator=(const CSSMutableStyleDeclaration& other) { ASSERT(!m_iteratorCount); diff --git a/Source/WebCore/css/CSSMutableStyleDeclaration.h b/Source/WebCore/css/CSSMutableStyleDeclaration.h index ea8ab3f..fb1e792 100644 --- a/Source/WebCore/css/CSSMutableStyleDeclaration.h +++ b/Source/WebCore/css/CSSMutableStyleDeclaration.h @@ -57,8 +57,6 @@ private: class CSSMutableStyleDeclaration : public CSSStyleDeclaration { public: - virtual ~CSSMutableStyleDeclaration(); - static PassRefPtr create() { return adoptRef(new CSSMutableStyleDeclaration); diff --git a/Source/WebCore/css/CSSMutableValue.h b/Source/WebCore/css/CSSMutableValue.h deleted file mode 100644 index 8a3aa72..0000000 --- a/Source/WebCore/css/CSSMutableValue.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) Research In Motion Limited 2011. 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 - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef CSSMutableValue_h -#define CSSMutableValue_h - -#include "CSSValue.h" -#include "Node.h" - -namespace WebCore { - -class CSSMutableValue : public CSSValue { -public: - CSSMutableValue() - : m_node(0) - { - } - - virtual ~CSSMutableValue() { } - virtual bool isMutableValue() const { return true; } - - Node* node() const { return m_node; } - void setNode(Node* node) { m_node = node; } - - void setNeedsStyleRecalc() - { - if (!m_node) - return; - m_node->setNeedsStyleRecalc(FullStyleChange); - } - -private: - Node* m_node; -}; - -} // namespace WebCore - -#endif // CSSMutableValue_h diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index b7030b2..7db8389 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -4252,6 +4252,9 @@ static bool parseColorIntOrPercentage(const UChar*& string, const UChar* end, co localValue = newValue; } + if (current == end) + return false; + if (expect == CSSPrimitiveValue::CSS_NUMBER && (*current == '.' || *current == '%')) return false; @@ -6429,9 +6432,11 @@ CSSRule* CSSParser::createFontFaceRule() if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) { RefPtr value = property->m_value.release(); property->m_value = CSSValueList::createCommaSeparated(); - static_cast(property->m_value.get())->append(value.release()); - } else if (id == CSSPropertyFontFamily && static_cast(property->m_value.get())->length() != 1) { - // Unlike font-family property, font-family descriptor in @font-face rule can take only one family name. + static_cast(property->value())->append(value.release()); + } else if (id == CSSPropertyFontFamily && (!property->value()->isValueList() || static_cast(property->value())->length() != 1)) { + // Unlike font-family property, font-family descriptor in @font-face rule + // has to be a value list with exactly one family name. It cannot have a + // have 'initial' value and cannot 'inherit' from parent. // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc clearProperties(); return 0; diff --git a/Source/WebCore/css/CSSStyleDeclaration.cpp b/Source/WebCore/css/CSSStyleDeclaration.cpp index 67dc6e0..1c465e5 100644 --- a/Source/WebCore/css/CSSStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSStyleDeclaration.cpp @@ -22,13 +22,10 @@ #include "CSSStyleDeclaration.h" #include "CSSMutableStyleDeclaration.h" -#include "CSSMutableValue.h" #include "CSSParser.h" #include "CSSProperty.h" #include "CSSPropertyNames.h" #include "CSSRule.h" -#include "Node.h" -#include "SVGElement.h" #include using namespace WTF; @@ -45,28 +42,7 @@ PassRefPtr CSSStyleDeclaration::getPropertyCSSValue(const String& prop int propID = cssPropertyID(propertyName); if (!propID) return 0; - - // Short-cut, not involving any change to the refcount. - if (!isMutableStyleDeclaration()) - return getPropertyCSSValue(propID); - - // Slow path. - RefPtr value = getPropertyCSSValue(propID); - if (!value || !value->isMutableValue()) - return value.release(); - - Node* node = static_cast(this)->node(); - if (!node || !node->isStyledElement()) - return value.release(); - - Node* associatedNode = static_cast(value.get())->node(); - if (associatedNode) { - ASSERT(associatedNode == node); - return value.release(); - } - - static_cast(value.get())->setNode(node); - return value.release(); + return getPropertyCSSValue(propID); } String CSSStyleDeclaration::getPropertyValue(const String &propertyName) diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h index de46ff9..da2c582 100644 --- a/Source/WebCore/css/CSSValue.h +++ b/Source/WebCore/css/CSSValue.h @@ -50,8 +50,6 @@ public: virtual String cssText() const = 0; void setCssText(const String&, ExceptionCode&) { } // FIXME: Not implemented. - virtual bool isMutableValue() const { return false; } - virtual bool isBorderImageValue() const { return false; } virtual bool isCursorImageValue() const { return false; } virtual bool isFontFamilyValue() const { return false; } diff --git a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp index 5dfe03e..0cf6181 100644 --- a/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp @@ -27,7 +27,6 @@ #include "CSSPropertyNames.h" #include "Document.h" #include "RenderStyle.h" -#include "SVGPaint.h" namespace WebCore { @@ -60,14 +59,6 @@ static PassRefPtr strokeDashArrayToCSSValueList(const Vector CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor(PassRefPtr newPaint, RenderStyle* style) const -{ - RefPtr paint = newPaint; - if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) - paint->setColor(style->color()); - return paint.release(); -} - PassRefPtr CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int propertyID, EUpdateLayout updateLayout) const { Node* node = m_node.get(); @@ -136,13 +127,13 @@ PassRefPtr CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro return CSSPrimitiveValue::create(svgStyle->filterResource(), CSSPrimitiveValue::CSS_URI); return CSSPrimitiveValue::createIdentifier(CSSValueNone); case CSSPropertyFloodColor: - return currentColorOrValidColor(style, svgStyle->floodColor()); + return CSSPrimitiveValue::createColor(svgStyle->floodColor().rgb()); case CSSPropertyLightingColor: - return currentColorOrValidColor(style, svgStyle->lightingColor()); + return CSSPrimitiveValue::createColor(svgStyle->lightingColor().rgb()); case CSSPropertyStopColor: - return currentColorOrValidColor(style, svgStyle->stopColor()); + return CSSPrimitiveValue::createColor(svgStyle->stopColor().rgb()); case CSSPropertyFill: - return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle->fillPaintType(), svgStyle->fillPaintUri(), svgStyle->fillPaintColor()), style); + return svgStyle->fillPaint(); case CSSPropertyKerning: return SVGLength::toCSSPrimitiveValue(svgStyle->kerning()); case CSSPropertyMarkerEnd: @@ -158,7 +149,7 @@ PassRefPtr CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro return CSSPrimitiveValue::create(svgStyle->markerStartResource(), CSSPrimitiveValue::CSS_URI); return CSSPrimitiveValue::createIdentifier(CSSValueNone); case CSSPropertyStroke: - return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle->strokePaintType(), svgStyle->strokePaintUri(), svgStyle->strokePaintColor()), style); + return svgStyle->strokePaint(); case CSSPropertyStrokeDasharray: return strokeDashArrayToCSSValueList(svgStyle->strokeDashArray()); case CSSPropertyStrokeDashoffset: diff --git a/Source/WebCore/css/SVGCSSStyleSelector.cpp b/Source/WebCore/css/SVGCSSStyleSelector.cpp index 47e3fc3..64665d4 100644 --- a/Source/WebCore/css/SVGCSSStyleSelector.cpp +++ b/Source/WebCore/css/SVGCSSStyleSelector.cpp @@ -231,36 +231,17 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value) // end of ident only properties case CSSPropertyFill: { - if (isInherit) { - const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); - svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri()); - return; - } - if (isInitial) { - svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri()); - return; - } - if (value->isSVGPaint()) { - SVGPaint* svgPaint = static_cast(value); - svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri()); - } + HANDLE_INHERIT_AND_INITIAL(fillPaint, FillPaint) + if (value->isSVGPaint()) + svgstyle->setFillPaint(static_cast(value)); break; } case CSSPropertyStroke: { - if (isInherit) { - const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); - svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri()); - return; - } - if (isInitial) { - svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri()); - return; - } - if (value->isSVGPaint()) { - SVGPaint* svgPaint = static_cast(value); - svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri()); - } + HANDLE_INHERIT_AND_INITIAL(strokePaint, StrokePaint) + if (value->isSVGPaint()) + svgstyle->setStrokePaint(static_cast(value)); + break; } case CSSPropertyStrokeWidth: diff --git a/Source/WebCore/css/mediaControlsChromium.css b/Source/WebCore/css/mediaControlsChromium.css index 60c7d62..9ba44ec 100644 --- a/Source/WebCore/css/mediaControlsChromium.css +++ b/Source/WebCore/css/mediaControlsChromium.css @@ -103,6 +103,10 @@ audio::-webkit-media-controls-current-time-display, video::-webkit-media-control overflow: hidden; cursor: default; + position: absolute; + top: 6px; + right: 0; + line-height: 21px; height: 20px; width: 58px; @@ -156,8 +160,13 @@ audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline { box-sizing: border-box; -webkit-box-flex: 1; + position: absolute; + top: 7px; + left: 6px; + right: 64px; + padding: 0px; - margin: 0px 6px; + margin: 0px; height: 18px; border-color: rgba(255, 255, 255, 0.2); -- cgit v1.1