summaryrefslogtreecommitdiff
path: root/Source/WebCore/css
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source/WebCore/css
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/WebCore/css')
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp71
-rw-r--r--Source/WebCore/css/CSSFontFaceSrcValue.cpp12
-rw-r--r--Source/WebCore/css/CSSFontFaceSrcValue.h7
-rw-r--r--Source/WebCore/css/CSSFontSelector.cpp3
-rw-r--r--Source/WebCore/css/CSSInitialValue.h6
-rw-r--r--Source/WebCore/css/CSSMutableStyleDeclaration.h2
-rw-r--r--Source/WebCore/css/CSSParser.cpp65
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h40
-rw-r--r--Source/WebCore/css/CSSProperty.cpp3
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in3
-rw-r--r--Source/WebCore/css/CSSStyleApplyProperty.cpp3
-rw-r--r--Source/WebCore/css/CSSStyleSelector.cpp49
-rw-r--r--Source/WebCore/css/CSSStyleSelector.h18
-rw-r--r--Source/WebCore/css/CSSValue.cpp5
-rw-r--r--Source/WebCore/css/CSSValue.h18
-rw-r--r--Source/WebCore/css/CSSValueList.cpp56
-rw-r--r--Source/WebCore/css/CSSValueList.h14
-rw-r--r--Source/WebCore/css/StyleMedia.cpp2
-rw-r--r--Source/WebCore/css/StyleMedia.h16
-rw-r--r--Source/WebCore/css/WebKitCSSFilterValue.cpp2
-rw-r--r--Source/WebCore/css/WebKitCSSTransformValue.cpp2
-rw-r--r--Source/WebCore/css/fullscreenQuickTime.css9
22 files changed, 291 insertions, 115 deletions
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 3e0dc8c21..112abbe83 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -217,10 +217,11 @@ static const int computedProperties[] = {
#endif
CSSPropertyWebkitFlexOrder,
CSSPropertyWebkitFlexPack,
- CSSPropertyWebkitFlexAlign,
+ CSSPropertyWebkitFlexItemAlign,
CSSPropertyWebkitFlexDirection,
CSSPropertyWebkitFlexFlow,
CSSPropertyWebkitFlexWrap,
+ CSSPropertyWebkitFontKerning,
CSSPropertyWebkitFontSmoothing,
#if ENABLE(CSS_GRID_LAYOUT)
CSSPropertyWebkitGridColumns,
@@ -576,14 +577,9 @@ PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
return cssValuePool->createColorValue(color.rgb());
}
-static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
+static PassRefPtr<CSSValueList> getBorderRadiusCornerValues(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
{
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- if (radius.width() == radius.height()) {
- if (radius.width().type() == Percent)
- return cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
- return zoomAdjustedPixelValue(radius.width().value(), style, cssValuePool);
- }
if (radius.width().type() == Percent)
list->append(cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
else
@@ -595,6 +591,58 @@ static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const
return list.release();
}
+static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
+{
+ if (radius.width() == radius.height()) {
+ if (radius.width().type() == Percent)
+ return cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
+ return zoomAdjustedPixelValue(radius.width().value(), style, cssValuePool);
+ }
+ return getBorderRadiusCornerValues(radius, style, cssValuePool);
+}
+
+static PassRefPtr<CSSValueList> getBorderRadiusShorthandValue(const RenderStyle* style, CSSValuePool* cssValuePool)
+{
+ RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
+ bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != style->borderBottomLeftRadius().width();
+ bool showHorizontalBottomRight = style->borderBottomRightRadius().width() != style->borderTopLeftRadius().width();
+ bool showHorizontalTopRight = style->borderTopRightRadius().width() != style->borderTopLeftRadius().width();
+
+ bool showVerticalBottomLeft = style->borderTopRightRadius().height() != style->borderBottomLeftRadius().height();
+ bool showVerticalBottomRight = (style->borderBottomRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomLeft;
+ bool showVerticalTopRight = (style->borderTopRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomRight;
+ bool showVerticalTopLeft = (style->borderTopLeftRadius().width() != style->borderTopLeftRadius().height());
+
+ RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style->borderTopLeftRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> topRightRadius = getBorderRadiusCornerValues(style->borderTopRightRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> bottomRightRadius = getBorderRadiusCornerValues(style->borderBottomRightRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> bottomLeftRadius = getBorderRadiusCornerValues(style->borderBottomLeftRadius(), style, cssValuePool);
+
+ RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated();
+ horizontalRadii->append(topLeftRadius->item(0));
+ if (showHorizontalTopRight)
+ horizontalRadii->append(topRightRadius->item(0));
+ if (showHorizontalBottomRight)
+ horizontalRadii->append(bottomRightRadius->item(0));
+ if (showHorizontalBottomLeft)
+ horizontalRadii->append(bottomLeftRadius->item(0));
+
+ list->append(horizontalRadii);
+
+ if (showVerticalTopLeft) {
+ RefPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated();
+ verticalRadii->append(topLeftRadius->item(1));
+ if (showVerticalTopRight)
+ verticalRadii->append(topRightRadius->item(1));
+ if (showVerticalBottomRight)
+ verticalRadii->append(bottomRightRadius->item(1));
+ if (showVerticalBottomLeft)
+ verticalRadii->append(bottomLeftRadius->item(1));
+ list->append(verticalRadii);
+ }
+ return list.release();
+}
+
static LayoutRect sizingBox(RenderObject* renderer)
{
if (!renderer->isBox())
@@ -1473,8 +1521,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return cssValuePool->createValue(style->flexOrder(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyWebkitFlexPack:
return cssValuePool->createValue(style->flexPack());
- case CSSPropertyWebkitFlexAlign:
- return cssValuePool->createValue(style->flexAlign());
+ case CSSPropertyWebkitFlexItemAlign:
+ return cssValuePool->createValue(style->flexItemAlign());
case CSSPropertyWebkitFlexDirection:
return cssValuePool->createValue(style->flexDirection());
case CSSPropertyWebkitFlexWrap:
@@ -1819,6 +1867,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return cssValuePool->createValue(style->matchNearestMailBlockquoteColor());
case CSSPropertyResize:
return cssValuePool->createValue(style->resize());
+ case CSSPropertyWebkitFontKerning:
+ return cssValuePool->createValue(style->fontDescription().kerning());
case CSSPropertyWebkitFontSmoothing:
return cssValuePool->createValue(style->fontDescription().fontSmoothing());
case CSSPropertyZIndex:
@@ -2135,7 +2185,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitFilter:
return valueForFilter(style.get());
#endif
- /* Shorthand properties, currently not supported see bug 13658*/
case CSSPropertyBackground: {
const int properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage,
CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment,
@@ -2170,7 +2219,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyBorderImage:
return valueForNinePieceImage(style->borderImage(), cssValuePool);
case CSSPropertyBorderRadius:
- break;
+ return getBorderRadiusShorthandValue(style.get(), cssValuePool);
case CSSPropertyBorderRight: {
const int properties[3] = { CSSPropertyBorderRightWidth, CSSPropertyBorderRightStyle,
CSSPropertyBorderRightColor };
diff --git a/Source/WebCore/css/CSSFontFaceSrcValue.cpp b/Source/WebCore/css/CSSFontFaceSrcValue.cpp
index 57300ef71..3cdece883 100644
--- a/Source/WebCore/css/CSSFontFaceSrcValue.cpp
+++ b/Source/WebCore/css/CSSFontFaceSrcValue.cpp
@@ -26,6 +26,9 @@
#include "config.h"
#include "CSSFontFaceSrcValue.h"
#include "CSSStyleSheet.h"
+#include "CachedFont.h"
+#include "CachedResourceLoader.h"
+#include "Document.h"
#include "FontCustomPlatformData.h"
#include "Node.h"
@@ -76,5 +79,14 @@ void CSSFontFaceSrcValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const
addSubresourceURL(urls, styleSheet->completeURL(m_resource));
}
+CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document)
+{
+ if (!m_cachedFont) {
+ ResourceRequest request(document->completeURL(m_resource));
+ m_cachedFont = document->cachedResourceLoader()->requestFont(request);
+ }
+ return m_cachedFont.get();
+}
+
}
diff --git a/Source/WebCore/css/CSSFontFaceSrcValue.h b/Source/WebCore/css/CSSFontFaceSrcValue.h
index 121f4d4e1..a5f54de47 100644
--- a/Source/WebCore/css/CSSFontFaceSrcValue.h
+++ b/Source/WebCore/css/CSSFontFaceSrcValue.h
@@ -27,11 +27,14 @@
#define CSSFontFaceSrcValue_h
#include "CSSValue.h"
+#include "CachedResourceHandle.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
namespace WebCore {
+class CachedFont;
+class Document;
class SVGFontFaceElement;
class CSSFontFaceSrcValue : public CSSValue {
@@ -64,6 +67,8 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
+ CachedFont* cachedFont(Document*);
+
private:
CSSFontFaceSrcValue(const String& resource, bool local)
: CSSValue(FontFaceSrcClass)
@@ -79,6 +84,8 @@ private:
String m_format;
bool m_isLocal;
+ CachedResourceHandle<CachedFont> m_cachedFont;
+
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* m_svgFontFaceElement;
#endif
diff --git a/Source/WebCore/css/CSSFontSelector.cpp b/Source/WebCore/css/CSSFontSelector.cpp
index ed715038a..4c90ae3d7 100644
--- a/Source/WebCore/css/CSSFontSelector.cpp
+++ b/Source/WebCore/css/CSSFontSelector.cpp
@@ -243,8 +243,7 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
Settings* settings = m_document ? m_document->frame() ? m_document->frame()->settings() : 0 : 0;
bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
if (allowDownloading && item->isSupportedFormat() && m_document) {
- ResourceRequest request(m_document->completeURL(item->resource()));
- CachedFont* cachedFont = m_document->cachedResourceLoader()->requestFont(request);
+ CachedFont* cachedFont = item->cachedFont(m_document);
if (cachedFont) {
source = adoptPtr(new CSSFontFaceSource(item->resource(), cachedFont));
#if ENABLE(SVG_FONTS)
diff --git a/Source/WebCore/css/CSSInitialValue.h b/Source/WebCore/css/CSSInitialValue.h
index f5888903b..dd86d8424 100644
--- a/Source/WebCore/css/CSSInitialValue.h
+++ b/Source/WebCore/css/CSSInitialValue.h
@@ -39,12 +39,16 @@ public:
String customCssText() const;
+ bool isImplicit() const { return m_isImplicit; }
+
private:
CSSInitialValue(bool implicit)
: CSSValue(InitialClass)
+ , m_isImplicit(implicit)
{
- m_isImplicitInitialValue = implicit;
}
+
+ bool m_isImplicit;
};
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSMutableStyleDeclaration.h b/Source/WebCore/css/CSSMutableStyleDeclaration.h
index 54e08edb4..f483fbe5c 100644
--- a/Source/WebCore/css/CSSMutableStyleDeclaration.h
+++ b/Source/WebCore/css/CSSMutableStyleDeclaration.h
@@ -127,8 +127,6 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&);
- bool propertiesEqual(const CSSMutableStyleDeclaration* o) const { return m_properties == o->m_properties; }
-
protected:
CSSMutableStyleDeclaration(CSSRule* parentRule);
CSSMutableStyleDeclaration();
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 7940b2774..2f5cab605 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -906,28 +906,28 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyPosition: // static | relative | absolute | fixed | inherit
- if (id == CSSValueStatic ||
- id == CSSValueRelative ||
- id == CSSValueAbsolute ||
- id == CSSValueFixed)
+ if (id == CSSValueStatic
+ || id == CSSValueRelative
+ || id == CSSValueAbsolute
+ || id == CSSValueFixed)
validPrimitive = true;
break;
- case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
+ case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
case CSSPropertyPageBreakBefore:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitRegionBreakAfter:
case CSSPropertyWebkitRegionBreakBefore:
- if (id == CSSValueAuto ||
- id == CSSValueAlways ||
- id == CSSValueAvoid ||
- id == CSSValueLeft ||
- id == CSSValueRight)
+ if (id == CSSValueAuto
+ || id == CSSValueAlways
+ || id == CSSValueAvoid
+ || id == CSSValueLeft
+ || id == CSSValueRight)
validPrimitive = true;
break;
- case CSSPropertyPageBreakInside: // avoid | auto | inherit
+ case CSSPropertyPageBreakInside: // avoid | auto | inherit
case CSSPropertyWebkitColumnBreakInside:
case CSSPropertyWebkitRegionBreakInside:
if (id == CSSValueAuto || id == CSSValueAvoid)
@@ -935,8 +935,8 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyEmptyCells: // show | hide | inherit
- if (id == CSSValueShow ||
- id == CSSValueHide)
+ if (id == CSSValueShow
+ || id == CSSValueHide)
validPrimitive = true;
break;
@@ -945,11 +945,11 @@ bool CSSParser::parseValue(int propId, bool important)
return parseContent(propId, important);
case CSSPropertyWhiteSpace: // normal | pre | nowrap | inherit
- if (id == CSSValueNormal ||
- id == CSSValuePre ||
- id == CSSValuePreWrap ||
- id == CSSValuePreLine ||
- id == CSSValueNowrap)
+ if (id == CSSValueNormal
+ || id == CSSValuePre
+ || id == CSSValuePreWrap
+ || id == CSSValuePreLine
+ || id == CSSValueNowrap)
validPrimitive = true;
break;
@@ -1036,8 +1036,8 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyClear: // none | left | right | both | inherit
- if (id == CSSValueNone || id == CSSValueLeft ||
- id == CSSValueRight|| id == CSSValueBoth)
+ if (id == CSSValueNone || id == CSSValueLeft
+ || id == CSSValueRight|| id == CSSValueBoth)
validPrimitive = true;
break;
@@ -1045,7 +1045,7 @@ bool CSSParser::parseValue(int propId, bool important)
// left | right | center | justify | webkit_left | webkit_right | webkit_center | webkit_match_parent |
// start | end | <string> | inherit
if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id == CSSValueStart || id == CSSValueEnd
- || value->unit == CSSPrimitiveValue::CSS_STRING)
+ || value->unit == CSSPrimitiveValue::CSS_STRING)
validPrimitive = true;
break;
@@ -1408,7 +1408,7 @@ bool CSSParser::parseValue(int propId, bool important)
return parseCounter(propId, 1, important);
validPrimitive = true;
break;
- case CSSPropertyCounterReset: // [ <identifier> <integer>? ]+ | none | inherit
+ case CSSPropertyCounterReset: // [ <identifier> <integer>? ]+ | none | inherit
if (id != CSSValueNone)
return parseCounter(propId, 0, important);
validPrimitive = true;
@@ -1637,8 +1637,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyWebkitFlexPack:
validPrimitive = id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueJustify;
break;
- case CSSPropertyWebkitFlexAlign:
- validPrimitive = id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline || id == CSSValueStretch;
+ case CSSPropertyWebkitFlexItemAlign:
+ validPrimitive = id == CSSValueAuto || id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline || id == CSSValueStretch;
break;
case CSSPropertyWebkitFlexDirection:
validPrimitive = id == CSSValueRow || id == CSSValueRowReverse || id == CSSValueColumn || id == CSSValueColumnReverse;
@@ -2009,7 +2009,7 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyWebkitTapHighlightColor:
if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu
|| (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && !m_strict)) {
- validPrimitive = true;
+ validPrimitive = true;
} else {
parsedValue = parseColor();
if (parsedValue)
@@ -2228,6 +2228,11 @@ bool CSSParser::parseValue(int propId, bool important)
return parseFontFeatureSettings(important);
break;
+ case CSSPropertyWebkitFontKerning:
+ if (id == CSSValueAuto || id == CSSValueNormal || id == CSSValueNone)
+ validPrimitive = true;
+ break;
+
case CSSPropertyWebkitWrapShapeInside:
case CSSPropertyWebkitWrapShapeOutside:
if (id == CSSValueAuto)
@@ -5170,7 +5175,7 @@ PassRefPtr<CSSValueList> CSSParser::parseShadow(CSSParserValueList* valueList, i
if (!parsedColor || !context.allowColor)
return 0; // This value is not a color or length and is invalid or
- // it is a color, but a color isn't allowed at this point.
+ // it is a color, but a color isn't allowed at this point.
context.commitColor(parsedColor.release());
}
@@ -5458,7 +5463,7 @@ bool CSSParser::parseBorderImage(int propId, RefPtr<CSSValue>& result)
static bool isBorderImageRepeatKeyword(int id)
{
- return id == CSSValueStretch || id == CSSValueRepeat || id == CSSValueSpace || id == CSSValueRound;
+ return id == CSSValueStretch || id == CSSValueRepeat || id == CSSValueSpace || id == CSSValueRound;
}
bool CSSParser::parseBorderImageRepeat(RefPtr<CSSValue>& result)
@@ -5543,7 +5548,7 @@ public:
m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
}
if (!m_left)
- m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
+ m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
// Now build a rect value to hold all four of our primitive values.
RefPtr<Quad> quad = Quad::create();
@@ -5659,7 +5664,7 @@ public:
m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
}
if (!m_left)
- m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
+ m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
// Now build a quad value to hold all four of our primitive values.
RefPtr<Quad> quad = Quad::create();
@@ -6619,7 +6624,7 @@ static void filterInfoForName(const CSSParserString& name, WebKitCSSFilterValue:
else if (equalIgnoringCase(name, "sepia("))
filterType = WebKitCSSFilterValue::SepiaFilterOperation;
else if (equalIgnoringCase(name, "saturate("))
- filterType = WebKitCSSFilterValue::SaturateFilterOperation;
+ filterType = WebKitCSSFilterValue::SaturateFilterOperation;
else if (equalIgnoringCase(name, "hue-rotate("))
filterType = WebKitCSSFilterValue::HueRotateFilterOperation;
else if (equalIgnoringCase(name, "invert("))
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index f8444ca6a..6d85beeb3 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1158,6 +1158,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
{
m_primitiveUnitType = CSS_IDENT;
switch (e) {
+ case AlignAuto:
+ m_value.ident = CSSValueAuto;
+ break;
case AlignStart:
m_value.ident = CSSValueStart;
break;
@@ -1179,6 +1182,8 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
template<> inline CSSPrimitiveValue::operator EFlexAlign() const
{
switch (m_value.ident) {
+ case CSSValueAuto:
+ return AlignAuto;
case CSSValueStart:
return AlignStart;
case CSSValueEnd:
@@ -2821,6 +2826,41 @@ template<> inline CSSPrimitiveValue::operator EPointerEvents() const
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontDescription::Kerning kerning)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_IDENT;
+ switch (kerning) {
+ case FontDescription::AutoKerning:
+ m_value.ident = CSSValueAuto;
+ return;
+ case FontDescription::NormalKerning:
+ m_value.ident = CSSValueNormal;
+ return;
+ case FontDescription::NoneKerning:
+ m_value.ident = CSSValueNone;
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+ m_value.ident = CSSValueAuto;
+}
+
+template<> inline CSSPrimitiveValue::operator FontDescription::Kerning() const
+{
+ switch (m_value.ident) {
+ case CSSValueAuto:
+ return FontDescription::AutoKerning;
+ case CSSValueNormal:
+ return FontDescription::NormalKerning;
+ case CSSValueNone:
+ return FontDescription::NoneKerning;
+ }
+
+ ASSERT_NOT_REACHED();
+ return FontDescription::AutoKerning;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
: CSSValue(PrimitiveClass)
{
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index 3bbf03227..b3d056c56 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -318,6 +318,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
case CSSPropertyWebkitBoxDirection:
case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitFontFeatureSettings:
+ case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitLocale:
case CSSPropertyWebkitHighlight:
@@ -558,7 +559,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
#endif
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
- case CSSPropertyWebkitFlexAlign:
+ case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexFlow:
case CSSPropertyWebkitFlexWrap:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index c0299da60..e69875bb8 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -21,6 +21,7 @@ font-variant
font-weight
text-rendering
-webkit-font-feature-settings
+-webkit-font-kerning
-webkit-font-smoothing
-webkit-locale
-webkit-text-orientation
@@ -253,9 +254,9 @@ z-index
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
-webkit-filter
#endif
--webkit-flex-align
-webkit-flex-direction
-webkit-flex-flow
+-webkit-flex-item-align
-webkit-flex-order
-webkit-flex-pack
-webkit-flex-wrap
diff --git a/Source/WebCore/css/CSSStyleApplyProperty.cpp b/Source/WebCore/css/CSSStyleApplyProperty.cpp
index 389f25c4a..0b4a63336 100644
--- a/Source/WebCore/css/CSSStyleApplyProperty.cpp
+++ b/Source/WebCore/css/CSSStyleApplyProperty.cpp
@@ -1672,7 +1672,7 @@ CSSStyleApplyProperty::CSSStyleApplyProperty()
setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
- setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitFlexItemAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexItemAlign, EFlexAlign, &RenderStyle::setFlexItemAlign, EFlexAlign, &RenderStyle::initialFlexItemAlign>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
@@ -1681,6 +1681,7 @@ CSSStyleApplyProperty::CSSStyleApplyProperty()
setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp
index b0282c120..97f19cfba 100644
--- a/Source/WebCore/css/CSSStyleSelector.cpp
+++ b/Source/WebCore/css/CSSStyleSelector.cpp
@@ -330,6 +330,7 @@ CSSStyleSelector::CSSStyleSelector(Document* document, StyleSheetList* styleShee
bool strictParsing, bool matchAuthorAndUserStyles)
: m_hasUAAppearance(false)
, m_backgroundData(BackgroundFillLayer)
+ , m_matchedDeclarationCacheAdditionsSinceLastSweep(0)
, m_checker(document, strictParsing)
, m_parentStyle(0)
, m_rootElementStyle(0)
@@ -479,7 +480,27 @@ void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule)
CSSStyleSelector::~CSSStyleSelector()
{
m_fontSelector->clearDocument();
- deleteAllValues(m_viewportDependentMediaQueryResults);
+}
+
+void CSSStyleSelector::sweepMatchedDeclarationCache()
+{
+ // Look for cache entries containing a style declaration with a single ref and remove them.
+ // This may happen when an element attribute mutation causes it to swap out its Attribute::decl()
+ // for another CSSMappedAttributeDeclaration, potentially leaving this cache with the last ref.
+ Vector<unsigned, 16> toRemove;
+ MatchedStyleDeclarationCache::iterator it = m_matchedStyleDeclarationCache.begin();
+ MatchedStyleDeclarationCache::iterator end = m_matchedStyleDeclarationCache.end();
+ for (; it != end; ++it) {
+ Vector<MatchedStyleDeclaration>& matchedStyleDeclarations = it->second.matchedStyleDeclarations;
+ for (size_t i = 0; i < matchedStyleDeclarations.size(); ++i) {
+ if (matchedStyleDeclarations[i].styleDeclaration->hasOneRef()) {
+ toRemove.append(it->first);
+ break;
+ }
+ }
+ }
+ for (size_t i = 0; i < toRemove.size(); ++i)
+ m_matchedStyleDeclarationCache.remove(toRemove[i]);
}
CSSStyleSelector::Features::Features()
@@ -627,12 +648,6 @@ static void ensureDefaultStyleSheetsForElement(Element* element)
#endif
}
-CSSStyleSelector::MatchedStyleDeclaration::MatchedStyleDeclaration()
-{
- // Make sure all memory is zero initializes as we calculate hash over the bytes of this object.
- memset(this, 0, sizeof(*this));
-}
-
void CSSStyleSelector::addMatchedDeclaration(CSSMutableStyleDeclaration* styleDeclaration, unsigned linkMatchType)
{
m_matchedDecls.grow(m_matchedDecls.size() + 1);
@@ -815,12 +830,12 @@ void CSSStyleSelector::matchAllRules(MatchResult& result)
const NamedNodeMap* map = m_styledElement->attributeMap();
for (unsigned i = 0; i < map->length(); ++i) {
Attribute* attr = map->attributeItem(i);
- if (attr->isMappedAttribute() && attr->decl()) {
+ if (attr->decl()) {
+ ASSERT(attr->isMappedAttribute());
result.lastAuthorRule = m_matchedDecls.size();
if (result.firstAuthorRule == -1)
result.firstAuthorRule = result.lastAuthorRule;
addMatchedDeclaration(attr->decl());
- result.isCacheable = false;
}
}
}
@@ -2212,7 +2227,7 @@ void CSSStyleSelector::applyDeclaration(CSSMutableStyleDeclaration* styleDeclara
int property = current.id();
if (applyFirst) {
COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property);
- COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 16, CSS_zoom_is_end_of_first_prop_range);
+ COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 17, 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
if (property > CSSPropertyLineHeight)
@@ -2239,7 +2254,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
if (m_style->insideLink() != NotInsideLink) {
for (int i = startIndex; i <= endIndex; ++i) {
- CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration;
+ CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration.get();
unsigned linkMatchType = m_matchedDecls[i].linkMatchType;
// FIXME: It would be nicer to pass these as arguments but that requires changes in many places.
m_applyPropertyToRegularStyle = linkMatchType & SelectorChecker::MatchLink;
@@ -2252,7 +2267,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
return;
}
for (int i = startIndex; i <= endIndex; ++i)
- applyDeclaration<applyFirst>(m_matchedDecls[i].styleDeclaration, isImportant, inheritedOnly);
+ applyDeclaration<applyFirst>(m_matchedDecls[i].styleDeclaration.get(), isImportant, inheritedOnly);
}
unsigned CSSStyleSelector::computeDeclarationHash(MatchedStyleDeclaration* declarations, unsigned size)
@@ -2310,6 +2325,12 @@ const CSSStyleSelector::MatchedStyleDeclarationCacheItem* CSSStyleSelector::find
void CSSStyleSelector::addToMatchedDeclarationCache(const RenderStyle* style, const RenderStyle* parentStyle, unsigned hash, const MatchResult& matchResult)
{
+ static unsigned matchedDeclarationCacheAdditionsBetweenSweeps = 100;
+ if (++m_matchedDeclarationCacheAdditionsSinceLastSweep >= matchedDeclarationCacheAdditionsBetweenSweeps) {
+ sweepMatchedDeclarationCache();
+ m_matchedDeclarationCacheAdditionsSinceLastSweep = 0;
+ }
+
ASSERT(hash);
MatchedStyleDeclarationCacheItem cacheItem;
cacheItem.matchedStyleDeclarations.append(m_matchedDecls);
@@ -3698,7 +3719,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyWordSpacing:
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
- case CSSPropertyWebkitFlexAlign:
+ case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexFlow:
case CSSPropertyWebkitFlexWrap:
@@ -4703,7 +4724,7 @@ bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname) con
void CSSStyleSelector::addViewportDependentMediaQueryResult(const MediaQueryExp* expr, bool result)
{
- m_viewportDependentMediaQueryResults.append(new MediaQueryResult(*expr, result));
+ m_viewportDependentMediaQueryResults.append(adoptPtr(new MediaQueryResult(*expr, result)));
}
bool CSSStyleSelector::affectedByViewportChange() const
diff --git a/Source/WebCore/css/CSSStyleSelector.h b/Source/WebCore/css/CSSStyleSelector.h
index 872b634f5..856193f99 100644
--- a/Source/WebCore/css/CSSStyleSelector.h
+++ b/Source/WebCore/css/CSSStyleSelector.h
@@ -346,9 +346,14 @@ private:
void loadPendingImages();
struct MatchedStyleDeclaration {
- MatchedStyleDeclaration();
- CSSMutableStyleDeclaration* styleDeclaration;
- unsigned linkMatchType;
+ MatchedStyleDeclaration() : possiblyPaddedMember(0) { }
+
+ RefPtr<CSSMutableStyleDeclaration> styleDeclaration;
+ union {
+ unsigned linkMatchType;
+ // Used to make sure all memory is zero-initialized since we compute the hash over the bytes of this object.
+ void* possiblyPaddedMember;
+ };
};
static unsigned computeDeclarationHash(MatchedStyleDeclaration*, unsigned size);
struct MatchedStyleDeclarationCacheItem {
@@ -360,11 +365,16 @@ private:
const MatchedStyleDeclarationCacheItem* findFromMatchedDeclarationCache(unsigned hash, const MatchResult&);
void addToMatchedDeclarationCache(const RenderStyle*, const RenderStyle* parentStyle, unsigned hash, const MatchResult&);
+ // Every N additions to the matched declaration cache trigger a sweep where entries holding
+ // the last reference to a style declaration are garbage collected.
+ void sweepMatchedDeclarationCache();
+
// We collect the set of decls that match in |m_matchedDecls|. We then walk the
// set of matched decls four times, once for those properties that others depend on (like font-size),
// and then a second time for all the remaining properties. We then do the same two passes
// for any !important rules.
Vector<MatchedStyleDeclaration, 64> m_matchedDecls;
+ unsigned m_matchedDeclarationCacheAdditionsSinceLastSweep;
typedef HashMap<unsigned, MatchedStyleDeclarationCacheItem> MatchedStyleDeclarationCache;
MatchedStyleDeclarationCache m_matchedStyleDeclarationCache;
@@ -397,7 +407,7 @@ private:
bool m_sameOriginOnly;
RefPtr<CSSFontSelector> m_fontSelector;
- Vector<MediaQueryResult*> m_viewportDependentMediaQueryResults;
+ Vector<OwnPtr<MediaQueryResult> > m_viewportDependentMediaQueryResults;
bool m_applyPropertyToRegularStyle;
bool m_applyPropertyToVisitedLinkStyle;
diff --git a/Source/WebCore/css/CSSValue.cpp b/Source/WebCore/css/CSSValue.cpp
index 0e83c0818..711e4c5ed 100644
--- a/Source/WebCore/css/CSSValue.cpp
+++ b/Source/WebCore/css/CSSValue.cpp
@@ -65,6 +65,11 @@ class SameSizeAsCSSValue : public RefCounted<SameSizeAsCSSValue> {
COMPILE_ASSERT(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), CSS_value_should_stay_small);
+bool CSSValue::isImplicitInitialValue() const
+{
+ return m_classType == InitialClass && static_cast<const CSSInitialValue*>(this)->isImplicit();
+}
+
CSSValue::Type CSSValue::cssValueType() const
{
if (isInheritedValue())
diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h
index ce95369ab..fd5e6f520 100644
--- a/Source/WebCore/css/CSSValue.h
+++ b/Source/WebCore/css/CSSValue.h
@@ -68,7 +68,7 @@ public:
bool isFontValue() const { return m_classType == FontClass; }
bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; }
bool isImageValue() const { return m_classType == ImageClass || m_classType == CursorImageClass; }
- bool isImplicitInitialValue() const { return m_classType == InitialClass && m_isImplicitInitialValue; }
+ bool isImplicitInitialValue() const;
bool isInheritedValue() const { return m_classType == InheritedClass; }
bool isInitialValue() const { return m_classType == InitialClass; }
bool isReflectValue() const { return m_classType == ReflectClass; }
@@ -145,14 +145,20 @@ protected:
// Do not append non-list class types here.
};
+ static const size_t ValueListSeparatorBits = 2;
+ enum ValueListSeparator {
+ SpaceSeparator,
+ CommaSeparator,
+ SlashSeparator
+ };
+
ClassType classType() const { return static_cast<ClassType>(m_classType); }
explicit CSSValue(ClassType classType)
: m_primitiveUnitType(0)
, m_hasCachedCSSText(false)
, m_isQuirkValue(false)
- , m_isImplicitInitialValue(false)
- , m_isSpaceSeparatedValueList(false)
+ , m_valueListSeparator(SpaceSeparator)
, m_classType(classType)
{
}
@@ -174,11 +180,7 @@ protected:
mutable bool m_hasCachedCSSText : 1;
bool m_isQuirkValue : 1;
- // CSSInitialValue bits:
- bool m_isImplicitInitialValue : 1;
-
- // CSSValueList bits:
- bool m_isSpaceSeparatedValueList : 1;
+ unsigned char m_valueListSeparator : ValueListSeparatorBits;
private:
unsigned char m_classType : ClassTypeBits; // ClassType
diff --git a/Source/WebCore/css/CSSValueList.cpp b/Source/WebCore/css/CSSValueList.cpp
index 661e183a7..07aa789b0 100644
--- a/Source/WebCore/css/CSSValueList.cpp
+++ b/Source/WebCore/css/CSSValueList.cpp
@@ -24,25 +24,26 @@
#include "CSSParserValues.h"
#include "PlatformString.h"
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
-CSSValueList::CSSValueList(ClassType classType, bool isSpaceSeparated)
+CSSValueList::CSSValueList(ClassType classType, ValueListSeparator listSeparator)
: CSSValue(classType)
{
- m_isSpaceSeparatedValueList = isSpaceSeparated;
+ m_valueListSeparator = listSeparator;
}
-CSSValueList::CSSValueList(bool isSpaceSeparated)
+CSSValueList::CSSValueList(ValueListSeparator listSeparator)
: CSSValue(ValueListClass)
{
- m_isSpaceSeparatedValueList = isSpaceSeparated;
+ m_valueListSeparator = listSeparator;
}
CSSValueList::CSSValueList(CSSParserValueList* list)
: CSSValue(ValueListClass)
{
- m_isSpaceSeparatedValueList = true;
+ m_valueListSeparator = SpaceSeparator;
if (list) {
size_t size = list->size();
for (unsigned i = 0; i < size; ++i)
@@ -88,28 +89,51 @@ bool CSSValueList::hasValue(CSSValue* val) const
PassRefPtr<CSSValueList> CSSValueList::copy()
{
- PassRefPtr<CSSValueList> newList = isSpaceSeparated() ? createSpaceSeparated() : createCommaSeparated();
+ RefPtr<CSSValueList> newList;
+ switch (m_valueListSeparator) {
+ case SpaceSeparator:
+ newList = createSpaceSeparated();
+ break;
+ case CommaSeparator:
+ newList = createCommaSeparated();
+ break;
+ case SlashSeparator:
+ newList = createSlashSeparated();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
for (size_t index = 0; index < m_values.size(); index++)
newList->append(m_values[index]);
- return newList;
+ return newList.release();
}
String CSSValueList::customCssText() const
{
- String result = "";
+ StringBuilder result;
+ String separator;
+ switch (m_valueListSeparator) {
+ case SpaceSeparator:
+ separator = " ";
+ break;
+ case CommaSeparator:
+ separator = ", ";
+ break;
+ case SlashSeparator:
+ separator = " / ";
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
unsigned size = m_values.size();
for (unsigned i = 0; i < size; i++) {
- if (!result.isEmpty()) {
- if (isSpaceSeparated())
- result += " ";
- else
- result += ", ";
- }
- result += m_values[i]->cssText();
+ if (!result.isEmpty())
+ result.append(separator);
+ result.append(m_values[i]->cssText());
}
- return result;
+ return result.toString();
}
void CSSValueList::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const CSSStyleSheet* styleSheet)
diff --git a/Source/WebCore/css/CSSValueList.h b/Source/WebCore/css/CSSValueList.h
index c62262a9e..16d195b0d 100644
--- a/Source/WebCore/css/CSSValueList.h
+++ b/Source/WebCore/css/CSSValueList.h
@@ -33,11 +33,15 @@ class CSSValueList : public CSSValue {
public:
static PassRefPtr<CSSValueList> createCommaSeparated()
{
- return adoptRef(new CSSValueList(false));
+ return adoptRef(new CSSValueList(CommaSeparator));
}
static PassRefPtr<CSSValueList> createSpaceSeparated()
{
- return adoptRef(new CSSValueList(true));
+ return adoptRef(new CSSValueList(SpaceSeparator));
+ }
+ static PassRefPtr<CSSValueList> createSlashSeparated()
+ {
+ return adoptRef(new CSSValueList(SlashSeparator));
}
static PassRefPtr<CSSValueList> createFromParserValueList(CSSParserValueList* list)
{
@@ -59,14 +63,12 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
protected:
- CSSValueList(ClassType, bool isSpaceSeparated);
+ CSSValueList(ClassType, ValueListSeparator);
private:
- explicit CSSValueList(bool isSpaceSeparated);
+ explicit CSSValueList(ValueListSeparator);
explicit CSSValueList(CSSParserValueList*);
- bool isSpaceSeparated() const { return m_isSpaceSeparatedValueList; }
-
Vector<RefPtr<CSSValue> > m_values;
};
diff --git a/Source/WebCore/css/StyleMedia.cpp b/Source/WebCore/css/StyleMedia.cpp
index 90b574017..5db8a6f98 100644
--- a/Source/WebCore/css/StyleMedia.cpp
+++ b/Source/WebCore/css/StyleMedia.cpp
@@ -36,7 +36,7 @@
namespace WebCore {
StyleMedia::StyleMedia(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
diff --git a/Source/WebCore/css/StyleMedia.h b/Source/WebCore/css/StyleMedia.h
index 760524271..032929e08 100644
--- a/Source/WebCore/css/StyleMedia.h
+++ b/Source/WebCore/css/StyleMedia.h
@@ -27,6 +27,7 @@
#ifndef StyleMedia_h
#define StyleMedia_h
+#include "DOMWindowProperty.h"
#include "PlatformString.h"
#include <wtf/RefCounted.h>
@@ -34,24 +35,15 @@ namespace WebCore {
class Frame;
-class StyleMedia : public RefCounted<StyleMedia> {
+class StyleMedia : public RefCounted<StyleMedia>, public DOMWindowProperty {
public:
- static PassRefPtr<StyleMedia> create(Frame* frame)
- {
- return adoptRef(new StyleMedia(frame));
- }
-
- Frame* frame() { return m_frame; }
- void disconnectFrame() { m_frame = 0; }
+ static PassRefPtr<StyleMedia> create(Frame* frame) { return adoptRef(new StyleMedia(frame));}
String type() const;
-
bool matchMedium(const String&) const;
private:
- StyleMedia(Frame*);
-
- Frame* m_frame;
+ explicit StyleMedia(Frame*);
};
} // namespace
diff --git a/Source/WebCore/css/WebKitCSSFilterValue.cpp b/Source/WebCore/css/WebKitCSSFilterValue.cpp
index b8e39933a..93ae41097 100644
--- a/Source/WebCore/css/WebKitCSSFilterValue.cpp
+++ b/Source/WebCore/css/WebKitCSSFilterValue.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
WebKitCSSFilterValue::WebKitCSSFilterValue(FilterOperationType operationType)
- : CSSValueList(WebKitCSSFilterClass, typeUsesSpaceSeparator(operationType))
+ : CSSValueList(WebKitCSSFilterClass, typeUsesSpaceSeparator(operationType) ? SpaceSeparator : CommaSeparator)
, m_type(operationType)
{
}
diff --git a/Source/WebCore/css/WebKitCSSTransformValue.cpp b/Source/WebCore/css/WebKitCSSTransformValue.cpp
index 6a391ac85..3e2f9e60d 100644
--- a/Source/WebCore/css/WebKitCSSTransformValue.cpp
+++ b/Source/WebCore/css/WebKitCSSTransformValue.cpp
@@ -33,7 +33,7 @@
namespace WebCore {
WebKitCSSTransformValue::WebKitCSSTransformValue(TransformOperationType op)
- : CSSValueList(WebKitCSSTransformClass, false)
+ : CSSValueList(WebKitCSSTransformClass, CommaSeparator)
, m_type(op)
{
}
diff --git a/Source/WebCore/css/fullscreenQuickTime.css b/Source/WebCore/css/fullscreenQuickTime.css
index a5559768d..ea1ebd6ec 100644
--- a/Source/WebCore/css/fullscreenQuickTime.css
+++ b/Source/WebCore/css/fullscreenQuickTime.css
@@ -29,9 +29,6 @@ video:-webkit-full-screen::-webkit-media-controls-panel {
-webkit-box-pack: end !important;
-webkit-appearance: none !important;
- bottom: 50px !important;
- left: 50% !important;
- margin-left: -220px !important;
padding: 12px 0 0 10px !important;
width: 430px !important;
height: 48px !important;
@@ -58,6 +55,12 @@ video:-webkit-full-screen::-webkit-media-controls-panel {
-webkit-transition: opacity 0.3s linear !important;
}
+video:-webkit-full-screen::-webkit-media-controls-panel:not(.dragged) {
+ bottom: 50px !important;
+ left: 50% !important;
+ margin-left: -220px !important;
+}
+
video:-webkit-animating-full-screen-transition::-webkit-media-controls-panel {
opacity: 0 ! important;
-webkit-transition: opacity 0 ! important;