• fs's avatar
    Match <area shape> ASCII case-insensitively · 07a9d830
    fs authored
    The 'shape' attribute on HTMLAreaElement is an "enumerated attribute"
    [1], which means that it should be matched ASCII case-insensitively[2].
    
    To get a proper overload of equalIgnoringASCIICase(...) that matches the
    required use (AtomicString against string literal/const char*),
    restructure the definition of equalIgnoringASCIICase() to do away with
    the templated version in favor of a generic StringImpl* version, and
    specific wrappers around that one for AtomicString/String.
    Also add a specialization for comparing against char/LChar.
    
    No effect on the specified test because:
    a) Invalid/missing value default is not per spec, so the unexpected shape
    is picked anyway.
    But more importantly:
    b) the way case-folding is implemented/specified, no non-ASCII character
    is case-folded to something in the ASCII-range.
    
    [1] https://html.spec.whatwg.org/multipage/embedded-content.html#attr-area-shape
    [2] https://html.spec.whatwg.org/multipage/infrastructure.html#enumerated-attribute
    
    TEST=fast/html/area-shape.html
    BUG=578125
    
    Review URL: https://codereview.chromium.org/1624383002
    
    Cr-Commit-Position: refs/heads/master@{#371478}
    07a9d830
StringImpl.h 26.8 KB