Bug 16703 - Acid3 expects [class=foo] selectors to be case sensitive
Summary: Acid3 expects [class=foo] selectors to be case sensitive
Status: RESOLVED DUPLICATE of bug 15470
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-01 22:08 PST by Eric Seidel (no email)
Modified: 2008-01-01 22:09 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-01-01 22:08:31 PST
Acid3 expects [class=foo] selectors to be case sensitive

IIRC we have code which makes attribute selectors case insensitive for HTML, excepting special cases (which I would have though have included class).  I might have actually even worked on such a patch... I feel like I did.  For some css3.info selectors test, iirc.

      selectorTest(function (doc, add, expect) {
        builder(doc);
        p.className = "selectorPingTest";
        var good = add("[class=selectorPingTest]");
        add("[class=SelectorPingTest]");
        add("[class=selectorpingtest]");
        expect(doc.body, 0, "failure 3");
        expect(p, good, "class attribute matching failed");
      });

That's the test case.

  function selectorTest(tester) {
    var iframe = document.getElementById("selectors");
    var doc = iframe.contentDocument;
    for (var i = doc.documentElement.childNodes.length-1; i >= 0; i -= 1)
      doc.documentElement.removeChild(doc.documentElement.childNodes[i]);
    doc.documentElement.appendChild(doc.createElement('head'));
    doc.documentElement.firstChild.appendChild(doc.createElement('title'));
    doc.documentElement.appendChild(doc.createElement('body'));
    var style = doc.createElement('style');
    style.appendChild(doc.createTextNode("* { z-index: 0; position: absolute; }\n"));
    doc.documentElement.firstChild.appendChild(style);
    var ruleCount = 0;
    tester(doc, function (selector) {
        ruleCount += 1;
        style.appendChild(doc.createTextNode(selector + " { z-index: " + ruleCount + "; }\n"));
        return ruleCount;
      }, function(node, rule, message) {
        var value = doc.defaultView.getComputedStyle(node, "").zIndex;
        assert(value != 'auto', "underlying problems prevent this test from running properly");
        assert(value == rule, "expected " + rule + ", got " + value + " - " + message);
    });
  }

is the interesting support function.
Comment 1 Eric Seidel (no email) 2008-01-01 22:09:54 PST

*** This bug has been marked as a duplicate of 15470 ***