Skip to content

Commit

Permalink
Test CSS test on font size instead of padding.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Oct 13, 2010
1 parent 9ede46b commit 73e4ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit/css.js
Expand Up @@ -113,8 +113,8 @@ test("css(String, Object)", function() {


// using contents will get comments regular, text, and comment nodes // using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents(); var j = jQuery("#nonnodes").contents();
j.css("padding-left", "1px"); j.css("fontSize", "1px");
equals( j.css("padding-left"), "1px", "Check node,textnode,comment css works" ); equals( j.css("fontSize"), "1px", "Check node,textnode,comment css works" );


// opera sometimes doesn't update 'display' correctly, see #2037 // opera sometimes doesn't update 'display' correctly, see #2037
jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML
Expand Down

2 comments on commit 73e4ef2

@jitter
Copy link
Contributor

@jitter jitter commented on 73e4ef2 Oct 13, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test change breaks in all Opera versions (at least for me). I don't have time at the moment to investigate this further but it looks like you can't set the font-size to anything smaller then 9px (you can set it but it gets ignored)

@jitter
Copy link
Contributor

@jitter jitter commented on 73e4ef2 Oct 13, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon further investigation I discovered that Opera by default enforces a Minimum font size of 9px for webpage text (it a configurable limit). Actually I never took note before of this setting which sits right there under Settings - Advanced - Fonts - Minimum font size (pixels). If I change it to 1px the test in question succeeds.

I also found that (which I wasn't aware before) Firefox, Safari and IE all have the ability to define such a minimum font size (for accessibility reasons) although none of them activate this by default. Of the major browsers only Chrome doesn't support such a setting.

So I suggest changing j.css("fontSize", "1px"); to something like j.css("fontSize", "15px"); to correct this false negative

Please sign in to comment.