summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-06-10 16:52:27 +0100
committerSteve Block <steveblock@google.com>2011-06-14 01:14:02 +0100
commit54cdeeebc7adcbcd900e8b6a141a8cae27d9a631 (patch)
tree845b0d338b204a48560eca3b51b34cf92ed96840 /Source/WebCore/css
parentd2c5226a647dc21d0c15267e09a3d19cf3e0d593 (diff)
downloadexternal_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.zip
external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.gz
external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.bz2
Merge WebKit at branches/chromium/742 r88085: Initial merge by git.
Change-Id: I0501b484b9528e31b0026e5ad64416dd6541cdde
Diffstat (limited to 'Source/WebCore/css')
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.h8
-rw-r--r--Source/WebCore/css/CSSMutableStyleDeclaration.cpp12
-rw-r--r--Source/WebCore/css/CSSMutableStyleDeclaration.h2
-rw-r--r--Source/WebCore/css/CSSMutableValue.h54
-rw-r--r--Source/WebCore/css/CSSParser.cpp11
-rw-r--r--Source/WebCore/css/CSSStyleDeclaration.cpp26
-rw-r--r--Source/WebCore/css/CSSValue.h2
-rw-r--r--Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp19
-rw-r--r--Source/WebCore/css/SVGCSSStyleSelector.cpp33
-rw-r--r--Source/WebCore/css/mediaControlsChromium.css11
10 files changed, 33 insertions, 145 deletions
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 <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
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<CSSValue> valueForShadow(const ShadowData*, int, RenderStyle*) const;
PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const;
-#if ENABLE(SVG)
- PassRefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, RenderStyle*) const;
-#endif
-
+
RefPtr<Node> 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<CSSMutableValue*>(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<CSSMutableStyleDeclaration> 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<CSSValue> value = property->m_value.release();
property->m_value = CSSValueList::createCommaSeparated();
- static_cast<CSSValueList*>(property->m_value.get())->append(value.release());
- } else if (id == CSSPropertyFontFamily && static_cast<CSSValueList*>(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<CSSValueList*>(property->value())->append(value.release());
+ } else if (id == CSSPropertyFontFamily && (!property->value()->isValueList() || static_cast<CSSValueList*>(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 <wtf/ASCIICType.h>
using namespace WTF;
@@ -45,28 +42,7 @@ PassRefPtr<CSSValue> 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<CSSValue> value = getPropertyCSSValue(propID);
- if (!value || !value->isMutableValue())
- return value.release();
-
- Node* node = static_cast<CSSMutableStyleDeclaration*>(this)->node();
- if (!node || !node->isStyledElement())
- return value.release();
-
- Node* associatedNode = static_cast<CSSMutableValue*>(value.get())->node();
- if (associatedNode) {
- ASSERT(associatedNode == node);
- return value.release();
- }
-
- static_cast<CSSMutableValue*>(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<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLength
return list.release();
}
-PassRefPtr<SVGPaint> CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const
-{
- RefPtr<SVGPaint> paint = newPaint;
- if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR)
- paint->setColor(style->color());
- return paint.release();
-}
-
PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int propertyID, EUpdateLayout updateLayout) const
{
Node* node = m_node.get();
@@ -136,13 +127,13 @@ PassRefPtr<CSSValue> 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<CSSValue> 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<SVGPaint*>(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<SVGPaint*>(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<SVGPaint*>(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<SVGPaint*>(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);