Changeset 81962 in webkit


Ignore:
Timestamp:
Mar 25, 2011 8:10:32 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-25 Vsevolod Vlasov <vsevik@chromium.org>

Reviewed by Pavel Feldman.

XML Viewer: extensions can't render original XML
https://bugs.webkit.org/show_bug.cgi?id=56263

Added source xml to transformed document, renamed onload function.

  • fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt:
  • fast/encoding/dumpAsText/utf-16-no-bom-expected.txt:
  • http/tests/xmlviewer/dumpAsText/wml-expected.txt:
  • http/tests/xmlviewer/dumpAsText/xlink-expected.txt:
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251-expected.txt:
  • http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8-expected.txt:
  • http/tests/xmlviewer/dumpAsText/xmlviewer-expected.txt:
  • http/tests/xmlviewer/dumpAsText/xul-expected.txt:
  • platform/chromium-linux/http/tests/xmlviewer/dumpAsText/wml-expected.txt:
  • platform/chromium/http/tests/xmlviewer/dumpAsText/mathml-expected.txt:
  • svg/hixie/error/dumpAsText/004-expected.txt:
  • svg/hixie/error/dumpAsText/005-expected.txt:
  • xmlviewer/extensions-api-expected.txt: Added.
  • xmlviewer/extensions-api.html_disabled: Added.
  • xmlviewer/resources/sample.xml: Added.

2011-03-25 Vsevolod Vlasov <vsevik@chromium.org>

Reviewed by Pavel Feldman.

XML Viewer: extensions can't render original XML
https://bugs.webkit.org/show_bug.cgi?id=56263

Added source xml to transformed document, renamed onload function.

  • xml/XMLTreeViewer.cpp: (WebCore::XMLTreeViewer::transformDocumentToTreeView):
  • xml/XMLViewer.xsl:
Location:
trunk
Files:
5 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r81958 r81962  
     12011-03-25  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        XML Viewer: extensions can't render original XML
     6        https://bugs.webkit.org/show_bug.cgi?id=56263
     7
     8        Added source xml to transformed document, renamed onload function.
     9
     10        * fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt:
     11        * fast/encoding/dumpAsText/utf-16-no-bom-expected.txt:
     12        * http/tests/xmlviewer/dumpAsText/wml-expected.txt:
     13        * http/tests/xmlviewer/dumpAsText/xlink-expected.txt:
     14        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251-expected.txt:
     15        * http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8-expected.txt:
     16        * http/tests/xmlviewer/dumpAsText/xmlviewer-expected.txt:
     17        * http/tests/xmlviewer/dumpAsText/xul-expected.txt:
     18        * platform/chromium-linux/http/tests/xmlviewer/dumpAsText/wml-expected.txt:
     19        * platform/chromium/http/tests/xmlviewer/dumpAsText/mathml-expected.txt:
     20        * svg/hixie/error/dumpAsText/004-expected.txt:
     21        * svg/hixie/error/dumpAsText/005-expected.txt:
     22        * xmlviewer/extensions-api-expected.txt: Added.
     23        * xmlviewer/extensions-api.html_disabled: Added.
     24        * xmlviewer/resources/sample.xml: Added.
     25
    1262011-03-25  Adam Roben  <aroben@apple.com>
    227
  • trunk/LayoutTests/fast/css/dumpAsText/xml-stylesheet-pi-not-in-prolog-expected.txt

    r79861 r81962  
    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/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt

    r79861 r81962  
    33Should be "CYRILLIC SMALL LETTER IO" (like e with diaeresis): ё
    44</TEST>
    5 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/wml-expected.txt

    r80085 r81962  
    1515</card>
    1616</wml>
    17 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/xlink-expected.txt

    r79861 r81962  
    88<xlink l:type="simple" l:href="xlink.xml">SUCCESS</xlink>
    99</test>
    10 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/xmlviewer-charset-cp1251-expected.txt

    r79861 r81962  
    33<cp1251>SUССЕSS - These 'CCE' are cyrillic letters.</cp1251>
    44</root>
    5 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/xmlviewer-charset-utf8-expected.txt

    r79861 r81962  
    33<utf8>SUССЕSS - These 'CCE' are cyrillic letters.</utf8>
    44</root>
    5 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/xmlviewer-expected.txt

    r79861 r81962  
    2929<ns:tag-with-some-namespace/>
    3030</root-tag-with-mixed-content>
    31 
  • trunk/LayoutTests/http/tests/xmlviewer/dumpAsText/xul-expected.txt

    r79861 r81962  
    77<box a:attr="value">SUCCESS</box>
    88</FAIL>
    9 
  • trunk/LayoutTests/platform/chromium-linux/http/tests/xmlviewer/dumpAsText/wml-expected.txt

    r80071 r81962  
    1515</card>
    1616</wml>
    17 
  • trunk/LayoutTests/platform/chromium/http/tests/xmlviewer/dumpAsText/mathml-expected.txt

    r79861 r81962  
    1313</a:math>
    1414</FAIL>
    15 
  • trunk/LayoutTests/svg/hixie/error/dumpAsText/004-expected.txt

    r79861 r81962  
    88-->
    99</svg>
    10 
  • trunk/LayoutTests/svg/hixie/error/dumpAsText/005-expected.txt

    r79861 r81962  
    55<rect x="10" y="10" width="280" height="180" fill="red"/>
    66</svg>
    7 
  • trunk/Source/WebCore/ChangeLog

    r81961 r81962  
     12011-03-25  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        XML Viewer: extensions can't render original XML
     6        https://bugs.webkit.org/show_bug.cgi?id=56263
     7
     8        Added source xml to transformed document, renamed onload function.
     9
     10        * xml/XMLTreeViewer.cpp:
     11        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
     12        * xml/XMLViewer.xsl:
     13
    1142011-03-25  Benjamin Poulain  <benjamin.poulain@nokia.com>
    215
  • trunk/Source/WebCore/xml/XMLTreeViewer.cpp

    r81770 r81962  
    3434
    3535#include "Base64.h"
     36#include "Element.h"
    3637#include "Document.h"
    3738#include "Frame.h"
     
    105106    if (processor->transformToString(m_document, resultMIMEType, newSource, resultEncoding))
    106107        processor->createDocumentFromSource(newSource, resultEncoding, resultMIMEType, m_document, frame);
     108
     109    // Adding source xml for dealing with namespaces and CDATA issues and for extensions use.
     110    Element* sourceXmlElement = frame->document()->getElementById(AtomicString("source-xml"));
     111    if (sourceXmlElement)
     112        m_document->cloneChildNodes(sourceXmlElement);
     113
    107114    // New document should have been loaded in frame. Tell it to use view source styles.
    108115    frame->document()->setUsesViewSourceStyles(true);
    109116    frame->document()->styleSelectorChanged(RecalcStyleImmediately);
     117
    110118}
    111119
  • trunk/Source/WebCore/xml/XMLViewer.xsl

    r81773 r81962  
    249249                <xsl:call-template name="script"/>
    250250            </head>
    251             <body onload="onload()">
     251            <body onload="onWebKitXMLViewerLoad()">
    252252                <div class="header">
    253                     <span> <xsl:value-of select="$xml_has_no_style_message"/> </span> 
     253                    <span> <xsl:value-of select="$xml_has_no_style_message"/> </span>
    254254                    <br/>
    255255                </div>
     
    258258                    <xsl:apply-templates/>
    259259                </div>
    260                 <div> </div>
     260                <div id="source-xml"></div>
    261261            </body>
    262262        </html>
     
    266266        <script type="text/javascript">
    267267            <xsl:text>
    268                 function onload()
     268                function onWebKitXMLViewerLoad()
    269269                {
    270270                    drawArrows();
     
    361361                font-family: monospace;
    362362                font-size: 13px;
     363            }
     364
     365            #source-xml {
     366                display: none;
    363367            }
    364368
Note: See TracChangeset for help on using the changeset viewer.