"Santhosh.thottingal" changed the status of MediaWiki.r111374 to "ok"
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/111374

Old status:  new
New status: ok

Commit summary for MediaWiki.r111374:

[WebFonts tests] Refactor / fix breakage

* attr() / css() problem (r109144)
-- Basically undoes r109144, which changed usage of css() to attr().
-- attr() returns the attribute value, whereas the style property (via css()) 
returns the actually used/applied style in the DOM. The latter should be 
tested, because attr() will always return what it was given, so it will never 
appear to fail even when it doesn't work.
-- It turns out that in Chrome, creating an element and setting some style 
properties, will not instantly update and/or create a "style" attribute with 
the cssText. Triggering the browser to index the element (by accessing 
innerHTML) fixes this for Chrome. This is a work-around that only applies to 
the unit test and is fine. It does not affect production, since in production 
these elements would be pre-existing at least one function call ahead of time 
(usually even from the server response).

* <body> attribute restoration (r109230)
-- Code was storing and setting the <body lang> attribute, and then supposedly 
restored it later by doing ``$body.attr( 'lang', bodyLang );``. However, since 
attr() does both retrieval and setting of attributes, if the second arguments 
is undefined, it will return the current value instead of setting it to 
'undefined'.
-- The reason <body lang> value was undefined, is because MediaWiki stores it 
on <html>, not on the <body>.
-- Fixed code by getting/setting the lang-attribute from <html> instead, and 
added an undefined-check to be future proof.

* <select> test failure (r#)
-- The unit test was failing on <select> before the switch to attr(), even 
after the above fix the <select> test was still failing. This is actually not a 
bug anywhere in WebFonts, but something browsers don't allow/support.
-- Removed 'select' selector from tests and from production code

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to