summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/css
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/css')
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp1
-rw-r--r--Source/WebCore/css/CSSFontFaceSource.cpp2
-rw-r--r--Source/WebCore/css/CSSGradientValue.cpp3
-rw-r--r--Source/WebCore/css/CSSGrammar.y52
-rw-r--r--Source/WebCore/css/CSSParser.cpp90
-rw-r--r--Source/WebCore/css/CSSParser.h2
-rw-r--r--Source/WebCore/css/CSSSegmentedFontFace.cpp2
-rw-r--r--Source/WebCore/css/CSSSelector.cpp10
-rw-r--r--Source/WebCore/css/CSSSelector.h10
-rw-r--r--Source/WebCore/css/CSSSelectorList.cpp16
-rw-r--r--Source/WebCore/css/CSSSelectorList.h1
-rw-r--r--Source/WebCore/css/CSSStyleSelector.cpp39
-rw-r--r--Source/WebCore/css/CSSValue.h2
-rw-r--r--Source/WebCore/css/WebKitCSSMatrix.cpp10
-rw-r--r--Source/WebCore/css/html.css61
-rw-r--r--Source/WebCore/css/mediaControlsGtk.css30
-rw-r--r--Source/WebCore/css/mediaControlsQtFullscreen.css190
-rw-r--r--Source/WebCore/css/themeQtMobile.css4
18 files changed, 421 insertions, 104 deletions
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 21cf9ac..89564c3 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -24,6 +24,7 @@
#include "CSSComputedStyleDeclaration.h"
#include "AnimationController.h"
+#include "CursorList.h"
#include "CSSBorderImageValue.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSPrimitiveValue.h"
diff --git a/Source/WebCore/css/CSSFontFaceSource.cpp b/Source/WebCore/css/CSSFontFaceSource.cpp
index 12d2e1e..034b22e 100644
--- a/Source/WebCore/css/CSSFontFaceSource.cpp
+++ b/Source/WebCore/css/CSSFontFaceSource.cpp
@@ -115,7 +115,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
}
// See if we have a mapping in our FontData cache.
- unsigned hashKey = fontDescription.computedPixelSize() << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
+ unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
if (SimpleFontData* cachedData = m_fontDataTable.get(hashKey))
return cachedData;
diff --git a/Source/WebCore/css/CSSGradientValue.cpp b/Source/WebCore/css/CSSGradientValue.cpp
index 8040c6c..fde4a4e 100644
--- a/Source/WebCore/css/CSSGradientValue.cpp
+++ b/Source/WebCore/css/CSSGradientValue.cpp
@@ -43,7 +43,8 @@ namespace WebCore {
Image* CSSGradientValue::image(RenderObject* renderer, const IntSize& size)
{
- ASSERT(m_clients.contains(renderer));
+ if (!m_clients.contains(renderer))
+ return 0;
// Need to look up our size. Create a string of width*height to use as a hash key.
// FIXME: hashing based only on size is not sufficient. Color stops may use context-sensitive units (like em)
diff --git a/Source/WebCore/css/CSSGrammar.y b/Source/WebCore/css/CSSGrammar.y
index ba5855d..a5fe795 100644
--- a/Source/WebCore/css/CSSGrammar.y
+++ b/Source/WebCore/css/CSSGrammar.y
@@ -901,16 +901,13 @@ simple_selector:
}
| element_name specifier_list {
$$ = $2;
- if ($$) {
- CSSParser* p = static_cast<CSSParser*>(parser);
- $$->m_tag = QualifiedName(nullAtom, $1, p->m_defaultNamespace);
- }
+ if ($$)
+ static_cast<CSSParser*>(parser)->updateSpecifiersWithElementName(nullAtom, $1, $$);
}
| specifier_list {
$$ = $1;
- CSSParser* p = static_cast<CSSParser*>(parser);
- if ($$ && p->m_defaultNamespace != starAtom)
- $$->m_tag = QualifiedName(nullAtom, starAtom, p->m_defaultNamespace);
+ if ($$)
+ static_cast<CSSParser*>(parser)->updateSpecifiersWithElementName(nullAtom, starAtom, $$);
}
| namespace_selector element_name {
AtomicString namespacePrefix = $1;
@@ -924,25 +921,13 @@ simple_selector:
}
| namespace_selector element_name specifier_list {
$$ = $3;
- if ($$) {
- AtomicString namespacePrefix = $1;
- CSSParser* p = static_cast<CSSParser*>(parser);
- if (p->m_styleSheet)
- $$->m_tag = QualifiedName(namespacePrefix, $2,
- p->m_styleSheet->determineNamespace(namespacePrefix));
- else // FIXME: Shouldn't this case be an error?
- $$->m_tag = QualifiedName(nullAtom, $2, p->m_defaultNamespace);
- }
+ if ($$)
+ static_cast<CSSParser*>(parser)->updateSpecifiersWithElementName($1, $2, $$);
}
| namespace_selector specifier_list {
$$ = $2;
- if ($$) {
- AtomicString namespacePrefix = $1;
- CSSParser* p = static_cast<CSSParser*>(parser);
- if (p->m_styleSheet)
- $$->m_tag = QualifiedName(namespacePrefix, starAtom,
- p->m_styleSheet->determineNamespace(namespacePrefix));
- }
+ if ($$)
+ static_cast<CSSParser*>(parser)->updateSpecifiersWithElementName($1, starAtom, $$);
}
;
@@ -970,13 +955,22 @@ specifier_list:
if (!$2)
$$ = 0;
else if ($1) {
- $$ = $1;
CSSParser* p = static_cast<CSSParser*>(parser);
- CSSSelector* end = $1;
- while (end->tagHistory())
+ CSSSelector* end;
+ CSSSelector* history;
+ // Ensure that unknown pseudo element always stays at the top of selector chain.
+ if ($2->isUnknownPseudoElement()) {
+ end = $2;
+ history = $1;
+ } else {
+ end = $1;
+ history = $2;
+ }
+ $$ = end;
+ while(end->tagHistory())
end = end->tagHistory();
end->m_relation = CSSSelector::SubSelector;
- end->setTagHistory(p->sinkFloatingSelector($2));
+ end->setTagHistory(p->sinkFloatingSelector(history));
}
}
| specifier_list error {
@@ -1141,9 +1135,7 @@ pseudo:
$3.lower();
$$->m_value = $3;
CSSSelector::PseudoType type = $$->pseudoType();
- if (type == CSSSelector::PseudoUnknown)
- $$ = 0;
- else if (type == CSSSelector::PseudoFirstLine) {
+ if (type == CSSSelector::PseudoFirstLine) {
CSSParser* p = static_cast<CSSParser*>(parser);
if (Document* doc = p->document())
doc->setUsesFirstLineRules(true);
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index abc9300..fd5841f 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -5004,7 +5004,6 @@ bool CSSParser::parseLinearGradient(RefPtr<CSSValue>& gradient, CSSGradientRepea
a = args->next();
expectComma = true;
} else {
-
// Look one or two optional keywords that indicate a side or corner.
RefPtr<CSSPrimitiveValue> startX, startY;
@@ -5043,35 +5042,8 @@ bool CSSParser::parseLinearGradient(RefPtr<CSSValue>& gradient, CSSGradientRepea
result->setFirstY(startY.release());
}
- // Now look for 0 or more color stops.
- while (a) {
- // Look for the comma before the next stop.
- if (expectComma) {
- if (a->unit != CSSParserValue::Operator || a->iValue != ',')
- return false;
-
- a = args->next();
- if (!a)
- return false;
- }
-
- // <color-stop> = <color> [ <percentage> | <length> ]?
- CSSGradientColorStop stop;
- stop.m_color = parseGradientColorOrKeyword(this, a);
- if (!stop.m_color)
- return false;
-
- a = args->next();
- if (a) {
- if (validUnit(a, FLength | FPercent, m_strict)) {
- stop.m_position = CSSPrimitiveValue::create(a->fValue, (CSSPrimitiveValue::UnitTypes)a->unit);
- a = args->next();
- }
- }
-
- result->addStop(stop);
- expectComma = true;
- }
+ if (!parseGradientColorStops(args, result.get(), expectComma))
+ return false;
Vector<CSSGradientColorStop>& stops = result->stops();
if (stops.isEmpty())
@@ -5191,14 +5163,25 @@ bool CSSParser::parseRadialGradient(RefPtr<CSSValue>& gradient, CSSGradientRepea
result->setEndHorizontalSize(horizontalSize);
result->setEndVerticalSize(verticalSize);
- // Now look for 0 or more color stops.
+ if (!parseGradientColorStops(args, result.get(), expectComma))
+ return false;
+
+ gradient = result.release();
+ return true;
+}
+
+bool CSSParser::parseGradientColorStops(CSSParserValueList* valueList, CSSGradientValue* gradient, bool expectComma)
+{
+ CSSParserValue* a = valueList->current();
+
+ // Now look for color stops.
while (a) {
// Look for the comma before the next stop.
if (expectComma) {
if (a->unit != CSSParserValue::Operator || a->iValue != ',')
return false;
- a = args->next();
+ a = valueList->next();
if (!a)
return false;
}
@@ -5209,24 +5192,20 @@ bool CSSParser::parseRadialGradient(RefPtr<CSSValue>& gradient, CSSGradientRepea
if (!stop.m_color)
return false;
- a = args->next();
+ a = valueList->next();
if (a) {
if (validUnit(a, FLength | FPercent, m_strict)) {
stop.m_position = CSSPrimitiveValue::create(a->fValue, (CSSPrimitiveValue::UnitTypes)a->unit);
- a = args->next();
+ a = valueList->next();
}
}
- result->addStop(stop);
+ gradient->addStop(stop);
expectComma = true;
}
- Vector<CSSGradientColorStop>& stops = result->stops();
- if (stops.isEmpty())
- return false;
-
- gradient = result.release();
- return true;
+ // Must have 2 or more stops to be valid.
+ return gradient->stops().size() > 1;
}
bool CSSParser::isGeneratedImageValue(CSSParserValue* val) const
@@ -6026,6 +6005,35 @@ void CSSParser::addNamespace(const AtomicString& prefix, const AtomicString& uri
m_styleSheet->addNamespace(this, prefix, uri);
}
+void CSSParser::updateSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSSelector* specifiers)
+{
+ AtomicString determinedNamespace = namespacePrefix != nullAtom && m_styleSheet ? m_styleSheet->determineNamespace(namespacePrefix) : m_defaultNamespace;
+ QualifiedName tag = QualifiedName(namespacePrefix, elementName, determinedNamespace);
+ if (!specifiers->isUnknownPseudoElement()) {
+ specifiers->m_tag = tag;
+ return;
+ }
+
+ if (Document* doc = document())
+ doc->setUsesDescendantRules(true);
+
+ specifiers->m_relation = CSSSelector::ShadowDescendant;
+ if (CSSSelector* history = specifiers->tagHistory()) {
+ history->m_tag = tag;
+ return;
+ }
+
+ // No need to create an extra element name selector if we are matching any element
+ // in any namespace.
+ if (elementName == starAtom && m_defaultNamespace == starAtom)
+ return;
+
+ CSSSelector* elementNameSelector = fastNew<CSSSelector>();
+ elementNameSelector->m_tag = tag;
+ specifiers->setTagHistory(elementNameSelector);
+}
+
+
CSSRule* CSSParser::createPageRule(CSSSelector* pageSelector)
{
// FIXME: Margin at-rules are ignored.
diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h
index e60519e..496a21a 100644
--- a/Source/WebCore/css/CSSParser.h
+++ b/Source/WebCore/css/CSSParser.h
@@ -160,6 +160,7 @@ namespace WebCore {
bool parseDeprecatedGradient(RefPtr<CSSValue>&);
bool parseLinearGradient(RefPtr<CSSValue>&, CSSGradientRepeat repeating);
bool parseRadialGradient(RefPtr<CSSValue>&, CSSGradientRepeat repeating);
+ bool parseGradientColorStops(CSSParserValueList*, CSSGradientValue*, bool expectComma);
PassRefPtr<CSSValueList> parseTransform();
bool parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
@@ -203,6 +204,7 @@ namespace WebCore {
PassOwnPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*);
void addNamespace(const AtomicString& prefix, const AtomicString& uri);
+ void updateSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSSelector*);
void invalidBlockHit();
diff --git a/Source/WebCore/css/CSSSegmentedFontFace.cpp b/Source/WebCore/css/CSSSegmentedFontFace.cpp
index cdabec1..1f6e20d 100644
--- a/Source/WebCore/css/CSSSegmentedFontFace.cpp
+++ b/Source/WebCore/css/CSSSegmentedFontFace.cpp
@@ -88,7 +88,7 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti
return 0;
FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
- unsigned hashKey = (fontDescription.computedPixelSize() << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
+ unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
SegmentedFontData* fontData = m_fontDataTable.get(hashKey);
if (fontData)
diff --git a/Source/WebCore/css/CSSSelector.cpp b/Source/WebCore/css/CSSSelector.cpp
index c139dbf..400dd40 100644
--- a/Source/WebCore/css/CSSSelector.cpp
+++ b/Source/WebCore/css/CSSSelector.cpp
@@ -99,7 +99,10 @@ inline unsigned CSSSelector::specificityForOneSelector() const
case Contain:
case Begin:
case End:
- s += 0x100;
+ if (pseudoType() == PseudoNot && simpleSelector())
+ s += simpleSelector()->specificityForOneSelector();
+ else
+ s += 0x100;
case None:
break;
}
@@ -148,8 +151,6 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoInputSpeechButton:
return INPUT_SPEECH_BUTTON;
#endif
- case PseudoSliderThumb:
- return SLIDER_THUMB;
case PseudoSearchCancelButton:
return SEARCH_CANCEL_BUTTON;
case PseudoSearchDecoration:
@@ -417,7 +418,6 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
DEFINE_STATIC_LOCAL(AtomicString, searchResultsDecoration, ("-webkit-search-results-decoration"));
DEFINE_STATIC_LOCAL(AtomicString, searchResultsButton, ("-webkit-search-results-button"));
DEFINE_STATIC_LOCAL(AtomicString, selection, ("selection"));
- DEFINE_STATIC_LOCAL(AtomicString, sliderThumb, ("-webkit-slider-thumb"));
DEFINE_STATIC_LOCAL(AtomicString, target, ("target"));
DEFINE_STATIC_LOCAL(AtomicString, visited, ("visited"));
DEFINE_STATIC_LOCAL(AtomicString, windowInactive, ("window-inactive"));
@@ -546,7 +546,6 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
nameToPseudoType->set(searchResultsDecoration.impl(), CSSSelector::PseudoSearchResultsDecoration);
nameToPseudoType->set(searchResultsButton.impl(), CSSSelector::PseudoSearchResultsButton);
nameToPseudoType->set(selection.impl(), CSSSelector::PseudoSelection);
- nameToPseudoType->set(sliderThumb.impl(), CSSSelector::PseudoSliderThumb);
nameToPseudoType->set(target.impl(), CSSSelector::PseudoTarget);
nameToPseudoType->set(visited.impl(), CSSSelector::PseudoVisited);
nameToPseudoType->set(firstPage.impl(), CSSSelector::PseudoFirstPage);
@@ -634,7 +633,6 @@ void CSSSelector::extractPseudoType() const
case PseudoSearchResultsDecoration:
case PseudoSearchResultsButton:
case PseudoSelection:
- case PseudoSliderThumb:
element = true;
break;
case PseudoUnknown:
diff --git a/Source/WebCore/css/CSSSelector.h b/Source/WebCore/css/CSSSelector.h
index 353fb5e..1101eed 100644
--- a/Source/WebCore/css/CSSSelector.h
+++ b/Source/WebCore/css/CSSSelector.h
@@ -109,7 +109,8 @@ namespace WebCore {
Child,
DirectAdjacent,
IndirectAdjacent,
- SubSelector
+ SubSelector,
+ ShadowDescendant
};
enum PseudoType {
@@ -177,7 +178,6 @@ namespace WebCore {
PseudoNoButton,
PseudoSelection,
PseudoFileUploadButton,
- PseudoSliderThumb,
PseudoSearchCancelButton,
PseudoSearchDecoration,
PseudoSearchResultsDecoration,
@@ -277,6 +277,7 @@ namespace WebCore {
extractPseudoType();
return m_match == PseudoElement;
}
+ bool isUnknownPseudoElement() const;
Relation relation() const { return static_cast<Relation>(m_relation); }
@@ -344,6 +345,11 @@ namespace WebCore {
QualifiedName m_tag;
};
+inline bool CSSSelector::isUnknownPseudoElement() const
+{
+ return m_match == PseudoElement && m_pseudoType == PseudoUnknown;
+}
+
} // namespace WebCore
#endif // CSSSelector_h
diff --git a/Source/WebCore/css/CSSSelectorList.cpp b/Source/WebCore/css/CSSSelectorList.cpp
index 7f82ca4..7cb4df4 100644
--- a/Source/WebCore/css/CSSSelectorList.cpp
+++ b/Source/WebCore/css/CSSSelectorList.cpp
@@ -136,4 +136,20 @@ bool CSSSelectorList::selectorsNeedNamespaceResolution()
return forEachSelector(functor, this);
}
+class SelectorHasUnknownPseudoElementFunctor {
+public:
+ bool operator()(CSSSelector* selector)
+ {
+ return selector->isUnknownPseudoElement();
+ }
+};
+
+bool CSSSelectorList::hasUnknownPseudoElements() const
+{
+ SelectorHasUnknownPseudoElementFunctor functor;
+ return forEachSelector(functor, this);
+}
+
+
+
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSSelectorList.h b/Source/WebCore/css/CSSSelectorList.h
index 9e40ef8..7adc6b9 100644
--- a/Source/WebCore/css/CSSSelectorList.h
+++ b/Source/WebCore/css/CSSSelectorList.h
@@ -44,6 +44,7 @@ public:
bool hasOneSelector() const { return m_selectorArray ? m_selectorArray->isLastInSelectorList() : false; }
bool selectorsNeedNamespaceResolution();
+ bool hasUnknownPseudoElements() const;
private:
void deleteSelectors();
diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp
index 986591d..b98b90d 100644
--- a/Source/WebCore/css/CSSStyleSelector.cpp
+++ b/Source/WebCore/css/CSSStyleSelector.cpp
@@ -27,6 +27,9 @@
#include "CSSStyleSelector.h"
#include "Attribute.h"
+#include "ContentData.h"
+#include "CounterContent.h"
+#include "CursorList.h"
#include "CSSBorderImageValue.h"
#include "CSSCursorImageValue.h"
#include "CSSFontFaceRule.h"
@@ -76,6 +79,7 @@
#include "ScaleTransformOperation.h"
#include "SelectionController.h"
#include "Settings.h"
+#include "ShadowData.h"
#include "ShadowValue.h"
#include "SkewTransformOperation.h"
#include "StyleCachedImage.h"
@@ -424,6 +428,7 @@ public:
CSSRuleDataList* getIDRules(AtomicStringImpl* key) { return m_idRules.get(key); }
CSSRuleDataList* getClassRules(AtomicStringImpl* key) { return m_classRules.get(key); }
CSSRuleDataList* getTagRules(AtomicStringImpl* key) { return m_tagRules.get(key); }
+ CSSRuleDataList* getPseudoRules(AtomicStringImpl* key) { return m_pseudoRules.get(key); }
CSSRuleDataList* getUniversalRules() { return m_universalRules.get(); }
CSSRuleDataList* getPageRules() { return m_pageRules.get(); }
@@ -431,6 +436,7 @@ public:
AtomRuleMap m_idRules;
AtomRuleMap m_classRules;
AtomRuleMap m_tagRules;
+ AtomRuleMap m_pseudoRules;
OwnPtr<CSSRuleDataList> m_universalRules;
OwnPtr<CSSRuleDataList> m_pageRules;
unsigned m_ruleCount;
@@ -658,6 +664,10 @@ void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& l
for (size_t i = 0; i < size; ++i)
matchRulesForList(rules->getClassRules(classNames[i].impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
}
+ if (!m_element->shadowPseudoId().isEmpty()) {
+ ASSERT(m_styledElement);
+ matchRulesForList(rules->getPseudoRules(m_element->shadowPseudoId().impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
+ }
matchRulesForList(rules->getTagRules(m_element->localName().impl()), firstRuleIndex, lastRuleIndex, includeEmptyRules);
matchRulesForList(rules->getUniversalRules(), firstRuleIndex, lastRuleIndex, includeEmptyRules);
@@ -816,12 +826,7 @@ inline void CSSStyleSelector::initForStyleResolve(Element* e, RenderStyle* paren
{
m_checker.m_pseudoStyle = pseudoID;
- m_parentNode = e ? e->parentNode() : 0;
-
-#if ENABLE(SVG)
- if (!m_parentNode && e && e->isSVGElement() && e->isShadowRoot())
- m_parentNode = e->shadowHost();
-#endif
+ m_parentNode = e ? e->parentOrHostNode() : 0;
if (parentStyle)
m_parentStyle = parentStyle;
@@ -980,6 +985,7 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n) const
(s->hovered() == m_element->hovered()) &&
(s->active() == m_element->active()) &&
(s->focused() == m_element->focused()) &&
+ (s->shadowPseudoId() == m_element->shadowPseudoId()) &&
(s != s->document()->cssTarget() && m_element != m_element->document()->cssTarget()) &&
(s->fastGetAttribute(typeAttr) == m_element->fastGetAttribute(typeAttr)) &&
(s->fastGetAttribute(XMLNames::langAttr) == m_element->fastGetAttribute(XMLNames::langAttr)) &&
@@ -2051,6 +2057,14 @@ CSSStyleSelector::SelectorMatch CSSStyleSelector::SelectorChecker::checkSelector
!((RenderScrollbar::scrollbarForStyleResolve() || dynamicPseudo == SCROLLBAR_CORNER || dynamicPseudo == RESIZER) && sel->m_match == CSSSelector::PseudoClass))
return SelectorFailsCompletely;
return checkSelector(sel, e, selectorAttrs, dynamicPseudo, true, encounteredLink, elementStyle, elementParentStyle);
+ case CSSSelector::ShadowDescendant:
+ {
+ Node* shadowHostNode = e->shadowAncestorNode();
+ if (shadowHostNode == e || !shadowHostNode->isElementNode())
+ return SelectorFailsCompletely;
+ e = static_cast<Element*>(shadowHostNode);
+ return checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, encounteredLink);
+ }
}
return SelectorFailsCompletely;
@@ -2703,12 +2717,8 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
if (Document* document = e->document())
document->setUsesFirstLetterRules(true);
}
- if (pseudoId != NOPSEUDO) {
+ if (pseudoId != NOPSEUDO)
dynamicPseudo = pseudoId;
- return true;
- }
- ASSERT_NOT_REACHED();
- return false;
}
// ### add the rest of the checks...
return true;
@@ -2829,12 +2839,17 @@ void CSSRuleSet::addRule(CSSStyleRule* rule, CSSSelector* sel)
return;
}
+ if (sel->isUnknownPseudoElement()) {
+ addToRuleSet(sel->m_value.impl(), m_pseudoRules, rule, sel);
+ return;
+ }
+
const AtomicString& localName = sel->m_tag.localName();
if (localName != starAtom) {
addToRuleSet(localName.impl(), m_tagRules, rule, sel);
return;
}
-
+
// Just put it in the universal rule set.
if (!m_universalRules)
m_universalRules = adoptPtr(new CSSRuleDataList(m_ruleCount++, rule, sel));
diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h
index ec1b15e..d1464ca 100644
--- a/Source/WebCore/css/CSSValue.h
+++ b/Source/WebCore/css/CSSValue.h
@@ -21,8 +21,6 @@
#ifndef CSSValue_h
#define CSSValue_h
-#include "StyleBase.h"
-
#include "CSSParserValues.h"
#include "KURLHash.h"
#include <wtf/ListHashSet.h>
diff --git a/Source/WebCore/css/WebKitCSSMatrix.cpp b/Source/WebCore/css/WebKitCSSMatrix.cpp
index a4af7f8..7d60f8c 100644
--- a/Source/WebCore/css/WebKitCSSMatrix.cpp
+++ b/Source/WebCore/css/WebKitCSSMatrix.cpp
@@ -30,6 +30,7 @@
#include "CSSStyleSelector.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
#include "ExceptionCode.h"
#include "RenderStyle.h"
#include <wtf/MathExtras.h>
@@ -57,9 +58,14 @@ void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
if (p.parseValue(styleDeclaration.get(), CSSPropertyWebkitTransform, string, true)) {
// Convert to TransformOperations. This can fail if a property
// requires style (i.e., param uses 'ems' or 'exs')
- PassRefPtr<CSSValue> val = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);
+ RefPtr<CSSValue> value = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);
+
+ // Check for a "none" or empty transform. In these cases we can use the default identity matrix.
+ if (!value || (value->isPrimitiveValue() && (static_cast<CSSPrimitiveValue*>(value.get()))->getIdent() == CSSValueNone))
+ return;
+
TransformOperations operations;
- if (!CSSStyleSelector::createTransformOperations(val.get(), 0, 0, operations)) {
+ if (!CSSStyleSelector::createTransformOperations(value.get(), 0, 0, operations)) {
ec = SYNTAX_ERR;
return;
}
diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css
index 823f5f3..3c75559 100644
--- a/Source/WebCore/css/html.css
+++ b/Source/WebCore/css/html.css
@@ -2,7 +2,7 @@
* The default style sheet used to render HTML.
*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -474,6 +474,7 @@ input[type="range"] {
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: sliderthumb-horizontal;
+ display: block;
}
input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
@@ -536,10 +537,6 @@ select[size="1"] {
white-space: pre;
}
-datalist {
- display: none;
-}
-
optgroup {
font-weight: bolder;
}
@@ -552,6 +549,59 @@ output {
display: inline;
}
+/* form validation message bubble */
+
+::-webkit-validation-bubble {
+ display: block;
+ z-index: 2147483647;
+ position: absolute;
+ opacity: 0.9;
+ line-height: 0;
+ -webkit-transition: opacity 05.5s ease;
+}
+
+::-webkit-validation-bubble-message {
+ display: block;
+ font: message-box;
+ min-width: 50px;
+ max-width: 200px;
+ border: solid 2px black;
+ background: -webkit-gradient(linear, left top, left bottom, from(#fbf9f9), to(#f0e4e4));
+ padding: 8px;
+ -webkit-border-radius: 8px;
+ -webkit-box-shadow: 4px 4px 4px rgba(204,204,204,0.7);
+ line-height: normal;
+}
+
+::-webkit-validation-bubble-top-outer-arrow {
+ display: inline-block;
+ position: relative;
+ left: 14px;
+ height: 0;
+ width: 0;
+ border-style: solid;
+ border-width: 14px;
+ border-bottom-color: black;
+ border-right-color: transparent;
+ border-top-width: 0;
+ border-left-width: 0;
+}
+
+::-webkit-validation-bubble-top-inner-arrow {
+ display: inline-block;
+ height: 0;
+ width: 0;
+ border-style: solid;
+ border-width: 10px; /* <border box width of outer-arrow> - <message border width> * 2 */
+ border-bottom-color: #fbf9f9;
+ border-right-color: transparent;
+ border-top-width: 0;
+ border-left-width: 0;
+ position: relative;
+ top: 2px; /* <message border width> */
+ left: 2px; /* <outer-arrow position> + <message border width> - <border box width of outer-arrow> */
+}
+
/* meter */
meter {
@@ -738,6 +788,7 @@ ruby, rt {
rt {
line-height: normal;
+ -webkit-text-emphasis: none;
}
ruby > rt {
diff --git a/Source/WebCore/css/mediaControlsGtk.css b/Source/WebCore/css/mediaControlsGtk.css
index 18b7dcc..b4637f7 100644
--- a/Source/WebCore/css/mediaControlsGtk.css
+++ b/Source/WebCore/css/mediaControlsGtk.css
@@ -26,7 +26,17 @@ audio {
}
audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
- height: 20px;
+ display: -webkit-box;
+ -webkit-box-orient: horizontal;
+ -webkit-box-align: end;
+ -webkit-user-select: none;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ z-index: 0;
+ overflow: hidden;
+ text-align: right;
+ height: 100%;
}
audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
@@ -75,3 +85,21 @@ audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-f
width: 20px;
height: 20px;
}
+
+audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
+ -webkit-appearance: media-volume-slider-container;
+ position: absolute;
+ height: 100px;
+ width: 20px;
+}
+
+audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider {
+ -webkit-appearance: media-volume-slider;
+ display: inline;
+ position: absolute;
+ width: 14px;
+ height: 95px;
+
+ left: 3px;
+ top: 5px;
+} \ No newline at end of file
diff --git a/Source/WebCore/css/mediaControlsQtFullscreen.css b/Source/WebCore/css/mediaControlsQtFullscreen.css
new file mode 100644
index 0000000..d191331
--- /dev/null
+++ b/Source/WebCore/css/mediaControlsQtFullscreen.css
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+audio {
+ height: 34px;
+ width: 400px;
+}
+
+audio::-webkit-media-controls-panel {
+ display: -webkit-box;
+ -webkit-box-orient: horizontal;
+ -webkit-box-align: end;
+ -webkit-user-select: none;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ z-index: 0;
+ overflow: visible;
+ height: 100%;
+ text-align: right;
+}
+
+video::-webkit-media-controls-panel {
+/* The control panel is only play button for full screen */
+ display: -webkit-box;
+ -webkit-box-align: center;
+ -webkit-box-pack: center;
+ width: 100%;
+ height: 100%;
+}
+
+video:-webkit-full-page-media::-webkit-media-controls-panel {
+ display: none;
+}
+
+audio::-webkit-media-controls-mute-button {
+ width: 12px;
+ height: 12px;
+ padding: 6px;
+ margin: 5px 5px 5px 3px;
+}
+
+video::-webkit-media-controls-mute-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-play-button {
+ width: 9px;
+ height: 12px;
+ padding: 6px 12px 6px 11px;
+ margin: 5px 3px 5px 5px;
+}
+
+video::-webkit-media-controls-play-button {
+ display: -webkit-box;
+ -webkit-box-align: center;
+ -webkit-box-pack: center;
+ width: 50px;
+ height: 50px;
+ padding: 20px;
+}
+
+audio::-webkit-media-controls-timeline-container {
+ height: 34px;
+}
+
+video::-webkit-media-controls-timeline-container {
+ display: none;
+}
+
+audio::-webkit-media-controls-current-time-display {
+ -webkit-appearance: media-current-time-display;
+ -webkit-user-select: none;
+ display: inline-block;
+ height: 12px;
+ padding: 6px;
+ margin: 5px 3px;
+
+ overflow: hidden;
+ cursor: default;
+
+ text-align: center;
+ font-size: 10px;
+ font-family: Verdana;
+ font-weight: bold;
+ color: white;
+}
+
+video::-webkit-media-controls-current-time-display {
+ -webkit-appearance: media-current-time-display;
+ -webkit-user-select: none;
+ display: none;
+}
+
+audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display {
+ display: none;
+}
+
+audio::-webkit-media-controls-timeline {
+ height: 12px;
+ padding: 6px 8px;
+ margin: 5px 3px;
+}
+
+video::-webkit-media-controls-timeline {
+ display: none;
+}
+
+audio::-webkit-media-controls-volume-slider-container {
+ -webkit-appearance: media-volume-slider-container;
+ position: absolute;
+ height: 103px;
+ width: 24px;
+}
+
+video::-webkit-media-controls-volume-slider-container {
+ -webkit-appearance: media-volume-slider-container;
+ display: none;
+}
+
+audio::-webkit-media-controls-volume-slider {
+ -webkit-appearance: media-volume-slider;
+ display: inline;
+ position: absolute;
+
+ width: 12px;
+ padding: 6px;
+ height: 88px;
+ margin: 0 0 3px 0;
+}
+
+video::-webkit-media-controls-volume-slider {
+ -webkit-appearance: media-volume-slider;
+ display: none;
+}
+
+audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-fullscreen-button {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ width: 12px;
+ height: 12px;
+ padding: 6px;
+ margin: 5px 5px 5px 3px;
+}
+
+video::-webkit-media-controls-fullscreen-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-return-to-realtime-button, video::-webkit-media-controls-return-to-realtime-button {
+ display: none;
+}
+
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+ display: none;
+}
diff --git a/Source/WebCore/css/themeQtMobile.css b/Source/WebCore/css/themeQtMobile.css
index f6327a9..27be523 100644
--- a/Source/WebCore/css/themeQtMobile.css
+++ b/Source/WebCore/css/themeQtMobile.css
@@ -128,3 +128,7 @@ input[type="url"]:active,
textarea:active {
background: ButtonShadow;
}
+
+video {
+ background-color: #000000;
+}