| 997 | } |
| 998 | |
| 999 | getLayoutBrowserSupport(code) { |
| 1000 | const support = { |
| 1001 | chrome: '完全支持', |
| 1002 | firefox: '完全支持', |
| 1003 | safari: '完全支持', |
| 1004 | edge: '完全支持', |
| 1005 | ie: '部分支持' |
| 1006 | }; |
| 1007 | |
| 1008 | // Grid 支持 |
| 1009 | if (code.includes('grid')) { |
| 1010 | support.ie = '不支持 Grid'; |
| 1011 | } |
| 1012 | |
| 1013 | // Flexbox 支持 |
| 1014 | if (code.includes('flex')) { |
| 1015 | support.ie = 'IE11 部分支持 Flexbox'; |
| 1016 | } |
| 1017 | |
| 1018 | return JSON.stringify(support); |
| 1019 | } |
| 1020 | |
| 1021 | analyzePerformance(content, cssProperties) { |
| 1022 | const properties = JSON.parse(cssProperties); |