Diff
Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/ChangeLog 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog 2015-07-24 17:59:51 UTC (rev 187346)
@@ -1,3 +1,29 @@
+2015-07-24 Lucas Forschler <[email protected]>
+
+ Merge r187149
+
+ 2015-07-21 Benjamin Poulain <[email protected]>
+
+ [CSS Selectors Level 4] Add #ifdefs to the new '>>' descendant combinator
+ https://bugs.webkit.org/show_bug.cgi?id=147184
+
+ Reviewed by Anders Carlsson.
+
+ Now that '>>>' is dead, the combinator '>>' is at risk.
+
+ This patch #ifdef all that code with the other experimental
+ features from Level 4.
+
+ * css/CSSGrammar.y.in:
+ * css/CSSParserValues.cpp:
+ (WebCore::CSSParserSelector::appendTagHistory):
+ * css/CSSParserValues.h:
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::CSSSelector):
+ (WebCore::CSSSelector::selectorText):
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::CSSSelector):
+
2015-07-24 Matthew Hanson <[email protected]>
Merge r187036. rdar://problem/21901881
Modified: branches/safari-601.1-branch/Source/WebCore/css/CSSGrammar.y.in (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/css/CSSGrammar.y.in 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/css/CSSGrammar.y.in 2015-07-24 17:59:51 UTC (rev 187346)
@@ -1011,7 +1011,9 @@
'+' maybe_space { $$ = CSSParserSelectorCombinator::DirectAdjacent; }
| '~' maybe_space { $$ = CSSParserSelectorCombinator::IndirectAdjacent; }
| '>' maybe_space { $$ = CSSParserSelectorCombinator::Child; }
+#if ENABLE_CSS_SELECTORS_LEVEL4
| '>' '>' maybe_space { $$ = CSSParserSelectorCombinator::DescendantDoubleChild; }
+#endif
;
maybe_unary_operator: unary_operator | { $$ = 1; } ;
Modified: branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.cpp (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.cpp 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.cpp 2015-07-24 17:59:51 UTC (rev 187346)
@@ -336,9 +336,11 @@
case CSSParserSelectorCombinator::DescendantSpace:
selectorRelation = CSSSelector::Descendant;
break;
+#if ENABLE(CSS_SELECTORS_LEVEL4)
case CSSParserSelectorCombinator::DescendantDoubleChild:
selectorRelation = CSSSelector::Descendant;
break;
+#endif
case CSSParserSelectorCombinator::DirectAdjacent:
selectorRelation = CSSSelector::DirectAdjacent;
break;
@@ -348,8 +350,10 @@
}
end->setRelation(selectorRelation);
+#if ENABLE(CSS_SELECTORS_LEVEL4)
if (relation == CSSParserSelectorCombinator::DescendantDoubleChild)
end->setDescendantUseDoubleChildSyntax();
+#endif
end->setTagHistory(WTF::move(selector));
}
Modified: branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.h (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.h 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/css/CSSParserValues.h 2015-07-24 17:59:51 UTC (rev 187346)
@@ -181,7 +181,9 @@
enum class CSSParserSelectorCombinator {
Child,
DescendantSpace,
+#if ENABLE(CSS_SELECTORS_LEVEL4)
DescendantDoubleChild,
+#endif
DirectAdjacent,
IndirectAdjacent
};
@@ -236,7 +238,9 @@
void prependTagSelector(const QualifiedName&, bool tagIsForNamespaceRule = false);
private:
+#if ENABLE(CSS_SELECTORS_LEVEL4)
void setDescendantUseDoubleChildSyntax() { m_selector->setDescendantUseDoubleChildSyntax(); }
+#endif
std::unique_ptr<CSSSelector> m_selector;
std::unique_ptr<CSSParserSelector> m_tagHistory;
Modified: branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.cpp (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.cpp 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.cpp 2015-07-24 17:59:51 UTC (rev 187346)
@@ -60,7 +60,9 @@
, m_hasNameWithCase(false)
, m_isForPage(false)
, m_tagIsForNamespaceRule(tagIsForNamespaceRule)
+#if ENABLE(CSS_SELECTORS_LEVEL4)
, m_descendantDoubleChildSyntax(false)
+#endif
, m_caseInsensitiveAttributeValueMatching(false)
{
const AtomicString& tagLocalName = tagQName.localName();
@@ -699,8 +701,10 @@
if (const CSSSelector* tagHistory = cs->tagHistory()) {
switch (cs->relation()) {
case CSSSelector::Descendant:
+#if ENABLE(CSS_SELECTORS_LEVEL4)
if (cs->m_descendantDoubleChildSyntax)
return tagHistory->selectorText(" >> " + str.toString() + rightSide);
+#endif
return tagHistory->selectorText(" " + str.toString() + rightSide);
case CSSSelector::Child:
return tagHistory->selectorText(" > " + str.toString() + rightSide);
Modified: branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.h (187345 => 187346)
--- branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.h 2015-07-24 17:51:05 UTC (rev 187345)
+++ branches/safari-601.1-branch/Source/WebCore/css/CSSSelector.h 2015-07-24 17:59:51 UTC (rev 187346)
@@ -283,11 +283,13 @@
ASSERT(m_relation == relation);
}
+#if ENABLE(CSS_SELECTORS_LEVEL4)
void setDescendantUseDoubleChildSyntax()
{
ASSERT(relation() == Descendant);
m_descendantDoubleChildSyntax = true;
}
+#endif
Match match() const { return static_cast<Match>(m_match); }
void setMatch(Match match)
@@ -315,7 +317,9 @@
unsigned m_hasNameWithCase : 1;
unsigned m_isForPage : 1;
unsigned m_tagIsForNamespaceRule : 1;
+#if ENABLE(CSS_SELECTORS_LEVEL4)
unsigned m_descendantDoubleChildSyntax : 1;
+#endif
unsigned m_caseInsensitiveAttributeValueMatching : 1;
unsigned simpleSelectorSpecificityForPage() const;
@@ -455,7 +459,9 @@
, m_hasNameWithCase(false)
, m_isForPage(false)
, m_tagIsForNamespaceRule(false)
+#if ENABLE(CSS_SELECTORS_LEVEL4)
, m_descendantDoubleChildSyntax(false)
+#endif
, m_caseInsensitiveAttributeValueMatching(false)
{
}
@@ -471,7 +477,9 @@
, m_hasNameWithCase(o.m_hasNameWithCase)
, m_isForPage(o.m_isForPage)
, m_tagIsForNamespaceRule(o.m_tagIsForNamespaceRule)
+#if ENABLE(CSS_SELECTORS_LEVEL4)
, m_descendantDoubleChildSyntax(o.m_descendantDoubleChildSyntax)
+#endif
, m_caseInsensitiveAttributeValueMatching(o.m_caseInsensitiveAttributeValueMatching)
{
if (o.m_hasRareData) {