OLD | NEW |
1 function getPaintOrder(element) | 1 function getPaintOrder(element) |
2 { | 2 { |
3 var divElementsBeforePromote = []; | 3 var divElementsBeforePromote = []; |
4 var divElementsAfterPromote = []; | 4 var divElementsAfterPromote = []; |
5 // Force a style recalc. | 5 // Force a style recalc. |
| 6 document.body.style.overflow = 'scroll'; |
| 7 document.body.offsetTop; |
| 8 document.body.style.overflow = ''; |
6 document.body.offsetTop; | 9 document.body.offsetTop; |
7 | 10 |
8 var paintOrderListBeforePromote = window.internals.paintOrderListBeforePromote
(element); | 11 var paintOrderListBeforePromote = window.internals.paintOrderListBeforePromote
(element); |
9 var paintOrderListAfterPromote = window.internals.paintOrderListAfterPromote(e
lement); | 12 var paintOrderListAfterPromote = window.internals.paintOrderListAfterPromote(e
lement); |
10 | 13 |
11 for (var i = 0; i < paintOrderListBeforePromote.length; ++i) | 14 for (var i = 0; i < paintOrderListBeforePromote.length; ++i) |
12 if (paintOrderListBeforePromote[i].nodeName === "DIV") | 15 if (paintOrderListBeforePromote[i].nodeName === "DIV") |
13 divElementsBeforePromote.push(paintOrderListBeforePromote[i]); | 16 divElementsBeforePromote.push(paintOrderListBeforePromote[i]); |
14 | 17 |
15 for (var i = 0; i < paintOrderListAfterPromote.length; ++i) | 18 for (var i = 0; i < paintOrderListAfterPromote.length; ++i) |
(...skipping 17 matching lines...) Expand all Loading... |
33 } | 36 } |
34 | 37 |
35 function countOccurrencesOfElementInPaintOrderList(paintOrder, element) { | 38 function countOccurrencesOfElementInPaintOrderList(paintOrder, element) { |
36 var occurrenceCount = 0; | 39 var occurrenceCount = 0; |
37 for (var i = 0; i < paintOrder.length; i++) | 40 for (var i = 0; i < paintOrder.length; i++) |
38 if (paintOrder[i] === element) | 41 if (paintOrder[i] === element) |
39 occurrenceCount++; | 42 occurrenceCount++; |
40 | 43 |
41 return occurrenceCount; | 44 return occurrenceCount; |
42 } | 45 } |
OLD | NEW |