Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js)
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 23:15:56 +0000 (23:15 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 23:15:56 +0000 (23:15 +0000)
commit71c0983de6263ea5f9fd68d6209e4a4999301811
tree16e35a9fa6fbd21deff9dd2ad7ef3f008fe1275d
parentaf2567c7c2b24cd76a078078dbc288169ab2c2d4
Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js)
https://bugs.webkit.org/show_bug.cgi?id=192946
<rdar://problem/42546126>

Rubber-stamped by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(whitespaceRatio):
(isTextLikelyMinified):
Check the first 2500 and the last 2500 characters whitespace ratio.
If either is below 20% then treat as minified.

LayoutTests:

* inspector/formatting/is-text-likely-minified-expected.txt:
* inspector/formatting/is-text-likely-minified.html:
Add a test for a long header doc at the start but minified content at the end.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/formatting/is-text-likely-minified-expected.txt
LayoutTests/inspector/formatting/is-text-likely-minified.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Utilities.js