Skip frame owner disconnect when there's no frames
https://bugs.webkit.org/show_bug.cgi?id=101619

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-11-08
Reviewed by Ojan Vafai.

Even when there's no subframes in the document we traverse down every
subtree on Node removal looking for frames to disconnect. This patch
checks document()->frame()->tree()->firstChild() to skip this traversal
if there's no subframes.

No new tests, this just short circuits code for speed.

* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildFrameDisconnector::ChildFrameDisconnector):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout test editing/pasteboard/file-drag-to-editable.html flaky
https://bugs.webkit.org/show_bug.cgi?id=101092

Reviewed by Ryosuke Niwa.

Fix a flaky test.  The problem was that we were confusing the test harness by
trying to do a navigation before the initial load finished (the notifyDone()
call did nothing because waitUntilDone() was missing).  Depending on the state
of the frame loader when the test run, there was a race in whether or not we
would dump the results before or after completing the script execution.

Fix this by restructuring the test to run during onload and by calling notifyDone()
after the file load attempt failed.

* editing/pasteboard/file-drag-to-editable-expected.txt:
* editing/pasteboard/script-tests/file-drag-to-editable.js:
(runTest.window.onbeforeunload): Simplify and don't run nofityDone yet.
(runTest): Run test during onload event.
* platform/chromium/TestExpectations: Remove flaky marker.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Print preview should vend images to the UIProcess instead of PDFs
https://bugs.webkit.org/show_bug.cgi?id=101382
<rdar://problem/9866766>

Reviewed by Alexey Proskuryakov.

In the interests of keeping PDF processing inside the WebProcess, we should
remove print preview's reliance on PDFs, by handing bitmaps back instead.

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::create): Add an optional SharedMemory::Protection argument, so we can make
ShareableBitmaps from read-only handles if desired. Defaults to read-write as previously.
(WebKit::ShareableBitmap::createHandle): Add an optional SharedMemory::Protection argument, so we can make
read-only handles if desired. Defaults to read-write as previously.
* Shared/ShareableBitmap.h:
* UIProcess/API/mac/WKPrintingView.h:
(WebImage): Store WebImages instead of raw PDF data for previews.
* UIProcess/API/mac/WKPrintingView.mm:
(pageDidDrawToImage): Add a callback for when a preview we've requested is done rendering into an image.
Cache the image in _pagePreviews if appropriate.
(pageDidDrawToPDF): Do not handle PDF data unless we are expecting a real print callback (not a preview).
(-[WKPrintingView _drawPreview:]): Request an image instead of PDF data when doing a print preview.
* UIProcess/GenericCallback.h:
(ImageCallback): Add a callback type with one argument: a ShareableBitmap::Handle.
I can't use the GenericCallback template because ShareableBitmap::Handle doesn't have a corresponding WK type.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): Add support for ImageCallback.
(WebKit::WebPageProxy::imageCallback): Add support for ImageCallback.
(WebKit::WebPageProxy::drawRectToImage): Rename drawRectToPDF to drawRectToImage.
* UIProcess/WebPageProxy.h:
(WebPageProxy): Rename drawRectToPDF to drawRectToImage, add support for ImageCallback.
* UIProcess/WebPageProxy.messages.in: Add support for ImageCallback.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRectToImage): Rename drawRectToPDF to drawRectToImage.
Make drawRectToImage create a bitmap snapshot of the page (using the normal snapshotting code),
or, if the page is backed by a *PDFPlugin, draw the PDF document into a bitmap and use that.
* WebProcess/WebPage/WebPage.h:
(WebPage): Rename drawRectToPDF to drawRectToImage.
* WebProcess/WebPage/WebPage.messages.in: Rename drawRectToPDF to drawRectToImage.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::drawPDFDocument): Rename drawRectToPDFFromPDFDocument to drawPDFDocument,
because it's more like drawImage than anything else.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium rebaselines.

* platform/chromium-linux-x86/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/chromium-linux-x86/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt:
* platform/chromium-mac-lion/fast/css/text-overflow-ellipsis-bidi-expected.png: Added.
* platform/chromium-mac-lion/fast/css/text-overflow-ellipsis-expected.png: Added.
* platform/chromium-mac-lion/fast/css/text-overflow-ellipsis-strict-expected.png: Added.
* platform/chromium-mac-lion/fast/css/text-overflow-input-expected.png: Added.
* platform/chromium-mac-lion/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/basic-textareas-quirks-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/input-disabled-color-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/input-readonly-dimmed-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/input-text-scroll-left-on-blur-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/search-rtl-expected.png: Added.
* platform/chromium-mac-lion/fast/multicol/span/anonymous-split-block-crash-expected.png: Added.
* platform/chromium-mac-lion/fast/multicol/span/clone-anonymous-block-non-inline-child-crash-expected.png: Added.
* platform/chromium-mac-lion/fast/replaced/width100percent-textarea-expected.png: Added.
* platform/chromium-mac/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
* platform/chromium-win-xp/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/chromium-win-xp/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt:
* platform/chromium-win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/chromium-win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt:
* platform/efl-wk1/fast/css: Added.
* platform/efl-wk1/fast/css/text-overflow-ellipsis-bidi-expected.png: Added.
* platform/efl-wk1/fast/css/text-overflow-ellipsis-expected.png: Added.
* platform/efl-wk1/fast/css/text-overflow-ellipsis-strict-expected.png: Added.
* platform/efl-wk1/fast/css/text-overflow-ellipsis-text-align-center-expected.png: Added.
* platform/efl-wk1/fast/css/text-overflow-input-expected.png: Added.
* platform/efl-wk1/fast/css/text-overflow-input-expected.txt: Added.
* platform/efl-wk1/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png: Added.
* platform/efl/fast/css/text-overflow-ellipsis-bidi-expected.png: Removed.
* platform/efl/fast/css/text-overflow-ellipsis-expected.png: Removed.
* platform/efl/fast/css/text-overflow-ellipsis-strict-expected.png: Removed.
* platform/efl/fast/css/text-overflow-ellipsis-text-align-center-expected.png: Removed.
* platform/efl/fast/css/text-overflow-input-expected.png: Removed.
* platform/efl/fast/css/text-overflow-input-expected.txt: Removed.
* platform/efl/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png: Removed.
* platform/efl/fast/forms/basic-textareas-quirks-expected.png: Removed.
* platform/efl/fast/forms/basic-textareas-quirks-expected.txt: Removed.
* platform/efl/fast/forms/input-disabled-color-expected.png: Removed.
* platform/efl/fast/forms/input-disabled-color-expected.txt: Removed.
* platform/efl/fast/forms/input-readonly-dimmed-expected.png: Removed.
* platform/efl/fast/forms/input-readonly-dimmed-expected.txt: Removed.
* platform/efl/fast/forms/input-text-scroll-left-on-blur-expected.png: Removed.
* platform/efl/fast/forms/input-text-scroll-left-on-blur-expected.txt: Removed.
* platform/efl/fast/multicol/span/anonymous-split-block-crash-expected.png: Removed.
* platform/efl/fast/multicol/span/clone-anonymous-block-non-inline-child-crash-expected.png: Removed.
* platform/efl/fast/replaced/width100percent-textarea-expected.png: Removed.


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