Web Inspector: HTML Formatter - XML mode
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Sep 2019 02:16:00 +0000 (02:16 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Sep 2019 02:16:00 +0000 (02:16 +0000)
commit52ce48f3a44323932d804447c323953d02db6c91
tree0625ca79878b66a243493a0bd21ce3bbabb39dea
parent643b21ccf1b4dfdfe7b3578f67b7972afa9bca84
Web Inspector: HTML Formatter - XML mode
https://bugs.webkit.org/show_bug.cgi?id=201758

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Tools/HTMLFormatter/index.html:
* Tools/SourceMaps/index.html:
Update Tools to more easily test XML.

* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatXML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow formatting XML content.

* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatHTML):
(FormatterWorker.prototype.formatXML):
Expose "formatXML".

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype._shouldHaveNoChildren):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype.parseDocument):
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
Give the HTMLFormatter and related classes an XML mode that
has less of the smarts of XML.

LayoutTests:

* inspector/formatting/formatting-xml-expected.txt: Added.
* inspector/formatting/formatting-xml.html: Added.
* inspector/formatting/resources/formatting-utilities.js:
(TestPage.registerInitializer.async.runFormattingTest):
* inspector/formatting/resources/xml-tests/atom-expected.xml: Added.
* inspector/formatting/resources/xml-tests/atom.xml: Added.
* inspector/formatting/resources/xml-tests/basic-expected.xml: Added.
* inspector/formatting/resources/xml-tests/basic.xml: Added.
* inspector/formatting/resources/xml-tests/rss-expected.xml: Added.
* inspector/formatting/resources/xml-tests/rss.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml-expected.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml.xml: Added.
* inspector/formatting/resources/xml-tests/xslt-expected.xml: Added.
* inspector/formatting/resources/xml-tests/xslt.xml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/formatting/formatting-xml-expected.txt [new file with mode: 0644]
LayoutTests/inspector/formatting/formatting-xml.html [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/formatting-utilities.js
LayoutTests/inspector/formatting/resources/xml-tests/atom-expected.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/atom.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/basic-expected.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/basic.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/rss-expected.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/rss.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/valid-html-invalid-xml-expected.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/valid-html-invalid-xml.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/xslt-expected.xml [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/xml-tests/xslt.xml [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Tools/HTMLFormatter/index.html
Source/WebInspectorUI/Tools/SourceMaps/index.html
Source/WebInspectorUI/UserInterface/Proxies/FormatterWorkerProxy.js
Source/WebInspectorUI/UserInterface/Views/TextEditor.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/FormatterWorker.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLFormatter.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLParser.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js