Changeset 79861 in webkit


Ignore:
Timestamp:
Feb 28, 2011 7:26:44 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-02-28 Vsevolod Vlasov <vsevik@chromium.org>

Reviewed by Pavel Feldman.

XML without style should render as syntax-highlighted source.
https://bugs.webkit.org/show_bug.cgi?id=13807

Added tests for XML tree view mode. Testing both logic for entering
XML tree view mode and rendering itself.
Tests are disabled for QT since this logic is not yet implemented, see
https://bugs.webkit.org/show_bug.cgi?id=55302

  • fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt: Copied from LayoutTests/fast/css/xml-stylesheet-pi-not-in-prolog.xml.
  • fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog.xml: Renamed from LayoutTests/fast/css/xml-stylesheet-pi-not-in-prolog.xml.
  • fast/encoding/dumpAsText/utf-16-no-bom-expected.txt: Added.
  • fast/encoding/dumpAsText/utf-16-no-bom.xml: Renamed from LayoutTests/fast/encoding/utf-16-no-bom.xml.
  • http/tests/xmlviewer/dumpAsText/css-stylesheet-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/css-stylesheet.xml: Added.
  • http/tests/xmlviewer/dumpAsText/frames-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/frames.html: Added.
  • http/tests/xmlviewer/dumpAsText/mathml-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/mathml.xml: Added.
  • http/tests/xmlviewer/dumpAsText/resources/css-stylesheet.css: Added. (assertion):
  • http/tests/xmlviewer/dumpAsText/resources/frames-helper.xml: Added.
  • http/tests/xmlviewer/dumpAsText/resources/xsl.xml: Added.
  • http/tests/xmlviewer/dumpAsText/svg-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/svg.xml: Added.
  • http/tests/xmlviewer/dumpAsText/wml-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/wml.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xhtml-tag-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xhtml-tag.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xlink-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xlink.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xmlviewer.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xsl-stylesheet-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml: Added.
  • http/tests/xmlviewer/dumpAsText/xul-expected.txt: Added.
  • http/tests/xmlviewer/dumpAsText/xul.xml: Added.
  • platform/chromium-linux/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
  • platform/chromium-linux/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
  • platform/chromium-linux/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
  • platform/chromium-linux/fast/encoding/utf-16-no-bom-expected.png: Removed.
  • platform/chromium-linux/svg/hixie/error/004-expected.checksum: Removed.
  • platform/chromium-linux/svg/hixie/error/004-expected.png: Removed.
  • platform/chromium-linux/svg/hixie/error/005-expected.checksum: Removed.
  • platform/chromium-linux/svg/hixie/error/005-expected.png: Removed.
  • platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
  • platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
  • platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
  • platform/chromium-win/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
  • platform/chromium-win/fast/encoding/utf-16-no-bom-expected.png: Removed.
  • platform/chromium-win/fast/encoding/utf-16-no-bom-expected.txt: Removed.
  • platform/chromium-win/svg/hixie/error/004-expected.checksum: Removed.
  • platform/chromium-win/svg/hixie/error/004-expected.png: Removed.
  • platform/chromium-win/svg/hixie/error/004-expected.txt: Removed.
  • platform/chromium-win/svg/hixie/error/005-expected.checksum: Removed.
  • platform/chromium-win/svg/hixie/error/005-expected.png: Removed.
  • platform/chromium-win/svg/hixie/error/005-expected.txt: Removed.
  • platform/chromium/http/tests/xmlviewer/dumpAsText/mathml-expected.txt: Added.
  • platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
  • platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
  • platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
  • platform/gtk/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
  • platform/gtk/fast/encoding/utf-16-no-bom-expected.png: Removed.
  • platform/gtk/fast/encoding/utf-16-no-bom-expected.txt: Removed.
  • platform/gtk/svg/hixie/error/004-expected.checksum: Removed.
  • platform/gtk/svg/hixie/error/004-expected.png: Removed.
  • platform/gtk/svg/hixie/error/004-expected.txt: Removed.
  • platform/gtk/svg/hixie/error/005-expected.checksum: Removed.
  • platform/gtk/svg/hixie/error/005-expected.png: Removed.
  • platform/gtk/svg/hixie/error/005-expected.txt: Removed.
  • platform/mac-leopard/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
  • platform/mac-leopard/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
  • platform/mac-leopard/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
  • platform/mac-leopard/fast/encoding/utf-16-no-bom-expected.png: Removed.
  • platform/mac-leopard/svg/hixie/error/004-expected.checksum: Removed.
  • platform/mac-leopard/svg/hixie/error/004-expected.png: Removed.
  • platform/mac-leopard/svg/hixie/error/005-expected.checksum: Removed.
  • platform/mac-leopard/svg/hixie/error/005-expected.png: Removed.
  • platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
  • platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
  • platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
  • platform/mac/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
  • platform/mac/fast/encoding/utf-16-no-bom-expected.png: Removed.
  • platform/mac/fast/encoding/utf-16-no-bom-expected.txt: Removed.
  • platform/mac/svg/hixie/error/004-expected.checksum: Removed.
  • platform/mac/svg/hixie/error/004-expected.png: Removed.
  • platform/mac/svg/hixie/error/004-expected.txt: Removed.
  • platform/mac/svg/hixie/error/005-expected.checksum: Removed.
  • platform/mac/svg/hixie/error/005-expected.png: Removed.
  • platform/mac/svg/hixie/error/005-expected.txt: Removed.
  • platform/qt/Skipped:
  • platform/qt/fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt: Added.
  • platform/qt/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
  • platform/qt/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt: Added.
  • platform/qt/fast/encoding/utf-16-no-bom-expected.txt: Removed.
  • platform/qt/svg/hixie/error/004-expected.txt: Removed.
  • platform/qt/svg/hixie/error/005-expected.txt: Removed.
  • platform/qt/svg/hixie/error/dumpAsText/004-expected.txt: Added.
  • platform/qt/svg/hixie/error/dumpAsText/005-expected.txt: Added.
  • svg/hixie/error/dumpAsText/004-expected.txt: Added.
  • svg/hixie/error/dumpAsText/004.xml: Renamed from LayoutTests/svg/hixie/error/004.xml.
  • svg/hixie/error/dumpAsText/005-expected.txt: Added.
  • svg/hixie/error/dumpAsText/005.xml: Renamed from LayoutTests/svg/hixie/error/005.xml.

2011-02-28 Vsevolod Vlasov <vsevik@chromium.org>

Reviewed by Pavel Feldman.

XML without style should render as syntax-highlighted source.
https://bugs.webkit.org/show_bug.cgi?id=13807

XML tree view mode implemented. If XML does not have any style
information, it is rendered as highlighted source with collapsable
elements.

Tests: fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog.xml

fast/encoding/dumpAsText/utf-16-no-bom.xml
http/tests/xmlviewer/dumpAsText/css-stylesheet.xml
http/tests/xmlviewer/dumpAsText/frames.html
http/tests/xmlviewer/dumpAsText/mathml.xml
http/tests/xmlviewer/dumpAsText/svg.xml
http/tests/xmlviewer/dumpAsText/wml.xml
http/tests/xmlviewer/dumpAsText/xhtml-tag.xml
http/tests/xmlviewer/dumpAsText/xlink.xml
http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251.xml
http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8.xml
http/tests/xmlviewer/dumpAsText/xmlviewer.xml
http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml
http/tests/xmlviewer/dumpAsText/xul.xml
svg/hixie/error/dumpAsText/004.xml
svg/hixie/error/dumpAsText/005.xml

  • CMakeLists.txt:
  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gyp/WebCore.gyp:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::matchUARules):
  • dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::createElement):
  • dom/Document.h: (WebCore::Document::usesViewSourceStyles): (WebCore::Document::setUsesViewSourceStyles): (WebCore::Document::sawElementsInKnownNamespaces):
  • dom/XMLDocumentParser.h:
  • dom/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::XMLDocumentParser): (WebCore::XMLDocumentParser::processingInstruction): (WebCore::XMLDocumentParser::initializeParserContext): (WebCore::XMLDocumentParser::doEnd):
  • dom/XMLDocumentParserQt.cpp: (WebCore::XMLDocumentParser::XMLDocumentParser): (WebCore::XMLDocumentParser::initializeParserContext): (WebCore::XMLDocumentParser::parseProcessingInstruction):
  • html/HTMLViewSourceDocument.cpp: (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
  • xml/XMLTreeViewer.cpp: Added. (WebCore::XMLTreeViewer::XMLTreeViewer): (WebCore::XMLTreeViewer::hasNoStyleInformation): (WebCore::XMLTreeViewer::transformDocumentToTreeView):
  • xml/XMLTreeViewer.h: Added. (WebCore::XMLTreeViewer::~XMLTreeViewer):
  • xml/XMLViewer.xsl: Added.
  • xml/XSLStyleSheet.h: (WebCore::XSLStyleSheet::createForXMLTreeViewer):
Location:
trunk
Files:
44 added
36 deleted
18 edited
1 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79860 r79861  
     12011-02-28  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        XML without style should render as syntax-highlighted source.
     6        https://bugs.webkit.org/show_bug.cgi?id=13807
     7
     8        Added tests for XML tree view mode. Testing both logic for entering
     9        XML tree view mode and rendering itself.
     10        Tests are disabled for QT since this logic is not yet implemented, see
     11        https://bugs.webkit.org/show_bug.cgi?id=55302
     12
     13        * fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt: Copied from LayoutTests/fast/css/xml-stylesheet-pi-not-in-prolog.xml.
     14        * fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog.xml: Renamed from LayoutTests/fast/css/xml-stylesheet-pi-not-in-prolog.xml.
     15        * fast/encoding/dumpAsText/utf-16-no-bom-expected.txt: Added.
     16        * fast/encoding/dumpAsText/utf-16-no-bom.xml: Renamed from LayoutTests/fast/encoding/utf-16-no-bom.xml.
     17        * http/tests/xmlviewer/dumpAsText/css-stylesheet-expected.txt: Added.
     18        * http/tests/xmlviewer/dumpAsText/css-stylesheet.xml: Added.
     19        * http/tests/xmlviewer/dumpAsText/frames-expected.txt: Added.
     20        * http/tests/xmlviewer/dumpAsText/frames.html: Added.
     21        * http/tests/xmlviewer/dumpAsText/mathml-expected.txt: Added.
     22        * http/tests/xmlviewer/dumpAsText/mathml.xml: Added.
     23        * http/tests/xmlviewer/dumpAsText/resources/css-stylesheet.css: Added.
     24        (assertion):
     25        * http/tests/xmlviewer/dumpAsText/resources/frames-helper.xml: Added.
     26        * http/tests/xmlviewer/dumpAsText/resources/xsl.xml: Added.
     27        * http/tests/xmlviewer/dumpAsText/svg-expected.txt: Added.
     28        * http/tests/xmlviewer/dumpAsText/svg.xml: Added.
     29        * http/tests/xmlviewer/dumpAsText/wml-expected.txt: Added.
     30        * http/tests/xmlviewer/dumpAsText/wml.xml: Added.
     31        * http/tests/xmlviewer/dumpAsText/xhtml-tag-expected.txt: Added.
     32        * http/tests/xmlviewer/dumpAsText/xhtml-tag.xml: Added.
     33        * http/tests/xmlviewer/dumpAsText/xlink-expected.txt: Added.
     34        * http/tests/xmlviewer/dumpAsText/xlink.xml: Added.
     35        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251-expected.txt: Added.
     36        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251.xml: Added.
     37        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8-expected.txt: Added.
     38        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8.xml: Added.
     39        * http/tests/xmlviewer/dumpAsText/xmlviewer-expected.txt: Added.
     40        * http/tests/xmlviewer/dumpAsText/xmlviewer.xml: Added.
     41        * http/tests/xmlviewer/dumpAsText/xsl-stylesheet-expected.txt: Added.
     42        * http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml: Added.
     43        * http/tests/xmlviewer/dumpAsText/xul-expected.txt: Added.
     44        * http/tests/xmlviewer/dumpAsText/xul.xml: Added.
     45        * platform/chromium-linux/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
     46        * platform/chromium-linux/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
     47        * platform/chromium-linux/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
     48        * platform/chromium-linux/fast/encoding/utf-16-no-bom-expected.png: Removed.
     49        * platform/chromium-linux/svg/hixie/error/004-expected.checksum: Removed.
     50        * platform/chromium-linux/svg/hixie/error/004-expected.png: Removed.
     51        * platform/chromium-linux/svg/hixie/error/005-expected.checksum: Removed.
     52        * platform/chromium-linux/svg/hixie/error/005-expected.png: Removed.
     53        * platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
     54        * platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
     55        * platform/chromium-win/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
     56        * platform/chromium-win/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
     57        * platform/chromium-win/fast/encoding/utf-16-no-bom-expected.png: Removed.
     58        * platform/chromium-win/fast/encoding/utf-16-no-bom-expected.txt: Removed.
     59        * platform/chromium-win/svg/hixie/error/004-expected.checksum: Removed.
     60        * platform/chromium-win/svg/hixie/error/004-expected.png: Removed.
     61        * platform/chromium-win/svg/hixie/error/004-expected.txt: Removed.
     62        * platform/chromium-win/svg/hixie/error/005-expected.checksum: Removed.
     63        * platform/chromium-win/svg/hixie/error/005-expected.png: Removed.
     64        * platform/chromium-win/svg/hixie/error/005-expected.txt: Removed.
     65        * platform/chromium/http/tests/xmlviewer/dumpAsText/mathml-expected.txt: Added.
     66        * platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
     67        * platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
     68        * platform/gtk/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
     69        * platform/gtk/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
     70        * platform/gtk/fast/encoding/utf-16-no-bom-expected.png: Removed.
     71        * platform/gtk/fast/encoding/utf-16-no-bom-expected.txt: Removed.
     72        * platform/gtk/svg/hixie/error/004-expected.checksum: Removed.
     73        * platform/gtk/svg/hixie/error/004-expected.png: Removed.
     74        * platform/gtk/svg/hixie/error/004-expected.txt: Removed.
     75        * platform/gtk/svg/hixie/error/005-expected.checksum: Removed.
     76        * platform/gtk/svg/hixie/error/005-expected.png: Removed.
     77        * platform/gtk/svg/hixie/error/005-expected.txt: Removed.
     78        * platform/mac-leopard/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
     79        * platform/mac-leopard/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
     80        * platform/mac-leopard/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
     81        * platform/mac-leopard/fast/encoding/utf-16-no-bom-expected.png: Removed.
     82        * platform/mac-leopard/svg/hixie/error/004-expected.checksum: Removed.
     83        * platform/mac-leopard/svg/hixie/error/004-expected.png: Removed.
     84        * platform/mac-leopard/svg/hixie/error/005-expected.checksum: Removed.
     85        * platform/mac-leopard/svg/hixie/error/005-expected.png: Removed.
     86        * platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.checksum: Removed.
     87        * platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.png: Removed.
     88        * platform/mac/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
     89        * platform/mac/fast/encoding/utf-16-no-bom-expected.checksum: Removed.
     90        * platform/mac/fast/encoding/utf-16-no-bom-expected.png: Removed.
     91        * platform/mac/fast/encoding/utf-16-no-bom-expected.txt: Removed.
     92        * platform/mac/svg/hixie/error/004-expected.checksum: Removed.
     93        * platform/mac/svg/hixie/error/004-expected.png: Removed.
     94        * platform/mac/svg/hixie/error/004-expected.txt: Removed.
     95        * platform/mac/svg/hixie/error/005-expected.checksum: Removed.
     96        * platform/mac/svg/hixie/error/005-expected.png: Removed.
     97        * platform/mac/svg/hixie/error/005-expected.txt: Removed.
     98        * platform/qt/Skipped:
     99        * platform/qt/fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt: Added.
     100        * platform/qt/fast/css/xml-stylesheet-pi-not-in-prolog-expected.txt: Removed.
     101        * platform/qt/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt: Added.
     102        * platform/qt/fast/encoding/utf-16-no-bom-expected.txt: Removed.
     103        * platform/qt/svg/hixie/error/004-expected.txt: Removed.
     104        * platform/qt/svg/hixie/error/005-expected.txt: Removed.
     105        * platform/qt/svg/hixie/error/dumpAsText/004-expected.txt: Added.
     106        * platform/qt/svg/hixie/error/dumpAsText/005-expected.txt: Added.
     107        * svg/hixie/error/dumpAsText/004-expected.txt: Added.
     108        * svg/hixie/error/dumpAsText/004.xml: Renamed from LayoutTests/svg/hixie/error/004.xml.
     109        * svg/hixie/error/dumpAsText/005-expected.txt: Added.
     110        * svg/hixie/error/dumpAsText/005.xml: Renamed from LayoutTests/svg/hixie/error/005.xml.
     111
    11122011-02-28  Pavel Feldman  <pfeldman@chromium.org>
    2113
  • trunk/LayoutTests/fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt

    r79860 r79861  
     1This XML file does not appear to have any style information associated with it. The document tree is shown below.
    12<foo>
    2 <?xml-stylesheet href="resources/xml-stylesheet-pi-not-in-prolog.css" type="text/css"?>
    33This tests that xml-stylesheet processing instructions have no effect when they're not in the prolog (before the root element). If this test is successful, this text should NOT have a black border.
    44</foo>
     5
  • trunk/LayoutTests/platform/qt/Skipped

    r79857 r79861  
    36133613http/tests/inspector-enabled/open-close-open.html
    36143614http/tests/inspector/change-iframe-src.html
     3615
     3616# [Qt] XML Viewer fails due to specifics in the parser implementation
     3617# https://bugs.webkit.org/show_bug.cgi?id=55302
     3618http/tests/xmlviewer/dumpAsText/svg.xml
     3619http/tests/xmlviewer/dumpAsText/wml.xml
     3620http/tests/xmlviewer/dumpAsText/xlink.xml
     3621http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251.xml
     3622http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8.xml
     3623http/tests/xmlviewer/dumpAsText/xmlviewer.xml
     3624http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml
     3625http/tests/xmlviewer/dumpAsText/xul.xml
  • trunk/Source/WebCore/CMakeLists.txt

    r79825 r79861  
    15051505    xml/XMLHttpRequestProgressEventThrottle.cpp
    15061506    xml/XMLHttpRequestUpload.cpp
     1507    xml/XMLTreeViewer.cpp
    15071508    xml/XMLSerializer.cpp
    15081509    xml/XPathEvaluator.cpp
     
    21402141
    21412142
     2143# Generate XMLViewerXSL.h
     2144ADD_CUSTOM_COMMAND(
     2145    OUTPUT ${DERIVED_SOURCES_DIR}/XMLViewerXSL.h
     2146    MAIN_DEPENDENCY xml/XMLViewer.xsl
     2147    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl XMLViewer_xsl ${WEBCORE_DIR}/xml/XMLViewer.xsl ${DERIVED_SOURCES_DIR}/XMLViewerXSL.h
     2148    VERBATIM)
     2149LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XMLViewerXSL.h)
     2150
     2151
    21422152# Generate HTML entity table
    21432153ADD_CUSTOM_COMMAND(
  • trunk/Source/WebCore/ChangeLog

    r79858 r79861  
     12011-02-28  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        XML without style should render as syntax-highlighted source.
     6        https://bugs.webkit.org/show_bug.cgi?id=13807
     7
     8        XML tree view mode implemented. If XML does not have any style
     9        information, it is rendered as highlighted source with collapsable
     10        elements.
     11
     12        Tests: fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog.xml
     13               fast/encoding/dumpAsText/utf-16-no-bom.xml
     14               http/tests/xmlviewer/dumpAsText/css-stylesheet.xml
     15               http/tests/xmlviewer/dumpAsText/frames.html
     16               http/tests/xmlviewer/dumpAsText/mathml.xml
     17               http/tests/xmlviewer/dumpAsText/svg.xml
     18               http/tests/xmlviewer/dumpAsText/wml.xml
     19               http/tests/xmlviewer/dumpAsText/xhtml-tag.xml
     20               http/tests/xmlviewer/dumpAsText/xlink.xml
     21               http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251.xml
     22               http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8.xml
     23               http/tests/xmlviewer/dumpAsText/xmlviewer.xml
     24               http/tests/xmlviewer/dumpAsText/xsl-stylesheet.xml
     25               http/tests/xmlviewer/dumpAsText/xul.xml
     26               svg/hixie/error/dumpAsText/004.xml
     27               svg/hixie/error/dumpAsText/005.xml
     28
     29        * CMakeLists.txt:
     30        * DerivedSources.make:
     31        * GNUmakefile.am:
     32        * WebCore.gyp/WebCore.gyp:
     33        * WebCore.gypi:
     34        * WebCore.vcproj/WebCore.vcproj:
     35        * WebCore.xcodeproj/project.pbxproj:
     36        * css/CSSStyleSelector.cpp:
     37        (WebCore::CSSStyleSelector::matchUARules):
     38        * dom/Document.cpp:
     39        (WebCore::Document::Document):
     40        (WebCore::Document::createElement):
     41        * dom/Document.h:
     42        (WebCore::Document::usesViewSourceStyles):
     43        (WebCore::Document::setUsesViewSourceStyles):
     44        (WebCore::Document::sawElementsInKnownNamespaces):
     45        * dom/XMLDocumentParser.h:
     46        * dom/XMLDocumentParserLibxml2.cpp:
     47        (WebCore::XMLDocumentParser::XMLDocumentParser):
     48        (WebCore::XMLDocumentParser::processingInstruction):
     49        (WebCore::XMLDocumentParser::initializeParserContext):
     50        (WebCore::XMLDocumentParser::doEnd):
     51        * dom/XMLDocumentParserQt.cpp:
     52        (WebCore::XMLDocumentParser::XMLDocumentParser):
     53        (WebCore::XMLDocumentParser::initializeParserContext):
     54        (WebCore::XMLDocumentParser::parseProcessingInstruction):
     55        * html/HTMLViewSourceDocument.cpp:
     56        (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
     57        * xml/XMLTreeViewer.cpp: Added.
     58        (WebCore::XMLTreeViewer::XMLTreeViewer):
     59        (WebCore::XMLTreeViewer::hasNoStyleInformation):
     60        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
     61        * xml/XMLTreeViewer.h: Added.
     62        (WebCore::XMLTreeViewer::~XMLTreeViewer):
     63        * xml/XMLViewer.xsl: Added.
     64        * xml/XSLStyleSheet.h:
     65        (WebCore::XSLStyleSheet::createForXMLTreeViewer):
     66
    1672011-02-28  Yury Semikhatsky  <yurys@chromium.org>
    268
  • trunk/Source/WebCore/DerivedSources.make

    r79805 r79861  
    649649# --------
    650650
     651# XMLViewer XSLT
     652
     653all : XMLViewerXSL.h
     654
     655XMLViewerXSL.h : xml/XMLViewer.xsl
     656        perl $(WebCore)/inspector/xxd.pl XMLViewer_xsl $(WebCore)/xml/XMLViewer.xsl XMLViewerXSL.h
     657
     658# --------
     659
    651660# HTML entity names
    652661
  • trunk/Source/WebCore/GNUmakefile.am

    r79825 r79861  
    647647        DerivedSources/WebCore/XMLNames.h \
    648648        DerivedSources/WebCore/XMLNSNames.cpp \
    649         DerivedSources/WebCore/XMLNSNames.h
     649        DerivedSources/WebCore/XMLNSNames.h \
     650        DerivedSources/WebCore/XMLViewerXSL.h
    650651
    651652webcore_sources += \
     
    36253626        Source/WebCore/xml/XMLHttpRequestUpload.cpp \
    36263627        Source/WebCore/xml/XMLHttpRequestUpload.h \
     3628        Source/WebCore/xml/XMLTreeViewer.cpp \
     3629        Source/WebCore/xml/XMLTreeViewer.h \
    36273630        Source/WebCore/xml/XMLSerializer.cpp \
    36283631        Source/WebCore/xml/XMLSerializer.h \
     
    48584861        $(PERL) $(WebCore)/make-hash-tools.pl $(GENSOURCES_WEBCORE) $(WebCore)/html/DocTypeStrings.gperf
    48594862
     4863# XML Viewer XSL
     4864DerivedSources/WebCore/XMLViewerXSL.h: $(WebCore)/xml/XMLViewer.xsl
     4865        $(PERL) $(WebCore)/inspector/xxd.pl XMLViewer_xsl $(WebCore)/xml/XMLViewer.xsl $(GENSOURCES_WEBCORE)/XMLViewerXSL.h
     4866
    48604867# HTML entity names
    48614868DerivedSources/WebCore/HTMLEntityTable.cpp: $(WebCore)/html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r79805 r79861  
    388388        # Actions to build derived sources.
    389389        {
     390          'action_name': 'generateXMLViewerXSL',
     391          'inputs': [
     392            '../xml/XMLViewer.xsl',
     393          ],
     394          'outputs': [
     395            '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerXSL.h',
     396            '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerXSL.cpp',
     397          ],
     398          'action': [
     399            'perl',
     400            '../inspector/xxd.pl',
     401            'XMLViewer_xsl',
     402            '../xml/XMLViewer.xsl',
     403            '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerXSL.h'
     404          ],
     405        },
     406        {
    390407          'action_name': 'HTMLEntityTable',
    391408          'inputs': [
  • trunk/Source/WebCore/WebCore.gypi

    r79825 r79861  
    46404640            'xml/XMLHttpRequestUpload.cpp',
    46414641            'xml/XMLHttpRequestUpload.h',
     4642            'xml/XMLTreeViewer.cpp',
     4643            'xml/XMLTreeViewer.h',
    46424644            'xml/XMLSerializer.cpp',
    46434645            'xml/XMLSerializer.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r79825 r79861  
    2303923039                        </File>
    2304023040                        <File
     23041                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\XMLViewerXSL.h"
     23042                                >
     23043                        </File>
     23044                        <File
    2304123045                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\XPathGrammar.cpp"
    2304223046                                >
     
    4098540989                        </File>
    4098640990                        <File
     40991                                RelativePath="..\xml\XMLTreeViewer.cpp"
     40992                                >
     40993                        </File>
     40994                        <File
     40995                                RelativePath="..\xml\XMLTreeViewer.h"
     40996                                >
     40997                        </File>
     40998                        <File
    4098740999                                RelativePath="..\xml\XMLSerializer.cpp"
    4098841000                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r79825 r79861  
    13671367                550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
    13681368                550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1369                5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */; };
     1370                5905ADC01302F3CE00F116DF /* XMLTreeViewer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */; };
    13691371                590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = 590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13701372                590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */; };
     
    78187820                550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    78197821                550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     7822                5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLTreeViewer.cpp; sourceTree = "<group>"; };
     7823                5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLTreeViewer.h; sourceTree = "<group>"; };
    78207824                590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientation.h; sourceTree = "<group>"; };
    78217825                590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceOrientationEventCustom.cpp; sourceTree = "<group>"; };
     
    78267830                596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
    78277831                596229791133EFE200DC4CBB /* GeolocationPositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationPositionCache.h; sourceTree = "<group>"; };
     7832                5980B03312EF3D8400DF5F85 /* XMLViewer.xsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = XMLViewer.xsl; sourceTree = "<group>"; };
    78287833                599E758F11055A1F00D904FA /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bridge.h; path = bridge/Bridge.h; sourceTree = "<group>"; };
    78297834                59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientationEvent.cpp; sourceTree = "<group>"; };
     
    1841618421                                BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */,
    1841718422                                BCDFD4900E305644009D10AD /* XMLHttpRequestUpload.idl */,
     18423                                5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */,
     18424                                5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */,
    1841818425                                1ACE53E40A8D18E70022947D /* XMLSerializer.cpp */,
    1841918426                                1ACE53E50A8D18E70022947D /* XMLSerializer.h */,
    1842018427                                1ACE53E60A8D18E70022947D /* XMLSerializer.idl */,
     18428                                5980B03312EF3D8400DF5F85 /* XMLViewer.xsl */,
    1842118429                                1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */,
    1842218430                                1AB7FC480A8B92EC00D9D37B /* XPathEvaluator.h */,
     
    2245122459                                E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */,
    2245222460                                1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */,
     22461                                5905ADC01302F3CE00F116DF /* XMLTreeViewer.h in Headers */,
    2245322462                                1AB7FC690A8B92EC00D9D37B /* XPathEvaluator.h in Headers */,
    2245422463                                BC60DA5B0D2A31F700B9918F /* XPathException.h in Headers */,
     
    2509425103                                E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
    2509525104                                1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */,
     25105                                5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */,
    2509625106                                1AB7FC680A8B92EC00D9D37B /* XPathEvaluator.cpp in Sources */,
    2509725107                                1AB7FC6B0A8B92EC00D9D37B /* XPathExpression.cpp in Sources */,
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r79805 r79861  
    12531253        matchRules(defaultQuirksStyle, firstUARule, lastUARule, false);
    12541254       
    1255     // If we're in view source mode, then we match rules from the view source style sheet.
    1256     if (m_checker.m_document->frame() && m_checker.m_document->frame()->inViewSourceMode()) {
     1255    // If document uses view source styles (in view source mode or in xml viewer mode), then we match rules from the view source style sheet.
     1256    if (m_checker.m_document->usesViewSourceStyles()) {
    12571257        if (!defaultViewSourceStyle)
    12581258            loadViewSourceStyle();
  • trunk/Source/WebCore/dom/Document.cpp

    r79805 r79861  
    410410    , m_isXHTML(isXHTML)
    411411    , m_isHTML(isHTML)
     412    , m_usesViewSourceStyles(false)
     413    , m_sawElementsInKnownNamespaces(false)
    412414    , m_numNodeListCaches(0)
    413415#if USE(JSC)
     
    960962#endif
    961963
    962     if (!e)
     964    if (e)
     965        m_sawElementsInKnownNamespaces = true;
     966    else
    963967        e = Element::create(qName, document());
    964968
  • trunk/Source/WebCore/dom/Document.h

    r79805 r79861  
    436436   
    437437    CSSStyleSelector* styleSelectorIfExists() const { return m_styleSelector.get(); }
     438
     439    bool usesViewSourceStyles() const { return m_usesViewSourceStyles; }
     440    void setUsesViewSourceStyles(bool usesViewSourceStyles) { m_usesViewSourceStyles = usesViewSourceStyles; }
     441
     442    bool sawElementsInKnownNamespaces() const { return m_sawElementsInKnownNamespaces; }
     443
    438444    CSSStyleSelector* styleSelector()
    439445    {
     
    13711377    bool m_isHTML;
    13721378
     1379    bool m_usesViewSourceStyles;
     1380    bool m_sawElementsInKnownNamespaces;
     1381
    13731382    unsigned m_numNodeListCaches;
    13741383
  • trunk/Source/WebCore/dom/XMLDocumentParser.h

    r79805 r79861  
    195195
    196196        bool m_sawError;
     197        bool m_sawCSS;
    197198        bool m_sawXSLTransform;
    198199        bool m_sawFirstElement;
  • trunk/Source/WebCore/dom/XMLDocumentParserLibxml2.cpp

    r79805 r79861  
    6464
    6565#if ENABLE(XSLT)
     66#include "XMLTreeViewer.h"
    6667#include <libxslt/xslt.h>
    6768#endif
    6869
    6970#if ENABLE(XHTMLMP)
    70 #include "HTMLNames.h"
    7171#include "HTMLScriptElement.h"
    7272#endif
     73
    7374
    7475using namespace std;
     
    549550    , m_currentNode(document)
    550551    , m_sawError(false)
     552    , m_sawCSS(false)
    551553    , m_sawXSLTransform(false)
    552554    , m_sawFirstElement(false)
     
    575577    , m_currentNode(fragment)
    576578    , m_sawError(false)
     579    , m_sawCSS(false)
    577580    , m_sawXSLTransform(false)
    578581    , m_sawFirstElement(false)
     
    968971
    969972    // ### handle exceptions
    970     int exception = 0;
     973    ExceptionCode ec = 0;
    971974    RefPtr<ProcessingInstruction> pi = document()->createProcessingInstruction(
    972         toString(target), toString(data), exception);
    973     if (exception)
     975        toString(target), toString(data), ec);
     976    if (ec)
    974977        return;
    975978
     
    982985    pi->finishParsingChildren();
    983986
     987    if (pi->isCSS())
     988        m_sawCSS = true;
    984989#if ENABLE(XSLT)
    985990    m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
     
    13081313    DocumentParser::startParsing();
    13091314    m_sawError = false;
     1315    m_sawCSS = false;
    13101316    m_sawXSLTransform = false;
    13111317    m_sawFirstElement = false;
     
    13221328void XMLDocumentParser::doEnd()
    13231329{
     1330    if (!isStopped()) {
     1331        if (m_context) {
     1332            // Tell libxml we're done.
     1333            {
     1334                XMLDocumentParserScope scope(document()->cachedResourceLoader());
     1335                xmlParseChunk(context(), 0, 0, 1);
     1336            }
     1337
     1338            m_context = 0;
     1339        }
     1340    }
     1341
    13241342#if ENABLE(XSLT)
    1325     if (m_sawXSLTransform) {
     1343    XMLTreeViewer xmlTreeViewer(document());
     1344
     1345    bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && xmlTreeViewer.hasNoStyleInformation();
     1346
     1347    if (xmlViewerMode || m_sawXSLTransform) {
    13261348        void* doc = xmlDocPtrForString(document()->cachedResourceLoader(), m_originalSourceForTransform, document()->url().string());
    13271349        document()->setTransformSource(new TransformSource(doc));
    13281350
    1329         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
    1330         document()->styleSelectorChanged(RecalcStyleImmediately);
    1331         document()->setParsing(true);
     1351        if (xmlViewerMode)
     1352            xmlTreeViewer.transformDocumentToTreeView();
     1353        else {
     1354            document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
     1355            document()->styleSelectorChanged(RecalcStyleImmediately);
     1356            document()->setParsing(true);
     1357        }
     1358
    13321359        DocumentParser::stopParsing();
    13331360    }
    13341361#endif
    13351362
    1336     if (isStopped())
    1337         return;
    1338 
    1339     if (m_context) {
    1340         // Tell libxml we're done.
    1341         {
    1342             XMLDocumentParserScope scope(document()->cachedResourceLoader());
    1343             xmlParseChunk(context(), 0, 0, 1);
    1344         }
    1345 
    1346         m_context = 0;
    1347     }
    13481363}
    13491364
  • trunk/Source/WebCore/dom/XMLDocumentParserQt.cpp

    r79805 r79861  
    9292    , m_currentNode(document)
    9393    , m_sawError(false)
     94    , m_sawCSS(false)
    9495    , m_sawXSLTransform(false)
    9596    , m_sawFirstElement(false)
     
    118119    , m_currentNode(fragment)
    119120    , m_sawError(false)
     121    , m_sawCSS(false)
    120122    , m_sawXSLTransform(false)
    121123    , m_sawFirstElement(false)
     
    206208    DocumentParser::startParsing();
    207209    m_sawError = false;
     210    m_sawCSS = false;
    208211    m_sawXSLTransform = false;
    209212    m_sawFirstElement = false;
     
    641644    pi->finishParsingChildren();
    642645
     646    if (pi->isCSS())
     647        m_sawCSS = true;
    643648#if ENABLE(XSLT)
    644649    m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
  • trunk/Source/WebCore/html/HTMLViewSourceDocument.cpp

    r79805 r79861  
    5353{
    5454    setUsesBeforeAfterRules(true);
     55    setUsesViewSourceStyles(true);
     56
    5557    setCompatibilityMode(QuirksMode);
    5658    lockCompatibilityMode();
  • trunk/Source/WebCore/xml/XSLStyleSheet.h

    r79805 r79861  
    6464    }
    6565
     66    static PassRefPtr<XSLStyleSheet> createForXMLTreeViewer(Node* node, const String& sheetString)
     67    {
     68        RefPtr<XSLStyleSheet> sheet = adoptRef(new XSLStyleSheet(node, String(), KURL(), false));
     69        sheet->parseString(sheetString);
     70
     71        return sheet.release();
     72    }
     73
    6674    virtual ~XSLStyleSheet();
    6775   
Note: See TracChangeset for help on using the changeset viewer.