WebKit-https.git
2 years agoUse SandboxExtension::HandleArray when sending extensions for file uploads to the...
bburg@apple.com [Wed, 26 Jul 2017 18:32:45 +0000 (18:32 +0000)]
Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
https://bugs.webkit.org/show_bug.cgi?id=174828

Reviewed by Tim Horton.

In the previous change I forgot to hoist the HandleArray and message-send out of the
loop, so the code wasn't actually sending fewer messages. That's fixed now.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):

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

2 years agoAdd the ability to change sp and pc to the ARM64 JIT probe.
mark.lam@apple.com [Wed, 26 Jul 2017 18:31:02 +0000 (18:31 +0000)]
Add the ability to change sp and pc to the ARM64 JIT probe.
https://bugs.webkit.org/show_bug.cgi?id=174697
<rdar://problem/33436965>

Reviewed by JF Bastien.

This patch implements the following:

1. The ARM64 probe now supports modifying the pc and sp.

   However, lr is not preserved when modifying the pc because it is used as the
   scratch register for the indirect jump. Hence, the probe handler function
   may not modify both lr and pc in the same probe invocation.

2. Fix probe tests to use bitwise comparison when comparing double register
   values. Otherwise, equivalent nan values will be interpreted as not equivalent.

3. Change the minimum offset increment in testProbeModifiesStackPointer to be
   16 bytes for ARM64.  This is because the ARM64 probe now uses the ldp and stp
   instructions which require 16 byte alignment for their memory access.

* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeError):
(JSC::MacroAssembler::probe):
(JSC::arm64ProbeTrampoline): Deleted.
* assembler/testmasm.cpp:
(JSC::isSpecialGPR):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesStackPointerToInsideProbeContextOnStack):
(JSC::testProbeModifiesStackPointerToNBytesBelowSP):

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

2 years agoPressing the Escape key should not be a valid user gesture to enter fullscreen
cdumez@apple.com [Wed, 26 Jul 2017 17:15:31 +0000 (17:15 +0000)]
Pressing the Escape key should not be a valid user gesture to enter fullscreen
https://bugs.webkit.org/show_bug.cgi?id=174864
<rdar://problem/33009088>

Reviewed by Geoffrey Garen.

Source/WebCore:

Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
is the gesture to exit fullscreen already.

Test: fullscreen/requestFullscreen-escape-key.html

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::create):
(WebCore::UserGestureToken::gestureType):
(WebCore::UserGestureToken::UserGestureToken):
* page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):

Tools:

Add support for eventSender.keyDown('escape') in DRT to match the behavior of
WKTR.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

LayoutTests:

Add layout test coverage.

* fullscreen/requestFullscreen-escape-key-expected.txt: Added.
* fullscreen/requestFullscreen-escape-key.html: Added.

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

2 years agoAX: Incorrect range from index and length in contenteditable with <p> tags
n_wang@apple.com [Wed, 26 Jul 2017 16:53:09 +0000 (16:53 +0000)]
AX: Incorrect range from index and length in contenteditable with <p> tags
https://bugs.webkit.org/show_bug.cgi?id=174856

Reviewed by Chris Fleizach.

Source/WebCore:

When asking for the string inside a text control with a given range, we sometimes get
a wrong string at the line boundary due to a bad plain range to text marker conversion.
To fix this, we should use the exsisting method on text controls to avoid this issue.

Updated the test to test the problematic case.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

LayoutTests:

* accessibility/mac/range-for-contenteditable-newline-expected.txt:
* accessibility/mac/range-for-contenteditable-newline.html:

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

2 years ago[Curl] Bug fix after r219606
commit-queue@webkit.org [Wed, 26 Jul 2017 15:29:29 +0000 (15:29 +0000)]
[Curl] Bug fix after r219606
https://bugs.webkit.org/show_bug.cgi?id=174845

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-07-26
Reviewed by Alex Christensen.

* platform/network/curl/CurlContext.h:
(WebCore::CurlSList::isEmpty):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandleInternal::didReceiveHeaderLine):
(WebCore::ResourceHandleInternal::headerCallback):

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

2 years agoRemove obsolete failure annotation for bad-charset-alias.html.
commit-queue@webkit.org [Wed, 26 Jul 2017 15:27:13 +0000 (15:27 +0000)]
Remove obsolete failure annotation for bad-charset-alias.html.
https://bugs.webkit.org/show_bug.cgi?id=145048

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Carlos Garcia Campos.

This appears to have been fixed in r204850.

* platform/gtk/TestExpectations:

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

2 years ago[EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
zandobersek@gmail.com [Wed, 26 Jul 2017 14:33:10 +0000 (14:33 +0000)]
[EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=174779

Reviewed by Xabier Rodriguez-Calvar.

In the CENC decryptor, the key ID value is retrieved from the info structure
on the GstProtectionMeta object. GstBuffer for that value is retrieved and
passed to the setupCipher() function.

In the ClearKey decryptor (which extends the CENC decryptor), the single
GstBuffer object on the private instance that holds the key value is replaced
with a Vector object that holds pairs of key ID and value GstBuffers. In the
handleKeyResponse() implementation that Vector is emptied and then refilled
with key ID and value pairs that are passed in through the drm-cipher-clearkey
structure that's attached to the GstEvent that signalled new key information.

In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
buffer is used to find a matching key ID and value pair stored on the private
instance. If not found, an error is thrown. If found, the matching key value
is used for decryption.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorHandleKeyResponse):
(webKitMediaClearKeyDecryptorSetupCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:

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

2 years ago[EME][GStreamer] Handle ClearKey as a supported key system
zandobersek@gmail.com [Wed, 26 Jul 2017 14:31:13 +0000 (14:31 +0000)]
[EME][GStreamer] Handle ClearKey as a supported key system
https://bugs.webkit.org/show_bug.cgi?id=174778

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
Return true for the 'org.w3.clearkey' key system when building with
ENCRYPTED_MEDIA enabled. The underlying implementation will follow.

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

2 years agoUnreviewed, minor adjustments to the previous demo.
fred.wang@free.fr [Wed, 26 Jul 2017 14:23:21 +0000 (14:23 +0000)]
Unreviewed, minor adjustments to the previous demo.

Patch by Frederic Wang <fwang@igalia.com> on 2017-07-26

* demos/frames/index.html: Added. Index page for the list of demos.
* demos/frames/sandboxing/index.html: Minor fixes.

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

2 years ago[WPE] Fix a potential crash in the platform pasteboard when reading a string
csaavedra@igalia.com [Wed, 26 Jul 2017 13:52:35 +0000 (13:52 +0000)]
[WPE] Fix a potential crash in the platform pasteboard when reading a string
https://bugs.webkit.org/show_bug.cgi?id=174859

Reviewed by Žan Doberšek.

We shouldn't assume that the wpe_pasteboard_string struct will be
filled in, so initialize it.

* platform/wpe/PlatformPasteboardWPE.cpp:
(WebCore::PlatformPasteboard::readString): Initialize the struct
before passing it to wpe and early return if it's still empty.

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

2 years agoUnreviewed, add demos (frame sandboxing and scrolling) for a blog post.
fred.wang@free.fr [Wed, 26 Jul 2017 13:43:25 +0000 (13:43 +0000)]
Unreviewed, add demos (frame sandboxing and scrolling) for a blog post.

Patch by Frederic Wang <fwang@igalia.com> on 2017-07-26

* demos/frames/sandboxing/am-i-sandboxed.html: Added.
* demos/frames/sandboxing/framebusting-success.html: Added.
* demos/frames/sandboxing/framebusting-without-user-activation.html: Added.
* demos/frames/sandboxing/index.html: Added.
* demos/frames/scrollable-iframes.html: Added.
* demos/frames/scrollingElement.html: Added.

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

2 years agoUnreviewed, added Romain Bellessort to contributors.json.
romain.bellessort@crf.canon.fr [Wed, 26 Jul 2017 13:41:37 +0000 (13:41 +0000)]
Unreviewed, added Romain Bellessort to contributors.json.

* Scripts/webkitpy/common/config/contributors.json:

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

2 years agoUnreviewed. Fix a compiler warning that springs up when
zandobersek@gmail.com [Wed, 26 Jul 2017 13:09:30 +0000 (13:09 +0000)]
Unreviewed. Fix a compiler warning that springs up when
building the WPE port with Clang.

* UIProcess/API/wpe/ScrollGestureController.h:
Let ScrollGestureController be a class, and not a struct.
This fits the usual pattern, and also matches the forward
declaration used in WPE's PageClientImpl.h.

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

2 years agoRemove obsolete failure expectations for 2d.fillStyle.parse.{rgb,rgba}-eof.
commit-queue@webkit.org [Wed, 26 Jul 2017 10:33:22 +0000 (10:33 +0000)]
Remove obsolete failure expectations for 2d.fillStyle.parse.{rgb,rgba}-eof.
https://bugs.webkit.org/show_bug.cgi?id=174857

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Žan Doberšek.

These tests started passing in r209666.

* platform/gtk/TestExpectations:

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

2 years agoInsertOrderedList command applied to table cells inserts an extra BR before the table
jfernandez@igalia.com [Wed, 26 Jul 2017 09:48:37 +0000 (09:48 +0000)]
InsertOrderedList command applied to table cells inserts an extra BR before the table
https://bugs.webkit.org/show_bug.cgi?id=174593

Reviewed by Darin Adler.

Source/WebCore:

Don't add BR when pruning empty blocks if it's the start of a paragraph.

The function MoveParagraph is used for several operations and editing
commands, like 'insertOrderedList'. When moving paragraphs we check out
whether we should add a 'br' element to avoid undesired block collapse.

However, we shouldn't do this when destination is the start of a
paragraph.

Tests: editing/inserting/insert-list-in-table-cell-01.html
       editing/inserting/insert-list-in-table-cell-02.html
       editing/inserting/insert-list-in-table-cell-03.html
       editing/inserting/insert-list-in-table-cell-04.html
       editing/inserting/insert-list-in-table-cell-05.html
       editing/inserting/insert-list-in-table-cell-06.html
       editing/inserting/insert-list-in-table-cell-07.html
       editing/inserting/insert-list-in-table-cell-08.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):

LayoutTests:

Tests to verify that the insertOrderedList command works as expected when applied
in table cells.

* editing/inserting/insert-list-in-table-cell-01.html: Added.
* editing/inserting/insert-list-in-table-cell-01-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-02.html: Added.
* editing/inserting/insert-list-in-table-cell-02-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-03.html: Added.
* editing/inserting/insert-list-in-table-cell-03-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-04.html: Added.
* editing/inserting/insert-list-in-table-cell-04-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-05.html: Added.
* editing/inserting/insert-list-in-table-cell-05-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-06.html: Added.
* editing/inserting/insert-list-in-table-cell-06-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-07.html: Added.
* editing/inserting/insert-list-in-table-cell-07-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-08.html: Added.
* editing/inserting/insert-list-in-table-cell-08-expected.txt: Added.

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

2 years agoFix an incorrect check in 2d.missingargs.html.
commit-queue@webkit.org [Wed, 26 Jul 2017 09:22:49 +0000 (09:22 +0000)]
Fix an incorrect check in 2d.missingargs.html.
https://bugs.webkit.org/show_bug.cgi?id=174854

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Carlos Garcia Campos.

The check was introduced without explanation in r168302. This change reverts
it to the previous, correct check.

* canvas/philip/tests/2d.missingargs-expected.txt:
* canvas/philip/tests/2d.missingargs.html:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/canvas/philip/tests/2d.missingargs-expected.txt: Removed.
* platform/wpe/TestExpectations:

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

2 years ago[WPE] Enable KeyboardEvent key and code attributes
csaavedra@igalia.com [Wed, 26 Jul 2017 09:01:34 +0000 (09:01 +0000)]
[WPE] Enable KeyboardEvent key and code attributes
https://bugs.webkit.org/show_bug.cgi?id=174822

Reviewed by Žan Doberšek.

Source/WTF:

There is no reason for this to be disabled from what I see.

* wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.

LayoutTests:

* platform/wpe/TestExpectations: Mark
fast/events/constructors/keyboard-event-constructor.html as passing.

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

2 years agoUnreviewed. Fix WebKit2 derived sources directory creation after r219488.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:31:17 +0000 (08:31 +0000)]
Unreviewed. Fix WebKit2 derived sources directory creation after r219488.

The variable is still DERIVED_SOURCES_WEBKIT2_DIR, not DERIVED_SOURCES_WEBKIT_DIR. Build was not really affected
because WebKit2 makefile creates the directory too.

* Source/cmake/WebKitFS.cmake:

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

2 years ago[WPE] WebGL2 support
zandobersek@gmail.com [Wed, 26 Jul 2017 08:26:08 +0000 (08:26 +0000)]
[WPE] WebGL2 support
https://bugs.webkit.org/show_bug.cgi?id=174249

Reviewed by Alex Christensen.

Source/WebCore:

Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
the implementation specific to libepoxy (which WPE leverages by default).

In the GraphicsContext3D::create() method, we first construct the
GraphicsContext3D object that also ensures a current GL context on this thread.
Only then can we determine through libepoxy whether the underlying GL library
is able to support WebGL2.

For WebGL2, the GLES3 support is required. The initial libepoxy implementation
ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
This effectively translates to the only supported configuration being the
EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
discard the existing GraphicsContext3D object and return null.

WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
been tested yet. Implementation will in the future be extended to support that
as required.

In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
has to now receive the second argument, the desired shader specification that's
used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
and SH_WEBGL2_SPEC for WebGL2.

No new tests -- a small set of existing WebGL2 tests is unskipped and passing.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
Add WebGL2-specific methods to the build.

Tools:

* Scripts/webkitperl/FeatureList.pm:
Enable WebGL2 for WPE when building through build-webkit.

LayoutTests:

* platform/wpe/TestExpectations:
Unskip WebGL2 tests under the webgl/ directory. More tests under fast/canvas/webgl2/
will be unskipped later.

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:15:15 +0000 (08:15 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit:

* gtk/NEWS: Add release notes for 2.17.5.

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

2 years agoUnreviewed. Fix GTK distcheck.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:13:27 +0000 (08:13 +0000)]
Unreviewed. Fix GTK distcheck.

Source/WebDriver:

Ensure WebDriver derived sources directory is created, WebKitFS.cmake is useless for this.

* PlatformGTK.cmake:

Tools:

* gtk/make-dist.py:
(ensure_version_if_possible): Use the right pkg-config filename, it's webkit2gtk not webkitgtk.

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

2 years agoAX: should dispatch accessibilityPerformPressAction async on MacOS
n_wang@apple.com [Wed, 26 Jul 2017 07:39:01 +0000 (07:39 +0000)]
AX: should dispatch accessibilityPerformPressAction async on MacOS
https://bugs.webkit.org/show_bug.cgi?id=174849

Reviewed by Chris Fleizach.

Source/WebCore:

If performing the accessibility press action results in a modal alert being displayed,
it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.

Updated tests to adapt to this change.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):

LayoutTests:

* accessibility/file-upload-button-with-axpress.html:
* accessibility/mac/html5-input-number.html:
* accessibility/mac/search-field-cancel-button.html:
* accessibility/press-target-uses-text-descendant-node.html:
* accessibility/press-targets-center-point.html:
* accessibility/press-works-on-control-types.html:

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

2 years agoIcon loader error on startup
carlosgc@webkit.org [Wed, 26 Jul 2017 06:19:47 +0000 (06:19 +0000)]
Icon loader error on startup
https://bugs.webkit.org/show_bug.cgi?id=174787

Reviewed by Brady Eidson.

Source/WebCore:

This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
pages. IconController::startLoader() did several checks before starting the load that
DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
same checks now before starting to load icons.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):

Source/WebKit:

Ignore non HTTP favicons in glib API.

* UIProcess/API/glib/WebKitIconLoadingClient.cpp:

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

2 years agoResourceLoadStatistics grandfathering happens much too often.
beidson@apple.com [Wed, 26 Jul 2017 05:44:05 +0000 (05:44 +0000)]
ResourceLoadStatistics grandfathering happens much too often.
<rdar://problem/32655834> and https://bugs.webkit.org/show_bug.cgi?id=174825

Reviewed by Chris Dumez.

Source/WebKit:

The ResourceLoadStatistics grandfathering procedure happens too often.
- With an empty memory store, even though an empty memory store is a perfectly valid state.
- On each launch, even if grandfathering happened on the last launch - because grandfathering
  data would not automatically be saved to disk.
- After clearing all website data, at which point no grandfathering can possibly be relevant
  because there is no data to grandfather.

This patch fixes those cases and adds API tests to verify they remain fixed.

* Shared/WebsiteData/WebsiteDataType.h:

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of
  the types that ResourceLoadStatistics care about, don't grandfather afterwards.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto.
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from
  disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering".
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather
  on next launch, and also log the grandfathering event.
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag
  to tell whether or not data should be re-grandfathered after the store is cleared.
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client.
(WebKit::dataTypesToRemove): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both
  with and without a testing callback.
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/EmptyGrandfatheredResourceLoadStatistics.plist: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ResourceLoadStatistics.mm: Added.
(TEST):

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

2 years agoSpeedometer 2.0: Document es2015-babel-webpack build process
commit-queue@webkit.org [Wed, 26 Jul 2017 04:42:19 +0000 (04:42 +0000)]
Speedometer 2.0: Document es2015-babel-webpack build process
https://bugs.webkit.org/show_bug.cgi?id=174252

Patch by Mathias Bynens <mathias@qiwi.be> on 2017-07-25
Reviewed by Ryosuke Niwa.

* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/README.md: Added build docs.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/dist/*: Update generated build files.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/package.json: Remove unused items.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/package-lock.json: Added lockfile.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/src/index.html: Make title consistent.

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

2 years ago[WebIDL] Remove custom bindings for HTMLCanvasElement
weinig@apple.com [Wed, 26 Jul 2017 04:31:40 +0000 (04:31 +0000)]
[WebIDL] Remove custom bindings for HTMLCanvasElement
https://bugs.webkit.org/show_bug.cgi?id=174847

Reviewed by Darin Adler.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
Remove JSHTMLCanvasElementCustom.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
Move context picking code to HTMLCanvasElement. Give more
exact types to remaining context getters.

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

2 years agoClean up ExceptionCode enumeration
cdumez@apple.com [Wed, 26 Jul 2017 02:34:56 +0000 (02:34 +0000)]
Clean up ExceptionCode enumeration
https://bugs.webkit.org/show_bug.cgi?id=174812

Reviewed by Darin Adler.

Clean up ExceptionCode enumeration:
- Updated comments to reflect the latest WebIDL specification
- Drop special values given to some exception codes. Those legacy codes are already in the
  table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
  table
- Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
  instead.

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::IDBError):
(WebCore::IDBError::name):
(WebCore::IDBError::message):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::code):
(WebCore::IDBError::encode):
(WebCore::IDBError::decode):
* dom/DOMException.cpp:
* dom/ExceptionCode.h:
* fileapi/FileReaderSync.cpp:
(WebCore::errorCodeToException):
(WebCore::FileReaderSync::startLoading):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* xml/XMLHttpRequest.h:

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

2 years agoWeb Inspector: Don't output "No message" for multi-value logs like console.log(x, y)
commit-queue@webkit.org [Wed, 26 Jul 2017 02:27:08 +0000 (02:27 +0000)]
Web Inspector: Don't output "No message" for multi-value logs like console.log(x, y)
https://bugs.webkit.org/show_bug.cgi?id=174842

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
Removed "No message".

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
Track whether or not outputting the next parameter will need a divider
in front of it or not.

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

2 years agoWebAssembly: generate smaller binaries
jfbastien@apple.com [Wed, 26 Jul 2017 02:23:01 +0000 (02:23 +0000)]
WebAssembly: generate smaller binaries
https://bugs.webkit.org/show_bug.cgi?id=174818

Reviewed by Filip Pizlo.

This patch reduces generated code size for WebAssembly in 2 ways:

1. Use the ZR register when storing zero on ARM64.
2. Synthesize wasm context lazily.

This leads to a modest size reduction on both x86-64 and ARM64 for
large WebAssembly games, without any performance loss on WasmBench
and TitzerBench.

The reason this works is that these games, using Emscripten,
generate 100k+ tiny functions, and our JIT allocation granule
rounds all allocations up to 32 bytes. There are plenty of other
simple gains to be had, I've filed a follow-up bug at
webkit.org/b/174819

We should further avoid the per-function cost of tiering, which
represents the bulk of code generated for small functions.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::storeZero64):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::storeZero64):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::createStore): this doesn't make sense
for x86 because it constrains register reuse and codegen in a way
that doesn't affect ARM64 because it has a dedicated zero
register.
* b3/air/AirOpcode.opcodes: add the storeZero64 opcode.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::instanceValue):
(JSC::Wasm::B3IRGenerator::restoreWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::materializeWasmContext): Deleted.

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

2 years agoB3 should do LICM
fpizlo@apple.com [Wed, 26 Jul 2017 01:58:36 +0000 (01:58 +0000)]
B3 should do LICM
https://bugs.webkit.org/show_bug.cgi?id=174750

Reviewed by Keith Miller and Saam Barati.

Source/JavaScriptCore:

Added a LICM phase to B3. This phase is called hoistLoopInvariantValues, to conform to the B3 naming
convention for phases (it has to be an imperative). The phase uses NaturalLoops and BackwardsDominators,
so this adds those analyses to B3. BackwardsDominators was already available in templatized form. This
change templatizes DFG::NaturalLoops so that we can just use it.

The LICM phase itself is really simple. We are decently precise with our handling of everything except
the relationship between control dependence and side exits.

Also added a bunch of tests.

This isn't super important. It's perf-neutral on JS benchmarks. FTL already does LICM on DFG SSA IR, and
probably all current WebAssembly content has had LICM done to it. That being said, this is a cheap phase
so it doesn't hurt to have it.

I wrote it because I thought I needed it for bug 174727. It turns out that there's a better way to
handle the problem I had, so I ended up not needed it - but by then I had already written it. I think
it's good to have it because LICM is one of those core compiler phases; every compiler has it
eventually.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3BackwardsCFG.h: Added.
(JSC::B3::BackwardsCFG::BackwardsCFG):
* b3/B3BackwardsDominators.h: Added.
(JSC::B3::BackwardsDominators::BackwardsDominators):
* b3/B3BasicBlock.cpp:
(JSC::B3::BasicBlock::appendNonTerminal):
* b3/B3Effects.h:
* b3/B3EnsureLoopPreHeaders.cpp: Added.
(JSC::B3::ensureLoopPreHeaders):
* b3/B3EnsureLoopPreHeaders.h: Added.
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3HoistLoopInvariantValues.cpp: Added.
(JSC::B3::hoistLoopInvariantValues):
* b3/B3HoistLoopInvariantValues.h: Added.
* b3/B3NaturalLoops.h: Added.
(JSC::B3::NaturalLoops::NaturalLoops):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::invalidateCFG):
(JSC::B3::Procedure::naturalLoops):
(JSC::B3::Procedure::backwardsCFG):
(JSC::B3::Procedure::backwardsDominators):
* b3/B3Procedure.h:
* b3/testb3.cpp:
(JSC::B3::generateLoop):
(JSC::B3::makeArrayForLoops):
(JSC::B3::generateLoopNotBackwardsDominant):
(JSC::B3::oneFunction):
(JSC::B3::noOpFunction):
(JSC::B3::testLICMPure):
(JSC::B3::testLICMPureSideExits):
(JSC::B3::testLICMPureWritesPinned):
(JSC::B3::testLICMPureWrites):
(JSC::B3::testLICMReadsLocalState):
(JSC::B3::testLICMReadsPinned):
(JSC::B3::testLICMReads):
(JSC::B3::testLICMPureNotBackwardsDominant):
(JSC::B3::testLICMPureFoiledByChild):
(JSC::B3::testLICMPureNotBackwardsDominantFoiledByChild):
(JSC::B3::testLICMExitsSideways):
(JSC::B3::testLICMWritesLocalState):
(JSC::B3::testLICMWrites):
(JSC::B3::testLICMFence):
(JSC::B3::testLICMWritesPinned):
(JSC::B3::testLICMControlDependent):
(JSC::B3::testLICMControlDependentNotBackwardsDominant):
(JSC::B3::testLICMControlDependentSideExits):
(JSC::B3::testLICMReadsPinnedWritesPinned):
(JSC::B3::testLICMReadsWritesDifferentHeaps):
(JSC::B3::testLICMReadsWritesOverlappingHeaps):
(JSC::B3::testLICMDefaultCall):
(JSC::B3::run):
* dfg/DFGBasicBlock.h:
* dfg/DFGCFG.h:
* dfg/DFGNaturalLoops.cpp: Removed.
* dfg/DFGNaturalLoops.h:
(JSC::DFG::NaturalLoops::NaturalLoops):
(JSC::DFG::NaturalLoop::NaturalLoop): Deleted.
(JSC::DFG::NaturalLoop::header): Deleted.
(JSC::DFG::NaturalLoop::size): Deleted.
(JSC::DFG::NaturalLoop::at): Deleted.
(JSC::DFG::NaturalLoop::operator[]): Deleted.
(JSC::DFG::NaturalLoop::contains): Deleted.
(JSC::DFG::NaturalLoop::index): Deleted.
(JSC::DFG::NaturalLoop::isOuterMostLoop): Deleted.
(JSC::DFG::NaturalLoop::addBlock): Deleted.
(JSC::DFG::NaturalLoops::numLoops): Deleted.
(JSC::DFG::NaturalLoops::loop): Deleted.
(JSC::DFG::NaturalLoops::headerOf): Deleted.
(JSC::DFG::NaturalLoops::innerMostLoopOf): Deleted.
(JSC::DFG::NaturalLoops::innerMostOuterLoop): Deleted.
(JSC::DFG::NaturalLoops::belongsTo): Deleted.
(JSC::DFG::NaturalLoops::loopDepth): Deleted.

Source/WTF:

Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
Dominators<>. This allows us to add a B3::NaturalLoops for free.

Also made small tweaks to RangeSet, which the LICM uses.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Dominators.h:
* wtf/NaturalLoops.h: Added.
(WTF::NaturalLoop::NaturalLoop):
(WTF::NaturalLoop::graph):
(WTF::NaturalLoop::header):
(WTF::NaturalLoop::size):
(WTF::NaturalLoop::at):
(WTF::NaturalLoop::operator[]):
(WTF::NaturalLoop::contains):
(WTF::NaturalLoop::index):
(WTF::NaturalLoop::isOuterMostLoop):
(WTF::NaturalLoop::dump):
(WTF::NaturalLoop::addBlock):
(WTF::NaturalLoops::NaturalLoops):
(WTF::NaturalLoops::graph):
(WTF::NaturalLoops::numLoops):
(WTF::NaturalLoops::loop):
(WTF::NaturalLoops::headerOf):
(WTF::NaturalLoops::innerMostLoopOf):
(WTF::NaturalLoops::innerMostOuterLoop):
(WTF::NaturalLoops::belongsTo):
(WTF::NaturalLoops::loopDepth):
(WTF::NaturalLoops::loopsOf):
(WTF::NaturalLoops::dump):
* wtf/RangeSet.h:
(WTF::RangeSet::begin):
(WTF::RangeSet::end):
(WTF::RangeSet::addAll):

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

2 years agoGC should be fine with trading blocks between destructor and non-destructor blocks
fpizlo@apple.com [Wed, 26 Jul 2017 01:19:23 +0000 (01:19 +0000)]
GC should be fine with trading blocks between destructor and non-destructor blocks
https://bugs.webkit.org/show_bug.cgi?id=174811

Reviewed by Mark Lam.

Our GC has the ability to trade blocks between MarkedAllocators. A MarkedAllocator is a
size-class-within-a-Subspace. The ability to trade helps reduce memory wastage due to
fragmentation. Prior to this change, this only worked between blocks that did not have destructors.
This was partly a policy decision. But mostly, it was fallout from the way we use the `empty` block
set.

Here's how `empty` used to work. If a block is empty, we don't run destructors. We say that a block
is empty if:

A) It has no live objects and its a non-destructor block, or
B) We just allocated it (so it has no destructors even if it's a destructor block), or
C) We just stole it from another allocator (so it also has no destructors), or
D) We just swept the block and ran all destructors.

Case (A) is for trading blocks. That's how a different MarkedAllocator would know that this is a
block that could be stolen.

Cases (B) and (C) need to be detected for correctness, since otherwise we might try to run
destructors in blocks that have garbage bits. In that case, the isZapped check won't detect that
cells don't need destruction, so without having the `empty` bit we would try to destruct garbage
and crash. Currently, we know that we have cases (B) and (C) when the block is empty.

Case (D) is necessary for detecting which blocks can be removed when we `shrink` the heap.

If we tried to enable trading of blocks between allocators without making any changes to how
`empty` works, then it just would not work. We have to set the `empty` bits of blocks that have no
live objects in order for those bits to be candidates for trading. But if we do that, then our
logic for cases (B-D) will think that the block has no destructible objects. That's bad, since then
our destructors won't run and we'll leak memory.

This change fixes this issue by decoupling the "do I have destructors" question from the "do I have
live objects" question by introducing a new `destructible` bitvector. The GC flags all live blocks
as being destructible at the end. We clear the destructible bit in cases (B-D). Cases (B-C) are
handled entirely by the new destrictible bit, while case (D) is detected by looking for blocks that
are (empty & ~destructible).

Then we can simply remove all destructor-oriented special-casing of the `empty` bit. And we can
remove destructor-oriented special-casing of block trading.

This is a perf-neutral change. We expect most free memory to be in non-destructor blocks anyway,
so this change is more about clean-up than perf. But, this could reduce memory usage in some
pathological cases.

* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::findEmptyBlockToSteal):
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
(JSC::MarkedAllocator::endMarking):
(JSC::MarkedAllocator::shrink):
(JSC::MarkedAllocator::shouldStealEmptyBlocksFromOtherAllocators): Deleted.
* heap/MarkedAllocator.h:
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::sweep):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::finishSweepKnowingSubspace):
(JSC::MarkedBlock::Handle::emptyMode):

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

2 years ago[Apple Pay] Add "carteBancaire" as a supported payment network
aestes@apple.com [Wed, 26 Jul 2017 01:03:29 +0000 (01:03 +0000)]
[Apple Pay] Add "carteBancaire" as a supported payment network
https://bugs.webkit.org/show_bug.cgi?id=174841
<rdar://problem/31935596>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/ssl/applepay/ApplePaySession.html
       http/tests/ssl/applepay/ApplePaySessionV3.html

* Modules/applepay/PaymentRequest.cpp:
(WebCore::PaymentRequest::isValidSupportedNetwork):

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toSupportedNetwork):

LayoutTests:

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:
* http/tests/ssl/applepay/ApplePaySessionV3.html:

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

2 years agoRemove Broken CompareEq constant folding phase.
keith_miller@apple.com [Wed, 26 Jul 2017 00:45:58 +0000 (00:45 +0000)]
Remove Broken CompareEq constant folding phase.
https://bugs.webkit.org/show_bug.cgi?id=174846
<rdar://problem/32978808>

Reviewed by Saam Barati.

This bug happened when we would get code like the following:

a: JSConst(Undefined)
b: GetLocal(SomeObjectOrUndefined)
...
c: CompareEq(Check:ObjectOrOther:b, Check:ObjectOrOther:a)

constant folding will turn this into:

a: JSConst(Undefined)
b: GetLocal(SomeObjectOrUndefined)
...
c: CompareEq(Check:ObjectOrOther:b, Other:a)

But the SpeculativeJIT/FTL lowering will fail to check b
properly which leads to an assertion failure in the AI.

I'll follow up with a more robust fix later. For now, I'll remove the
case that generates the code. Removing the code appears to be perf
neutral.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):

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

2 years agoWeb Inspector: Fix warnings about console.assert lines without semicolons
commit-queue@webkit.org [Wed, 26 Jul 2017 00:45:04 +0000 (00:45 +0000)]
Web Inspector: Fix warnings about console.assert lines without semicolons
https://bugs.webkit.org/show_bug.cgi?id=174840

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Brian Burg.

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype.set selectedSettingsView):
(WebInspector.SettingsTabContentView.prototype.setSettingsViewVisible):
Add semicolon to assert lines so they can be stripped in optimized builds.

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

2 years agoWeb Inspector: Inline multiple console log values if they are simple
commit-queue@webkit.org [Tue, 25 Jul 2017 23:31:19 +0000 (23:31 +0000)]
Web Inspector: Inline multiple console log values if they are simple
https://bugs.webkit.org/show_bug.cgi?id=174746
<rdar://problem/33469376>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Matt Baker.

* UserInterface/Models/IssueMessage.js:
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.type): Deleted.
Remove this as it isn't as useful as directly checking the type.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendExtraParameters):
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
(WebInspector.ConsoleMessageView.prototype._hasSimpleDisplay):
(WebInspector.ConsoleMessageView.prototype._isStackTrace):
For leading primitive/simple values, display them inline on the console message.

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.hasSimpleDisplay):
Provide a helper to determine if a formatted value will be simple.

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

2 years agoMake StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member...
dbates@webkit.org [Tue, 25 Jul 2017 23:06:29 +0000 (23:06 +0000)]
Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
https://bugs.webkit.org/show_bug.cgi?id=174827

Reviewed by Simon Fraser.

StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
class data. Moreover, they are private member functions and hence cannot be
used outside of StyleResolver's implementation. So, make these static, inline,
non-member functions.

* css/StyleResolver.cpp:
(WebCore::isValidRegionStyleProperty):
(WebCore::isValidCueStyleProperty):
(WebCore::StyleResolver::CascadedProperties::addMatch):
(WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
(WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
* css/StyleResolver.h:

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

2 years agoDragged links are blurry on 1x displays.
pvollan@apple.com [Tue, 25 Jul 2017 22:48:56 +0000 (22:48 +0000)]
Dragged links are blurry on 1x displays.
https://bugs.webkit.org/show_bug.cgi?id=174831
<rdar://problem/33519698>

Reviewed by Simon Fraser.

When the width and height of the drag image is a multiple of 2, the drag image is not blurry
on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
is fixed.

No new tests, since this is not straightforward to test with a layout test.

* platform/mac/DragImageMac.mm:
(WebCore::LinkImageLayout::LinkImageLayout):

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

2 years agoMarked multiple fast/ tests as crashing on High Sierra WK1.
jlewis3@apple.com [Tue, 25 Jul 2017 21:49:35 +0000 (21:49 +0000)]
Marked multiple fast/ tests as crashing on High Sierra WK1.
<rdar://problem/33522420>

Unreviewed test gardening.

* platform/mac-highsierra-wk1/TestExpectations:

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

2 years agoWeb Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
mattbaker@apple.com [Tue, 25 Jul 2017 21:46:42 +0000 (21:46 +0000)]
Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
https://bugs.webkit.org/show_bug.cgi?id=174738

Reviewed by Brian Burg.

Source/JavaScriptCore:

Move AsyncCallType enum to InspectorDebuggerAgent, which manages async
stack traces. This preserves the call type in JSC, makes the range of
possible call types explicit, and is safer than passing ints.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::asyncCallIdentifier):
(Inspector::InspectorDebuggerAgent::didScheduleAsyncCall):
(Inspector::InspectorDebuggerAgent::didCancelAsyncCall):
(Inspector::InspectorDebuggerAgent::willDispatchAsyncCall):
* inspector/agents/InspectorDebuggerAgent.h:

Source/WebCore:

Relocate AsyncCallType from InspectorInstrumentation to the debugger
agent. Plumbing for `requestAnimationFrame` notifications has been added
to PageDebuggerAgent, which is responsible for managing async stack traces.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(): Deleted.
(WebCore::didScheduleAsyncCall): Deleted.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didRequestAnimationFrame):
(WebCore::InspectorInstrumentation::didCancelAnimationFrame):
(WebCore::InspectorInstrumentation::willFireAnimationFrame):
Replaced Frame and Document pointers with references and moved
pointer validation upstream.

* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didRequestAnimationFrame):
(WebCore::PageDebuggerAgent::willFireAnimationFrame):
(WebCore::PageDebuggerAgent::didCancelAnimationFrame):
* inspector/PageDebuggerAgent.h:

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

2 years agoWeb Inspector: Styles: Add a switch for Spreadsheet model style editor to experimenta...
nvasilyev@apple.com [Tue, 25 Jul 2017 21:43:14 +0000 (21:43 +0000)]
Web Inspector: Styles: Add a switch for Spreadsheet model style editor to experimental settings
https://bugs.webkit.org/show_bug.cgi?id=174741
<rdar://problem/33467954>

Reviewed by Brian Burg.

Show a blank panel when Spreadsheet Style Editor is enabled.

* UserInterface/Base/Setting.js:
* UserInterface/Main.html:
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty):
* UserInterface/Views/RulesStyleSpreadsheetDetailsPanel.js: Added.
(WebInspector.RulesStyleSpreadsheetDetailsPanel):
(WebInspector.RulesStyleSpreadsheetDetailsPanel.prototype.filterDidChange):
(WebInspector.RulesStyleSpreadsheetDetailsPanel.prototype.scrollToSectionAndHighlightProperty):

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container.hidden):
(.content-view.settings > .settings-view > .container-centered):
(.content-view.settings > .settings-view > .container button):
* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype._createDebugSettingsView):
* UserInterface/Views/SettingsView.js:
(WebInspector.SettingsView.prototype.addCenteredContainer):
(WebInspector.SettingsView):
Show "Reload Web Inspector" button when Spreadsheet Style Editor setting is modified.

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

2 years agoUse SandboxExtension::HandleArray when sending extensions for file uploads to the...
bburg@apple.com [Tue, 25 Jul 2017 21:22:29 +0000 (21:22 +0000)]
Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
https://bugs.webkit.org/show_bug.cgi?id=174828

Reviewed by Tim Horton.

Send all of the sandbox extension handles in a single message, rather than
one message per extension. Update message name and parameter types to match.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::extendSandboxForFilesFromOpenPanel):
(WebKit::WebPage::extendSandboxForFileFromOpenPanel): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

2 years agoMarked imported/w3c/web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type...
jlewis3@apple.com [Tue, 25 Jul 2017 21:12:13 +0000 (21:12 +0000)]
Marked imported/w3c/web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type.html as failing.
<rdar://problem/33251388>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

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

2 years agoFix bugs in probe code to change sp on x86, x86_64 and 32-bit ARM.
mark.lam@apple.com [Tue, 25 Jul 2017 20:56:04 +0000 (20:56 +0000)]
Fix bugs in probe code to change sp on x86, x86_64 and 32-bit ARM.
https://bugs.webkit.org/show_bug.cgi?id=174809
<rdar://problem/33504759>

Reviewed by Filip Pizlo.

1. When the probe handler function changes the sp register to point to the
   region of stack in the middle of the ProbeContext on the stack, there is a
   bug where the ProbeContext's register values to be restored can be over-written
   before they can be restored.  This is now fixed.

2. Added more robust probe tests for changing the sp register.

3. Made existing probe tests to ensure that probe handlers were actually called.

4. Added some verification to testProbePreservesGPRS().

5. Change all the probe tests to fail early on discovering an error instead of
   batching till the end of the test.  This helps point a finger to the failing
   issue earlier.

This patch was tested on x86, x86_64, and ARMv7.  ARM64 probe code will be fixed
next in https://bugs.webkit.org/show_bug.cgi?id=174697.

* assembler/MacroAssemblerARM.cpp:
* assembler/MacroAssemblerARMv7.cpp:
* assembler/MacroAssemblerX86Common.cpp:
* assembler/testmasm.cpp:
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesStackPointerToInsideProbeContextOnStack):
(JSC::testProbeModifiesStackPointerToNBytesBelowSP):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):

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

2 years agoRebaselinged the test http/tests/quicklook/top-navigation-blocked.html
jlewis3@apple.com [Tue, 25 Jul 2017 20:55:46 +0000 (20:55 +0000)]
Rebaselinged the test http/tests/quicklook/top-navigation-blocked.html
https://bugs.webkit.org/show_bug.cgi?id=174755

Unreviewed test gardening.

* http/tests/quicklook/top-navigation-blocked-expected.txt:

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

2 years agoFix autoinstaller failing on autoinstall_everything
commit-queue@webkit.org [Tue, 25 Jul 2017 20:50:19 +0000 (20:50 +0000)]
Fix autoinstaller failing on autoinstall_everything
https://bugs.webkit.org/show_bug.cgi?id=174830

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-25
Reviewed by Joseph Pecoraro.

* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.find_module):
(AutoinstallImportHook.install_chromedriver):
(AutoinstallImportHook.install_geckodriver):
(AutoinstallImportHook._install_chromedriver): Deleted.
(AutoinstallImportHook._install_geckodriver): Deleted.

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

2 years agoFix API tests after r219871.
achristensen@apple.com [Tue, 25 Jul 2017 20:47:00 +0000 (20:47 +0000)]
Fix API tests after r219871.
https://bugs.webkit.org/show_bug.cgi?id=174807

WebKit2.OpenAndCloseWindowAsync and WebKit2.OpenAsyncWithNil API tests are fixed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
createNewPageAsync or createNewPage should be called, not both.

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

2 years agoRebaselined missed test.
jlewis3@apple.com [Tue, 25 Jul 2017 18:56:28 +0000 (18:56 +0000)]
Rebaselined missed test.
https://bugs.webkit.org/show_bug.cgi?id=174734

Unreviewed test gardening.

* fast/events/touch/ios/touches-client-coords-after-zoom-expected.txt:

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

2 years agoAsync image decoding for large images should be disabled after the first time a tile...
commit-queue@webkit.org [Tue, 25 Jul 2017 18:53:08 +0000 (18:53 +0000)]
Async image decoding for large images should be disabled after the first time a tile is painted
https://bugs.webkit.org/show_bug.cgi?id=174451
<rdar://problem/31246421>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-25
Reviewed by Simon Fraser.

Source/WebCore:

Flashing because of DOM mutation can be fixed by disabling the asynchronous
image decoding after the first time a tile was painted.

We can detect this by consulting the tile repaintCount. If it is zero, then
it is safe to use asynchronous image decoded. If the tile repaintCount is
greater than zero, we are not sure if the renderer rectangle has an image
drawn in it already or not. In this case we have to use the synchronous
image decoding to avoid causing a flash.

Tests: fast/images/async-image-background-change.html
       fast/images/async-image-src-change.html
       http/tests/multipart/multipart-async-image.html

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameView.cpp:
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::paintContentsForSnapshot):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::paintContents):
* page/PageOverlayController.h:
* page/linux/ResourceUsageOverlayLinux.cpp:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::paintContents):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::platformCALayerPaintContents):
* platform/graphics/ca/TileCoverageMap.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
(WebCore::TileGrid::platformCALayerRepaintCount):
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback):
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
(WebTiledBackingLayerWin::displayCallback):
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):
(-[WebSimpleLayer drawInContext:]):
* rendering/PaintPhase.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw):
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderLayerCompositor.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):
* testing/Internals.cpp:
(WebCore::imageFromImageElement):
(WebCore::bitmapImageFromImageElement):
(WebCore::Internals::imageFrameIndex):
(WebCore::Internals::setImageFrameDecodingDuration):
(WebCore::Internals::resetImageAnimation):
(WebCore::Internals::isImageAnimating):
(WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
(WebCore::Internals::imageDecodeCount):
(WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::paintContents):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame _paintBehaviorForDestinationContext:]):
(-[WebFrame _drawRect:contentsOnly:]):
* WebView/WebHTMLView.mm:
(imageFromRect):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerPaintContents):
* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::paintContents):
* WebCoreSupport/AcceleratedCompositingContext.h:

LayoutTests:

To test async image decoding for large images, we have to create the <img>
element dynamically so we can listen to the load and webkitImageFrameReady
events and know reliably when to end the test. But with this patch the async
image decoding for large images will be disabled after the first paint.
That means async image decoding for large images will be disabled always
unless we force the async image decoding till the image is painted for the
first time. We use Internals::setLargeImageAsyncDecodingEnabledForTesting()
to force the async image decoding. So painting an image in this case will
require multiple paints; in all of them the async image decoding will be
enabled. But this is okay because it resembles the case where the <img> is
created from a static <img> tag in the HTML file.

For new tests, where we want to make sure that mutating the DOM will not
cause a flash, async image decoding will be forced till the image is drawn
for the first time. After that the async image decoding is enabled but not
forced.

Disable new tests for WK1 because the async image decoding is always enabled
because tiling does not necessarily exist in WK1 . But eventually the async
image decoding for large images will be always disabled for WK1.

* fast/images/async-image-background-change-expected.html: Added.
* fast/images/async-image-background-change.html: Added.
* fast/images/async-image-background-image-repeated.html:
* fast/images/async-image-background-image.html:
* fast/images/async-image-body-background-image.html:
* fast/images/async-image-multiple-clients-repaint.html:
* fast/images/async-image-src-change-expected.html: Added.
* fast/images/async-image-src-change.html: Added.
* fast/images/resources/green-400x400.png: Added.
* fast/images/resources/red-100x100.png: Added.
* fast/images/resources/red-400x400.png: Added.
* fast/images/sprite-sheet-image-draw.html:
* http/tests/multipart/multipart-async-image-expected.txt: Added.
* http/tests/multipart/multipart-async-image.html: Added.
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

2 years agoReplace --runtime with something for both ios-simulator and ios-device
jbedard@apple.com [Tue, 25 Jul 2017 18:28:34 +0000 (18:28 +0000)]
Replace --runtime with something for both ios-simulator and ios-device
https://bugs.webkit.org/show_bug.cgi?id=173775
<rdar://problem/32952164>

Reviewed by Aakash Jain.

Add --version flag for both iOS simulator and iOS device.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args): Add --version flag and move --no-install.
* Scripts/webkitpy/port/factory.py:
(platform_options): Move --no-intall to run_webkit_tests.py.
* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort._is_valid_ios_version): Check that the provided version string is legal.
(IOSPort.get_option): If accessing the iOS version, check that it is a valid version string.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.ios_version): Consult --version flag before checking connected
devices for iOS version.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.make_port): Set --version option so that we can generate test
expectation paths without devices connected.
(IOSDeviceTest.test_additional_platform_directory): Deleted.
(IOSDeviceTest.test_baseline_searchpath): Deleted.
(IOSDeviceTest.test_expectations_ordering): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.simulator_runtime): If no runtime is specified, use the --version
flag to specify a runtime.
(IOSSimulatorPort.ios_version): First check the --version flag, then the --runtime
flag and then use the default runtime.

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

2 years agoWeb Automation: add support for uploading files
bburg@apple.com [Tue, 25 Jul 2017 18:03:02 +0000 (18:03 +0000)]
Web Automation: add support for uploading files
https://bugs.webkit.org/show_bug.cgi?id=174797
<rdar://problem/28485063>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
Start generating frontend dispatcher code if the target framework is 'WebKit'.

* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator.generate_output):
Use a framework include for InspectorFrontendRouter.h since this generated code
will be compiled outside of WebCore.framework.

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
* inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
Rebaseline code generator tests.

Source/WebKit:

The general strategy is to have automation clients set the list of files they want
to select ahead of time. Then, the client simulates a click on the <input type="file"> element.
When that causes WebPageProxy to ask the UI delegate to runOpenPanel, it instead
gives WebAutomationSession a chance to select files if the page is under control of
automation. WebAutomationSession validates its file list and selects the files if valid.

* CMakeLists.txt: Add frontend dispatcher files.
* DerivedSources.make:
Add frontend dispatcher code generator scripts as dependencies of the generated code.
Add generated frontend dispatcher files to the list of output files.

* UIProcess/Automation/Automation.json:
Add a command to set the canned list of files that should be selected when prompted.
If no files are selected, then the effect is as if the user had clicked "cancel" in
the file chooser dialog.

Add an event to signal to the WebDriver service that the file selection request has
been either fulfilled or cancelled. This event is necessary because otherwise remotes
cannot distinguish whether selecting the files failed for some reason, or if the
UIProcess has not yet selected the files and sent them to the web content process.
In either case, the input element's "files" attribute would return an empty FileList.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
Add the frontend dispatcher for Automation domain. This is named m_domainNotifier since
m_domainDispatcher is already being used for the backend command dispatcher.

(WebKit::WebAutomationSession::handleRunOpenPanel):
Validate that the files-to-select list has valid entries and select the files if so.
If anything goes wrong, pretend to cancel out of the file chooser. Either way, notify the
frontend with an event that the file chooser was dismissed due to selecting files or cancelling.
Automation protocol clients may implement additional strategies to further restrict
the conditions upon which local files can be uploaded.

(WebKit::WebAutomationSession::setFilesToSelectForFileUpload): Added.
Store the list of files as a vector of strings. The file list is always replaced.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runOpenPanel):
If the page is under automation, delegating the runOpenPanel is likely to hang
because WebDriver cannot interact directly with the file chooser dialog. Instead,
give WebAutomationSession a chance to select files and don't tell the delegate.

* WebKit.xcodeproj/project.pbxproj:
Add frontend dispatcher files to "Derived Sources" group.

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

2 years ago[WebIDL] Add support for generating timer bindings
weinig@apple.com [Tue, 25 Jul 2017 18:02:57 +0000 (18:02 +0000)]
[WebIDL] Add support for generating timer bindings
https://bugs.webkit.org/show_bug.cgi?id=174766

Reviewed by Darin Adler.

Adds a new non-standard type, ScheduledAction, which stands in for the
standard (DOMString or Function). It would be good to move to that in
future, but for now, this allows for forward momentum on removing custom
bindings.

* WebCore.xcodeproj/project.pbxproj:
Add JSDOMConvertScheduledAction.h.

* bindings/IDLTypes.h:
Add IDLScheduledAction.

* bindings/js/JSDOMConvertScheduledAction.h: Added.
(WebCore::Converter<IDLScheduledAction>::convert):
Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
create function.

* bindings/js/JSDOMConvertVariadic.h:
(WebCore::convertVariadicArguments):
(WebCore::Detail::VariadicConverterBase::convert): Deleted.
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
* bindings/js/JSDOMConvertBase.h:
* bindings/js/JSDOMConvertAny.h:
(WebCore::VariadicConverter<IDLAny>::convert):
* bindings/js/JSDOMConvertInterface.h:
(WebCore::VariadicConverter<IDLInterface<T>>::convert):
Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename
VariadicConverterBase to VariadicConverter, and move specializations to the file
containing the base converter for that IDL type

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setTimeout): Deleted.
(WebCore::JSDOMWindow::setInterval): Deleted.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
(WebCore::JSWorkerGlobalScope::setInterval): Deleted.
Remove custom implementations of setTimeout and setInterval.

* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
(WebCore::ScheduledAction::ScheduledAction):
(WebCore::ScheduledAction::~ScheduledAction):
(WebCore::ScheduledAction::addArguments):
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScheduledAction.h:
(WebCore::ScheduledAction::ScheduledAction): Deleted.
Rework ScheduledAction. Now has two create functions, one for the function
form, one for the string form. These are now called by the Converter. Also,
rather than extracting the arguments directly from the ExecState, allow the
bindings to work as designed, and have the arguments come in as variadic
arguments to setTimeout/setInterval and get added to the ScheduledAction if
needed. Also, move ContentSecurityPolicy check out of construction, and into
setTimeout/setInterval.

* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
Add ScheduledAction to the builtin list.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
Add the correct include when ScheduledAction is used.

(GenerateParametersCheck):
Remove rule disallowing optional arguments before variadic arguments. That works
just fine.

(GetBaseIDLType):
Add mapping of ScheduledAction -> IDLScheduledAction.

(JSValueToNativeDOMConvertNeedsGlobalObject):
Add ScheduledAction to the list of types that need a global object
for conversion.

* page/WindowOrWorkerGlobalScope.idl:
Update interface to match spec and add FIXMEs for moving to TimerHandler.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):
* page/DOMWindow.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):
* workers/WorkerGlobalScope.h:
Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
even though it never throws, due to having one IDL file defining these. This is
unfortunate and something we should look at addressing the future.

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

2 years ago[GTK] Unreviewed test gardening
commit-queue@webkit.org [Tue, 25 Jul 2017 17:42:09 +0000 (17:42 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=174820

Unreviewed gardening.

Patch by Charlie Turner <cturner@igalia.com> on 2017-07-25

* platform/gtk/TestExpectations:

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

2 years agoModernize NavigationAction code
achristensen@apple.com [Tue, 25 Jul 2017 17:17:55 +0000 (17:17 +0000)]
Modernize NavigationAction code
https://bugs.webkit.org/show_bug.cgi?id=174807

Reviewed by Darin Adler.

Mostly just use more move semantics.

* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
* Shared/API/APIURLRequest.h:
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/API/APIPolicyClient.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
(API::UIClient::createNewPageAsync):
(API::UIClient::canCreateNewPageAsync):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLRequest):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPageUIClient):
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPageCommon):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::canCreateNewPageAsync):
(WebKit::UIDelegate::UIClient::createNewPageAsync):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction):
* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadRequestNavigation):
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:

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

2 years agoWeb Inspector: add context menu item for taking a screenshot of a node
drousso@apple.com [Tue, 25 Jul 2017 17:07:22 +0000 (17:07 +0000)]
Web Inspector: add context menu item for taking a screenshot of a node
https://bugs.webkit.org/show_bug.cgi?id=174754

Reviewed by Brian Burg.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ContextMenuUtilities.js:
(WebInspector.appendContextMenuItemsForDOMNode):
Add "Capture Element Screenshot " context menu item that opens a save dialog with a picture of the node.

* UserInterface/Base/Main.js:
(WebInspector.saveDataToFile):
Allow the saveData to specify whether the contained content is base64Encoded, instead of
having to go through a Blob to save base64 data.

* UserInterface/Base/Utilities.js:
Add Number.pad to add leading zeros up to a certain width.

Drive-by: fix failing test for Number.constrain.
* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode.prototype.scrollIntoView.resolvedNode.scrollIntoView): Added.
(WebInspector.DOMNode.prototype.scrollIntoView.resolvedNode): Added.
(WebInspector.DOMNode.prototype.scrollIntoView): Added.
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
(WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode.scrollIntoView): Deleted.
(WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode): Deleted.
(WebInspector.DOMTreeElement.prototype._scrollIntoView): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype.populateContextMenu):
Drive-by: move "Scroll Into View" context menu command to WebInspector.appendContextMenuItemsForDOMNode
so that it can be triggered from more places than just the DOM tree.

LayoutTests:

* inspector/unit-tests/number-utilities-expected.txt:
* inspector/unit-tests/number-utilities.html:
Add test for Number.zeroPad.

Drive-by: Change tests to use expectEqual for better output on failure.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219870 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WinCairo] Fix build with AllInOnes disabled
commit-queue@webkit.org [Tue, 25 Jul 2017 16:49:49 +0000 (16:49 +0000)]
[WinCairo] Fix build with AllInOnes disabled
https://bugs.webkit.org/show_bug.cgi?id=174784
<rdar://problem/33488914>

Patch by Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> on 2017-07-25
Reviewed by Alex Christensen.

* PlatformWin.cmake:
Add RenderThemeWin.cpp to WebCore_SOURCES

* rendering/RenderingAllInOne.cpp:
Remove #include "RenderThemeWin.cpp"

* testing/MemoryInfo.h:
Remove #include "JSDomWindow.h"

* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMWrapper.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* dom/ScriptExecutionContext.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorTimelineAgent.cpp:
* rendering/RenderMediaControls.cpp:
* rendering/RenderMediaControls.h:
* rendering/RenderThemeWin.cpp:

* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.

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

2 years agoREGRESSION (r143068): fast/events/clientXY-in-zoom-and-scroll.html failing on GTK, Qt
csaavedra@igalia.com [Tue, 25 Jul 2017 13:22:12 +0000 (13:22 +0000)]
REGRESSION (r143068): fast/events/clientXY-in-zoom-and-scroll.html failing on GTK, Qt
https://bugs.webkit.org/show_bug.cgi?id=110090

Unreviewed gardening.

This test only needed the expectation to be updated.

* platform/gtk/TestExpectations: Remove test below.
* platform/gtk/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.

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

2 years agoUnreviewed, fix Mac CMake build after r219567
annulen@yandex.ru [Tue, 25 Jul 2017 11:43:22 +0000 (11:43 +0000)]
Unreviewed, fix Mac CMake build after r219567

* PlatformMac.cmake:

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

2 years agoREGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCor...
carlosgc@webkit.org [Tue, 25 Jul 2017 11:38:13 +0000 (11:38 +0000)]
REGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCore::PlatformDisplay::~PlatformDisplay
https://bugs.webkit.org/show_bug.cgi?id=174789

Reviewed by Žan Doberšek.

Before r218629, the wayland nested compositor display was a singleton created on demand by
AcceleratedSurfaceWayland, but now it's created unconditionally on web process creation when a valid display
name is received from the UI process. The side effect of this is that now the shared display is created after
the nested compositor display that is not a singleton anymore. The atexit used by PlatformDisplay to shutdown
egl display assumes that it will be registered by the shared display. Since we switched to on demand AC mode,
the shared display is only used in the web process when entering AC mode, that's why it only crashes when we
have entered AC at least once. We just need to ensure that the shared display is created before the nested
compositor display.

* WebProcess/gtk/WaylandCompositorDisplay.cpp:
(WebKit::WaylandCompositorDisplay::create): Check we are under wayland before creating the WaylandCompositorDisplay.

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

2 years ago[GTK] TestWebKitAPI tests are no longer built since the WebKit2 rename
carlosgc@webkit.org [Tue, 25 Jul 2017 11:36:48 +0000 (11:36 +0000)]
[GTK] TestWebKitAPI tests are no longer built since the WebKit2 rename
https://bugs.webkit.org/show_bug.cgi?id=174815

Reviewed by Carlos Alberto Lopez Perez.

Only WebKitGTK specific tests are built, but not WebKit2, WTF nor WebCore ones. We are still checking
ENABLE_WEBKIT2 in the makefile, that was renamed to ENABLE_WEBKIT. Also, all WebKit2 test paths were updated to
use WebKit dir, while the tests are still in WebKit2 directory. This patch also removes
TestWebKitAPIInjectedBundle_PATH that is unused and now makes the configure to fail (it used to be a warning, I
think), probably because of a newer CMake version.

* CMakeLists.txt:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:

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

2 years agoUnreviewed. Fix GTK+ WebKit2 library soname after r219488.
carlosgc@webkit.org [Tue, 25 Jul 2017 10:22:40 +0000 (10:22 +0000)]
Unreviewed. Fix GTK+ WebKit2 library soname after r219488.

The WebKit2 -> WebKit rename shouldn't affect the GTK+ library that is still called libwebkit2gtk, so keep using
WEBKIT2 as the library name in CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE, since that's also what the WebKit
makefile passes to WEBKIT_POPULATE_LIBRARY_VERSION.

* Source/cmake/OptionsGTK.cmake:

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

2 years ago[GTK] ASSERTION FAILED: client in WebKit::IconDatabase::setClient
carlosgc@webkit.org [Tue, 25 Jul 2017 06:49:11 +0000 (06:49 +0000)]
[GTK] ASSERTION FAILED: client in WebKit::IconDatabase::setClient
https://bugs.webkit.org/show_bug.cgi?id=174788

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2017-07-24
Reviewed by Carlos Garcia Campos.

IconDatabase ensures that setClient is never called with nullptr, but WebKitFaviconDatabase
does exactly that. First, ensure it's safe to unset the client. Next, we can either remove
the assertions from setClient or else automatically unset the client in IconDatabase::close.
I opted to do both.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::close):
(WebKit::IconDatabase::setIconDataForIconURL):
(WebKit::IconDatabase::setIconURLForPageURL):
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
(_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): Deleted.
(webkitFaviconDatabaseDispose): Deleted.

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

2 years ago[GTK][WPE] Remove useless conditional in IconDatabase::setIconDataForIconURL
carlosgc@webkit.org [Tue, 25 Jul 2017 06:45:53 +0000 (06:45 +0000)]
[GTK][WPE] Remove useless conditional in IconDatabase::setIconDataForIconURL
https://bugs.webkit.org/show_bug.cgi?id=174792

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2017-07-24
Reviewed by Carlos Garcia Campos.

We have in IconDatabase::setIconDataForIconURL some code in a conditional to check if it's
not being executed on the icon sync thread. But at the top of the function is an assertion
to ensure the code is never executed on the icon sync thread. The condition is therefore
useless and the code should be executed unconditionally.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::setIconDataForIconURL):

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

2 years ago[GTK] Icon database error and crash
carlosgc@webkit.org [Tue, 25 Jul 2017 06:39:30 +0000 (06:39 +0000)]
[GTK] Icon database error and crash
https://bugs.webkit.org/show_bug.cgi?id=174760

Reviewed by Michael Catanzaro.

The crash is a debug ASSERT that happens when the IconRecord image is created in one thread and destroyed in
another one. IconDatabase creates and destroys IconRecord objects in both database and main thread. The
IconRecord is destroyed when the icon is no longer retained, and we only release icons when we fail to get the
image data (including pages that don't have a favicon). We can prevent this crash from happening if we ensure we
never create an Image for an IconRecord when the given image data is nullptr.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::IconRecord::setImageData):

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

2 years agoFix BenchmarkRunner to only import selenium when needed
commit-queue@webkit.org [Tue, 25 Jul 2017 04:36:46 +0000 (04:36 +0000)]
Fix BenchmarkRunner to only import selenium when needed
https://bugs.webkit.org/show_bug.cgi?id=174808

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-24
Reviewed by Stephanie Lewis.

* Scripts/webkitpy/benchmark_runner/browser_driver/linux_chrome_driver.py:
(LinuxChromeDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_firefox_driver.py:
(LinuxFirefoxDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:
(OSXChromeDriver.launch_driver):
(OSXChromeCanaryDriver.launch_driver):
(create_chrome_options):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py:
(OSXFirefoxDriver.launch_driver):
(OSXFirefoxNightlyDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/webdriver_benchmark_runner.py:
(WebDriverBenchmarkRunner._run_one_test):

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

2 years agoMore NeverDestroyed and related cleanup
darin@apple.com [Tue, 25 Jul 2017 04:29:08 +0000 (04:29 +0000)]
More NeverDestroyed and related cleanup
https://bugs.webkit.org/show_bug.cgi?id=174745

Reviewed by Alex Christensen.

Source/WebCore:

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback):
Use isNull() rather than comparing against nullAtom() since it's
slightly more efficient.

* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate): Use a switch statement for the
three states of forcedPrefersReducedMotionAccessibilityValue. Also update
to use Theme::singleton() instead of platformTheme().

* dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks,
and use isNull() rather than comparing against nullAtom() since it's
slightly more efficient.

* html/Autofill.cpp:
(WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull()
rather than comparing against nullAtom() since it's slightly more efficient.

* html/HTMLDocument.cpp:
(WebCore::addLocalNameToSet): Deleted.
(WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted.
(WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive
attribute set in here and made it use makeNeverDestroyed.

* html/HTMLNameCollection.cpp:
(WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
Formatted vertically and sorted so it's easier to see what it does.
(WebCore::WindowNameCollection::elementMatches): Use boolean logic instead
of multiple return statements to make this a little more straightforward.
(WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new
isExposed function. The old code called this isDocNamedItem.
(WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
Use isObjectElementForDocumentNameCollection to clean up logic. Also
sorted classes.
(WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
Use isObjectElementForDocumentNameCollection to clean up logic. Also
sorted classes and formatted vertically.
(WebCore::DocumentNameCollection::elementMatches): Write in terms of
above functions for clarity. Efficiency is roughly the same.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members
in class definition instead of here.
(WebCore::HTMLObjectElement::childrenChanged): Update for name change;
function is now called updateExposedState rather than updateDocNamedItem.
Also use m_useFallbackContent directly instead of through a function.
(WebCore::HTMLObjectElement::renderFallbackContent): Ditto.
(WebCore::preventsParentObjectFromExposure): Added. Replaces the old
isRecognizedTagName function, and does almost the same thing, but the
argument type is different and the param tag is now one of the tags
exempted here. Also broke up into two overloads so we can handle the
Element, Text, and other Node cases.
(WebCore::shouldBeExposed): Added. Helper for the updateExposedState
function that handles the logic of when the element should be exposed,
separating it from what to do when the state changes.
(WebCore::HTMLObjectElement::updateExposedState): Renamed from
updateDocNamedItem.

* html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed,
m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState,
stopped using bit fields for the two boolean data members, and
initialized those data members here in the class definition.

* platform/Theme.cpp:
(WebCore::Theme::baselinePositionAdjustment): Moved here from header.
(WebCore::Theme::controlFont): Ditto.
(WebCore::Theme::controlSize): Ditto.
(WebCore::Theme::minimumControlSize): Ditto.
(WebCore::Theme::controlRequiresPreWhiteSpace): Ditto.
(WebCore::Theme::paint): Ditto.
(WebCore::Theme::inflateControlPaintRect): Ditto.
(WebCore::Theme::userPrefersReducedMotion): Ditto.
(WebCore::Theme::controlBorder): Fixed switch statement indentation.
(WebCore::Theme::controlPadding): Ditto.

* platform/Theme.h: Removed the many unnecessary includes. The one
I was really after here was FontCascade.h. Replaced the platformTheme
function with a singleton function, following our normal style. Also
changed the return type to a reference rather than a pointer.
Removed many unused function and data members.

* platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing
unnecessary members and making overrides private.
* platform/cocoa/ThemeCocoa.mm: Moved include in here.

* platform/gamepad/glib/GamepadsGlib.cpp:
(WebCore::sampleGamepads): Use NeverDestroyed instead of
DEPRECATED_DEFINE_STATIC_LOCAL.

* platform/graphics/FontCascade.cpp:
(WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner
way and use a NeverDestroyed set instead of a heap-allocated one.
(WebCore::FontCascade::FontCascade): Moved initialization of data members
to the class definition.

* platform/graphics/FontCascade.h: Initialize GlyphOverflow and
FonstCascade data members in the class definition. Remove the constructor
for GlyphOverflow entirely. Added FIXME about the peculiar != operator we
defined for GlyphOverflow.

* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead
of platformTheme().
(WebCore::NamedImageGeneratedImage::drawPattern): Ditto.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using
DEPRECATED_DEFINE_STATIC_LOCAL.
(WebCore::CMTimeRangeDurationKey): Ditto.
(WebCore::CACFContextNeedsFlushNotification): Ditto.

* platform/graphics/ca/win/LayerChangesFlusher.cpp:
(WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of
DEPRECATED_DEFINE_STATIC_LOCAL.
* platform/graphics/ca/win/LayerChangesFlusher.h: Ditto.

* platform/graphics/cg/ImageSourceCGWin.cpp:
(WebCore::preferredExtensionForImageSourceType): Use HashMap constructor
instead of writing out a lot of add calls.

* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of
DEPRECATED_DEFINE_STATIC_LOCAL.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont): Ditto.

* platform/ios/ThemeIOS.h: Tightened up implementation, removing
unnecessary members and making overrides private.
* platform/ios/ThemeIOS.mm:
(WebCore::Theme::singleton): Renamed from platformTheme.

* platform/mac/ThemeMac.h: Tightened up implementation, removing
unnecessary members and making overrides private. Removed unneeded
WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap.
Removed unused -[NSFont webCoreFamilyName] method.
* platform/mac/ThemeMac.mm:
(-[NSFont webCoreFamilyName]): Deleted.
(WebCore::Theme::singleton): Renamed from platformTheme.

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
Removed unneeded include of FontCascade.h.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
Ditto.
* platform/mock/MockRealtimeAudioSource.h: Ditto.

* platform/network/win/DownloadBundleWin.cpp:
(WebCore::DownloadBundle::fileExtension): Use NeverDestroyed
instead of DEPRECATED_DEFINE_STATIC_LOCAL.

* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines): Use
appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL.

* platform/win/FileSystemWin.cpp:
(WebCore::bundleName): Use NeverDestroyed instead of
DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize
rather than a boolean to control one-time code.
(WebCore::storageDirectory): Removed unneeded use of
DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to
a String. The + operator can handle a literal just as efficiently
without first storing it in a String.

* platform/wpe/ThemeWPE.cpp:
(WebCore::Theme::singleton): Renamed from platformTheme.
* platform/wpe/ThemeWPE.h: Tightened up implementation, removing
unnecessary members and making overrides private.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::RenderTheme): No need to initialize m_theme.
(WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead
of accessing it through m_theme.
(WebCore::RenderTheme::paint): Ditto.
(WebCore::RenderTheme::baselinePosition): Ditto.
(WebCore::RenderTheme::adjustRepaintRect): Ditto.
(WebCore::RenderTheme::setCustomFocusRingColor): Ditto.
(WebCore::RenderTheme::platformTapHighlightColor): Ditto.

* rendering/RenderTheme.h: Removed unneded m_theme and unneeded
inclusion of Theme.h.

* rendering/line/LineBreaker.h: Removed unneeded include of
FontCascade.h.

Source/WebKitLegacy/mac:

* DOM/DOMUIKitExtensions.mm: Removed a lot of unneeded "using"
for names that aren't even used in this file.
(-[DOMNode boundingBoxes]): Use @[] syntax instead of
-[NSArray arrayWithObject:].
(-[DOMNode absoluteQuads]): Ditto.
(-[DOMNode findExplodedTextNodeAtPoint:]): Use auto* instead
of writing out various types.
(-[DOMHTMLAreaElement boundingBoxesWithOwner:]): Use @[]
syntax instea of -[NSArray arrayWithObject:].
(-[DOMHTMLAreaElement absoluteQuadsWithOwner:]): Ditto.
(-[DOMHTMLImageElement dataRepresentation:]): Use auto* instead
of writing out various types.
(-[DOMHTMLImageElement mimeType]): Ditto.

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:
(WebCore::persistentPluginMetadataCachePath): Use NeverDestroyed
instead of DEPRECATED_DEFINE_STATIC_LOCAL.
* Plugins/PluginMainThreadScheduler.cpp:
(WebCore::PluginMainThreadScheduler::scheduler): Ditto.
* Plugins/PluginMainThreadScheduler.h: Ditto.
* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::initialize): Ditto.
* WebCoreSupport/WebPlatformStrategies.h: Ditto.
* WebHistory.cpp:
(sharedHistoryStorage): Ditto.
* WebLocalizableStrings.cpp:
(mainBundleLocStrings): Ditto.
(frameworkLocStringsMutex): Ditto.
(frameworkLocStrings): Ditto.
* WebView.cpp:
(WebView::standardUserAgentWithApplicationName): Ditto.
Also changed to keep one global string with the prefix of the user agent string
instead of keeping two globals with pieces of that prefix.

Tools:

* DumpRenderTree/JavaScriptThreading.cpp:
(javaScriptThreadsMutex): Use NeverDestroyed instead of
DEPRECATED_DEFINE_STATIC_LOCAL.
(javaScriptThreads): Ditto.

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

2 years agoSubclass Benchmark Runner script for WebDriver support
commit-queue@webkit.org [Tue, 25 Jul 2017 04:10:00 +0000 (04:10 +0000)]
Subclass Benchmark Runner script for WebDriver support
https://bugs.webkit.org/show_bug.cgi?id=174390

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-24
Reviewed by Dewei Zhu, Stephanie Lewis.

Add WebServerBenchmarkRunner and WebDriverBenchmarkRunner subclasses.

* Scripts/webkitpy/benchmark_runner/benchmark_builder.py:
(BenchmarkBuilder.__init__):
* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner.__init__):
(BenchmarkRunner._find_plan_file):
(BenchmarkRunner._run_one_test.and):
(BenchmarkRunner.execute):
(BenchmarkRunner._get_result): Deleted.
* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(parse_args):
(start):
* Scripts/webkitpy/benchmark_runner/webdriver_benchmark_runner.py: Added.
(WebDriverBenchmarkRunner):
(WebDriverBenchmarkRunner._get_result):
(WebDriverBenchmarkRunner._run_one_test):
* Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py: Added.
(WebServerBenchmarkRunner):
(WebServerBenchmarkRunner.__init__):
(WebServerBenchmarkRunner._get_result):
(WebServerBenchmarkRunner._run_one_test):

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

2 years agoExceptionCode enumeration should use modern exception names
cdumez@apple.com [Tue, 25 Jul 2017 03:59:12 +0000 (03:59 +0000)]
ExceptionCode enumeration should use modern exception names
https://bugs.webkit.org/show_bug.cgi?id=174794

Reviewed by Geoffrey Garen.

Source/WebCore:

ExceptionCode enumeration should use modern exception names consistently.
This makes the code nicer and closer to the text of the specification.

Source/WebKitLegacy/mac:

* DOM/ExceptionHandlers.mm:
(raiseNotSupportedErrorException):

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

2 years ago[WK2][Cocoa] Allow overriding the ITP data removal internal using a default
cdumez@apple.com [Tue, 25 Jul 2017 03:07:26 +0000 (03:07 +0000)]
[WK2][Cocoa] Allow overriding the ITP data removal internal using a default
https://bugs.webkit.org/show_bug.cgi?id=174802
<rdar://problem/33497898>

Reviewed by Sam Weinig.

Allow overriding the ITP data removal internal using a default to facilitate testing.
Can be used like so:
defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60

Will cause us to write every 60 seconds instead of 3600.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):

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

2 years agoAdd BenchmarkRunner patches with WebDriver support for each testing plan
commit-queue@webkit.org [Tue, 25 Jul 2017 01:58:24 +0000 (01:58 +0000)]
Add BenchmarkRunner patches with WebDriver support for each testing plan
https://bugs.webkit.org/show_bug.cgi?id=174443

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-24
Reviewed by Dewei Zhu, Stephanie Lewis.

* Scripts/webkitpy/benchmark_runner/benchmark_builder.py:
(BenchmarkBuilder.__enter__):
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/ARES-6.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/ContentAnimation.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/Dromaeo.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/JSBench.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/JetStream.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/Kraken.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/MotionMark.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/Octane.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/Speedometer.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webdriver/SunSpider.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/ARES-6.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Animometer.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/ContentAnimation.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Dromaeo.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/JSBench.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/JetStream.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Kraken.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/MotionMark.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Octane.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Speedometer.patch:
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/SunSpider.patch:
* Scripts/webkitpy/benchmark_runner/data/plans/ares6.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/content-animation.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/dromaeo-cssquery.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/dromaeo-dom.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/dromaeo-jslib.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/jetstream.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/jsbench.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/kraken.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/motionmark.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/octane.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/speedometer.plan:
* Scripts/webkitpy/benchmark_runner/data/plans/sunspider.plan:

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

2 years agoAdd functions to autoinstaller needed for Benchmark Runner script
commit-queue@webkit.org [Tue, 25 Jul 2017 01:42:03 +0000 (01:42 +0000)]
Add functions to autoinstaller needed for Benchmark Runner script
https://bugs.webkit.org/show_bug.cgi?id=174331

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-24
Reviewed by Dean Johnson, Dewei Zhu, Stephanie Lewis.

Adds autoinstaller functions to install selenium and webdriver binaries
which will be used by the browser driver part of Benchmark Runner.

* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py:
(BrowserDriver.restore_env):
(BrowserDriver):
(BrowserDriver.get_webdriver_binary_path):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_chrome_driver.py:
(LinuxChromeDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_firefox_driver.py:
(LinuxFirefoxDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:
(OSXChromeDriver.launch_driver):
(OSXChromeCanaryDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py:
(OSXFirefoxDriver.launch_driver):
(OSXFirefoxNightlyDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
* Scripts/webkitpy/benchmark_runner/utils.py:
(get_driver_binary_path):
* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller._unzip):
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.find_module):
(AutoinstallImportHook._install_selenium):
(AutoinstallImportHook):
(AutoinstallImportHook._install_chromedriver):
(AutoinstallImportHook._install_geckodriver):
(AutoinstallImportHook.get_latest_pypi_url):
(AutoinstallImportHook.install_binary):
(autoinstall_everything):
(get_driver_filename):
(get_os_info):

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

2 years ago[iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple...
simon.fraser@apple.com [Tue, 25 Jul 2017 01:17:51 +0000 (01:17 +0000)]
[iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple finds
https://bugs.webkit.org/show_bug.cgi?id=174806
rdar://problem/33501664

Reviewed by Tim Horton.

Calling TextIndicator::createWithSelectionInFrame can trigger layout via VisibleSelection code,
which can re-enter FindController::updateFindIndicator which has by now removed m_findIndicatorOverlay
from pageOverlayController's map, but not deleted it. The second call to uninstallPageOverlay()
thus crashes at m_overlayGraphicsLayers.take(&overlay)->removeFromParent().

Fix by nulling out m_findIndicatorOverlay as soon as we uninstall it.

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):

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

2 years agoWeb Inspector: Settings: Some controls overlay settings header
commit-queue@webkit.org [Tue, 25 Jul 2017 00:51:11 +0000 (00:51 +0000)]
Web Inspector: Settings: Some controls overlay settings header
https://bugs.webkit.org/show_bug.cgi?id=174804

Patch by Nikita Vasilyev <me@elv1s.ru> on 2017-07-24
Reviewed by Matt Baker.

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar):

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

2 years agoAdd WebDriver support in browser driver part of BenchmarkRunner
commit-queue@webkit.org [Tue, 25 Jul 2017 00:40:52 +0000 (00:40 +0000)]
Add WebDriver support in browser driver part of BenchmarkRunner
https://bugs.webkit.org/show_bug.cgi?id=174445

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-24
Reviewed by Stephanie Lewis.

Adds a launch_driver function to each BrowserDriver subclass. This
function sets up the arguments for the webdriver and launches the
webdriver specific to that browser.

* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py:
(BrowserDriver.launch_webdriver):
(BrowserDriver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py:
(LinuxBrowserDriver.launch_webdriver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_chrome_driver.py:
(LinuxChromeDriver.launch_url):
(LinuxChromeDriver):
(LinuxChromeDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_epiphany_driver.py:
(EpiphanyBrowserDriver.launch_url):
(EpiphanyBrowserDriver):
(EpiphanyBrowserDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_firefox_driver.py:
(LinuxFirefoxDriver):
(LinuxFirefoxDriver.launch_url):
(LinuxFirefoxDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py:
(GTKMiniBrowserDriver.launch_url):
(GTKMiniBrowserDriver):
(GTKMiniBrowserDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_browser_driver.py:
(OSXBrowserDriver._launch_webdriver):
(OSXBrowserDriver):
(OSXBrowserDriver._screen_size):
(OSXBrowserDriver._insert_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:
(OSXChromeDriver):
(OSXChromeDriver.launch_url):
(OSXChromeDriver.launch_driver):
(OSXChromeCanaryDriver):
(OSXChromeCanaryDriver.launch_url):
(OSXChromeCanaryDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py:
(OSXFirefoxDriver):
(OSXFirefoxDriver.launch_url):
(OSXFirefoxDriver.launch_driver):
(OSXFirefoxNightlyDriver):
(OSXFirefoxNightlyDriver.launch_url):
(OSXFirefoxNightlyDriver.launch_driver):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_driver):

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

2 years ago[Win] The tests fast/text/line-height-minimumFontSize*.html are failing.
pvollan@apple.com [Mon, 24 Jul 2017 23:54:27 +0000 (23:54 +0000)]
[Win] The tests fast/text/line-height-minimumFontSize*.html are failing.
https://bugs.webkit.org/show_bug.cgi?id=174801

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years agoConsider implementing W3C Payment Request API
aestes@apple.com [Mon, 24 Jul 2017 23:52:07 +0000 (23:52 +0000)]
Consider implementing W3C Payment Request API
https://bugs.webkit.org/show_bug.cgi?id=174796

Reviewed by Daniel Bates.

Add Payment Request to features.json as "Under Consideration".

* features.json:

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

2 years agoMarked tests as failures.
jlewis3@apple.com [Mon, 24 Jul 2017 23:41:12 +0000 (23:41 +0000)]
Marked tests as failures.
<rdar://problem/33437597>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

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

2 years agoFixed typo in test expectations.
jlewis3@apple.com [Mon, 24 Jul 2017 23:12:39 +0000 (23:12 +0000)]
Fixed typo in test expectations.
https://bugs.webkit.org/show_bug.cgi?id=173010

Unreviewed gardening.
* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoFix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrW...
cdumez@apple.com [Mon, 24 Jul 2017 22:50:32 +0000 (22:50 +0000)]
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
https://bugs.webkit.org/show_bug.cgi?id=174790

Reviewed by Brady Eidson.

Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
|this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
get executed after the store is gone.

To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a
WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called
after the store has been destroyed.

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
(WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
(WebKit::ResourceLoadStatisticsPersistentStorage::ref):
(WebKit::ResourceLoadStatisticsPersistentStorage::deref):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:

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

2 years ago[Win] Async image tests are failing.
pvollan@apple.com [Mon, 24 Jul 2017 22:42:00 +0000 (22:42 +0000)]
[Win] Async image tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=174653

Unreviewed test gardening, update test expectations for async image tests.

* platform/win/TestExpectations:

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

2 years agoRebaseline this test. The previous result was generated using an older iOS SDK.
simon.fraser@apple.com [Mon, 24 Jul 2017 22:29:02 +0000 (22:29 +0000)]
Rebaseline this test. The previous result was generated using an older iOS SDK.

* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:

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

2 years agoMark Skia font test as image only failure on Windows.
pvollan@apple.com [Mon, 24 Jul 2017 22:26:11 +0000 (22:26 +0000)]
Mark Skia font test as image only failure on Windows.

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoLayoutTest userscripts/user-script-audio-document.html failing on High Sierra
commit-queue@webkit.org [Mon, 24 Jul 2017 21:57:34 +0000 (21:57 +0000)]
LayoutTest userscripts/user-script-audio-document.html failing on High Sierra
https://bugs.webkit.org/show_bug.cgi?id=174726
rdar://problem/30059973

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-24
Reviewed by Alexey Proskuryakov.

Underlying issue has been resolved.
Re-enable test: userscripts/user-script-audio-document.html

* platform/mac-highsierra/TestExpectations:

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

2 years agoUnreviewed attempt to fix Mac cmake build
annulen@yandex.ru [Mon, 24 Jul 2017 21:57:17 +0000 (21:57 +0000)]
Unreviewed attempt to fix Mac cmake build

* PlatformMac.cmake:

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

2 years agoFix typo (Timout -> Timeout).
simon.fraser@apple.com [Mon, 24 Jul 2017 21:53:38 +0000 (21:53 +0000)]
Fix typo (Timout -> Timeout).

* platform/mac-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r219828.
cdumez@apple.com [Mon, 24 Jul 2017 21:42:51 +0000 (21:42 +0000)]
Unreviewed, rolling out r219828.

Causes debug assertions to be hit on iOS

Reverted changeset:

"Fix lifetime management issue in
ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()"
https://bugs.webkit.org/show_bug.cgi?id=174790
http://trac.webkit.org/changeset/219828

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

2 years ago5 wav media layoutTest timeouts on High Sierra
commit-queue@webkit.org [Mon, 24 Jul 2017 21:21:06 +0000 (21:21 +0000)]
5 wav media layoutTest timeouts on High Sierra
https://bugs.webkit.org/show_bug.cgi?id=174725
rdar://problem/30182218

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-24
Reviewed by Andreas Kling.

Underlying issue is fixed. Re-enable tests on High Sierra.

media/audio-controls-timeline-in-media-document.html
media/audio-data-url.html
media/media-document-audio-controls-visible.html
media/media-document-audio-repaint.html
media/media-document-audio-size.html

* platform/mac-highsierra/TestExpectations:

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

2 years ago[Mac WK2] Add an API test to cover r219765 (null dereference in [WKWebView dealloc])
wenson_hsieh@apple.com [Mon, 24 Jul 2017 20:58:09 +0000 (20:58 +0000)]
[Mac WK2] Add an API test to cover r219765 (null dereference in [WKWebView dealloc])
https://bugs.webkit.org/show_bug.cgi?id=174793

Reviewed by Tim Horton.

Adds a new unit test that invokes some asynchronous NSTextInputClient SPI methods as the web view is tearing
down. Without r219765, this test will dereference null and crash.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/TestWebKitAPI/mac/NSTextInputClientSPI.h: Added.
* TestWebKitAPI/Tests/mac/WKWebViewSelectionTests.mm:
(TEST):

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

2 years agoWebDriver: rename m_browsingContext as m_currentBrowsingContext in Session
commit-queue@webkit.org [Mon, 24 Jul 2017 19:16:55 +0000 (19:16 +0000)]
WebDriver: rename m_browsingContext as m_currentBrowsingContext in Session
https://bugs.webkit.org/show_bug.cgi?id=174783

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-07-24
Reviewed by Brian Burg.

We have m_toplevelBrowsingContext and m_browsingContext, which is confusing. m_browsingContext is actually the
current browsing context, and the spec also refers to it as the current browsing context, so better use
m_currentBrowsingContext.

* Session.cpp:
(WebDriver::Session::switchToTopLevelBrowsingContext):
(WebDriver::Session::switchToBrowsingContext):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::findElements):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::elementSubmit):
(WebDriver::Session::executeScript):
* Session.h:

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

2 years ago[GTK][WPE] Stop using AutodrainedPool in IconDatabase
mcatanzaro@igalia.com [Mon, 24 Jul 2017 18:55:29 +0000 (18:55 +0000)]
[GTK][WPE] Stop using AutodrainedPool in IconDatabase
https://bugs.webkit.org/show_bug.cgi?id=174791

Reviewed by Alex Christensen.

AutodrainedPool seems to be some NS garbage collection thing that has no implementation on
other platforms. Now that IconDatabase is used only by GTK and WPE, we can stop using it.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::setIconDataForIconURL):
(WebKit::IconDatabase::setIconURLForPageURL):
(WebKit::IconDatabase::iconDatabaseSyncThread):
(WebKit::IconDatabase::performURLImport):
(WebKit::IconDatabase::readFromDatabase):

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

2 years agoMake ExceptionCode a proper enumeration
cdumez@apple.com [Mon, 24 Jul 2017 18:42:33 +0000 (18:42 +0000)]
Make ExceptionCode a proper enumeration
https://bugs.webkit.org/show_bug.cgi?id=174771

Reviewed by Sam Weinig.

Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.

Source/WebCore:

* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::formData):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::encode):
(WebCore::IDBError::decode):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::rejectWithException):
* dom/Exception.h:
* dom/ExceptionCode.h:
* fileapi/FileReaderSync.cpp:
(WebCore::errorCodeToExceptionCode):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* xml/XMLHttpRequest.h:

Source/WebKitLegacy/win:

* DOMCoreClasses.cpp:
(DOMDocument::createEvent):
* WebView.cpp:
(WebView::prepareCandidateWindow):

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

2 years ago[Win] Implement Authentication dialog in MiniBrowser
commit-queue@webkit.org [Mon, 24 Jul 2017 18:34:58 +0000 (18:34 +0000)]
[Win] Implement Authentication dialog in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=174662

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-07-24
Reviewed by Alex Christensen.

* MiniBrowser/win/Common.cpp:
(CustomUserAgent):
(DisplayAuthDialog):
(AuthDialogProc):
* MiniBrowser/win/MiniBrowserLib.rc:
* MiniBrowser/win/MiniBrowserLibResource.h:
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):

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

2 years agoChange "client" coordinates back to match scrolling coordinates
simon.fraser@apple.com [Mon, 24 Jul 2017 18:07:31 +0000 (18:07 +0000)]
Change "client" coordinates back to match scrolling coordinates
https://bugs.webkit.org/show_bug.cgi?id=174734
rdar://problem/33336930

Reviewed by Tim Horton.

Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.

At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
many of which are noted in webkit.org/b/170981.

* page/FrameView.cpp:
(WebCore::FrameView::documentToClientOffset):

LayoutTests:
Revert "client" coordinates to be in scrolling coordinates
https://bugs.webkit.org/show_bug.cgi?id=174734
rdar://problem/33336930

Reviewed by Tim Horton.

Rebaseline.

* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:
* fast/visual-viewport/client-coordinates-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/zoomed-fixed-expected.txt:
* fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed-expected.txt:
* platform/ios-wk2/fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/cssom-view/elementFromPoint-expected.txt: Added.
* platform/ios/fast/visual-viewport/zoomed-fixed-expected.txt:
* platform/ios/fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:

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

2 years agoFix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrW...
cdumez@apple.com [Mon, 24 Jul 2017 17:43:14 +0000 (17:43 +0000)]
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
https://bugs.webkit.org/show_bug.cgi?id=174790

Reviewed by Brady Eidson.

Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
|this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
get executed after the store is gone.

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
(WebKit::ResourceLoadStatisticsPersistentStorage::createWeakPtr):

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

2 years agoHandle case where line_numbers is None instead of an array of line numbers
jbedard@apple.com [Mon, 24 Jul 2017 17:31:12 +0000 (17:31 +0000)]
Handle case where line_numbers is None instead of an array of line numbers
https://bugs.webkit.org/show_bug.cgi?id=174775

Reviewed by Aakash Jain.

Added files set line_numbers to None in process_file.

* Scripts/webkitpy/style/filereader.py:
(TextFileReader.process_file): Handle case where line_number is set to None.
* Scripts/webkitpy/style/main_unittest.py:
(ExpectationLinterInStyleCheckerTest.test_linter_added_file_with_error): Test case of an added file.

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

2 years agoWeb Inspector: should only show Canvases in resource type filter if debug setting...
mattbaker@apple.com [Mon, 24 Jul 2017 17:13:27 +0000 (17:13 +0000)]
Web Inspector: should only show Canvases in resource type filter if debug setting enabled
https://bugs.webkit.org/show_bug.cgi?id=174765
<rdar://problem/33479009>

Reviewed by Devin Rousso.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):

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

2 years agoMarked tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical...
jlewis3@apple.com [Mon, 24 Jul 2017 16:41:35 +0000 (16:41 +0000)]
Marked tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html as failure.
https://bugs.webkit.org/show_bug.cgi?id=172148

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoRemove race from one plug-in test
darin@apple.com [Mon, 24 Jul 2017 16:06:50 +0000 (16:06 +0000)]
Remove race from one plug-in test
https://bugs.webkit.org/show_bug.cgi?id=130653

Reviewed by Antti Koivisto.

* plugins/plugin-remove-readystatechange.html: Updated test to use waitUntilDone/notifyDone
rather than racing. Added a computation of offsetLeft to trigger layout and adding a long
comment explaining why this is both needed and potentially insufficient in the long run.

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

2 years ago[CMake] libtasn1 should not be required when not enabling subtle_crypto
clopez@igalia.com [Mon, 24 Jul 2017 16:01:33 +0000 (16:01 +0000)]
[CMake] libtasn1 should not be required when not enabling subtle_crypto
https://bugs.webkit.org/show_bug.cgi?id=174785

Reviewed by Žan Doberšek.

* pal/PlatformGTK.cmake:
* pal/PlatformWPE.cmake:

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

2 years agoGardening: fixed C Loop build after r219790.
mark.lam@apple.com [Mon, 24 Jul 2017 14:46:43 +0000 (14:46 +0000)]
Gardening: fixed C Loop build after r219790.
https://bugs.webkit.org/show_bug.cgi?id=174696

Not reviewed.

* assembler/testmasm.cpp:

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

2 years ago[WPE] Add libepoxy to the Jhbuild moduleset
zandobersek@gmail.com [Mon, 24 Jul 2017 14:27:52 +0000 (14:27 +0000)]
[WPE] Add libepoxy to the Jhbuild moduleset
https://bugs.webkit.org/show_bug.cgi?id=174711

Reviewed by Carlos Alberto Lopez Perez.

.:

libepoxy 1.3.1 that's widely available in current stable distributions (Debian stable,
Ubuntu LTS) does suffice our needs, but also contains a bug that incorrectly determines
the current EGL context and the API version of OpenGL that's bound to that context.
Focusing on experiences on Debian systems, while the current stable Debian release has
this bug patched, the package for the testing distribution of Debian removed that same
patch for whatever reason, despite using the 1.3.1 version as the package basis.

To avoid this, libepoxy 1.4.3 is now added to WPE's Jhbuild moduleset. The WPE port
also now demands at least the 1.4.0 version to be available when configuring.

We should revisit the minimum version for libepoxy in the future if the 1.3 release
branch gets updated with the proper fix.

* Source/cmake/FindLibEpoxy.cmake:
* Source/cmake/OptionsWPE.cmake:

Tools:

* wpe/jhbuild.modules: Add libepoxy 1.4.3 to WPE's Jhbuild moduleset.

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