Skip to content
Permalink
Browse files

Test CSS test on font size instead of padding.

  • Loading branch information...
jeresig committed Oct 13, 2010
1 parent 9ede46b commit 73e4ef27f0d0a92e573092729107ca5572d52292
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/unit/css.js
@@ -113,8 +113,8 @@ test("css(String, Object)", function() {

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

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

2 comments on commit 73e4ef2

@jitter

This comment has been minimized.

Copy link
Contributor

replied Oct 13, 2010

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

This comment has been minimized.

Copy link
Contributor

replied Oct 13, 2010

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.
You can’t perform that action at this time.