#390 ✓resolved
Brice

1.6.0.3: Class name with Cap letter not recognize in Webkit browsers

Reported by Brice | October 15th, 2008 @ 05:35 AM | in 1.6.1

In 1.6.0.3, a class name containing Cap letter is not recognized by utility method $$ in browsers using Webkit (Chrome and Safari tested under WinXP, Epiphany under Linux).

This feature was working in previous releases.

See attached test case.

Comments and changes to this ticket

  • Tobie Langel

    Tobie Langel October 15th, 2008 @ 11:08 AM

    • State changed from “new” to “bug”
    • Milestone set to 1.6.1
    • Tag changed from 1.6.0.3, webkit to 1.6.0.3, regression, webkit
  • Tobie Langel

    Tobie Langel October 15th, 2008 @ 11:09 AM

    • Assigned user set to “Andrew Dupont”
    • Tag changed from 1.6.0.3, regression, webkit to regression, webkit

    This is a serious regression issue.

  • Andrew Dupont

    Andrew Dupont October 16th, 2008 @ 10:36 PM

    Initial investigation suggests this is an issue only in quirks mode. If I add a DOCTYPE to the test page, it produces the expected result.

  • Andrew Dupont

    Andrew Dupont October 16th, 2008 @ 10:49 PM

    • Tag changed from regression, webkit to discuss, regression, webkit

    Ah, now I remember: "In quirks mode css class names are case insensitive. In standards mode they are case sensitive."

    Looks like WebKit emulates that behavior in a stupid way.

    This popped up in 1.6.0.3 because we use the Selectors API when possible. We can easily fix this by adding logic that says "don't use document.querySelectorAll if we're not in standards mode."

    
        // The Selectors API has issues in quirks mode using WebKit.
        if (Prototype.Browser.WebKit && document.compatMode === "BackCompat")
          return false;
    

    It'd then fall back to XPath.

    We don't officially support quirks mode, but this is an easy fix, so I'm in favor of it. I don't think we need tests for this, though, since if we open that can of worms we'd have to start testing everything in quirks mode.

    Tobie, your thoughts?

  • Tobie Langel

    Tobie Langel October 16th, 2008 @ 11:34 PM

    Thanks for the explanation Andrew, that helped a lot. (And sorry I missed the missing doctype.)

    Regarding quirks mode testing, our testing framework now allows us to run the whole test suite with different doctypes very easily (by providing a different template). I'd be pretty interested in trying it out, just to see what works and what doesn't. I suppose most of the problems are related to positioning and dimensions, so you're probably a lot more aware of potential issues than I am.

    I must admit being worried about offering even partial support for quirks-mode as it lessens the incentive to write proper markup... which in turn, might just bring in new requests for broader quirks mode support.

    How do other frameworks approach this issue ?

  • Brice

    Brice October 17th, 2008 @ 02:09 AM

    Just to confirm that after adding doctype (tried html4 strict and loose) class names with cap letters are well recognized.

    Thank for the heads up.

  • Juriy Zaytsev

    Juriy Zaytsev October 17th, 2008 @ 02:13 AM

    Andrew, Tobie,

    this seems to be fixed in WebKit nightlies (v. 3.1.2, build 37469)

    On the other hand, do we really need to sniff here? What about something like:

    
    var CAPITAL_VALUES_IGNORED = (function(){
      var el = document.createElement('div'),
          el2 = document.createElement('span');
    
      el2.className = 'Test';
      el.appendChild(el2);
      var isIgnored = (el.querySelector('.Test') !== null);
      el = el2 = null;
      return isIgnored;
    })();
    

    I haven't tested this thoroughly, but it seems to work as expected in both - "faulty" Safari and "fixed" WebKit.

  • GitHub Robot

    GitHub Robot November 19th, 2008 @ 06:26 AM

    • State changed from “bug” to “resolved”

    (from [3ad847ce4b824608b1f6f9c5a163db21c7744a4e]) Fix issue where certain versions of Safari treat class names case-insensitively in Selector/$$ queries. [#390 state:resolved] http://github.com/sstephenson/pr...

  • GitHub Robot

    GitHub Robot December 11th, 2008 @ 04:47 PM

    (from [86407790d238f74cb4e6858998f467e39d20e846]) Fix issue where certain versions of Safari treat class names case-insensitively in Selector/7390 queries. [#390 state:resolved] http://github.com/sstephenson/pr...

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:39 AM

    • Tag changed from discuss, regression, webkit to needs:discussion, webkit

    [not-tagged:"discuss" tagged:"needs:discussion" bulk edit command]

  • Tobie Langel

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Attachments

Referenced by

Pages