├── lib
├── blank.gif
├── src
│ ├── IE7.js
│ ├── IE8.js
│ ├── IE9.js
│ ├── blank.gif
│ ├── ie7-squish.js
│ └── ie7-recalc.js
├── LICENSE
├── ie7-squish.js
├── ie7-recalc.js
├── IE7.js
└── IE8.js
├── src
├── blank.gif
├── build.php
├── ie9-layout.js
├── ie9-graphics.js
├── ie8-graphics.js
├── ie9-html.js
├── ie8-layout.js
├── ie7-squish.js
├── ie7-html.js
├── ie7-dhtml.js
├── ie8-html.js
├── ie7-overflow.js
├── ie7-ie5.js
├── ie7-quirks.js
├── ie7-graphics.js
├── ie7-recalc.js
├── ie9-css.js
├── ie8-css.js
├── ie7-fixed.js
├── ie7-layout.js
├── cssQuery.js
├── base2.js
└── ie7-css.js
└── README.md
/lib/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/lib/blank.gif
--------------------------------------------------------------------------------
/lib/src/IE7.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/lib/src/IE7.js
--------------------------------------------------------------------------------
/lib/src/IE8.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/lib/src/IE8.js
--------------------------------------------------------------------------------
/lib/src/IE9.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/lib/src/IE9.js
--------------------------------------------------------------------------------
/src/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/src/blank.gif
--------------------------------------------------------------------------------
/src/build.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/src/build.php
--------------------------------------------------------------------------------
/lib/src/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/roylory/ie7-js/HEAD/lib/src/blank.gif
--------------------------------------------------------------------------------
/src/ie9-layout.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie9-layout.js
4 | // =========================================================================
5 |
--------------------------------------------------------------------------------
/src/ie9-graphics.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie9-graphics.js
4 | // =========================================================================
5 |
6 | IE7.CSS.addFix(/\bopacity\s*:\s*([\d.]+)/, function(match, value) {
7 | return "zoom:1;filter:Alpha(opacity=" + ((value * 100) || 1) + ")";
8 | });
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ie7-js
2 | ======
3 |
4 | Dean Edward's original code is from http://code.google.com/p/ie7-js/
5 |
6 | I have stripped down the code in the same way Integralist did in http://github.com/Integralist/Dean-Edwards--IE-7-and-8-and-9
7 |
8 | Plus, I changed it to load css files asynchronously so that it does not block. This fixed the notable performance issue for me.
--------------------------------------------------------------------------------
/src/ie8-graphics.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie8-graphics.js
4 | // =========================================================================
5 |
6 | if (appVersion < 8) {
7 | // fix object[type=image/*]
8 | var IMAGE = /^image/i;
9 | IE7.HTML.addRecalc("object", function(element) {
10 | if (IMAGE.test(element.type)) {
11 | element.body.style.cssText = "margin:0;padding:0;border:none;overflow:hidden";
12 | return element;
13 | }
14 | });
15 | }
16 |
--------------------------------------------------------------------------------
/src/ie9-html.js:
--------------------------------------------------------------------------------
1 |
2 | var HTML5 = "article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");
3 | for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName);
4 |
5 | HEADER += "datalist{display:none}\
6 | details{padding-left:40px;display:block;margin:1em 0}\
7 | meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}\
8 | progress{width:10em;}\
9 | article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}\
10 | figure{margin:1em 40px;display:block}\
11 | mark{background:yellow}";
12 |
--------------------------------------------------------------------------------
/src/ie8-layout.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie8-layout.js
4 | // =========================================================================
5 |
6 | if (appVersion < 8) {
7 | IE7.CSS.addRecalc("border-spacing", NUMERIC, function(element) {
8 | if (element.currentStyle.borderCollapse !== "collapse") {
9 | element.cellSpacing = getPixelValue(element, element.currentStyle["ie7-border-spacing"].split(" ")[0]);
10 | }
11 | });
12 | IE7.CSS.addRecalc("box-sizing", "content-box", IE7.Layout.boxSizing);
13 | IE7.CSS.addRecalc("box-sizing", "border-box", IE7.Layout.borderBox);
14 | }
15 |
--------------------------------------------------------------------------------
/lib/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2004-2010 Dean Edwards
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/lib/ie7-squish.js:
--------------------------------------------------------------------------------
1 |
2 | /* ---------------------------------------------------------------------
3 |
4 | Squish some IE bugs!
5 |
6 | Some of these bug fixes may have adverse effects so they are
7 | not included in the standard library. Add your own if you want.
8 |
9 | --------------------------------------------------------------------- */
10 |
11 | // NOTE: IE7.Layout.boxSizing is the same as the "Holly Hack"
12 |
13 | if (IE7.loaded && IE7.appVersion < 7) {
14 |
15 | // "doubled margin" bug
16 | // http://www.positioniseverything.net/explorer/doubled-margin.html
17 | IE7.CSS.addFix(/(float\s*:\s*(left|right))/, "display:inline;$1");
18 |
19 | // "peekaboo" bug
20 | // http://www.positioniseverything.net/explorer/peekaboo.html
21 | if (IE7.appVersion >= 6) IE7.CSS.addRecalc("float", "(left|right)", function(element) {
22 | IE7.Layout.boxSizing(element.parentElement);
23 | // "doubled margin" bug
24 | element.style.display = "inline";
25 | });
26 |
27 | // "unscrollable content" bug
28 | // http://www.positioniseverything.net/explorer/unscrollable.html
29 | IE7.CSS.addRecalc("position", "absolute|fixed", function(element) {
30 | if (element.offsetParent && element.offsetParent.currentStyle.position === "relative")
31 | IE7.Layout.boxSizing(element.offsetParent);
32 | });
33 | }
34 |
35 | //# // get rid of Microsoft's pesky image toolbar
36 | //# document.write('');
37 |
--------------------------------------------------------------------------------
/src/ie7-squish.js:
--------------------------------------------------------------------------------
1 |
2 | /* ---------------------------------------------------------------------
3 |
4 | Squish some IE bugs!
5 |
6 | Some of these bug fixes may have adverse effects so they are
7 | not included in the standard library. Add your own if you want.
8 |
9 | --------------------------------------------------------------------- */
10 |
11 | // NOTE: IE7.Layout.boxSizing is the same as the "Holly Hack"
12 |
13 | if (IE7.loaded && IE7.appVersion < 7) {
14 |
15 | // "doubled margin" bug
16 | // http://www.positioniseverything.net/explorer/doubled-margin.html
17 | IE7.CSS.addFix(/(float\s*:\s*(left|right))/, "display:inline;$1");
18 |
19 | // "peekaboo" bug
20 | // http://www.positioniseverything.net/explorer/peekaboo.html
21 | if (IE7.appVersion >= 6) IE7.CSS.addRecalc("float", "(left|right)", function(element) {
22 | IE7.Layout.boxSizing(element.parentElement);
23 | // "doubled margin" bug
24 | element.style.display = "inline";
25 | });
26 |
27 | // "unscrollable content" bug
28 | // http://www.positioniseverything.net/explorer/unscrollable.html
29 | IE7.CSS.addRecalc("position", "absolute|fixed", function(element) {
30 | if (element.offsetParent && element.offsetParent.currentStyle.position === "relative")
31 | IE7.Layout.boxSizing(element.offsetParent);
32 | });
33 | }
34 |
35 | //# // get rid of Microsoft's pesky image toolbar
36 | //# document.write('');
37 |
--------------------------------------------------------------------------------
/lib/src/ie7-squish.js:
--------------------------------------------------------------------------------
1 |
2 | /* ---------------------------------------------------------------------
3 |
4 | Squish some IE bugs!
5 |
6 | Some of these bug fixes may have adverse effects so they are
7 | not included in the standard library. Add your own if you want.
8 |
9 | --------------------------------------------------------------------- */
10 |
11 | // NOTE: IE7.Layout.boxSizing is the same as the "Holly Hack"
12 |
13 | if (IE7.loaded && IE7.appVersion < 7) {
14 |
15 | // "doubled margin" bug
16 | // http://www.positioniseverything.net/explorer/doubled-margin.html
17 | IE7.CSS.addFix(/(float\s*:\s*(left|right))/, "display:inline;$1");
18 |
19 | // "peekaboo" bug
20 | // http://www.positioniseverything.net/explorer/peekaboo.html
21 | if (IE7.appVersion >= 6) IE7.CSS.addRecalc("float", "(left|right)", function(element) {
22 | IE7.Layout.boxSizing(element.parentElement);
23 | // "doubled margin" bug
24 | element.style.display = "inline";
25 | });
26 |
27 | // "unscrollable content" bug
28 | // http://www.positioniseverything.net/explorer/unscrollable.html
29 | IE7.CSS.addRecalc("position", "absolute|fixed", function(element) {
30 | if (element.offsetParent && element.offsetParent.currentStyle.position === "relative")
31 | IE7.Layout.boxSizing(element.offsetParent);
32 | });
33 | }
34 |
35 | //# // get rid of Microsoft's pesky image toolbar
36 | //# document.write('');
37 |
--------------------------------------------------------------------------------
/lib/ie7-recalc.js:
--------------------------------------------------------------------------------
1 | /*
2 | IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards
3 | http://code.google.com/p/ie7-js/
4 | http://www.opensource.org/licenses/mit-license.php
5 | */
6 | ;(function(){if(!IE7.loaded)return;var e=/\sie7_class\d+/g;IE7.CSS.extend({elements:{},handlers:[],reset:function(){this.removeEventHandlers();var b=this.elements;for(var a in b)b[a].runtimeStyle.cssText="";this.elements={};var b=IE7.Rule.elements;for(var a in b){with(b[a])className=className.replace(e,"")}IE7.Rule.elements={}},reload:function(){this.rules=[];this.getInlineStyles();this.screen.load();if(this.print)this.print.load();this.refresh();this.trash()},addRecalc:function(f,d,c,b){this.base(f,d,function(a){c(a);IE7.CSS.elements[a.uniqueID]=a},b)},recalc:function(){this.reset();this.base()},addEventHandler:function(c,b,a){c.attachEvent(b,a);this.handlers.push(arguments)},removeEventHandlers:function(){var a;while(a=this.handlers.pop()){a[0].detachEvent(a[1],a[2])}},getInlineStyles:function(){var d=document.getElementsByTagName("style"),c;for(var b=d.length-1;(c=d[b]);b--){if(!c.disabled&&!c.ie7){var a=c.cssText||c.innerHTML;this.styles.push(a);c.cssText=a}}},trash:function(){var c=document.styleSheets,b,a;for(a=0;a tag.
51 | document.createElement("abbr");
52 |
53 | // bind to the first child control
54 | IE7.HTML.addRecalc("label", function(label) {
55 | if (!label.htmlFor) {
56 | var firstChildControl = cssQuery("input,textarea", label, true);
57 | if (firstChildControl) {
58 | addEventHandler(label, "onclick", function() {
59 | firstChildControl.click();
60 | });
61 | }
62 | }
63 | });
64 | }
65 |
--------------------------------------------------------------------------------
/src/ie7-dhtml.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie7-dhtml.js
4 | // =========================================================================
5 |
6 | (function() {
7 |
8 | /* ---------------------------------------------------------------------
9 | This module is still in development and should not be used.
10 | --------------------------------------------------------------------- */
11 |
12 | // constants
13 | var PATTERNS = {
14 | width: "(width|paddingLeft|paddingRight|borderLeftWidth|borderRightWidth|borderLeftStyle|borderRightStyle)",
15 | height: "(height|paddingTop|paddingBottom|borderTopHeight|borderBottomHeight|borderTopStyle|borderBottomStyle)"
16 | };
17 |
18 | var PROPERTY_NAMES = {
19 | width: "fixedWidth",
20 | height: "fixedHeight",
21 | right: "width",
22 | bottom: "height"
23 | };
24 |
25 | var DASH_LETTER = /-(\w)/g;
26 | var PROPERTY_NAME = /\w+/;
27 |
28 | IE7.CSS.extend({
29 | recalc: function() {
30 | this.base();
31 | for (var i = 0; i < this.recalcs.length; i++) {
32 | var recalc = this.recalcs[i];
33 | for (var j = 0; i < recalc[3].length; i++) {
34 | addPropertyChangeHandler(recalc[3][j], getPropertyName(recalc[2]), recalc[1]);
35 | }
36 | }
37 | }
38 | });
39 |
40 | function addPropertyChangeHandler(element, propertyName, fix) {
41 | addEventHandler(element, "onpropertychange", function() {
42 | var pattern = new RegExp("^style\\." + (PATTERNS[propertyName] || propertyName) + "$");
43 | if (pattern.test(event.propertyName)) {
44 | reset(element, propertyName);
45 | fix(element);
46 | }
47 | });
48 | };
49 |
50 | function getPropertyName(pattern) {
51 | return String(String(pattern).toLowerCase().replace(DASH_LETTER, function(match, letter) {
52 | return letter.toUpperCase();
53 | }).match(PROPERTY_NAME));
54 | };
55 |
56 | function reset(element, propertyName) {
57 | element.runtimeStyle[propertyName] = "";
58 | propertyName = PROPERTY_NAMES[propertyName]
59 | if (propertyName) element.runtimeStyle[propertyName] = "";
60 | };
61 |
62 | })();
63 |
--------------------------------------------------------------------------------
/src/ie8-html.js:
--------------------------------------------------------------------------------
1 |
2 | // =========================================================================
3 | // ie8-html.js
4 | // =========================================================================
5 |
6 | var UNSUCCESSFUL = /^(submit|reset|button)$/;
7 |
8 | // -----------------------------------------------------------------------
9 | //