[Webkit-unassigned] [Bug 56263] XML Viewer: extensions can't render original XML

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 14 09:08:39 PDT 2011


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


Vsevolod Vlasov <vsevik at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #85682|                            |review?, commit-queue?
               Flag|                            |




--- Comment #3 from Vsevolod Vlasov <vsevik at chromium.org>  2011-03-14 09:08:38 PST ---
Created an attachment (id=85682)
 --> (https://bugs.webkit.org/attachment.cgi?id=85682&action=review)
Patch

Since current xml viewer implementation applies XSL transformation internally, custom xml tree extensions encounter two problems:
1. Detecting XML without style using code like 'if (document instanceof XMLDocument)' is not possible anymore.
2. Source XML is hidden from extension - it could only see an XSL transformation result.

Proposed solution:

1. XML Viewer defines global javascript function with pseudo-unique name handleWebKitXMLViewerOnLoadEvent(). Extensions could check if this function is defined.
2. WebKit xml viewer is not shown when window.opener is defined. Running  window.open(document.location, '_self') will turn xml viewer off.

Putting all together, extension with logic like

if (currentDocumentIsXMLWithoutStyle()) 
  showCustomXMLViewer()

Could be rewritten like  

if (typeof(window['handleWebKitXMLViewerOnLoadEvent']) == 'function')
  window.open(document.location, '_self');
else if (currentDocumentIsXMLWithoutStyle()) 
  showCustomXMLViewer();

The worst impact would be triggering one-time page reload for pages having 'handleWebKitXMLViewerOnLoadEvent()' function defined for some reason.

-- 
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