Ticket #6015: tabindex_bug.patch

File tabindex_bug.patch, 1.1 KB (added by Richard Barrell, 14 years ago)

Proposed patch. Same workaround as for the fact that old Safari returns "undefined" when it should return -1.

  • _source/core/dom/element.js

     
    527527                                {
    528528                                        var tabIndex = this.$.tabIndex;
    529529
     530                    // WebKit (as of r63640) returns 0 for tabIndex of
     531                    // fieldset and legend elements, despite these elements not
     532                    // being focusable. As with the undefined case, get it from
     533                    // the attribute instead.
     534                    // https://bugs.webkit.org/show_bug.cgi?id=42765
     535
    530536                                        // Safari returns "undefined" for elements that should not
    531537                                        // have tabindex (like a div). So, we must try to get it
    532538                                        // from the attribute.
    533539                                        // https://bugs.webkit.org/show_bug.cgi?id=20596
    534                                         if ( tabIndex == undefined )
     540                                        if ( (tabIndex == undefined) ||
     541                         (this.$.nodeName === 'FIELDSET') ||
     542                         (this.$.nodeName === 'LEGEND') )
    535543                                        {
    536544                                                tabIndex = parseInt( this.getAttribute( 'tabindex' ), 10 );
    537545
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy