Unstyled XML viewer crashes when XML contains an element with id="tree"
https://bugs.webkit.org/show_bug.cgi?id=117117
<rdar://problem/13727267>

Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml

* xml/XMLViewer.css: Removed the rule to hide source document, as we no longer
keep it in the tree.

* xml/XMLViewer.js:
(prepareWebKitXMLViewer): Make sourceXML a detached tree, as otherwise it can
have ID conflicts with elements we add.
(sourceXMLLoaded): Removed some commented out code. Removed code that was checking
whether an extension took over XML display, as it makes no sense to duplicate this
functionality in an extension.

LayoutTests:

* http/tests/xmlviewer/dumpAsText/existing-tree-element-crash-expected.txt: Added.
* http/tests/xmlviewer/dumpAsText/existing-tree-element-crash.xml: Added.

* xmlviewer: Removed.
* xmlviewer/extensions-api-expected.txt: Removed.
* xmlviewer/extensions-api.html: Removed.
* xmlviewer/resources: Removed.
* xmlviewer/resources/sample.xml: Removed.
The "API" no longer exists.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][CoordinatedGraphics]: Use a properly initialized WebPage when creating a PageClient
https://bugs.webkit.org/show_bug.cgi?id=117116

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-06-02
Reviewed by Tim Horton.

Valgrind reported a "conditional jump or move depends on uninitialised value"
at WebPageProxy constructor, when checking the m_isVisible variable inside
the ENABLE(PAGE_VISIBILITY_API) guard.

The issue was tracked down to the WebView constructor, which was creating a
WebKit::PageClient* making use of `this' before having initialized all of its
attributes.

The solution was to move the initialization of the `page' member to inside the
constructor itself - out of the initialization list -, where we can guarantee
all the relevant stuff has already been properly initialized.

Here's the relevant valgrind trace for reference:

Conditional jump or move depends on uninitialised value(s)
    at 0x65A35A4: WebKit::WebPageProxy::WebPageProxy(WebKit::PageClient*,
                  WTF::PassRefPtr<WebKit::WebProcessProxy>,
                  WebKit::WebPageGroup*, unsigned long) (WebPageProxy.cpp:322)
    by 0x65A2BA2: WebKit::WebPageProxy::create(WebKit::PageClient*,
                  WTF::PassRefPtr<WebKit::WebProcessProxy>,
                  WebKit::WebPageGroup*, unsigned long) (WebPageProxy.cpp:233)
    by 0x65E94BB: WebKit::WebProcessProxy::createWebPage(WebKit::PageClient*,
                  WebKit::WebContext*, WebKit::WebPageGroup*)
                  (WebProcessProxy.cpp:172)
    by 0x6570957: WebKit::WebContext::createWebPage(WebKit::PageClient*,
                  WebKit::WebPageGroup*, WebKit::WebPageProxy*)
                  (WebContext.cpp:735)
    by 0x67673E3: WebKit::WebView::WebView(WebKit::WebContext*,
                  WebKit::WebPageGroup*) (WebView.cpp:52)
    by 0x6775F18: WebKit::WebViewEfl::WebViewEfl(WebKit::WebContext*,
                  WebKit::WebPageGroup*) (WebViewEfl.cpp:54)
    by 0x6775EB4: WebKit::WebView::create(WebKit::WebContext*,
                  WebKit::WebPageGroup*) (WebViewEfl.cpp:49)
    by 0x673E13D: WKViewCreate (WKView.cpp:33)
    by 0x6763ECE: EWKViewCreate (ewk_view.cpp:92)

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::WebView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151081 268f45cc-cd09-0410-ab3c-d52691b4dbfc