SVG loaded through html <img> can't request to load any external resources.
https://bugs.webkit.org/show_bug.cgi?id=137762.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2014-10-22
Reviewed by Daniel Bates.

Source/WebCore:

SVG images have unique security rules that prevent them from loading any external
resources. This patch enforces these rules in CachedResourceLoader::canRequest for
all non-data-uri resources.

The fix and the tests are ported but modified a little from the chromium fix:
http://src.chromium.org/viewvc/blink?view=rev&rev=176084

Test: http/tests/security/svg-image-with-cached-remote-image.html
      http/tests/security/svg-image-with-css-cross-domain.html

For the SVG image, prevent loading any external sub-resource except for data urls.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):

LayoutTests:

Ensure that SVG images, which are loaded through the <img> tag or through the
CSS background image, cannot load any external sub-resource except for data-
URL resources (though this doesn't work at the time of writing, see bug #137941).
Also ensure the same rule is enforced on cached resources.

The tests are ported but modified a little from the chromium fix:
http://src.chromium.org/viewvc/blink?view=rev&rev=176084

Set the circle background to orange
* http/tests/security/resources/image-with-css-cross-domain-circle.css: Added.
(circle):

Set the circle stroke-width = 2 and the circle stroke = red
* http/tests/security/resources/image-with-css-cross-domain-circle2.css: Added.
(circle):

This svg references the two css files: one is relative path and the other is absolute path
* http/tests/security/resources/image-with-css-cross-domain.svg: Added.

This svg references an external image.
* http/tests/security/resources/image-with-remote-image.svg: Added.

A helper css which sets the formatting style for some html tags
* http/tests/security/svg-image-with-css-cross-domain.css: Added.
(span):
(span.circle-css-cross-domain):
(embed):
(iframe):

Test the svg which is referenced as a cached image by an <object> tag, does not load
external sub-resource.
* http/tests/security/svg-image-with-cached-remote-image-expected.html: Added.
* http/tests/security/svg-image-with-cached-remote-image.html: Added.

Test loading sub-resources for an svg which is included in the html by different ways
and which references external css files.
Ensure the image object does not load any external sub-resources.
* http/tests/security/svg-image-with-css-cross-domain-expected.html: Added.
* http/tests/security/svg-image-with-css-cross-domain.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add action menu support for images
https://bugs.webkit.org/show_bug.cgi?id=137987
<rdar://problem/18717767>

Reviewed by Anders Carlsson, Sam Weinig, and Beth Dakin.

* Resources/AddImageToPhotos.pdf: Added.
* Resources/CopyImage.pdf: Added.
* Resources/SaveImageToDownloads.pdf: Added.
* Resources/ShareImage.pdf: Added.
Add some temporary artwork.

* Scripts/webkit/messages.py:
(struct_or_class):
ActionMenuHitTestResult is a struct.

* Shared/API/c/WKActionMenuItemTypes.h:
Add new items for image menus.

* Shared/mac/ActionMenuHitTestResult.cpp:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
For now, pass the hit image data across to the UI process as a ShareableBitmap.

* Shared/mac/ActionMenuHitTestResult.h:

* UIProcess/API/mac/WKView.mm:
(-[WKView _createActionMenuItemForTag:]):
Refactor action menu item creation into a single function, so that
callers can share code and be much simpler.

(webKitBundleImageNamed):
Add a helper to acquire an image from the WebKit2 bundle.

(-[WKView _copyImage:]):
(-[WKView _saveImageToDownloads:]):
(temporaryPhotosDirectoryPath):
(pathToPhotoOnDisk):
(-[WKView _addImageToPhotos:]):
Add rudimentary implementations of image actions.

(-[WKView _defaultMenuItemsForImage]):
Support the image menu, plus a submenu acquired from NSSharingServicePicker
for the Share menu.

(-[WKView _defaultMenuItems]):
Call _defaultMenuItemsForImage if needed.

(-[WKView _updateActionMenu]):
Refactor _updateActionMenu out of prepareForMenu:withEvent:.

(-[WKView prepareForMenu:withEvent:]):
Ask the Web process to re-hit-test under the location that the menu
will appear. Mark the menu as pending.

(-[WKView _didPerformActionMenuHitTest:]):
When we get the hit test reply, record the result for future use.

(-[WKView willOpenMenu:withEvent:]):
If we got a hit test reply, rebuild the menu immediately. If not, wait
up to 500ms for the reply to come in. This eventually needs to be
cancellable if the menu is rejected in the interim.

(-[WKView didCloseMenu:withEvent:]):
Clear all state when the menu closes.

* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performActionMenuHitTestAtLocation):
(WebKit::WebPageProxy::didPerformActionMenuHitTest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformActionMenuHitTest):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Plumb didPerformActionMenuHitTest back from WebPageProxy to WKView.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Hit test at the given location, recording the image data if there is any,
and return the result to the UI process.

* WebKit2.xcodeproj/project.pbxproj:
Add the PDFs.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flakiness dashboard should support OS X Yosemite
https://bugs.webkit.org/show_bug.cgi?id=137986

Reviewed by Ryosuke Niwa.

* TestResultServer/app.yaml:
* TestResultServer/static-dashboards/builders.jsonp:
* TestResultServer/static-dashboards/flakiness_dashboard.js:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Rebaseline various tests after switching to Windows rendering for native controls.

* platform/win/editing/inserting/before-after-input-element-expected.txt: Added.
* platform/win/editing/pasteboard/4806874-expected.txt: Added.
* platform/win/editing/pasteboard/pasting-tabs-expected.txt:
* platform/win/editing/selection/4397952-expected.txt:
* platform/win/editing/selection/4895428-3-expected.txt: Added.
* platform/win/editing/selection/select-across-readonly-input-4-expected.txt:
* platform/win/editing/selection/select-across-readonly-input-5-expected.txt:
* platform/win/fast/block/basic: Added.
* platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.txt: Added.
* platform/win/fast/block/float/032-expected.txt: Added.
* platform/win/fast/css/text-input-with-webkit-border-radius-expected.txt:
* platform/win/fast/dom/isindex-001-expected.txt: Added.
* platform/win/fast/dom/isindex-002-expected.txt: Added.
* platform/win/fast/forms/007-expected.txt: Added.
* platform/win/fast/forms/button-align-expected.txt: Added.
* platform/win/fast/forms/button-cannot-be-nested-expected.txt: Added.
* platform/win/fast/forms/button-default-title-expected.txt:
* platform/win/fast/forms/button-table-styles-expected.txt:
* platform/win/fast/forms/button-white-space-expected.txt: Added.
* platform/win/fast/forms/encoding-test-expected.txt: Added.
* platform/win/fast/forms/floating-textfield-relayout-expected.txt: Added.
* platform/win/fast/forms/input-align-expected.txt: Added.
* platform/win/fast/forms/input-appearance-bkcolor-expected.txt: Added.
* platform/win/fast/forms/input-appearance-default-bkcolor-expected.txt: Added.
* platform/win/fast/forms/input-appearance-disabled-expected.txt: Added.
* platform/win/fast/forms/input-appearance-preventDefault-expected.txt: Added.
* platform/win/fast/forms/input-appearance-width-expected.txt: Added.
* platform/win/fast/forms/input-baseline-expected.txt: Added.
* platform/win/fast/forms/input-disabled-color-expected.txt: Added.
* platform/win/fast/forms/input-field-text-truncated-expected.txt: Added.
* platform/win/fast/forms/input-placeholder-visibility-1-expected.txt: Added.
* platform/win/fast/forms/input-placeholder-visibility-3-expected.txt: Added.
* platform/win/fast/forms/input-readonly-empty-expected.txt: Added.
* platform/win/fast/forms/input-table-expected.txt: Added.
* platform/win/fast/forms/input-text-click-inside-expected.txt: Added.
* platform/win/fast/forms/input-text-option-delete-expected.txt: Added.
* platform/win/fast/forms/input-text-scroll-left-on-blur-expected.txt: Added.
* platform/win/fast/forms/input-text-self-emptying-click-expected.txt: Added.
* platform/win/fast/forms/input-text-word-wrap-expected.txt: Added.
* platform/win/fast/forms/menulist-restrict-line-height-expected.txt: Added.
* platform/win/fast/forms/menulist-style-color-expected.txt:
* platform/win/fast/forms/minWidthPercent-expected.txt: Added.
* platform/win/fast/forms/placeholder-position-expected.txt: Added.
* platform/win/fast/forms/select-listbox-multiple-no-focusring-expected.txt:
* platform/win/fast/forms/select-overflow-scroll-expected.txt:
* platform/win/fast/forms/select-overflow-scroll-inherited-expected.txt:
* platform/win/fast/forms/text-style-color-expected.txt: Added.
* platform/win/fast/forms/textfield-focus-ring-expected.txt: Added.
* platform/win/fast/forms/textfield-outline-expected.txt: Added.
* platform/win/fast/forms/visual-hebrew-text-field-expected.txt: Added.
* platform/win/fast/lists/dynamic-marker-crash-expected.txt: Added.
* platform/win/fast/table/spanOverlapRepaint-expected.txt: Added.
* platform/win/fast/table/text-field-baseline-expected.txt: Added.
* platform/win/fast/text/textIteratorNilRenderer-expected.txt:
* platform/win/svg/custom/inline-svg-in-html-expected.txt: Added.
* platform/win/svg/hixie/mixed: Added.
* platform/win/svg/hixie/mixed/003-expected.txt: Added.
* platform/win/tables/mozilla/bugs/45621-expected.txt: Added.
* platform/win/tables/mozilla/bugs/bug138725-expected.txt:
* platform/win/tables/mozilla/bugs/bug194024-expected.txt: Added.
* platform/win/tables/mozilla/bugs/bug24200-expected.txt: Added.
* platform/win/tables/mozilla/bugs/bug2479-3-expected.txt:
* platform/win/tables/mozilla/bugs/bug2479-4-expected.txt:
* platform/win/tables/mozilla/bugs/bug39209-expected.txt:
* platform/win/tables/mozilla/bugs/bug4527-expected.txt:
* platform/win/tables/mozilla/bugs/bug46368-1-expected.txt:
* platform/win/tables/mozilla/bugs/bug46368-2-expected.txt:
* platform/win/tables/mozilla/bugs/bug51727-expected.txt:
* platform/win/tables/mozilla/bugs/bug52505-expected.txt:
* platform/win/tables/mozilla/bugs/bug52506-expected.txt:
* platform/win/tables/mozilla/bugs/bug59354-expected.txt: Added.
* platform/win/tables/mozilla/bugs/bug60749-expected.txt:
* platform/win/tables/mozilla/bugs/bug68912-expected.txt: Added.
* platform/win/tables/mozilla/bugs/bug7342-expected.txt:
* platform/win/tables/mozilla/bugs/bugs28928-expected.txt: Added.
* platform/win/tables/mozilla/collapsing_borders/bug41262-4-expected.txt:
* platform/win/tables/mozilla_expected_failures/bugs/bug92647-1-expected.txt: Added.
* platform/win/tables/mozilla_expected_failures/collapsing_borders: Added.
* platform/win/tables/mozilla_expected_failures/collapsing_borders/bug41262-5-expected.txt: Added.
* platform/win/tables/mozilla_expected_failures/collapsing_borders/bug41262-6-expected.txt: Added.
* platform/win/tables/mozilla_expected_failures/core/captions1-expected.txt:
* platform/win/tables/mozilla_expected_failures/core/captions2-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
String(new Date(Mar 30 2014 01:00:00)) is wrong in CET
https://bugs.webkit.org/show_bug.cgi?id=130967

Patch by Byungseon Shin <sun.shin@lge.com> on 2014-10-22
Reviewed by Mark Lam.

Source/JavaScriptCore:

By definition of calculateLocalTimeOffset, input time should be UTC time.
But there are many cases when input time is based on local time.
So, it gives erroneous results while calculating offset of DST boundary time.
By adding a argument to distinguish UTC and local time, we can get the correct offset.

* JavaScriptCore.order:
* runtime/DateConstructor.cpp:
(JSC::constructDate):
(JSC::callDate):
(JSC::dateUTC):
* runtime/DateInstance.cpp:
(JSC::DateInstance::calculateGregorianDateTime):
(JSC::DateInstance::calculateGregorianDateTimeUTC):
* runtime/DatePrototype.cpp:
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetMilliSeconds):
(JSC::dateProtoFuncSetUTCMilliseconds):
(JSC::dateProtoFuncSetSeconds):
(JSC::dateProtoFuncSetUTCSeconds):
(JSC::dateProtoFuncSetMinutes):
(JSC::dateProtoFuncSetUTCMinutes):
(JSC::dateProtoFuncSetHours):
(JSC::dateProtoFuncSetUTCHours):
(JSC::dateProtoFuncSetDate):
(JSC::dateProtoFuncSetUTCDate):
(JSC::dateProtoFuncSetMonth):
(JSC::dateProtoFuncSetUTCMonth):
(JSC::dateProtoFuncSetFullYear):
(JSC::dateProtoFuncSetUTCFullYear):
(JSC::dateProtoFuncSetYear):
* runtime/JSDateMath.cpp:
(JSC::localTimeOffset):
(JSC::gregorianDateTimeToMS):
(JSC::msToGregorianDateTime):
(JSC::parseDateFromNullTerminatedCharacters):
* runtime/JSDateMath.h:
* runtime/VM.h:
(JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
(JSC::LocalTimeOffsetCache::reset):
Passing TimeType argument to distingush UTC time and local time.

Source/WTF:

By definition of calculateLocalTimeOffset, input time should be UTC time.
But there are many cases when input time is based on local time.
So, it gives erroneous results while calculating offset of DST boundary time.
By adding a argument to distinguish UTC and local time, we can get the correct offset.

* wtf/DateMath.cpp:
(WTF::calculateLocalTimeOffset):
(WTF::parseDateFromNullTerminatedCharacters):
Compensate time offset depends on UTC time or local time.
* wtf/DateMath.h:
Add argument to differenciate UTC or local time.

LayoutTests:

Set latest DST timezone boundary values on
<http://www.timeanddate.com/time/zone/usa/los-angeles>

* js/dom/script-tests/date-DST-time-cusps.js:

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