[Webkit-unassigned] [Bug 215635] New: [CSS Selector] Unknown combinator is not addressed correctly in |CSSSelectorParser::consumeComplexSelector|

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 18 18:34:26 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=215635

            Bug ID: 215635
           Summary: [CSS Selector] Unknown combinator is not addressed
                    correctly in
                    |CSSSelectorParser::consumeComplexSelector|
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jh718.park at samsung.com

CSS Selector unknown combinator is not addressed properly.

For example, as in https://jsfiddle.net/zhp5o1a7/, if execute below code,
<html>
<style>@supports  selector(A | .B) { #test {color: red}}</style>
<div id="test">test</div>
<script>console.log(CSS.supports("selector(A | .B)"));</script>
</html>

@supports selector(A | .B) function indicates that A | .B is supported css selector.

If I put some printf statements like this,

bool CSSSelectorParser::supportsComplexSelector(CSSParserTokenRange range, const CSSParserContext& context)
{
    range.consumeWhitespace();
    CSSSelectorParser parser(context, nullptr);
    printf("CSSSelectorParser::supportsComplexSelector: %s\n", range.serialize().utf8().data());
    auto parserSelector = parser.consumeComplexSelector(range);
    if (parser.m_failedParsing || !range.atEnd() || !parserSelector)
        return false;
    auto complexSelector = parserSelector->releaseSelector();
    printf("complexSelector: %s\n", complexSelector->value().string().utf8().data());
    ASSERT(complexSelector);
    if (containsUnknownWebKitPseudoElements(*complexSelector))
        return false;
    return true;
}

below logs are printed.

CSSSelectorParser::supportsComplexSelector: A | .B
complexSelector: B

So, it seems that |CSSSelectorParser::consumeComplexSelector| doesn't address the unknown combinator correctly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200819/223eb1a3/attachment.htm>


More information about the webkit-unassigned mailing list