Skip to content

Commit

Permalink
contrast ratio correction
Browse files Browse the repository at this point in the history
  • Loading branch information
lingua committed Jun 17, 2014
1 parent b1e9b0a commit bb672d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions data/contrast-finder-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
<label for="medium-size">
<input type="radio" name="text-size" id="medium-size" value="med">
<span id="medium-size-text">
14px &le; <span data-l10n-id="text"></span> &lt; 18px
14px &le; <span data-l10n-id="text"></span> &le; 18px
</span>
</label>
</div>
<div class="radio">
<label for="big-size">
<input type="radio" name="text-size" id="big-size" value="sup">
<span id="big-size-text">
<span data-l10n-id="text"></span> &ge; 18px
<span data-l10n-id="text"></span> &gt; 18px
</span>
</label>
</div>
Expand Down
4 changes: 2 additions & 2 deletions data/js/contrast-finder-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ function getResultAndEmit(elem, emitString) {
/********************************************************************/

function getIndexofSelectBoxRatio(fontSize, fontWeight, computeRatio) {
if ((fontSize < 18 && fontWeight < 700 && computeRatio < 4.5) || (fontSize < 14 && fontWeight >= 700 && computeRatio < 4.5)) {
if ((fontSize <= 18 && fontWeight < 700 && computeRatio < 4.5) || (fontSize < 14 && fontWeight >= 700 && computeRatio < 4.5)) {
return "4.5";
} else if ((fontSize >= 18 && fontWeight < 700 && computeRatio < 3) || (fontSize >= 14 && fontWeight >= 700 && computeRatio < 3 )) {
} else if ((fontSize > 18 && fontWeight < 700 && computeRatio < 3) || (fontSize >= 14 && fontWeight >= 700 && computeRatio < 3 )) {
return "3";
} else {
return "valid";
Expand Down
8 changes: 4 additions & 4 deletions data/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,22 @@ function setRatioFieldsetParameters(fontSize, fontWeight) {
small.checked = true;
ratio = "4.5";
pickerTextSize = "inf";
} else if (fontSize >= 18 && fontWeight < 700) {
} else if (fontSize > 18 && fontWeight < 700) {
boldState.checked = false;
big.checked = true;
ratio = "3";
pickerTextSize = "sup";
} else if (fontSize >= 18 && fontWeight >= 700) {
} else if (fontSize > 18 && fontWeight >= 700) {
boldState.checked = true;
big.checked = true;
ratio = "3";
pickerTextSize = "sup";
} else if (fontSize >= 14 && fontSize < 18 && fontWeight < 700) {
} else if (fontSize >= 14 && fontSize <= 18 && fontWeight < 700) {
boldState.checked = false;
medium.checked = true;
ratio = "4.5";
pickerTextSize = "med";
} else if (fontSize >= 14 && fontSize < 18 && fontWeight >= 700) {
} else if (fontSize >= 14 && fontSize <= 18 && fontWeight >= 700) {
boldState.checked = true;
medium.checked = true;
ratio = "3";
Expand Down

0 comments on commit bb672d3

Please sign in to comment.