Loading ...
Sorry, an error occurred while loading the content.

hasClass bug?

Expand Messages
  • lerhaupt
    Given html of: In YUI 2.5.2, YAHOO.util.Dom.hasClass( a , bar ) would return true. In YUI 2.8.0r4 as well as 2.7.0b it
    Message 1 of 2 , Sep 24, 2009
    • 0 Attachment
      Given html of:

      <div id="a" class="foo
      bar
      baz"></div>

      In YUI 2.5.2, YAHOO.util.Dom.hasClass("a", "bar") would return true.

      In YUI 2.8.0r4 as well as 2.7.0b it now returns false.

      Apparently the update to the code for hasClass in 2.7.0 broke the old supported behavior with regard to class names at the start of new lines. Bug or corrected behavior?

      Thanks,
      Gary

      diddit.com
    • lerhaupt
      yup http://yuilibrary.com/projects/yui2/ticket/2527825
      Message 2 of 2 , Sep 24, 2009
      • 0 Attachment
        yup http://yuilibrary.com/projects/yui2/ticket/2527825

        --- In ydn-javascript@yahoogroups.com, "lerhaupt" <gary@...> wrote:
        >
        > Given html of:
        >
        > <div id="a" class="foo
        > bar
        > baz"></div>
        >
        > In YUI 2.5.2, YAHOO.util.Dom.hasClass("a", "bar") would return true.
        >
        > In YUI 2.8.0r4 as well as 2.7.0b it now returns false.
        >
        > Apparently the update to the code for hasClass in 2.7.0 broke the old supported behavior with regard to class names at the start of new lines. Bug or corrected behavior?
        >
        > Thanks,
        > Gary
        >
        > diddit.com
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.