[Webkit-unassigned] [Bug 13807] XML without style should render as syntax-highlighted source

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 28 03:12:53 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=13807


Vsevolod Vlasov <vsevik at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vsevik at chromium.org




--- Comment #10 from Vsevolod Vlasov <vsevik at chromium.org>  2011-01-28 03:12:53 PST ---
I implemented this XML viewer with the following approach:

1) Rendering is done using XSLT stylesheet with the following features
  - Formatted xml output
  - Syntax highlighting (uses the same view-source.css as View Source Mode for colors)
  - Expand/collapse buttons on complex tags (similar to Firefox approach), expand all, collapse all buttons.

2) XML viewer is not shown when one of the following conditions is met:
  - Current frame has parent frame defined (since parent frame can execute scripts on current frame).
  - Current window has opener defined (since opener window can execute scripts on current frame).
    The side effect of this condition is that XML viewer is not shown for XML 
    documents opened with <a href="www.example.com/no-style.xml" target="_blank">Anchor text</a>.
  - Current document has any XML parsing errors.
  - Current document has <?xml-stylesheet ...?> processing instruction.
  - Current document has any element or attribute in one of the 'known' namespaces:
    - XHTML
    - SVG (if it is enabled)
    - WML (if it is enabled)
    - MATHML (if it is enabled)
    - XLINK
    - XUL

3) Layout Tests provided to test when and how XML viewer is shown. 
   Since I could not use javascript in most of the tests (they should not have xhtml namespace intentionally),
   I put them in http folder/tests/xmlviewer folder with .htaccess to serve all of them with application/xml mime type.
   At the same time I changed DumpRenderTree to always dump application/xml as text.
   That doesn't cause any problems with older tests (by default .xml files are served as text/xml)

My implementation seems to pass all of the Hixie's tests that were passed before patch.

So far I made DumpRenderTree changes only for chromium. WML and MathML are not working in chromium build (at least in default), so these tests do not have '*-expected.txt' files yet.

As a result of my changes these tests do not pass anymore
  fast/css/xml-stylesheet-pi-not-in-prolog.xml = IMAGE+TEXT =============== Has PI not in prolog
  fast/encoding/utf-16-no-bom.xml = IMAGE+TEXT  =========================== XSLT applied, strange file, strange symbols
  fast/invalid/junk-data.xml = IMAGE+TEXT  ================================ XML WITH ERROR -> fails after XSLT (only '>' in xml)
  svg/hixie/error/004.xml = IMAGE+TEXT ==================================== SVG WITHOUT NAMESPACES
  svg/hixie/error/005.xml = IMAGE+TEXT ==================================== SVG WITHOUT NAMESPACES
They are testing the behaviour with various incorrect xml files, so they are failing after applying XMLViewer.xsl transformation.

Could you give me any comments on this implementation?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list