forked from lojjic/PIE
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with rendering of rounded borders:
- Box path calculation has been improved to ensure a correct (squared) path when the shrink is greater than the radius. - Rewrote border renderer to use only fills with "eofill" subpaths to make the cut-outs for dashed/dotted/double styles. - Dashes are now centered along the edge like WebKit does. - Removed all logic around VML stroke as it is no longer used. - Flattened the getBoxPath method signature to avoid unnecessary transient object creation. Fixes issue lojjic#11
- Loading branch information
Jason Johnston
committed
Nov 13, 2011
1 parent
1c3fb0d
commit 47dc9d8
Showing
8 changed files
with
416 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<meta content="text/html; charset=UTF-8" http-equiv="content-type"> | ||
<title>Test cases for border-radius</title> | ||
|
||
<style type="text/css"> | ||
|
||
html { -pie-load-path: "../build"; } | ||
|
||
body { | ||
font-size: 12px; | ||
} | ||
|
||
#tests { | ||
padding: 2em; | ||
} | ||
#tests div { | ||
width: 50%; | ||
padding: 1.5em; | ||
margin: 1em 0; | ||
background: white; | ||
white-space: pre; | ||
behavior: url(../build/PIE.htc); | ||
position: relative; | ||
background: #CCF; | ||
} | ||
|
||
</style> | ||
|
||
</head> | ||
<body> | ||
|
||
<h1>Tests for border-radius</h1> | ||
|
||
<div id="tests"> | ||
<h2>Uniform</h2> | ||
<div>border-radius: 10px;</div> | ||
<div>border-radius: 1em;</div> | ||
<div>border-radius: 20%;</div> | ||
|
||
<h2>Different per corner</h2> | ||
<div>border-radius: 5px 10px 15px 20px;</div> | ||
<div>border-radius: 0.5em 1em 1.5em 2em;</div> | ||
<div>border-radius: 10% 20% 30% 40%;</div> | ||
|
||
<h2>Single corner</h2> | ||
<div>border-radius: 20px 0 0 0;</div> | ||
<div>border-radius: 0 20px 0 0;</div> | ||
<div>border-radius: 0 0 20px 0;</div> | ||
<div>border-radius: 0 0 0 20px;</div> | ||
|
||
<h2>X and Y</h2> | ||
<div>border-radius: 30px / 10px;</div> | ||
<div>border-radius: 3em / 1em;</div> | ||
<div>border-radius: 20% / 50%;</div> | ||
<div>border-radius: 5px 10px 15px 20px / 20px 15px 10px 5px;</div> | ||
|
||
<h2>Uniform with border</h2> | ||
<div>border-radius: 10px; border: 5px solid #000;</div> | ||
<div>border-radius: 10px; border: 5px dotted #000;</div> | ||
<div>border-radius: 10px; border: 5px dashed #000;</div> | ||
<div>border-radius: 10px; border: 5px double #000;</div> | ||
<!-- | ||
<div>border-radius: 10px; border: 5px groove #000;</div> | ||
<div>border-radius: 10px; border: 5px ridge #000;</div> | ||
<div>border-radius: 10px; border: 5px inset #000;</div> | ||
<div>border-radius: 10px; border: 5px outset #000;</div> | ||
--> | ||
|
||
<h2>Differing border widths</h2> | ||
<div>border-radius: 10px; border: solid #000; border-width: 6px 9px 6px 3px;</div> | ||
<div>border-radius: 10px; border: dotted #000; border-width: 6px 9px 6px 3px;</div> | ||
<div>border-radius: 10px; border: dashed #000; border-width: 6px 9px 6px 3px;</div> | ||
<div>border-radius: 10px; border: double #000; border-width: 6px 9px 6px 3px;</div> | ||
|
||
<h2>Border thicker than radius</h2> | ||
<div>border-radius: 10px; border: 20px solid #000;</div> | ||
<div>border-radius: 10px; border: 20px dotted #000;</div> | ||
<div>border-radius: 10px; border: 20px dashed #000;</div> | ||
<div>border-radius: 10px; border: 20px double #000;</div> | ||
<div>border-radius: 10px; border: solid #000; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: dotted #000; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: dashed #000; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: double #000; border-width: 3px 20px 9px 15px;</div> | ||
|
||
<h2>Zero-width borders</h2> | ||
<div>border-radius: 10px; border: 20px solid #000; border-top-width: 0;</div> | ||
<div>border-radius: 10px; border: 20px dotted #000; border-right-width: 0;</div> | ||
<div>border-radius: 10px; border: 20px dashed #000; border-bottom-width: 0;</div> | ||
<div>border-radius: 10px; border: 20px double #000; border-left-width: 0;</div> | ||
|
||
<h2>Differing border colors</h2> | ||
<div>border-radius: 10px; border: 20px solid; border-color: red green blue orange;</div> | ||
<div>border-radius: 10px; border: 20px dotted; border-color: red green blue orange;</div> | ||
<div>border-radius: 10px; border: 20px dashed; border-color: red green blue orange;</div> | ||
<div>border-radius: 10px; border: 20px double; border-color: red green blue orange;</div> | ||
|
||
<h2>Differing border colors and styles</h2> | ||
<div>border-radius: 10px; border: 20px; border-color: red green blue orange; border-style: solid dotted dashed double;</div> | ||
|
||
<h2>Differing border colors and widths</h2> | ||
<div>border-radius: 10px; border: solid; border-color: red green blue orange; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: dotted; border-color: red green blue orange; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: dashed; border-color: red green blue orange; border-width: 3px 20px 9px 15px;</div> | ||
<div>border-radius: 10px; border: double; border-color: red green blue orange; border-width: 3px 20px 9px 15px;</div> | ||
|
||
<h2>Differing border colors, styles, and widths</h2> | ||
<div>border-radius: 10px; border-style: solid dotted dashed double; border-color: red green blue orange; border-width: 3px 20px 9px 15px;</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
(function() { | ||
var divs= document.getElementById("tests").getElementsByTagName("div"), | ||
i = 0, len = divs.length, css; | ||
for(; i < len; i++) { | ||
divs[i].style.cssText += divs[i].firstChild.nodeValue; | ||
} | ||
})(); | ||
</script> | ||
|
||
|
||
</body> | ||
</html> |