screen.availWidth always returns width of primary display
https://bugs.webkit.org/show_bug.cgi?id=117863

Source/WebCore:

Reviewed by Geoffrey Garen.

In WebKit2, Widgets have no platformWidget, so trying to get to the
NSScreen via the platform widget's window never succeeded, and we always
fell back on getting info for the main display.

However, we were already pushing the WKView's displayID down to the
WebProcess for the requestAnimationFrame infrastructure, so use that.

Add a virtual function on Widget windowDisplayID(), that is overridden
in FrameView to return the PlatformDisplayID which Page has.

Fix PlatformScreenMac to fall back to Widget::windowDisplayID() when it fails
to get an NSWindow from the Widget.

Add a utility category on NSScreen to get an NSScreen's displayID, and to
find an NSScreen given a displayID.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.cpp:
(WebCore::FrameView::windowDisplayID):
* page/FrameView.h:
* platform/Widget.cpp:
(WebCore::Widget::windowDisplayID):
* platform/Widget.h:
* platform/mac/PlatformScreenMac.h: Added.
* platform/mac/PlatformScreenMac.mm:
(+[NSScreen screenForDislayID:]):
(-[NSScreen displayID]):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::windowDisplayID):

Source/WebKit2:

Reviewed by Geoffrey Garen.

In WebKit2, Widgets have no platformWidget, so trying to get to the
NSScreen via the platform widget's window never succeeded, and we always
fell back on getting info for the main display.

However, we were already pushing the WKView's displayID down to the
WebProcess for the requestAnimationFrame infrastructure, so use that.

The WebProcess would not receive a displayID for a WKView until the window
was activated; fix by calling -doWindowDidChangeScreen when the view
moves to a window, rather than doing it from -_windowDidBecomeKey:.

* UIProcess/API/mac/WKView.mm:
(-[WKView viewDidMoveToWindow]):
(-[WKView _windowDidBecomeKey:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] limit shape image values to same origin
https://bugs.webkit.org/show_bug.cgi?id=117610

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Restrict the image URL values for shape-inside and shape-outside to
the same origin as the document. The alpha channel of image shape values
will be thresholded to produce the shape's boundaries (see bug 116643)
so normal image access rules aren't secure enough.

Added a RequestOriginPolicy ResourceLoaderOption which is used by
StyleResolver::loadPendingShapeImage() to request the additional restriction.
The change should have no other effect although it does enable one to apply
the same restriction to other resources which can currently be loaded from
any origin - see CachedResourceLoader::canRequest().

Test: http/tests/security/shape-inside-image-origin.html

* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::cachedImage): Add an effectively optional ResourceLoaderOptions parameter.
* css/CSSImageValue.h:
(WebCore::CSSImageValue::cachedImage): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingShapeImage): Load the image with the default CachedResourceLoader options plus RestrictToSameOrigin.
(WebCore::StyleResolver::loadPendingImages): Call loadPendingShapeImage().
* css/StyleResolver.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Update the ResourceLoaderOptions static variable.
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Ditto.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::options):
* loader/ResourceLoaderOptions.h: Add RequestOriginPolicy enum.
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest): Pass ResourceLoaderOptions along to revised CachedResourceLoader::canRequest().
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Update load() ResourceLoaderOptions.
(WebCore::CachedResourceLoader::canRequest): Replaced ContentSecurityPolicyCheck parameter with ResourceLoaderOptions.
(WebCore::CachedResourceLoader::requestResource): Pass ResourceLoaderOptions along to revised CachedResourceLoader::canRequest().
(WebCore::CachedResourceLoader::defaultCachedResourceOptions): Added UseDefaultOriginRestrictionsForType initializer.
* loader/cache/CachedResourceLoader.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading): Added UseDefaultOriginRestrictionsForType intializer.

LayoutTests:

Verify that a non same-origin image URL specified for shape-inside or
shape-outside will not load and the shape property will be reset to "none".

* http/tests/resources/square100.png: Added.
* http/tests/security/shape-inside-image-origin-expected.txt: Added.
* http/tests/security/shape-inside-image-origin.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Followup from r151877 .
Fix crash in fast/frames/iframe-access-screen-of-deleted.html by null-checking the widget.

* platform/mac/PlatformScreenMac.mm:
(WebCore::screenForWidget):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r151878.

* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading): Pass the new UseDefaultOriginRestrictionsForType
argument to the ResourceLoaderOptions constructor.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Slightly reduce width threshold on detection of primary snapshotted Plug-In
https://bugs.webkit.org/show_bug.cgi?id=117914
<rdar://problem/14136687>

Reviewed by Simon Fraser.

We've noticed some content that should be detected as the primary snapshotted plug-in,
but is just a bit smaller than our 450x300 minimum threshold. Reduce the width to 400.

* WebProcess/WebPage/WebPage.cpp: Change primarySnapshottedPlugInMinimumWidth from 450 to 400.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add support for MHTML save/load feature to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=106620

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-06-22
Reviewed by Christophe Dumez.

Enable CTRL + S as save page in mhtml and CTRL + L to load any page
from filesystem.

* MiniBrowser/efl/CMakeLists.txt:
* MiniBrowser/efl/main.c:
(page_contents_callback):
(on_key_down):
(show_file_entry_dialog): generic function to show file enrty
selector dialogue

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove redundant helper from RenderRegion.
https://bugs.webkit.org/show_bug.cgi?id=117915

Patch by Zalan Bujtas <zalan@apple.com> on 2013-06-22
Reviewed by Andreas Kling.

Minor code cleanup.

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::regionOversetState):
(WebCore::RenderRegion::setRegionOversetState):
* rendering/RenderRegion.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sort all the Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=117696

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/ThirdParty:

* gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.
* gtest/xcode/gtest.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/WebInspectorUI:

* WebInspectorUI.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

Source/WTF:

* WTF.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening. Unskip two media tests because there is no crash after system update.

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Rebaseline test after r151868
https://bugs.webkit.org/show_bug.cgi?id=117892

Rubber stamped by Chris Fleizach.

* platform/mac/accessibility/lists-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hittest finds the truncated text instead of the floating input, when the input is clicked.
https://bugs.webkit.org/show_bug.cgi?id=115675

Patch by Zalan Bujtas <zalan@apple.com> on 2013-06-24
Reviewed by David Hyatt.

Ignore truncated text on inline textbox and everything beyond the ellipsis box on
the root inlinebox while hittesting. (provided that nodeAtPoint finds no hit for any of
the root inline's children.)

Source/WebCore:

Test: fast/css/text-overflow-ellipsis-and-floating-input-hittest.html

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::nodeAtPoint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::nodeAtPoint):
(WebCore::InlineTextBox::paint):

LayoutTests:

* fast/css/text-overflow-ellipsis-and-floating-input-hittest-expected.txt: Added.
* fast/css/text-overflow-ellipsis-and-floating-input-hittest.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move IDL implements statements to IDL files that implement the interface
https://bugs.webkit.org/show_bug.cgi?id=117921

Reviewed by Kentaro Hara.

Move IDL implements statements to IDL files that implement the interface
so that we can more easily know that a given IDL interface implements
another.

The generator now enforces this as well for consistency.

No new tests, covered by TestImplements.idl.

* bindings/scripts/preprocess-idls.pl:
(getImplementedInterfacesFromIDL):
* bindings/scripts/test/TestImplements.idl:
* bindings/scripts/test/TestInterface.idl:
* dom/CharacterData.idl:
* dom/ChildNode.idl:
* dom/DocumentType.idl:
* dom/Element.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skipping the crashing tests on debug bots.
https://bugs.webkit.org/show_bug.cgi?id=94458

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-06-24

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r151021.
http://trac.webkit.org/changeset/151021
https://bugs.webkit.org/show_bug.cgi?id=117924

caused regressions on Qt and GTK (#117141 and #117688)
(Requested by philn on #webkit).

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcFinalize):
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcStop):
(webKitWebSrcStart):
(webKitWebSrcChangeState):
(webKitWebSrcQueryWithParent):
(webKitWebSrcGetUri):
(webKitWebSrcSetUri):
(webKitWebSrcNeedDataMainCb):
(webKitWebSrcEnoughDataMainCb):
(webKitWebSrcSeekMainCb):
(webKitWebSrcSeekDataCb):
(StreamingClient::StreamingClient):
(StreamingClient::~StreamingClient):
(StreamingClient::didReceiveResponse):
(StreamingClient::didReceiveData):
(StreamingClient::didFinishLoading):
(StreamingClient::wasBlocked):
(StreamingClient::cannotShowURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Implement unit test callback: onWordGuesses.
https://bugs.webkit.org/show_bug.cgi?id=117794

Patch by Krzysztof Wolanski <k.wolanski@samsung.com> on 2013-06-24
Reviewed by Christophe Dumez.

* UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:
(onWordGuesses):
Add client suggestions for the word.

(checkClientSuggestionsForWord):
Verify the suggestions that were given by the client.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMAKE] Clear unused cmakedefines
https://bugs.webkit.org/show_bug.cgi?id=117931

Reviewed by Christophe Dumez.

* Source/cmakeconfig.h.cmake:
Removed ENABLE_AS_IMAGE, ENABLE_LEGACY_WEBKIT_BLOB_BUILDER and
ENABLE_CLIENT_BASED_GEOLOCATION cmakedefines which already removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for WinCE after r151783.

* rendering/RenderThemeWinCE.cpp:
(WebCore::cssValueIdToSysColorIndex):
(WebCore::RenderThemeWinCE::systemColor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for WinCE after r151563.

* bindings/js/JSDOMBinding.cpp:
(WebCore::toInt8): Use fabs() instead of abs().
(WebCore::toUInt8): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce WindowTimers IDL interface
https://bugs.webkit.org/show_bug.cgi?id=117929

Reviewed by Kentaro Hara.

Introduce WindowTimers IDL interface and have both DOMWindow and WorkerContext
implement it to match the latest specification and avoid IDL duplication:
- http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#windowtimers
- http://dev.w3.org/html5/workers/#apis-available-to-workers

No new tests, no behavior change.

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* page/DOMWindow.idl:
* page/WindowTimers.idl:
* workers/WorkerContext.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use SetFilePointer instead of SetFilePointerEx in FileSystemWin
https://bugs.webkit.org/show_bug.cgi?id=116205

Reviewed by Ryosuke Niwa.

SetFilePointerEx is not available on Windows CE, so use SetFilePointer.
Also add a extra return for the case of an failure.

* platform/win/FileSystemWin.cpp:
(WebCore::seekFile):


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