Title: [208142] trunk/Source/WebCore
- Revision
- 208142
- Author
- [email protected]
- Date
- 2016-10-31 08:01:18 -0700 (Mon, 31 Oct 2016)
Log Message
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164211
Reviewed by Darin Adler.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
Make sure to properly reject invalid transform-origin-z values.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeAttribute):
Make attribute selector parsing strict about requiring a ] to end
the selector.
(WebCore::CSSSelectorParser::consumePseudo):
Force the nth-child "of" syntax to have whitespace after "of" but
before the selector. It is unclear if this should be a requirement
or not (spec is ambiguous), but for now we match the old parser.
(WebCore::CSSSelectorParser::consumeCombinator):
Fix a bug that caused the double child combinator to match even
when there was whitespace between the two > symbols.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (208141 => 208142)
--- trunk/Source/WebCore/ChangeLog 2016-10-31 13:42:43 UTC (rev 208141)
+++ trunk/Source/WebCore/ChangeLog 2016-10-31 15:01:18 UTC (rev 208142)
@@ -1,3 +1,28 @@
+2016-10-30 Dave Hyatt <[email protected]>
+
+ [CSS Parser] Miscellaneous bug fixes
+ https://bugs.webkit.org/show_bug.cgi?id=164211
+
+ Reviewed by Darin Adler.
+
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::CSSPropertyParser::consumeTransformOrigin):
+ Make sure to properly reject invalid transform-origin-z values.
+
+ * css/parser/CSSSelectorParser.cpp:
+ (WebCore::CSSSelectorParser::consumeAttribute):
+ Make attribute selector parsing strict about requiring a ] to end
+ the selector.
+
+ (WebCore::CSSSelectorParser::consumePseudo):
+ Force the nth-child "of" syntax to have whitespace after "of" but
+ before the selector. It is unclear if this should be a requirement
+ or not (spec is ambiguous), but for now we match the old parser.
+
+ (WebCore::CSSSelectorParser::consumeCombinator):
+ Fix a bug that caused the double child combinator to match even
+ when there was whitespace between the two > symbols.
+
2016-10-31 Youenn Fablet <[email protected]>
RTCOfferAnswerOptions does not need to be refcounted
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (208141 => 208142)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2016-10-31 13:42:43 UTC (rev 208141)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2016-10-31 15:01:18 UTC (rev 208142)
@@ -364,7 +364,11 @@
RefPtr<CSSPrimitiveValue> resultX;
RefPtr<CSSPrimitiveValue> resultY;
if (consumeOneOrTwoValuedPosition(m_range, m_context.mode, UnitlessQuirk::Forbid, resultX, resultY)) {
+ m_range.consumeWhitespace();
+ bool atEnd = m_range.atEnd();
RefPtr<CSSPrimitiveValue> resultZ = consumeLength(m_range, m_context.mode, ValueRangeAll);
+ if (!resultZ && !atEnd)
+ return false;
if (!resultZ)
resultZ = CSSValuePool::singleton().createValue(0, CSSPrimitiveValue::UnitTypes::CSS_PX);
addProperty(CSSPropertyTransformOriginX, CSSPropertyTransformOrigin, resultX.releaseNonNull(), important);
Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (208141 => 208142)
--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2016-10-31 13:42:43 UTC (rev 208141)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2016-10-31 15:01:18 UTC (rev 208142)
@@ -420,6 +420,9 @@
{
ASSERT(range.peek().type() == LeftBracketToken);
CSSParserTokenRange block = range.consumeBlock();
+ if (block.end() == range.end())
+ return nullptr; // No ] was found. Be strict about this.
+
block.consumeWhitespace();
AtomicString namespacePrefix;
@@ -572,6 +575,8 @@
const CSSParserToken& ident = block.consume();
if (!equalIgnoringASCIICase(ident.value(), "of"))
return nullptr;
+ if (block.peek().type() != WhitespaceToken)
+ return nullptr;
DisallowPseudoElementsScope scope(this);
block.consumeWhitespace();
std::unique_ptr<CSSSelectorList> selectorList = std::unique_ptr<CSSSelectorList>(new CSSSelectorList());
@@ -671,16 +676,25 @@
UChar delimiter = range.peek().delimiter();
if (delimiter == '+' || delimiter == '~' || delimiter == '>') {
- range.consumeIncludingWhitespace();
- if (delimiter == '+')
+ if (delimiter == '+') {
+ range.consumeIncludingWhitespace();
return CSSSelector::DirectAdjacent;
- if (delimiter == '~')
+ }
+
+ if (delimiter == '~') {
+ range.consumeIncludingWhitespace();
return CSSSelector::IndirectAdjacent;
+ }
+
#if ENABLE_CSS_SELECTORS_LEVEL4
- if (delimiter == '>' && range.peek().type() == DelimiterToken && range.peek().delimiter() == '>') {
+ range.consume();
+ if (range.peek().type() == DelimiterToken && range.peek().delimiter() == '>') {
range.consumeIncludingWhitespace();
return CSSSelector::DescendantDoubleChild;
}
+ range.consumeWhitespace();
+#else
+ range.consumeIncludingWhitespace();
#endif
return CSSSelector::Child;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes