https://bugzilla.wikimedia.org/show_bug.cgi?id=32186

       Web browser: ---
             Bug #: 32186
           Summary: Remove weird user-agent sniffing from
                    jquery.textSelection scrolling
           Product: MediaWiki
           Version: 1.19-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Javascript
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


jquery.textSelection's scrollToCaretPosition() function has some weird-looking
UA sniffing bits:

    function getLineLength( e ) {
        return Math.floor( e.scrollWidth / ( $.client.profile().platform ==
'linux' ? 7 : 8 ) );
    }

What's that even mean? Why would being on Linux specifically mean the magic 7
number comes in? This looks like some awful magic code which is totally
undocumented.

Then a bit later similar:
        return ( $.client.profile().platform == 'mac' ? 13 : (
$.client.profile().platform == 'linux' ? 15 : 16 ) ) * row;

What is this? Is it assuming that certain font sizes are always in use? This
shouldn't fly...

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to