WebKit-https.git
3 years agoEnhance shouldBe()/shouldNotBe() to accept anonymous function arguments
ddkilzer@apple.com [Thu, 27 Apr 2017 21:29:23 +0000 (21:29 +0000)]
Enhance shouldBe()/shouldNotBe() to accept anonymous function arguments
<https://webkit.org/b/171362>
<rdar://problem/31867686>

Reviewed by Joseph Pecoraro.

JSTests:

* stress/resources/standalone-pre.js:
(shouldBe):
(shouldNotThrow):
(shouldThrow):
- Update shouldBe() to accept anonymous function arguments.
  (The shouldNotBe() function was never copied over.)
- Also fix shouldThrow()/shouldNotThrow() to accept anonymous
  function arguments (which were missed in r202609 for Bug
  159232).

LayoutTests:

This change makes it possible to pass either the first or second
argument (or both) as anonymous functions into shouldBe() and
shouldNotBe() to make it easy to capture local variables when
writing tests.  This is similar to the change in r202609 for Bug
159232 for shouldThrow() and shouldNotThrow().

Note that shouldBe()/shouldNotBe() from the following files were
NOT updated since they were imported from other projects and did
share the full WebKit history of resources/js-test-pre.js:

    http/tests/webgl/1.0.2/resources/webgl_test_files/resources/js-test-pre.js
    js/mozilla/resources/js-test-pre.js
    webgl/1.0.2/resources/webgl_test_files/resources/js-test-pre.js
    webgl/1.0.3/resources/webgl_test_files/resources/js-test-pre.js

However, these files WERE brought up-to-date with the ability to
pass anonymous functions into shouldBe()/shouldNotBe() for this
bug, and shouldThrow()/shouldNotThrow() which should have
originally been fixed with Bug 159232:

    http/tests/resources/js-test-pre.js
    resources/standalone-pre.js

* css3/scroll-snap/resources/iframe-content.html: Drive-by fix
to debug message for copy-paste error.  Found by searching
LayoutTests directory for "expects string arguments".

* fast/canvas/webgl/array-unit-tests-expected.txt: Update test
results.
* fast/canvas/webgl/array-unit-tests.html: Fix warning by making
second argument to shouldBe() a string.

* fast/css/script-tests/image-set-parsing.js:
(testImageSetRule): Remove comment by changing second argument
to shouldBe() into an anonymous function.

* http/tests/resources/js-test-pre.js:
(evalAndLog):
(evalAndLogResult):
(shouldBe):
(shouldNotBe):
(shouldEvaluateTo):
- Made a full copy of resources/js-test-pre.js to bring this up
  to speed.  Needs a checker written for it to keep them in sync.
* http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt:
- Update line numbers after updating http/tests/resources/js-test-pre.js.

* js/function-declarations-in-switch-statement-expected.txt:
- Update results after fixing warnings.
* js/script-tests/function-declarations-in-switch-statement.js:
- Fix warnings by passing in strings to shouldBe().

* js/script-tests/stack-unwinding.js:
- Update results after fixing warnings.
* js/stack-unwinding-expected.txt:
- Fix warnings by passing in strings to shouldBe().

* resources/js-test-pre.js:
(shouldBe):
(shouldNotBe):
* resources/js-test.js:
(shouldBe):
(shouldNotBe):
- Update shouldBe()/shouldNotBe() to accept anonymous function
  arguments.

* resources/standalone-pre.js:
(shouldBe):
(shouldNotBe):
(shouldNotThrow):
(shouldThrow):
- Update shouldBe()/shouldNotBe() to accept anonymous function
  arguments.
- Also fix shouldThrow()/shouldNotThrow() to accept anonymous
  function arguments (which were missed in r202609 for Bug
  159232).

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

3 years agoPerforming data interaction with plain text into a contenteditable does not insert...
wenson_hsieh@apple.com [Thu, 27 Apr 2017 21:17:59 +0000 (21:17 +0000)]
Performing data interaction with plain text into a contenteditable does not insert any content
https://bugs.webkit.org/show_bug.cgi?id=171381

Reviewed by Tim Horton.

Attempt to read plain-text-conformant UTI types as kUTTypePlainText before reading them as kUTTypeText.
This allows WebItemProviderPasteboard to properly materialize an NSString in -valuesForPasteboardType:
inItemSet: using a pre-loaded NSData blob.

This scenario is covered by DataInteractionTests.ExternalSourceUTF8PlainTextOnly, but DataInteractionTests
are temporarily disabled due to incompatibilities with the current internal SDK.

* platform/ios/PasteboardIOS.mm:
(WebCore::readPasteboardWebContentDataForType):

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

3 years agoElement.getBoundingClientRect() / getClientRects() should return a DOMRect types
cdumez@apple.com [Thu, 27 Apr 2017 21:00:50 +0000 (21:00 +0000)]
Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
https://bugs.webkit.org/show_bug.cgi?id=171226

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add baseline for web-platform-tests that is now passing and unskipped.

* web-platform-tests/cssom-view/cssom-getBoundingClientRect-002-expected.txt: Added.

Source/WebCore:

Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
as per:
- https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface

DOMRect is compatible with ClientRect, which we used to return so the risk should
be low.

Tests: fast/css/DOMRect-attributes-prototype.html
       fast/css/DOMRect-serialization.html
       fast/dom/Element/getClientRects-return-type.html

* dom/ClientRectList.cpp:
(WebCore::ClientRectList::ClientRectList):
* dom/ClientRectList.h:
(WebCore::ClientRectList::create):
* dom/DOMRect.h:
(WebCore::DOMRect::create):
* dom/DOMRectReadOnly.h:
* dom/Element.cpp:
(WebCore::toDOMRectVector):
(WebCore::Element::getClientRects):
(WebCore::Element::getBoundingClientRect):
* dom/Element.h:
* dom/Element.idl:
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox):

Source/WebKit2:

GTK build fix.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(toClientRect):
(webkit_dom_element_get_bounding_client_rect):
(webkit_dom_element_get_client_rects):

LayoutTests:

Update existing tests to reflect behavior change.

* TestExpectations:
* css3/flexbox/align-absolute-child-expected.txt:
* fast/css/ClientRect-attributes-prototype-expected.txt: Removed.
* fast/css/ClientRect-attributes-prototype.html: Removed.
* fast/css/ClientRect-serialization-expected.txt: Removed.
* fast/css/ClientRect-serialization.html: Removed.
* fast/css/DOMRect-attributes-prototype-expected.txt: Added.
* fast/css/DOMRect-attributes-prototype.html: Added.
* fast/css/DOMRect-serialization-expected.txt: Added.
* fast/css/DOMRect-serialization.html: Added.
* fast/dom/Element/getClientRects-return-type-expected.txt: Added.
* fast/dom/Element/getClientRects-return-type.html: Added.
* fast/dom/collection-iterators-expected.txt:
* fast/dom/collection-iterators.html:
* 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:
* fast/zooming/client-rect-in-fixed-zoomed.html:
* js/resources/JSON-stringify.js:

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

3 years agoRestore some caching functionality that got accidentally removed when doing Wasm...
sbarati@apple.com [Thu, 27 Apr 2017 20:58:04 +0000 (20:58 +0000)]
Restore some caching functionality that got accidentally removed when doing Wasm PIC patches
https://bugs.webkit.org/show_bug.cgi?id=171382

Reviewed by Keith Miller.

When I created Wasm::CodeBlock, I accidentally removed caching
the creation of JSWebAssemblyCodeBlocks. This patch restores it.
It's worth keeping JSWebAssemblyModule's JSWebAssemblyCodeBlock
cache because creating a JSWebAssemblyCodeBlock does non trivial
work by creating the various IC call stubs.

* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::codeBlock):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyModule.h:

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

3 years agoMark media/modern-media-controls/fullscreen-button/fullscreen-button.html as flaky.
ryanhaddad@apple.com [Thu, 27 Apr 2017 20:47:01 +0000 (20:47 +0000)]
Mark media/modern-media-controls/fullscreen-button/fullscreen-button.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171391

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoMark http/tests/security/contentSecurityPolicy/source-list-parsing-05.html as flaky.
ryanhaddad@apple.com [Thu, 27 Apr 2017 20:20:19 +0000 (20:20 +0000)]
Mark http/tests/security/contentSecurityPolicy/source-list-parsing-05.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171389

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoDisable flaky API test WKWebView.SetOverrideContentSecurityPolicyWithEmptyStringForPa...
ryanhaddad@apple.com [Thu, 27 Apr 2017 20:14:14 +0000 (20:14 +0000)]
Disable flaky API test WKWebView.SetOverrideContentSecurityPolicyWithEmptyStringForPageWithCSP.
https://bugs.webkit.org/show_bug.cgi?id=167914

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebKit2Cocoa/OverrideContentSecurityPolicy.mm:
(TEST):

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

3 years agoMark http/tests/xmlhttprequest/workers/methods.html as flaky.
ryanhaddad@apple.com [Thu, 27 Apr 2017 20:14:11 +0000 (20:14 +0000)]
Mark http/tests/xmlhttprequest/workers/methods.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170181

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoAX: Expose elements with the ARIA "feed" role
jdiggs@igalia.com [Thu, 27 Apr 2017 19:38:32 +0000 (19:38 +0000)]
AX: Expose elements with the ARIA "feed" role
https://bugs.webkit.org/show_bug.cgi?id=171184

Reviewed by Chris Fleizach.

Source/WebCore:

Map elements with the "feed" role to the internal ApplicationGroupRole
AccessibilityRole. This prevents them from being unexpectedly pruned from
the accessibility tree, and causes them to be exposed with ATK_ROLE_PANEL
in WebKitGtk and AXGroup in Safari.

No new tests needed. Instead, add the "feed" role to roles-exposed.html,
xml-roles-exposed.html, and roles-computedRoleString.html.

* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):

LayoutTests:

Add "feed" role to roles-exposed.html, xml-roles-exposed.html, and
roles-computedRoleString.html. Update expectations accordingly.

* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-computedRoleString.html:
* accessibility/roles-exposed.html:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/roles-computedRoleString-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

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

3 years agoAudit and fix incorrect uses of JSArray::tryCreateForInitializationPrivate().
mark.lam@apple.com [Thu, 27 Apr 2017 19:24:07 +0000 (19:24 +0000)]
Audit and fix incorrect uses of JSArray::tryCreateForInitializationPrivate().
https://bugs.webkit.org/show_bug.cgi?id=171344
<rdar://problem/31352667>

Reviewed by Filip Pizlo.

JSArray::tryCreateForInitializationPrivate() should only be used in performance
critical paths, and should always be used with care because it creates an
uninitialized object that needs to be initialized by its client before the object
can be released into the system.  Before the object is fully initialized:
a. the client should not re-enter the VM to execute JS code, and
b. GC should not run.

This is because until the object is fully initialized, it is an inconsistent
state that the GC and JS code will not be happy about.

In this patch, we do the following:

1. Renamed JSArray::tryCreateForInitializationPrivate() to
   JSArray::tryCreateUninitializedRestricted() because "private" is a bit ambiguous
   and can be confused with APIs that are called freely within WebKit but are
   not meant for clients of WebKit.  In this case, we intend for use of this API
   to be restricted to only a few carefully considered and crafted cases.

2. Introduce the ObjectInitializationScope RAII object which covers the period
   when the uninitialized object is created and gets initialized.

   ObjectInitializationScope will asserts that either the object is created
   fully initialized (in the case where the object structure is not an "original"
   structure) or if created uninitialized, is fully initialized at the end of
   the scope.

   If the object is created uninitialized, the ObjectInitializationScope also
   ensures that we do not GC nor re-enter the VM to execute JS code.  This is
   achieved by enabling DisallowGC and DisallowVMReentry scopes.

   tryCreateUninitializedRestricted() and initializeIndex() now requires an
   ObjectInitializationScope instance.  The ObjectInitializationScope replaces
   the VM& argument because it can be used to pass the VM& itself.  This is a
   small optimization that makes passing the ObjectInitializationScope free even
   on release builds.

3. Factored a DisallowScope out of DisallowGC, and make DisallowGC extend it.
   Introduce a DisallowVMReentry class that extends DisallowScope.

4. Fixed a bug found by the ObjectInitializationScope.  The bug is that there are
   scenarios where the structure passed to tryCreateUninitializedRestricted()
   that may not be an "original" structure.  As a result, initializeIndex() would
   end up allocating new structures, and therefore trigger a GC.

   The fix is to detect that the structure passed to tryCreateUninitializedRestricted()
   is not an "original" one, and pre-initialize the array with 0s.

   This bug was detected by existing tests. Hence, no new test needed.

5. Replaced all inappropriate uses of tryCreateUninitializedRestricted() with
   tryCreate().  Inappropriate uses here means code that is not in performance
   critical paths.

   Similarly, replaced accompanying uses of initializeIndex() with putDirectIndex().

   This patch is performance neutral (according to the JSC command line benchmarks).

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOperations.cpp:
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* heap/DeferGC.cpp:
* heap/DeferGC.h:
(JSC::DisallowGC::DisallowGC):
(JSC::DisallowGC::initialize):
(JSC::DisallowGC::scopeReentryCount):
(JSC::DisallowGC::setScopeReentryCount):
(JSC::DisallowGC::~DisallowGC): Deleted.
(JSC::DisallowGC::isGCDisallowedOnCurrentThread): Deleted.
* heap/GCDeferralContextInlines.h:
(JSC::GCDeferralContext::~GCDeferralContext):
* heap/Heap.cpp:
(JSC::Heap::collectIfNecessaryOrDefer):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createWithInlineFrame):
(JSC::ClonedArguments::createByCopyingFrom):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/DisallowScope.h: Added.
(JSC::DisallowScope::DisallowScope):
(JSC::DisallowScope::~DisallowScope):
(JSC::DisallowScope::isInEffectOnCurrentThread):
(JSC::DisallowScope::enable):
(JSC::DisallowScope::enterScope):
(JSC::DisallowScope::exitScope):
* runtime/DisallowVMReentry.cpp: Added.
* runtime/DisallowVMReentry.h: Added.
(JSC::DisallowVMReentry::DisallowVMReentry):
(JSC::DisallowVMReentry::initialize):
(JSC::DisallowVMReentry::scopeReentryCount):
(JSC::DisallowVMReentry::setScopeReentryCount):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSArray.cpp:
(JSC::JSArray::tryCreateUninitializedRestricted):
(JSC::JSArray::fastSlice):
(JSC::JSArray::tryCreateForInitializationPrivate): Deleted.
* runtime/JSArray.h:
(JSC::JSArray::tryCreateUninitializedRestricted):
(JSC::JSArray::tryCreate):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
(JSC::JSArray::tryCreateForInitializationPrivate): Deleted.
(JSC::createArrayButterfly): Deleted.
* runtime/JSCellInlines.h:
(JSC::allocateCell):
* runtime/JSObject.h:
(JSC::JSObject::initializeIndex):
(JSC::JSObject::initializeIndexWithoutBarrier):
* runtime/ObjectInitializationScope.cpp: Added.
(JSC::ObjectInitializationScope::ObjectInitializationScope):
(JSC::ObjectInitializationScope::~ObjectInitializationScope):
(JSC::ObjectInitializationScope::notifyAllocated):
(JSC::ObjectInitializationScope::verifyPropertiesAreInitialized):
* runtime/ObjectInitializationScope.h: Added.
(JSC::ObjectInitializationScope::ObjectInitializationScope):
(JSC::ObjectInitializationScope::vm):
(JSC::ObjectInitializationScope::notifyAllocated):
* runtime/Operations.h:
(JSC::isScribbledValue):
(JSC::scribble):
* runtime/RegExpMatchesArray.cpp:
(JSC::createEmptyRegExpMatchesArray):
* runtime/RegExpMatchesArray.h:
(JSC::tryCreateUninitializedRegExpMatchesArray):
(JSC::createRegExpMatchesArray):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):

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

3 years agoREGRESSION(r214572): Update fast/text/variations/advances.html to understand normaliz...
mmaxfield@apple.com [Thu, 27 Apr 2017 19:08:22 +0000 (19:08 +0000)]
REGRESSION(r214572): Update fast/text/variations/advances.html to understand normalized variation widths
https://bugs.webkit.org/show_bug.cgi?id=171356
<rdar://problem/28670085>

Reviewed by Dean Jackson.

Unspecified 'wdth' axis values are being normalized because the font is a GX font. However, this
font assumes no normalization, which means one of the comparisons in the test is bogus.

* fast/text/variations/advances-expected.txt:
* fast/text/variations/advances.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoUpdate NetworkStorageSession to support multiple persistent sessions and explicitly...
beidson@apple.com [Thu, 27 Apr 2017 18:40:05 +0000 (18:40 +0000)]
Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
https://bugs.webkit.org/show_bug.cgi?id=171365

Reviewed by Andy Estes.

Source/WebCore:

No new tests (No testable behavior change yet).

* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::destroySession):
* platform/network/NetworkStorageSession.h:

* platform/network/NetworkStorageSessionStub.cpp:
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
(WebCore::NetworkStorageSession::ensureSession):

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createCFStorageSessionForIdentifier):
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::defaultStorageSession):
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
(WebCore::NetworkStorageSession::ensureSession):
(WebCore::NetworkStorageSession::cookieStorage):

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::ensureSession):

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

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

3 years agoSkip css3/viewport-percentage-lengths/vh-auto-size.html on WK1.
antti@apple.com [Thu, 27 Apr 2017 18:11:03 +0000 (18:11 +0000)]
Skip css3/viewport-percentage-lengths/vh-auto-size.html on WK1.

Looks like use of auto-sizing leaves state behind in DRT.

* platform/mac-wk1/TestExpectations:

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

3 years agoWeb Inspector: fix tooltip wording for Reload button
bburg@apple.com [Thu, 27 Apr 2017 17:59:28 +0000 (17:59 +0000)]
Web Inspector: fix tooltip wording for Reload button
https://bugs.webkit.org/show_bug.cgi?id=171073
<rdar://problem/31378524>

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):

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

3 years agoMark media/modern-media-controls/buttons-container/buttons-container-buttons-property...
ryanhaddad@apple.com [Thu, 27 Apr 2017 17:39:35 +0000 (17:39 +0000)]
Mark media/modern-media-controls/buttons-container/buttons-container-buttons-property.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167371

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoMark webgl/1.0.2/conformance/glsl/misc/shader-with-reserved-words.html as flaky.
ryanhaddad@apple.com [Thu, 27 Apr 2017 17:32:20 +0000 (17:32 +0000)]
Mark webgl/1.0.2/conformance/glsl/misc/shader-with-reserved-words.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170877

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoUse text-shadow to visualize simple line layout coverage.
zalan@apple.com [Thu, 27 Apr 2017 17:11:38 +0000 (17:11 +0000)]
Use text-shadow to visualize simple line layout coverage.
https://bugs.webkit.org/show_bug.cgi?id=171379

Reviewed by Antti Koivisto.

Source/WebCore:

It's more subtle (for everyday use).

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::paintDebugBorders): Deleted.

LayoutTests:

* fast/inline/simple-line-layout-16bit-content-expected-mismatch.html: Added.
* fast/inline/simple-line-layout-16bit-content-expected.html: Removed.
* fast/inline/simple-line-layout-16bit-content.html:

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

3 years ago[ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG
jdiggs@igalia.com [Thu, 27 Apr 2017 17:04:23 +0000 (17:04 +0000)]
[ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG
https://bugs.webkit.org/show_bug.cgi?id=171187

Reviewed by Chris Fleizach.

Source/WebCore:

Map ApplicationAlertDialogRole to ATK_ROLE_DIALOG. While ATK_ROLE_ALERT is
appropriate as far as ATK is concerned, the Core Accessibility API Mappings
map ARIA's alertdialog role to ATK_ROLE_DIALOG. We should be consistent
with the spec. The fact that this is an alert dialog can still be obtained
via the AtkObject attributes.

No new tests needed. Update the expectations for roles-exposed.html,
xml-roles-exposed.html, and aria-mappings.html to reflect the change.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

* accessibility/aria-mappings-expected.txt: Updated.
* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.

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

3 years agoMake fast/text/complex-small-caps-non-bmp-capitalize.html more robust
mmaxfield@apple.com [Thu, 27 Apr 2017 16:55:12 +0000 (16:55 +0000)]
Make fast/text/complex-small-caps-non-bmp-capitalize.html more robust
https://bugs.webkit.org/show_bug.cgi?id=171366
<rdar://problem/30060323>

Reviewed by Alex Christensen.

This test needs a font which supports Deseret but doesn't support small caps.
Geneva is a better choice for such a font.

* fast/text/complex-small-caps-non-bmp-capitalize-expected.html:
* fast/text/complex-small-caps-non-bmp-capitalize.html:

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

3 years agoRepeated layouts in Mail due to viewport units being used with auto-sizing
antti@apple.com [Thu, 27 Apr 2017 16:51:11 +0000 (16:51 +0000)]
Repeated layouts in Mail due to viewport units being used with auto-sizing
https://bugs.webkit.org/show_bug.cgi?id=171371
<rdar://problem/28780084>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: css3/viewport-percentage-lengths/vh-auto-size.html

Auto-sizing code would adjust the size of the view in the beginning of layout(). This would
end up invalidating style for elements that use vh units and we would perform main layout
with unclean style. This would result in endless layout loops and hit assert on debug.

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

    Ensure we heve clean style after resize if we are in pre-layout.

LayoutTests:

* css3/viewport-percentage-lengths/vh-auto-size-expected.html: Added.
* css3/viewport-percentage-lengths/vh-auto-size.html: Added.

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

3 years agoAX: Inconsistent exposure of ARIA "button" role with non-false value of aria-haspopup
jdiggs@igalia.com [Thu, 27 Apr 2017 16:47:00 +0000 (16:47 +0000)]
AX: Inconsistent exposure of ARIA "button" role with non-false value of aria-haspopup
https://bugs.webkit.org/show_bug.cgi?id=171204

Reviewed by Chris Fleizach.

It turns out that this bug was fixed as a side effect of the changes made
to fix WebKitGtk bug 171164 (r215821). But we didn't realize it due to the
lack of an existing layout test covering the mappings for other platforms.
The test created for the WebKitGtk port was modified and moved to the shared
tests. Shared expectations are based on the Mac's mappings.

* accessibility/button-with-aria-haspopup-role-expected.txt: Added.
* accessibility/button-with-aria-haspopup-role.html: Renamed from LayoutTests/accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html.
* accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox-expected.txt: Removed.
* platform/gtk/accessibility/button-with-aria-haspopup-role-expected.txt: Added.

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

3 years agoModernize Frame.h
achristensen@apple.com [Thu, 27 Apr 2017 16:42:13 +0000 (16:42 +0000)]
Modernize Frame.h
https://bugs.webkit.org/show_bug.cgi?id=171357

Reviewed by Andy Estes.

Source/WebCore:

Frame.h has several std::unique_ptrs that are created in the constructor, never null,
and destroyed in the destructor.  This is what WTF::UniqueRef is for, and using UniqueRef
allows us to not check for null values because a UniqueRef can never be null.
An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor
of MainFrame, a subclass of Frame.  We added this in r199181 to fix a crash tested by
fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash
or assert in that test.

Using UniqueRef also requires const correctness, which this patch adds when necessary.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::dispatchTouchEvent):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
* editing/Editor.cpp:
(WebCore::Editor::isSelectTrailingWhitespaceEnabled):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
(WebCore::FrameSelection::copyTypingStyle):
* editing/FrameSelection.h:
(WebCore::FrameSelection::setTypingStyle):
* loader/EmptyClients.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/EditorClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint):
* page/EventHandler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::setView):
(WebCore::Frame::injectUserScripts):
* page/Frame.h:
(WebCore::Frame::editor):
(WebCore::Frame::eventHandler):
(WebCore::Frame::selection):
(WebCore::Frame::animation):
(WebCore::Frame::script):
(WebCore::Frame::eventHandlerPtr): Deleted.
* page/MainFrame.cpp:
(WebCore::MainFrame::~MainFrame):
* replay/UserInputBridge.cpp:
(WebCore::UserInputBridge::handleContextMenuEvent):
* replay/UserInputBridge.h:

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::isSelectTrailingWhitespaceEnabled):

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::isSelectTrailingWhitespaceEnabled):
* WebCoreSupport/WebEditorClient.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::contextMenuAtPointInWindow):
(WebKit::handleContextMenuEvent):
(WebKit::WebPage::isSelectTrailingWhitespaceEnabled):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::rangeForGranularityAtPoint):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):

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

3 years agoMark http/tests/local/blob/send-hybrid-blob-using-open-panel.html as flaky.
ryanhaddad@apple.com [Thu, 27 Apr 2017 16:03:52 +0000 (16:03 +0000)]
Mark http/tests/local/blob/send-hybrid-blob-using-open-panel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171353

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoFix the macOS build.
aestes@apple.com [Thu, 27 Apr 2017 15:56:47 +0000 (15:56 +0000)]
Fix the macOS build.

* platform/mac/WebPlaybackControlsManager.h:

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

3 years ago[GTK] Web Inspector: Add new GTK+ icons for instrument icons
commit-queue@webkit.org [Thu, 27 Apr 2017 15:53:35 +0000 (15:53 +0000)]
[GTK] Web Inspector: Add new GTK+ icons for instrument icons
https://bugs.webkit.org/show_bug.cgi?id=153892
<rdar://problem/24510460>

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-27
Reviewed by Joseph Pecoraro.

Add more free icons from art-libre symbolic and removed some
unused ones for the Web Inspector in GTK+.

* UserInterface/Images/gtk/Colors.png: Removed.
* UserInterface/Images/gtk/Colors@2x.png: Removed.
* UserInterface/Images/gtk/ColorsLarge.png: Removed.
* UserInterface/Images/gtk/ColorsLarge@2x.png: Removed.
* UserInterface/Images/gtk/Frames.png: Removed.
* UserInterface/Images/gtk/Frames@2x.png: Removed.
* UserInterface/Images/gtk/HeapAllocationsInstrument.svg: Added.
* UserInterface/Images/gtk/LayoutInstrument.svg: Added.
* UserInterface/Images/gtk/MemoryInstrument.svg: Added.
* UserInterface/Images/gtk/Network.png: Removed.
* UserInterface/Images/gtk/Network@2x.png: Removed.
* UserInterface/Images/gtk/NetworkInstrument.svg: Added.
* UserInterface/Images/gtk/NetworkLarge.png: Removed.
* UserInterface/Images/gtk/NetworkLarge@2x.png: Removed.
* UserInterface/Images/gtk/RenderingFramesInstrument.svg: Added.
* UserInterface/Images/gtk/Script.png: Removed.
* UserInterface/Images/gtk/Script@2x.png: Removed.
* UserInterface/Images/gtk/ScriptLarge.png: Removed.
* UserInterface/Images/gtk/ScriptLarge@2x.png: Removed.
* UserInterface/Images/gtk/ScriptsInstrument.svg: Added.
* UserInterface/Views/TimelineIcons.css:
(body:not(.mac-platform, .windows-platform) .network-icon .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .network-icon.large .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .layout-icon .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .layout-icon.large .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .script-icon .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .script-icon.large .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .rendering-frame-icon .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .memory-icon .icon): Deleted.
(body:not(.mac-platform, .windows-platform) .heap-allocations-icon .icon): Deleted.

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

3 years ago[GTK] Web Inspector: gtk/NavigationItemCurleyBraces.svg is licensed under NonCommerci...
commit-queue@webkit.org [Thu, 27 Apr 2017 15:52:12 +0000 (15:52 +0000)]
[GTK] Web Inspector: gtk/NavigationItemCurleyBraces.svg is licensed under NonCommercial CC
https://bugs.webkit.org/show_bug.cgi?id=170902

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-27
Reviewed by Michael Catanzaro.

* UserInterface/Images/gtk/NavigationItemCurleyBraces.svg:
Replaced with new one created by me.

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

3 years ago[GTK] Web Inspector: some SVG images are specified 'currentColor' incorrectly
commit-queue@webkit.org [Thu, 27 Apr 2017 15:39:34 +0000 (15:39 +0000)]
[GTK] Web Inspector: some SVG images are specified 'currentColor' incorrectly
https://bugs.webkit.org/show_bug.cgi?id=170977

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-27
Reviewed by Michael Catanzaro.

The keyword 'currentColor' is specifed manually in Bug 150602.
But, some SVG images are specified incorrectly.

* UserInterface/Images/gtk/NavigationItemTypes.svg: Do not stroke
with currentColor, but fill.
* UserInterface/Images/gtk/UpDownArrows.svg: Ditto.

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

3 years ago[WK1] Tweak the data interaction SPI to indicate whether or not a data interaction...
wenson_hsieh@apple.com [Thu, 27 Apr 2017 15:31:33 +0000 (15:31 +0000)]
[WK1] Tweak the data interaction SPI to indicate whether or not a data interaction was handled
https://bugs.webkit.org/show_bug.cgi?id=171369
<rdar://problem/31858853>

Reviewed by Dan Bernstein.

Introduce a new SPI hook intended to replace performDataInteraction:client:global:operation: that
returns whether or not the data interaction was handled. Due to the difference only in return type
and some staging constraints, this version is prefixed with "_tryTo".

* WebView/WebView.mm:
(-[WebView _tryToPerformDataInteraction:client:global:operation:]):
* WebView/WebViewPrivate.h:

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

3 years agoVersioning.
jmarcell@apple.com [Thu, 27 Apr 2017 15:28:53 +0000 (15:28 +0000)]
Versioning.

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

3 years agoFix some tests from platform-tests/cssom-view/cssom-view/
commit-queue@webkit.org [Thu, 27 Apr 2017 15:01:34 +0000 (15:01 +0000)]
Fix some tests from platform-tests/cssom-view/cssom-view/
https://bugs.webkit.org/show_bug.cgi?id=171228

Patch by Frederic Wang <fwang@igalia.com> on 2017-04-27
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Fixes for some tests are imported from the web-platform-test repository.
Expectations are updated accordingly.

* web-platform-tests/cssom-view/cssom-view/media-query-list-interface-expected.txt: Added.
* web-platform-tests/cssom-view/cssom-view/media-query-list-interface.xht:
* web-platform-tests/cssom-view/cssom-view/window-interface-expected.txt:
* web-platform-tests/cssom-view/cssom-view/window-interface.xht:

LayoutTests:

* TestExpectations: Unskip media-query-list-interface.

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

3 years ago[GTK] Remote inspector should support inspecting targets with previous version of...
carlosgc@webkit.org [Thu, 27 Apr 2017 12:28:46 +0000 (12:28 +0000)]
[GTK] Remote inspector should support inspecting targets with previous version of backend commands
https://bugs.webkit.org/show_bug.cgi?id=171267

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Rename GetTargetList DBus method as SetupInspectorClient since this method is actually called only once by
client right after connecting to the server. The method now receives the client backend commands hash as
argument and returns the contents of the backend commands file in case the hash doesn't match with the local
version.

* PlatformGTK.cmake: Add RemoteInspectorUtils to compilation.
* inspector/remote/glib/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::setupInspectorClient):
* inspector/remote/glib/RemoteInspectorServer.h:
* inspector/remote/glib/RemoteInspectorUtils.cpp: Added.
(Inspector::backendCommands):
(Inspector::backendCommandsHash):
* inspector/remote/glib/RemoteInspectorUtils.h: Added.

Source/WebInspectorUI:

Allow to use data URLs for script-src.

* UserInterface/Main.html:

Source/WebKit2:

There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when
inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector
code instead of the local copy. We are currently assuming that both ends use the same version of that file.

* UIProcess/glib/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load().
(WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to
SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands().
(WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file
conents if needed.
* UIProcess/glib/RemoteInspectorClient.h:
(WebKit::RemoteInspectorClient::backendCommandsURL):

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

3 years agoText gets cut off when bailing out of simple line layout with widows.
zalan@apple.com [Thu, 27 Apr 2017 11:02:09 +0000 (11:02 +0000)]
Text gets cut off when bailing out of simple line layout with widows.
https://bugs.webkit.org/show_bug.cgi?id=171370
<rdar://problem/31563414>

Reviewed by Antti Koivisto.

Source/WebCore:

Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows.

Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):

LayoutTests:

* fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout-expected.html: Added.
* fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html: Added.

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

3 years ago[JSC] Handle PhantomSpread in LoadVarargs as the same to the others
utatane.tea@gmail.com [Thu, 27 Apr 2017 08:59:09 +0000 (08:59 +0000)]
[JSC] Handle PhantomSpread in LoadVarargs as the same to the others
https://bugs.webkit.org/show_bug.cgi?id=171262

Reviewed by Saam Barati.

JSTests:

* stress/spread-outer-create-rest.js: Added.
(assert):
(foo):
(bar):
(baz):

Source/JavaScriptCore:

This is follow-up patch after r215720. In that patch, accidentally
we did not apply the same change to LoadVarargs in argument elimination
phase. This patch just does the same rewriting to handle PhantomSpread
correctly.

* dfg/DFGArgumentsEliminationPhase.cpp:

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

3 years agoUse the correct modern-media-controls
graouts@webkit.org [Thu, 27 Apr 2017 08:06:25 +0000 (08:06 +0000)]
Use the correct modern-media-controls
https://bugs.webkit.org/show_bug.cgi?id=171358

Reviewed by Antoine Quint.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoReverted r215774.
mitz@apple.com [Thu, 27 Apr 2017 06:21:22 +0000 (06:21 +0000)]
Reverted r215774.

It was not doing what it was intended to do and was inappropriate for WebCore.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoAdd some more testing modes for Wasm tests now that we have tier up
sbarati@apple.com [Thu, 27 Apr 2017 05:55:57 +0000 (05:55 +0000)]
Add some more testing modes for Wasm tests now that we have tier up
https://bugs.webkit.org/show_bug.cgi?id=171360

Reviewed by Keith Miller.

Lets enable the FTL on all Wasm tests. Let's also run each
test with and without CJIT.

* Scripts/run-jsc-stress-tests:

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

3 years agoUnreviewed, remove unnecessary expected result in platform/ios-wk2
cdumez@apple.com [Thu, 27 Apr 2017 05:45:10 +0000 (05:45 +0000)]
Unreviewed, remove unnecessary expected result in platform/ios-wk2

* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt: Removed.
* platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:

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

3 years agoWeb Inspector: Uint8ClampedArray should be treated like an array, not an object
commit-queue@webkit.org [Thu, 27 Apr 2017 05:12:53 +0000 (05:12 +0000)]
Web Inspector: Uint8ClampedArray should be treated like an array, not an object
https://bugs.webkit.org/show_bug.cgi?id=171364
<rdar://problem/10873037>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-26
Reviewed by Sam Weinig.

Source/JavaScriptCore:

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Treat Uint8ClampedArray (like other Typed Arrays) as an array.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* platform/mac/inspector/model/remote-object-expected.txt:
Test a Uint8ClampedArray is treated like an array.

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

3 years agoPrint Wasm function index in stack trace
sbarati@apple.com [Thu, 27 Apr 2017 03:38:12 +0000 (03:38 +0000)]
Print Wasm function index in stack trace
https://bugs.webkit.org/show_bug.cgi?id=171349

Reviewed by JF Bastien.

JSTests:

* wasm/function-tests/stack-trace.js: Added.
(import.Builder.from.string_appeared_here.assert):
(let.imp):
* wasm/function-tests/trap-after-cross-instance-call.js:
(wasmFrameCountFromError):
* wasm/function-tests/trap-load-2.js:
(wasmFrameCountFromError):
* wasm/function-tests/trap-load.js:
(wasmFrameCountFromError):

Source/JavaScriptCore:

This patch prints a Callee's index in the function index
space in Error.stack.

This will lead to stack traces that have lines of text like:
wasm function index: 4@[wasm code]

We don't ascribe indices to everything in wasm. Specifically, the
Wasm->JS call stub callee does not get a name, and neither does
the JS -> Wasm entrypoint.

* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::Frame::functionName):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::wasmFunctionIndex):
* runtime/StackFrame.cpp:
(JSC::StackFrame::functionName):
* runtime/StackFrame.h:
(JSC::StackFrame::StackFrame):
(JSC::StackFrame::wasm):
(JSC::StackFrame::hasBytecodeOffset):
(JSC::StackFrame::bytecodeOffset):
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
* wasm/WasmCallee.h:
(JSC::Wasm::Callee::create):
(JSC::Wasm::Callee::index):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):

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

3 years agoFollow up to r215843
keith_miller@apple.com [Thu, 27 Apr 2017 02:57:09 +0000 (02:57 +0000)]
Follow up to r215843
https://bugs.webkit.org/show_bug.cgi?id=171361

Reviewed by Saam Barati.

This patch fixes some style comments Saam didn't get a chance to
request before I landed: https://bugs.webkit.org/show_bug.cgi?id=170134.

It renames Wasm::CodeBlock::m_wasmEntrypoints to
m_wasmIndirectCallEntrypoints, as well as fixes some copyrights and
indentation.

* wasm/WasmBBQPlan.cpp:
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::CodeBlock):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmTierUpCount.h:
(JSC::Wasm::TierUpCount::TierUpCount):
(JSC::Wasm::TierUpCount::loopDecrement):
(JSC::Wasm::TierUpCount::functionEntryDecrement):
(JSC::Wasm::TierUpCount::shouldStartTierUp):
(JSC::Wasm::TierUpCount::count):

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

3 years agoASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender()
sbarati@apple.com [Thu, 27 Apr 2017 02:28:39 +0000 (02:28 +0000)]
ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender()
https://bugs.webkit.org/show_bug.cgi?id=170924
<rdar://problem/31721052>

Reviewed by Mark Lam.

JSTests:

* stress/error-message-for-function-base-not-found.js: Added.
(assert):
(throw.new.Error):
* stress/error-messages-for-in-operator-should-not-crash.js: Added.
(catch):

LayoutTests/imported/w3c:

* web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt:
* web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt:
* web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt:

Source/JavaScriptCore:

The error message handler for "in" was searching for the literal
string "in". However, our parser incorrectly allows escaped characters
to be part of keywords. So this is parsed as "in" in JSC: "i\u006E".
It should not be parsed that way. I opened https://bugs.webkit.org/show_bug.cgi?id=171310
to address this issue.

Regardless, the error message handlers should handle unexpected text gracefully.
All functions that try to augment error messages with the goal of
providing a more textual context for the error message should use
the original error message instead of crashing when they detect
unexpected text.

This patch also changes the already buggy code that tries to find
the base of a function call. That could would fail for code like this:
"zoo.bar("/abc\)*/");". See https://bugs.webkit.org/show_bug.cgi?id=146304
It would think that the base is "z". However, the algorithm that tries
to find the base can often tell when it fails, and when it does, it should
happily return the approximate text error message instead of thinking
that the base is "z".

* runtime/ExceptionHelpers.cpp:
(JSC::functionCallBase):
(JSC::notAFunctionSourceAppender):
(JSC::invalidParameterInSourceAppender):

LayoutTests:

* js/let-syntax-expected.txt:

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

3 years agoAttempt to fix a PLT regression.
said@apple.com [Thu, 27 Apr 2017 01:26:08 +0000 (01:26 +0000)]
Attempt to fix a PLT regression.
<rdar://problem/31826998>

Unreviewed.

Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
on iOS for now.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder):

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

3 years ago[ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_CO...
jdiggs@igalia.com [Thu, 27 Apr 2017 01:17:01 +0000 (01:17 +0000)]
[ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_COMBO_BOX
https://bugs.webkit.org/show_bug.cgi?id=171182

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html

WebCore Accessibility assigns PopUpButtonRole to collapsed select elements,
which the ATK code correctly maps to ATK_ROLE_COMBO_BOX. It turns out that
WebCore Accessibility also maps the ARIA button role to PopUpButtonRole if
it also has aria-haspopup. Add a check to atkRole() so that the latter case
is mapped to ATK_ROLE_PUSH_BUTTON.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

* accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox-expected.txt: Added.
* accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html: Added.

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

3 years agoShould not drag x-apple-data-detectors links
timothy_horton@apple.com [Thu, 27 Apr 2017 01:03:14 +0000 (01:03 +0000)]
Should not drag x-apple-data-detectors links
https://bugs.webkit.org/show_bug.cgi?id=171352
<rdar://problem/31309081>

Reviewed by Beth Dakin.

Test: fast/events/do-not-drag-and-drop-data-detectors-link.html

These links are only meaningful in the context of the original document,
so they should not be draggable.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::dataDetectorURLProtocol):
(WebCore::DataDetection::isDataDetectorURL):
* page/DragController.cpp:
(WebCore::isDraggableLink):
Disallow dragging of <a href="x-apple-data-detectors://..."> links.

* fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt: Added.
* fast/events/do-not-drag-and-drop-data-detectors-link.html: Added.

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

3 years agoRevert accidentally smushed commit.
timothy_horton@apple.com [Thu, 27 Apr 2017 01:01:57 +0000 (01:01 +0000)]
Revert accidentally smushed commit.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::dataDetectorURLProtocol): Deleted.
(WebCore::DataDetection::isDataDetectorURL): Deleted.
* page/DragController.cpp:
(WebCore::isDraggableLink):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):

* TestExpectations:
* fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt: Removed.
* fast/events/do-not-drag-and-drop-data-detectors-link.html: Removed.
* platform/mac/TestExpectations:

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

3 years agoShould not drag x-apple-data-detectors links
timothy_horton@apple.com [Thu, 27 Apr 2017 00:53:23 +0000 (00:53 +0000)]
Should not drag x-apple-data-detectors links
https://bugs.webkit.org/show_bug.cgi?id=171352
<rdar://problem/31309081>

Reviewed by Beth Dakin.

Test: fast/events/do-not-drag-and-drop-data-detectors-link.html

These links are only meaningful in the context of the original document,
so they should not be draggable.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::dataDetectorURLProtocol):
(WebCore::DataDetection::isDataDetectorURL):
* page/DragController.cpp:
(WebCore::isDraggableLink):
Disallow dragging of <a href="x-apple-data-detectors://..."> links.

* fast/events/do-not-drag-and-drop-data-detectors-link-expected.txt: Added.
* fast/events/do-not-drag-and-drop-data-detectors-link.html: Added.

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

3 years agoJSC EWS Patch Relevance skips few JSC scripts
aakash_jain@apple.com [Thu, 27 Apr 2017 00:15:13 +0000 (00:15 +0000)]
JSC EWS Patch Relevance skips few JSC scripts
https://bugs.webkit.org/show_bug.cgi?id=171351

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/steps/checkpatchrelevance.py:
(CheckPatchRelevance): Added few jsc related scripts.

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

3 years agoREGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests
achristensen@apple.com [Thu, 27 Apr 2017 00:12:02 +0000 (00:12 +0000)]
REGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests
https://bugs.webkit.org/show_bug.cgi?id=171340

Reviewed by Brady Eidson.

This fixes a flaky assertion in webarchive/loading/missing-data.html

* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::append):
If there's no CFDataRef, there's no need to append data.
This happens sometimes.

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

3 years agoWebAssembly: Implement tier up
keith_miller@apple.com [Wed, 26 Apr 2017 23:55:05 +0000 (23:55 +0000)]
WebAssembly: Implement tier up
https://bugs.webkit.org/show_bug.cgi?id=170134

Reviewed by Filip Pizlo.

JSTests:

* wasm/function-tests/trap-after-cross-instance-call.js:
* wasm/tier-up/js-to-wasm.js: Added.
(async.test):
* wasm/tier-up/wasm-to-wasm.js: Added.
(async.test):

Source/JavaScriptCore:

This patch implements tier up for wasm functions. Unlike with JS
code, wasm code needs to be able to tier up concurrently with the
running code.  Since JS code is synchronous we can always link on
the running thread, wasm, however, can run the same code on more
than one thread. In order to make patching work correctly, we need
to ensure that all patches of callsites are aligned. On ARM we get
this for free since every call is a near call. On X86 we ensure
that the 32-bit relative offset is 32-bit aligned.

This patch also modifies how Wasm::Plan works. Now Plan is a
abstract super class and there are two subclasses, which
correspond to the different tiers of our wasm engine.  The first,
Build Bytecode Quickly (BBQ) tier, roughly does what the old plan
code did before.  The new tier, Optimized Machine code Generation
(OMG), can be called at any point by BBQ code and compiles exactly
one function. Once an OMGPlan finishes it will link it's code
internally then reset the instruction cache of all running wasm
threads, via, a ThreadMessage. Once the instruction caches have
been reset all the other functions will be patched to call the new
code.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::ensureCacheLineSpace):
* assembler/CodeLocation.h:
(JSC::CodeLocationThreadSafeNearCall::CodeLocationThreadSafeNearCall):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::threadSafePatchableNearCall):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::threadSafeNearCall):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::threadSafePatchableNearCall):
* b3/air/AirEmitShuffle.cpp:
(JSC::B3::Air::ShufflePair::inst):
(JSC::B3::Air::ShufflePair::opcode): Deleted.
* b3/air/AirEmitShuffle.h:
* jsc.cpp:
(functionTestWasmModuleFunctions):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
* runtime/Options.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::materializeWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::constant):
(JSC::Wasm::B3IRGenerator::emitTierUpCheck):
(JSC::Wasm::B3IRGenerator::addLoop):
(JSC::Wasm::B3IRGenerator::addTopLevel):
(JSC::Wasm::B3IRGenerator::addBlock):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp: Copied from Source/JavaScriptCore/wasm/WasmPlan.cpp.
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::stateString):
(JSC::Wasm::BBQPlan::moveToState):
(JSC::Wasm::BBQPlan::parseAndValidateModule):
(JSC::Wasm::BBQPlan::prepare):
(JSC::Wasm::BBQPlan::ThreadCountHolder::ThreadCountHolder):
(JSC::Wasm::BBQPlan::ThreadCountHolder::~ThreadCountHolder):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
(JSC::Wasm::BBQPlan::work):
* wasm/WasmBBQPlan.h: Copied from Source/JavaScriptCore/wasm/WasmPlan.h.
* wasm/WasmBBQPlanInlines.h: Copied from Source/JavaScriptCore/wasm/WasmPlanInlines.h.
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmCallee.h:
(JSC::Wasm::Callee::entrypoint):
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::CodeBlock):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::tierUpCount):
(JSC::Wasm::CodeBlock::mode):
* wasm/WasmFormat.h:
(JSC::Wasm::CallableFunction::CallableFunction):
(JSC::Wasm::CallableFunction::offsetOfWasmEntrypointLoadLocation):
* wasm/WasmMachineThreads.cpp: Copied from Source/JavaScriptCore/wasm/WasmPlanInlines.h.
(JSC::Wasm::wasmThreads):
(JSC::Wasm::startTrackingCurrentThread):
(JSC::Wasm::resetInstructionCacheOnAllThreads):
* wasm/WasmMachineThreads.h: Copied from Source/JavaScriptCore/wasm/WasmCallee.h.
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationResult):
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
* wasm/WasmModule.h:
(JSC::Wasm::Module::codeBlockFor):
* wasm/WasmOMGPlan.cpp: Added.
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::work):
(JSC::Wasm::runOMGPlanForIndex):
* wasm/WasmOMGPlan.h: Copied from Source/JavaScriptCore/wasm/WasmPlanInlines.h.
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::runCompletionTasks):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::waitForCompletion):
(JSC::Wasm::Plan::tryRemoveVMAndCancelIfLast):
(JSC::Wasm::Plan::fail):
(JSC::Wasm::Plan::stateString): Deleted.
(JSC::Wasm::Plan::moveToState): Deleted.
(JSC::Wasm::Plan::parseAndValidateModule): Deleted.
(JSC::Wasm::Plan::prepare): Deleted.
(JSC::Wasm::Plan::ThreadCountHolder::ThreadCountHolder): Deleted.
(JSC::Wasm::Plan::ThreadCountHolder::~ThreadCountHolder): Deleted.
(JSC::Wasm::Plan::compileFunctions): Deleted.
(JSC::Wasm::Plan::complete): Deleted.
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::exports): Deleted.
(JSC::Wasm::Plan::internalFunctionCount): Deleted.
(JSC::Wasm::Plan::takeModuleInformation): Deleted.
(JSC::Wasm::Plan::takeCallLinkInfos): Deleted.
(JSC::Wasm::Plan::takeWasmToWasmExitStubs): Deleted.
(JSC::Wasm::Plan::hasWork): Deleted.
(JSC::Wasm::Plan::hasBeenPrepared): Deleted.
* wasm/WasmTierUpCount.h: Renamed from Source/JavaScriptCore/wasm/WasmPlanInlines.h.
(JSC::Wasm::TierUpCount::TierUpCount):
(JSC::Wasm::TierUpCount::loopDecrement):
(JSC::Wasm::TierUpCount::functionEntryDecrement):
(JSC::Wasm::TierUpCount::shouldStartTierUp):
(JSC::Wasm::TierUpCount::count):
* wasm/WasmWorklist.cpp:
* wasm/WasmWorklist.h:
(JSC::Wasm::Worklist::nextTicket):
* wasm/js/JSWebAssemblyCodeBlock.cpp:
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace):
(JSC::JSWebAssemblyCodeBlock::wasmToJsCallStubForImport):
(JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted.
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::WebAssemblyFunction):
* wasm/js/WebAssemblyFunction.h:
(JSC::WebAssemblyFunction::signatureIndex):
(JSC::WebAssemblyFunction::wasmEntrypointLoadLocation):
(JSC::WebAssemblyFunction::callableFunction):
(JSC::WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation):
(JSC::WebAssemblyFunction::wasmEntrypoint): Deleted.
(JSC::WebAssemblyFunction::offsetOfWasmEntrypoint): Deleted.
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::WebAssemblyWrapperFunction):
(JSC::WebAssemblyWrapperFunction::create):
* wasm/js/WebAssemblyWrapperFunction.h:
(JSC::WebAssemblyWrapperFunction::signatureIndex):
(JSC::WebAssemblyWrapperFunction::wasmEntrypointLoadLocation):
(JSC::WebAssemblyWrapperFunction::callableFunction):
(JSC::WebAssemblyWrapperFunction::wasmEntrypoint): Deleted.

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

3 years agoUnreviewed, rolling out r215814.
ryanhaddad@apple.com [Wed, 26 Apr 2017 23:52:19 +0000 (23:52 +0000)]
Unreviewed, rolling out r215814.

The LayoutTest for this change is failing on ios-simulator and
is flaky on macOS.

Reverted changeset:

"Response.blob() does not set the content-type based on the
header value."
https://bugs.webkit.org/show_bug.cgi?id=170849
http://trac.webkit.org/changeset/215814

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

3 years agoTest importer should delete obsolete files based on w3c-import.log
commit-queue@webkit.org [Wed, 26 Apr 2017 23:48:00 +0000 (23:48 +0000)]
Test importer should delete obsolete files based on w3c-import.log
https://bugs.webkit.org/show_bug.cgi?id=171348

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-26
Reviewed by Chris Dumez.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.do_import): Removing dangling -expected.txt files in regular import mode.
(TestImporter.remove_deleted_files): Fixing according w3c-import.log current format.
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(test_remove_obsolete_content):

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

3 years agoWebItemProviderPasteboard should not synchronously load provided data
wenson_hsieh@apple.com [Wed, 26 Apr 2017 23:33:34 +0000 (23:33 +0000)]
WebItemProviderPasteboard should not synchronously load provided data
https://bugs.webkit.org/show_bug.cgi?id=171341
<rdar://problem/31614010>

Reviewed by Tim Horton.

Source/WebCore:

Refactors WebItemProviderPasteboard to not require asynchronously loading item provider data. To accomplish this,
we ensure that before performing data interaction, the UTI type that the data operation target should consume is
propagated to the UI process prior to the web process receiving the signal from the UI process to begin the
data operation itself. This information is sent via WebPlatformStrategies::updatePreferredTypeIdentifiers, a new
pasteboard helper function.

* page/DragController.cpp:
(WebCore::DragController::DragController):
(WebCore::dragIsHandledByDocument):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
(WebCore::DragController::tryDocumentDrag):

Give DragHandlingMethod a richer representation of what type of action will be performed. DragController::
updatePreferredTypeIdentifiersForDragHandlingMethod uses this to determine what kinds of UTIs are acceptable for
the current drop session.

* page/DragController.h:
(WebCore::DragController::documentIsHandlingNonDefaultDrag):
* page/mac/DragControllerMac.mm:
(WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):

Updates the data interaction pasteboard's list of preferred type identifiers it should load upon data operation.

* platform/DragData.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers):
* platform/ios/WebItemProviderPasteboard.mm:

Introduce _preferredTypeIdentifiers, which -doAfterLoadingProvidedContentIntoFileURLs: uses as a hint when
determining which UTI to load for an item provider. In the absence of preferred type identifiers, the default
behavior is to use the highest fidelity type adhering to "public.content".

(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

Remove calls to -createObjectOfClass: and -copyDataRepresentation:. Instead, rely solely on the loaded file URL
to read and initialize data and objects from the pasteboard.

(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
(-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): Deleted.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::updatePreferredTypeIdentifiers):

Source/WebKit/mac:

Adds client-layer plumbing for updatePreferredTypeIdentifiers. See WebCore ChangeLog for more details.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::updatePreferredTypeIdentifiers):

Source/WebKit2:

Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to
signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more
details.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers):
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

3 years agoRe-baseline inspector/dom/getAccessibilityPropertiesForNode.html after r215821
ryanhaddad@apple.com [Wed, 26 Apr 2017 23:33:05 +0000 (23:33 +0000)]
Re-baseline inspector/dom/getAccessibilityPropertiesForNode.html after r215821
https://bugs.webkit.org/show_bug.cgi?id=171346

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-04-26

* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

3 years agoREGRESSION (r213926): We're sometimes trying to start WebKitTestRunner without proper...
jbedard@apple.com [Wed, 26 Apr 2017 23:28:38 +0000 (23:28 +0000)]
REGRESSION (r213926): We're sometimes trying to start WebKitTestRunner without proper DYLD variables
<rdar://problem/31816459>

Unreviewed infrastructure fix.

Some of our iOS Simulator bots are slow and will register crashes due to an incorrect
DYLD_FRAMEWORK_PATH when installing an app.

* Scripts/webkitpy/port/ios.py:
(IOSPort.setup_test_run): Pass DYLD_FRAMEWORK_PATH to app on install.

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

3 years ago[ATK] Elements with a defined, non-false value for aria-current should expose ATK_STA...
jdiggs@igalia.com [Wed, 26 Apr 2017 23:26:49 +0000 (23:26 +0000)]
[ATK] Elements with a defined, non-false value for aria-current should expose ATK_STATE_ACTIVE
https://bugs.webkit.org/show_bug.cgi?id=171163

Reviewed by Chris Fleizach.

Source/WebCore:

Add ATK_STATE_ACTIVE to the state set of elements which have a valid, non-false
value for aria-current, expose the value of via the "current" AtkObject attribute,
and emit state-change notifications when the value of aria-current changes from
non-false to false, or vice versa.

Tests: accessibility/gtk/aria-current-changed-notification.html
       accessibility/gtk/aria-current.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleAttributeChanged):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIACurrent):
(WebCore::AccessibilityObject::ariaCurrentValue):
* accessibility/AccessibilityObject.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Moved code returning
string value for aria-current into AccessibilityObject:ariaCurrentValue().

Tools:

Add support for state-change notifications for ATK_STATE_ACTIVE.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:

LayoutTests:

* accessibility/gtk/aria-current-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-current-changed-notification.html: Added.
* accessibility/gtk/aria-current-expected.txt: Added.
* accessibility/gtk/aria-current.html: Added.

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

3 years agoUnauthenticated CORS preflight requests should not use client certificates
commit-queue@webkit.org [Wed, 26 Apr 2017 23:11:21 +0000 (23:11 +0000)]
Unauthenticated CORS preflight requests should not use client certificates
https://bugs.webkit.org/show_bug.cgi?id=171298

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-26
Reviewed by Alex Christensen.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials.

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

3 years agoWebItemProviderPasteboard should fetch preloaded assets from disk when possible
wenson_hsieh@apple.com [Wed, 26 Apr 2017 23:09:40 +0000 (23:09 +0000)]
WebItemProviderPasteboard should fetch preloaded assets from disk when possible
https://bugs.webkit.org/show_bug.cgi?id=171320
<rdar://problem/31614010>

Reviewed by Tim Horton.

Adds a mechanism to WebItemProviderPasteboard to remember the temporary file URLs of assets it has loaded using
doAfterLoadingProvidedContentIntoFileURLs:. When retrieving data from the pasteboard, we then see if we can
first fetch serialized data straight from disk instead of having to go through the item provider in both
-dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:.

See below annotations for more detail.

* platform/ios/AbstractPasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::filenamesForDataInteraction):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:

Introduces _typeToFileURLMaps, an array of dictionaries. A dictionary at the ith index of this array represents
a mapping of UTIs to loaded temo file URLs for the ith UIItemProvider in the _itemProviders array. Before data
interaction is performed, all entries in this array will be empty.

(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

Consult any loaded assets on disk before hitting UIItemProviders via the new
-_preLoadedDataConformingToType:forItemProviderAtIndex: helper method.

(-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]):
(-[WebItemProviderPasteboard fileURLsForDataInteraction]):

Traverse _typeToFileURLMaps to collect all file URLs.

(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

Refactored to populate and set _typeToFileURLMaps when loading completes, rather than an array of file URLs.

(-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): Deleted.
(-[WebItemProviderPasteboard filenamesForDataInteraction]): Deleted.

Correct an erroneously named method (replaces filenames with fileURLs).

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

3 years agoThe current page is given a muted state when starting a media stream on iOS.
eric.carlson@apple.com [Wed, 26 Apr 2017 22:36:25 +0000 (22:36 +0000)]
The current page is given a muted state when starting a media stream on iOS.
https://bugs.webkit.org/show_bug.cgi?id=171290
<rdar://problem/31821427>

Reviewed by Jer Noble.

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current
page on iOS either, that will prevent the new media stream from playing.

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

3 years agoLayoutTest webrtc/datachannel/bufferedAmountLowThreshold.html is a flaky failure
commit-queue@webkit.org [Wed, 26 Apr 2017 22:04:24 +0000 (22:04 +0000)]
LayoutTest webrtc/datachannel/bufferedAmountLowThreshold.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170701

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-26
Reviewed by Eric Carlson.

* platform/mac-wk1/TestExpectations: Removing flaky expectation.
* webrtc/datachannel/bufferedAmountLowThreshold-expected.txt:
* webrtc/datachannel/bufferedAmountLowThreshold.html:

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

3 years agoLayoutTest webrtc/datachannel/basic.html is a flaky crash
commit-queue@webkit.org [Wed, 26 Apr 2017 22:01:02 +0000 (22:01 +0000)]
LayoutTest webrtc/datachannel/basic.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=170154
<rdar://problem/31288423>

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-26
Reviewed by Geoffrey Garen.

Before the patch, we are setting the channel handler client to null and then unregistering from observer to
libwebrtc data channel. Since this happens in two different threads, there might be a timing issue.

Removing this risk by first unregistering (done synchronously on the other thread), before setting client to null.
Made some clean-up related refactoring.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::close):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::setClient):
(WebCore::LibWebRTCDataChannelHandler::close):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* platform/mediastream/RTCDataChannelHandler.h:
* platform/mock/RTCDataChannelHandlerMock.cpp:
(WebCore::RTCDataChannelHandlerMock::setClient):
* platform/mock/RTCDataChannelHandlerMock.h:

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

3 years agoMake user script injection more robust
commit-queue@webkit.org [Wed, 26 Apr 2017 21:40:49 +0000 (21:40 +0000)]
Make user script injection more robust
https://bugs.webkit.org/show_bug.cgi?id=171339
<rdar://problem/30643691>

Patch by Alex Christensen <achristensen@webkit.org> on 2017-04-26
Reviewed by Geoffrey Garen.

Source/WebCore:

* loader/EmptyClients.cpp:
* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
* page/UserContentController.cpp:
(WebCore::UserContentController::forEachUserScript):
(WebCore::UserContentController::forEachUserStyleSheet):
(WebCore::UserContentController::forEachUserMessageHandler):
* page/UserContentController.h:
* page/UserContentProvider.h:

Source/WebKit2:

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::forEachUserScript):
(WebKit::WebUserContentController::forEachUserStyleSheet):
(WebKit::WebUserContentController::forEachUserMessageHandler):
* WebProcess/UserContent/WebUserContentController.h:

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

3 years agoRTL: recent searches popover is displayed in incorrect location
zalan@apple.com [Wed, 26 Apr 2017 20:52:15 +0000 (20:52 +0000)]
RTL: recent searches popover is displayed in incorrect location
https://bugs.webkit.org/show_bug.cgi?id=171338
<rdar://problem/31377807>

Reviewed by Dean Jackson.

Source/WebCore:

Compute the absolute coordinates for the popup the same way we do for the select dropdown.

* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::showPopup):

Source/WebKit/mac:

Add RTL support for the pop-under branch.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):

Source/WebKit2:

Add RTL support for the pop-under branch.

* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):

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

3 years agoRestrict WebKit image formats to a known whitelist
commit-queue@webkit.org [Wed, 26 Apr 2017 20:35:07 +0000 (20:35 +0000)]
Restrict WebKit image formats to a known whitelist
https://bugs.webkit.org/show_bug.cgi?id=170700

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-04-26
Reviewed by Tim Horton.

Source/WebCore:

If the image format is not supported, the load should be canceled and the
image is marked a broken image.

Test: fast/images/image-formats-support.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer):
(WebCore::CachedImage::setImageDataBuffer):
(WebCore::CachedImage::finishLoading):
* loader/cache/CachedImage.h:

LayoutTests:

* fast/images/image-formats-support-expected.txt: Added.
* fast/images/image-formats-support.html: Added.
* fast/images/resources/100x100-red-psd-renamed.png: Added.
* fast/images/resources/100x100-red-tga-renamed.png: Added.
* fast/images/resources/100x100-red.psd: Added.
* fast/images/resources/100x100-red.tga: Added.

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

3 years agowebkitpy: Teardown iOS Simulators on exit if managed Simulators are still running
jbedard@apple.com [Wed, 26 Apr 2017 20:23:32 +0000 (20:23 +0000)]
webkitpy: Teardown iOS Simulators on exit if managed Simulators are still running
https://bugs.webkit.org/show_bug.cgi?id=171293

Reviewed by Aakash Jain.

We should make an effort to teardown simulators which we booted even when an exception is
thrown while booting. Make some IOSSimulatorPort functions into static methods and register
one of these functions to be run at exit to ensure any devices webkitpy is managing gets
torn down.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run): Rely on exit handlers to teardown, not exceptions.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._teardown_managed_simulators): Function run on exit which will kill all
iOS simulators and teardown and managed devices.
(IOSSimulatorPort._create_simulators): Register teardown function.
(IOSSimulatorPort.clean_up_test_run): Move device teardown to _teardown_managed_simulators.
(IOSSimulatorPort._remove_device): Deleted.

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

3 years agoMark swipe/main-frame-pinning-requirement.html as a flaky failure on mac-wk2.
commit-queue@webkit.org [Wed, 26 Apr 2017 20:09:42 +0000 (20:09 +0000)]
Mark swipe/main-frame-pinning-requirement.html as a flaky failure on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=170484

Patch by Matt Lewis <jlewis3@apple.com> on 2017-04-26
Reviewed by Alexey Proskuryakov.

* platform/mac-wk2/TestExpectations:

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

3 years agoRe-sync html/browsers/the-window-object web-platform-tests from upstream
cdumez@apple.com [Wed, 26 Apr 2017 19:38:56 +0000 (19:38 +0000)]
Re-sync html/browsers/the-window-object web-platform-tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=171313

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/common/PrefixedPostMessage.js: Added.
(PrefixedMessage):
(PrefixedMessage.prototype.url):
(PrefixedMessage.prototype.onMessage):
(PrefixedMessageTest):
(PrefixedMessageResource):
(PrefixedMessageResource.prototype.postToOpener):
* web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-innerwidth-innerheight-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-innerwidth-innerheight.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-screenx-screeny-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-screenx-screeny.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-top-left-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-top-left.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-width-height-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-width-height.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerwidth-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerwidth.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-left-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-left.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screenx-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screenx.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-top-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-top.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-width-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-width.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-screenx-screeny-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-screenx-screeny.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-top-left-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-top-left.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/resources/message-opener.html: Added.
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/resources/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/named-access-on-the-window-object/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/security-window/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/support/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html:

LayoutTests:

* tests-options.json:

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

3 years ago[ATK] Implement support for new ARIA 1.1 values of aria-haspopup
jdiggs@igalia.com [Wed, 26 Apr 2017 19:30:08 +0000 (19:30 +0000)]
[ATK] Implement support for new ARIA 1.1 values of aria-haspopup
https://bugs.webkit.org/show_bug.cgi?id=171164

Reviewed by Chris Fleizach.

Source/WebCore:

In ARIA 1.1, aria-haspopup's value type changed from true/false to a token.
Values: true, false (default, unless it's a combobox), dialog, grid, listbox
(default for combobox), menu, and tree. Any value of aria-haspopup that is
not included in the list of allowed values, including an empty string, must
be treated as if the value false had been provided.

Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit
values, and give platform assistive technologies a means to access that value.

If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP
in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop"
AtkObject attribute.

Test: accessibility/gtk/aria-haspopup.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::ariaPopupValue):
(WebCore::AccessibilityObject::supportsARIAHasPopup):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::ariaHasPopup):
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):

Tools:

hasPopup() should return whether or not ATK_STATE_HAS_POPUP is in the
AtkStateSet; not what is found in the AtkObject's attributes.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::hasPopup):

LayoutTests:

In addition to the new test, update xml-roles-exposed.html's expectations
because the implicit value of aria-haspopup for the combobox role is now
listbox, and that value should be exposed via an AtkObject attribute.

* accessibility/gtk/aria-haspopup-expected.txt: Added.
* accessibility/gtk/aria-haspopup.html: Added.
* accessibility/gtk/xml-roles-exposed-expected.txt:

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

3 years agohttp/tests/frame-throttling tests failing on iOS
simon.fraser@apple.com [Wed, 26 Apr 2017 19:03:46 +0000 (19:03 +0000)]
http/tests/frame-throttling tests failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=171314
rdar://problem/31691134

Reviewed by Chris Dumez.

The tests use UIHelper.activateAt(), which in DumpRenderTree dispatches mouse events via EventSender, and in iOS WK2 uses
UIScriptController to dispatch touch events. The former just use standard hit testing, which works fine.
The latter go via Frame::qualifyingNodeAtViewportLocation(), which calls ancestorRespondingToClickEvents()
and does area hit testing, and this fails to find anything clickable inside the <iframe>s.

Fix by putting a div with an onlick handler inside the iframes, and adjusting the click
locations.

* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html:
* http/tests/frame-throttling/resources/requestAnimationFrame-frame.html:
* http/tests/frame-throttling/resources/timer-throttling-frame.html:
* http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html:

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

3 years agoFix CMake build.
achristensen@apple.com [Wed, 26 Apr 2017 19:01:58 +0000 (19:01 +0000)]
Fix CMake build.

* PlatformMac.cmake:

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

3 years agoLocklessBag needs a destructor
keith_miller@apple.com [Wed, 26 Apr 2017 18:46:52 +0000 (18:46 +0000)]
LocklessBag needs a destructor
https://bugs.webkit.org/show_bug.cgi?id=171334

Reviewed by Mark Lam.

Currently, if the bag is destructed any remaining nodes in the bag will
be leaked.

* wtf/LocklessBag.h:
(WTF::LocklessBag::consumeAll):
(WTF::LocklessBag::~LocklessBag):
* wtf/threads/Signals.cpp:
(WTF::jscSignalHandler):
(WTF::installSignalHandler):

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

3 years ago[ARM] Enable GCC visibility
commit-queue@webkit.org [Wed, 26 Apr 2017 18:28:01 +0000 (18:28 +0000)]
[ARM] Enable GCC visibility
https://bugs.webkit.org/show_bug.cgi?id=171296

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-04-26
Reviewed by Michael Catanzaro.

* wtf/Platform.h:

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

3 years agoEnable expired-only reload policy on Mac and iOS
antti@apple.com [Wed, 26 Apr 2017 18:22:27 +0000 (18:22 +0000)]
Enable expired-only reload policy on Mac and iOS
https://bugs.webkit.org/show_bug.cgi?id=171264
<rdar://problem/31807637>

Reviewed by Andreas Kling.

Source/WebCore:

Limit the behavior to http and data URLs (where we explicitly know about expiration).

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy):

    Pass the URL so we can test for protocol.

* loader/FrameLoader.h:
* loader/NavigationAction.cpp:
(WebCore::navigationType):

    Test for reload navigation type correctly.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::cachePolicy):
* loader/cache/CachedResourceLoader.h:

Source/WebKit2:

Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
The behavor is enabled in Safari and for other clients based on SDK version check.

* UIProcess/API/C/WKPage.cpp:
(WKPageReload):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView reload]):
* UIProcess/Cocoa/VersionChecks.h:

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

3 years agoResponse.blob() does not set the content-type based on the header value.
commit-queue@webkit.org [Wed, 26 Apr 2017 18:14:41 +0000 (18:14 +0000)]
Response.blob() does not set the content-type based on the header value.
https://bugs.webkit.org/show_bug.cgi?id=170849

Patch by WebKit Contributor <webkitcontrib@gmail.com> on 2017-04-26
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-consume-expected.txt:

Source/WebCore:

The Fetch API specification requires setting the blob contentType
using the Content-Type header value, if present.  Previously the
FetchResponse class only called updateContentType() when first
created even though all the headers were not available.  Call
updateContentType() again after the headers are populated.

This change allows WebKit to pass the "Consume response's body: from
fetch to blob" case in the WPT response-consume.html test.

Test: http://w3c-test.org/fetch/api/response/response-consume.html

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
call FetchBodyOwner::updateContentType() after filling m_headers.

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

3 years agoRemoving Flaky timeout expectation for swipe/main-frame-pinning-requirement.html.
commit-queue@webkit.org [Wed, 26 Apr 2017 18:11:27 +0000 (18:11 +0000)]
Removing Flaky timeout expectation for swipe/main-frame-pinning-requirement.html.
https://bugs.webkit.org/show_bug.cgi?id=161887

Patch by Matt Lewis <jlewis3@apple.com> on 2017-04-26
Reviewed by Tim Horton.

* platform/mac-wk2/TestExpectations:

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

3 years agoTry to fix the macOS Sierra build.
aestes@apple.com [Wed, 26 Apr 2017 18:03:25 +0000 (18:03 +0000)]
Try to fix the macOS Sierra build.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:

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

3 years ago[macOS] Add picture-in-picture support to WebPlaybackControlsManager
aestes@apple.com [Wed, 26 Apr 2017 17:51:51 +0000 (17:51 +0000)]
[macOS] Add picture-in-picture support to WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=171328
<rdar://problem/29875010>

Reviewed by Jer Noble.

Source/WebCore:

* platform/cocoa/WebPlaybackSessionModel.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::togglePictureInPicture): If the media element
is currently in PiP fullscreen mode, exit fullscreen. Otherwise, enter PiP fullscreen mode.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager canTogglePictureInPicture]): Added. Returns YES if
-allowsPictureInPicturePlayback returns YES.
(-[WebPlaybackControlsManager togglePictureInPicture]): Added. Calls
WebPlaybackSessionModel::togglePictureInPicture().
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Added a call to
-[WebPlaybackControlsManager setPictureInPictureActive:YES].
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Added a call to
-[WebPlaybackControlsManager setPictureInPictureActive:NO].
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Ditto.
* platform/spi/cocoa/AVKitSPI.h: Declared new SPI on AVTouchBarPlaybackControlsControlling.

Source/WebKit2:

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls
WebPlaybackSessionManagerProxy::togglePictureAndPicture().
(WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends
TogglePictureInPicture to WebPlaybackSessionManager.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateMediaTouchBar): Called
-[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if
WebPreferences::allowsPictureInPictureMediaPlayback() is true.
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a
UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture().

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

3 years ago[JSC] fix RETURN_IF_EXCEPTION() placement in ownPropertyKeys()
caitp@igalia.com [Wed, 26 Apr 2017 17:41:18 +0000 (17:41 +0000)]
[JSC] fix RETURN_IF_EXCEPTION() placement in ownPropertyKeys()
https://bugs.webkit.org/show_bug.cgi?id=171330

Reviewed by Mark Lam.

Ensure RETURN_IF_EXCEPTION() following invokation of the
filterPropertyIfNeeded() lambda.

* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):

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

3 years ago[Color] Make gradients work with ExtendedColors
dino@apple.com [Wed, 26 Apr 2017 17:34:50 +0000 (17:34 +0000)]
[Color] Make gradients work with ExtendedColors
https://bugs.webkit.org/show_bug.cgi?id=171315
<rdar://problems/31830177>

Reviewed by Antoine Quint.

Source/WebCore:

Allow gradients to hold Color objects, and thus
handle ExtendedColor. Implement the backend for
CoreGraphics.

Test: css3/color/gradients.html

* platform/graphics/Gradient.cpp:
(WebCore::Gradient::addColorStop): Just copy the Color now.
(WebCore::compareStops): Handle rename of stop to offset.
(WebCore::Gradient::hasAlpha): Use Color's helper.
* platform/graphics/Gradient.h:
(WebCore::Gradient::ColorStop::ColorStop): Rename stop
to offset, and store a Color rather than four floating
point values.
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::platformGradient):
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformGradient): Use the CG method
that can handle CGColorRefs with ColorSpace values, and
pass the Extended sRGB space which should be no change for
all existing gradients but also handle ColorSpaces like
Display P3.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::buildStops):

LayoutTests:

Test for gradients using the color() syntax. Unfortunately,
due to rounding errors, we can't use a ref test for some
transparent colors, so comment them out for the moment.
These can be re-enabled when we can specify a tolerance
value for image comparison in the testing framework.

* css3/color/gradients-expected.html: Added.
* css3/color/gradients.html: Added.

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

3 years agoWebKit calls AppKit NSCell API from a background queue
timothy_horton@apple.com [Wed, 26 Apr 2017 17:22:47 +0000 (17:22 +0000)]
WebKit calls AppKit NSCell API from a background queue
https://bugs.webkit.org/show_bug.cgi?id=171318
<rdar://problem/31798317>

Reviewed by Anders Carlsson.

* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::refreshExistingServices):
Synchronously bounce to the main thread to do non-thread-safe NSCell related work.

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

3 years agoEncoded filename should be decoded for WKContentExtension.identifier
achristensen@apple.com [Wed, 26 Apr 2017 17:08:51 +0000 (17:08 +0000)]
Encoded filename should be decoded for WKContentExtension.identifier
https://bugs.webkit.org/show_bug.cgi?id=171316

Reviewed by Andy Estes.

Source/WebCore:

* platform/FileSystem.h:

Source/WebKit2:

* UIProcess/API/APIContentExtensionStore.cpp:
(API::createExtension):
(API::ContentExtensionStore::lookupContentExtension):
(API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKContentExtensionStore.mm: Copied from Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm.
(TEST_F):
* TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm: Removed.

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

3 years agoFix typo in RenderFrameBase
commit-queue@webkit.org [Wed, 26 Apr 2017 16:54:18 +0000 (16:54 +0000)]
Fix typo in RenderFrameBase
https://bugs.webkit.org/show_bug.cgi?id=171324

Patch by Frederic Wang <fwang@igalia.com> on 2017-04-26
Reviewed by Zalan Bujtas.

No new tests, behavior unchanged.

* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::layoutWithFlattening):
(WebCore::RenderFrameBase::performLayoutWithFlattening):
(WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted.
* rendering/RenderFrameBase.h:

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

3 years agoForced page break on :after triggers infinite loop in column balancing
zalan@apple.com [Wed, 26 Apr 2017 16:34:32 +0000 (16:34 +0000)]
Forced page break on :after triggers infinite loop in column balancing
https://bugs.webkit.org/show_bug.cgi?id=171309
rdar://problem/26285884

Reviewed by David Hyatt.

Source/WebCore:

Stop trying to balance the columns when the forced page breaks >= the number of
columns even when this number is 1. Content will always overflow to the next page.
see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2

Test: fast/multicol/infinite-loop-when-forced-break.html

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateBalancedHeight):

LayoutTests:

* fast/multicol/infinite-loop-when-forced-break-expected.txt: Added.
* fast/multicol/infinite-loop-when-forced-break.html: Added.

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

3 years agoAttempt to fix a PLT regression.
said@apple.com [Wed, 26 Apr 2017 16:24:34 +0000 (16:24 +0000)]
Attempt to fix a PLT regression.

Unreviewed.

Disable async decoding for large images till the flickering bug wk170640
is fixed.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages):

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

3 years agoUnreviewed, rolling out r215767.
ryanhaddad@apple.com [Wed, 26 Apr 2017 16:13:02 +0000 (16:13 +0000)]
Unreviewed, rolling out r215767.

The LayoutTest for this change is a flaky failure.

Reverted changeset:

"Restrict WebKit image formats to a known whitelist"
https://bugs.webkit.org/show_bug.cgi?id=170700
http://trac.webkit.org/changeset/215767

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

3 years agoImprove wavy underline rendering
hyatt@apple.com [Wed, 26 Apr 2017 15:58:53 +0000 (15:58 +0000)]
Improve wavy underline rendering
https://bugs.webkit.org/show_bug.cgi?id=171281

Reviewed by Sam Weinig.

Change wavy underline rendering to use font size instead of stroke
thickness as a way to tune it. Cut the extra offset from 2 to 1.
Change the parameters to make the line flatter and to make the proportion
of the wave that renders underneath a glyph the same.

* rendering/TextDecorationPainter.cpp:
(WebCore::strokeWavyTextDecoration):
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::getWavyStrokeParameters):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:
(WebCore::wavyOffsetFromDecoration):

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

3 years agoMove mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences
commit-queue@webkit.org [Wed, 26 Apr 2017 15:55:34 +0000 (15:55 +0000)]
Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences
https://bugs.webkit.org/show_bug.cgi?id=171294

Patch by Andrew Gold <agold@apple.com> on 2017-04-26
Reviewed by Eric Carlson.

Since we now want the ability to toggle this setting dynamically, I have
moved it from WKWebViewConfiguration to WKPreferences.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mediaStreamEnabled]):
(-[WKPreferences _setMediaStreamEnabled:]):

* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from
the configuration.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted.
(-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

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

3 years ago[css-grid] Remove most of the usage of SizingOperation
svillar@igalia.com [Wed, 26 Apr 2017 15:34:40 +0000 (15:34 +0000)]
[css-grid] Remove most of the usage of SizingOperation
https://bugs.webkit.org/show_bug.cgi?id=171225

Reviewed by Darin Adler.

Source/WebCore:

SizingOperation was added as a way to modify the behaviour of the track sizing algorithm
with the specifics for intrinsic size computations. The problem is that although intrinsic
size computation does imply indefinite sizes, the opposite is not always true. For example,
a grid container with height:auto would compute the row sizes with an indefinite size but is
not part of the intrinsic size (preferred widths) computation.

That's why it was wrongly used in some parts of the current code, in most of the cases is
more than enough to check whether the available space is indefinite or not. In order to do
that we have to keep both available sizes (height & width) around all the time to properly
support orthogonal flows.

This change does not imply any change in behaviour.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::setAvailableSpace):
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
(WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::reset):
* rendering/GridTrackSizingAlgorithm.h:
(WebCore::GridTrackSizingAlgorithmStrategy::availableSpace):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::availableSpaceForGutters):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::gridGap):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::gridGapForDirection): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

Added a new test case which was working correctly but that was not properly tested before.

* fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows-expected.txt:
* fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows.html:

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

3 years ago[JSC] Object.keys() must discard property names with no PropertyDescriptor
caitp@igalia.com [Wed, 26 Apr 2017 14:56:53 +0000 (14:56 +0000)]
[JSC] Object.keys() must discard property names with no PropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=171291

Reviewed by Yusuke Suzuki.

JSTests:

* es6/Proxy_ownKeys_duplicates.js:
* stress/proxy-own-keys.js:
(let.handler.getOwnPropertyDescriptor):
(let.handler.ownKeys):

Source/JavaScriptCore:

Proxy objects can produce an arbitrary list of property names from the
"ownKeys" trap, however the Object.keys() algorithm is required to
discard names which do not have a PropertyDescriptor. This also
applies to other uses of the EnumerableOwnProperties() algorithm
(https://tc39.github.io/ecma262/#sec-enumerableownproperties)

Related to https://bugs.chromium.org/p/v8/issues/detail?id=6290

* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):

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

3 years agosendMessageScoped's signal handler calls LocklessBag::consumeAll, which causes heap...
utatane.tea@gmail.com [Wed, 26 Apr 2017 13:34:18 +0000 (13:34 +0000)]
sendMessageScoped's signal handler calls LocklessBag::consumeAll, which causes heap deallocation in signal handler and leads deadlock
https://bugs.webkit.org/show_bug.cgi?id=171319

Reviewed by Keith Miller.

In sendMessageScoped, we call LocklessBag<SignalHandler>::consumeAll `thread->threadMessages().consumeAll()`.
In LocklessBag::consumeAll, we call `delete` on Nodes.
The problem is that this is called under the context of signal handler. Thus, when calling this, the original
thread may hold the lock in bmalloc. In that case, this `delete` call attempts to lock the heap lock recursively,
and causes deadlock.

Instead, this patch transfers the LocklessBag's Node to the sender thread. And the sender thread deletes it instead.

* wtf/LocklessBag.h:
(WTF::LocklessBag::consumeAllWithNode):
* wtf/ThreadMessage.cpp:
(WTF::ThreadMessageData::ThreadMessageData):
(WTF::sendMessageScoped):

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

3 years agoRemove Document::*FrameElementsShouldIgnoreScrolling
commit-queue@webkit.org [Wed, 26 Apr 2017 08:50:22 +0000 (08:50 +0000)]
Remove Document::*FrameElementsShouldIgnoreScrolling
https://bugs.webkit.org/show_bug.cgi?id=171271

Patch by Frederic Wang <fwang@igalia.com> on 2017-04-26
Reviewed by Chris Dumez.

setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were
introduced bug 23072 in order to work around a bug in the Dictionary application.
However, this was removed in bug 132095 and hence the functions are no longer necessary.

No new tests.

* dom/Document.h:
(WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted.
(WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute):

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

3 years ago[GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportD...
zandobersek@gmail.com [Wed, 26 Apr 2017 07:40:28 +0000 (07:40 +0000)]
[GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
https://bugs.webkit.org/show_bug.cgi?id=171213

Reviewed by Michael Catanzaro.

CryptoKeyRSA::create() validates the specified key type along with the
provided data. If everything is OK, it then proceeds to build the key
of the appropriate type through an s-expression that is constructed with
the necessary data. We don't currently support creating private keys
with any additional prime information (apart from p and q).

CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength()
function that find the modulus MPI in the key s-expression and returns
the modulus data length in bits.

CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed
from the appropriate name, this key's modulus length, and this key's
public exponent data. It also specifies the hash if there is such a
restriction for this key.

CryptoKeyRSA::exportData() returns a properly-constructed
CryptoKeyDataRSAComponents object. The public modulus and exponent are
used in case the key is public. If the key is private, the secret
exponent and the p and q prime numbers are retrieved in MPI format.
They're then used to calculate the dp, dq and qi parameters that are
exported in the JWK format. Note that libgcrypt internally switches
the p and q prime numbers such that p < q, but the Web Crypto
specification and the dependant RFCs expect that q < p. We address
this by simply switching the roles of the two primes and follow the
usual q < p assumption when exporting the primes and computing the
dependant exponents and coefficients.

No new tests -- existing ones cover this but don't work yet due to missing
RSA-related CryptoAlgorithm implementations.

* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::getRSAModulusLength):
(WebCore::getParameterMPIData):
(WebCore::getRSAKeyParameter):
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::keySizeInBits):
(WebCore::CryptoKeyRSA::buildAlgorithm):
(WebCore::CryptoKeyRSA::exportData):

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

3 years agoREGRESSION (r209882): Web Inspector: Command-G does not work in the console
nvasilyev@apple.com [Wed, 26 Apr 2017 06:39:00 +0000 (06:39 +0000)]
REGRESSION (r209882): Web Inspector: Command-G does not work in the console
https://bugs.webkit.org/show_bug.cgi?id=170555
<rdar://problem/31481247>

Reviewed by Brian Burg.

Command-G didn't work in the console when the console content view was in focus. It only
worked when the search input field was focused.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.findBannerRevealPreviousResult):
(WebInspector.LogContentView.prototype.highlightPreviousSearchMatch): Added.
(WebInspector.LogContentView.prototype.findBannerRevealNextResult):
(WebInspector.LogContentView.prototype.highlightNextSearchMatch): Added.
Re-introduce highlightPreviousSearchMatch and highlightNextSearchMatch methods that were
removed in r209882.

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

3 years ago[mac-wk1 Debug] LayoutTest http/tests/inspector/network/resource-sizes-network.html...
commit-queue@webkit.org [Wed, 26 Apr 2017 06:38:37 +0000 (06:38 +0000)]
[mac-wk1 Debug] LayoutTest http/tests/inspector/network/resource-sizes-network.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170953

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

* http/tests/inspector/network/resource-sizes-disk-cache.html:
* http/tests/inspector/network/resource-sizes-network.html:
Read the entire data to ensure the load is complete before we notify the frontend.

* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
Unflake these tests, they should be more reliable now.

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

3 years agoWeb Inspector: Network Tab - Sorting by Priority Column hides all rows in the datagri...
commit-queue@webkit.org [Wed, 26 Apr 2017 06:35:04 +0000 (06:35 +0000)]
Web Inspector: Network Tab - Sorting by Priority Column hides all rows in the datagrid (uncaught exception)
https://bugs.webkit.org/show_bug.cgi?id=171312
<rdar://problem/31828554>

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

* UserInterface/Models/Resource.js:
(WebInspector.Resource.comparePriority):
Provide a helper for compariting NetworkPriority enum values.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
(WebInspector.NetworkGridContentView.prototype.dataGridSortComparator):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.dataGridSortComparator):
Custom sort handler for priority.

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

3 years agoUnhandled enumeration values in IntlDateTimeFormat.cpp
commit-queue@webkit.org [Wed, 26 Apr 2017 05:18:09 +0000 (05:18 +0000)]
Unhandled enumeration values in IntlDateTimeFormat.cpp
https://bugs.webkit.org/show_bug.cgi?id=171241

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2017-04-25
Reviewed by JF Bastien.

Added some missing cases of the UDateFormatField to partTypeString,
and made them conditional to the ICU version that added them.
This should remove the warnings that appear on platform builds using the
newer system ICU headers.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString):

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

3 years ago[WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
jiewen_tan@apple.com [Wed, 26 Apr 2017 04:31:57 +0000 (04:31 +0000)]
[WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
https://bugs.webkit.org/show_bug.cgi?id=171287
<rdar://problem/31735332>

Reviewed by Brent Fulgham.

Covered by existing tests.

* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
(WebCore::verifyECDSA):

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

3 years agoREGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
achristensen@apple.com [Wed, 26 Apr 2017 04:27:53 +0000 (04:27 +0000)]
REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
https://bugs.webkit.org/show_bug.cgi?id=171297
<rdar://problem/31530719>

Reviewed by Geoffrey Garen.

Source/WebKit2:

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):

Tools:

* TestWebKitAPI/PlatformWebView.h:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/EventModifiers.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::mouseDidMoveOverElement):
(TestWebKitAPI::setClients):
(TestWebKitAPI::TEST):
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::PlatformWebView::simulateRightClick):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):

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

3 years agoREGRESSION (r214863): Web Inspector: Uncaught Exception when losing focus from a...
nvasilyev@apple.com [Wed, 26 Apr 2017 04:27:37 +0000 (04:27 +0000)]
REGRESSION (r214863): Web Inspector: Uncaught Exception when losing focus from a selector field
https://bugs.webkit.org/show_bug.cgi?id=171254
<rdar://problem/31813959>

Reviewed by Joseph Pecoraro.

The event.relatedTarget of a blur event contains the element where focus moved to.
In some cases this can be null, such as if the user leaves the application window.
For example Command+Tab to switch to another application.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste):

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

3 years agofast/mediastream/RTCPeerConnection-icecandidate-event.html is flaky
commit-queue@webkit.org [Wed, 26 Apr 2017 04:24:21 +0000 (04:24 +0000)]
fast/mediastream/RTCPeerConnection-icecandidate-event.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=171242

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-25
Reviewed by Alex Christensen.

* TestExpectations:
* fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
* fast/mediastream/RTCPeerConnection-icecandidate-event.html: Updating test to be more deterministic.

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

3 years agoRelax the event firing ASSERT for Attr changes
bfulgham@apple.com [Wed, 26 Apr 2017 02:26:05 +0000 (02:26 +0000)]
Relax the event firing ASSERT for Attr changes
https://bugs.webkit.org/show_bug.cgi?id=171236
<rdar://problem/30516349>

Reviewed by Dean Jackson.

Source/WebCore:

The assertions added in Bug 167318 were overly strict, and trigger for valid behavior.
Relax the assertion preventing event dispatch for the case of Attr elements at the
end of childrenChanged.

Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html

* dom/Attr.cpp:
(WebCore::Attr::childrenChanged):

LayoutTests:

* fast/dom/HTMLLinkElement/event-while-removing-attribute-expected.txt: Added.
* fast/dom/HTMLLinkElement/event-while-removing-attribute.html: Added.

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