WebKit-https.git
4 years agoREGRESSION(r201171): Web Inspector: Timeline Recording playhead should always start...
commit-queue@webkit.org [Tue, 18 Oct 2016 18:08:16 +0000 (18:08 +0000)]
REGRESSION(r201171): Web Inspector: Timeline Recording playhead should always start immediately, not wait until first event
https://bugs.webkit.org/show_bug.cgi?id=163583
<rdar://problem/28815882>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-18
Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
Revert logic change introduced by r201171 with no explanation.
Whenever we get a start time we should use it, regardless of
of what the current time is, precisely because the backend is
informing us of the start time to use.

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

4 years agoAdd flaky expectation for tiled-drawing/scrolling/latched-div-with-scroll-snap.html...
ryanhaddad@apple.com [Tue, 18 Oct 2016 17:43:33 +0000 (17:43 +0000)]
Add flaky expectation for tiled-drawing/scrolling/latched-div-with-scroll-snap.html that was errantly removed.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoSVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
said@apple.com [Tue, 18 Oct 2016 17:41:14 +0000 (17:41 +0000)]
SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
https://bugs.webkit.org/show_bug.cgi?id=116470

Reviewed by Simon Fraser.

Source/WebCore:

When we encounter a shorthand css property, we set m_implicitShorthand
to true to tell addProperty() later that the individual properties are
all set through a short hand one. We need to make sure that setting
m_implicitShorthand to true will not be leaked after finishing parsing
the short hand property.

Test: fast/css/implicit-property-restore.html

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
(WTF::ImplicitScope::ImplicitScope): Deleted.
(WTF::ImplicitScope::~ImplicitScope): Deleted.
Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.

* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
Restore m_implicitShorthand value after setting it temporarily to true.

Source/WTF:

* wtf/TemporaryChange.h:
(WTF::TemporaryChange::TemporaryChange):
Add a new constructor to make TemporaryChange work as a restorer. The
temporary change will happen after we construct the object.

LayoutTests:

* fast/css/implicit-property-restore-expected.txt: Added.
* fast/css/implicit-property-restore.html: Added.

* fast/css/remove-shorthand-expected.txt:
Rebase-line the test expected results because of fixing the leak of
m_implicitShorthand. The bug was happening because "background: ..." property
comes immediately before the "list-style: ...." property.

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

4 years agoMarking inspector/debugger/breakpoint-action-eval.html as a flaky timeout on mac...
ryanhaddad@apple.com [Tue, 18 Oct 2016 17:39:47 +0000 (17:39 +0000)]
Marking inspector/debugger/breakpoint-action-eval.html as a flaky timeout on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=163604

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoMarking scroll-restoration-fragment-scrolling-cross-origin.html as flaky on mac-wk1.
ryanhaddad@apple.com [Tue, 18 Oct 2016 17:28:53 +0000 (17:28 +0000)]
Marking scroll-restoration-fragment-scrolling-cross-origin.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=161360

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoUpdate TrackEvent to stop using legacy [ConstructorTemplate=Event]
cdumez@apple.com [Tue, 18 Oct 2016 17:13:53 +0000 (17:13 +0000)]
Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163580

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Incorporate https://github.com/w3c/web-platform-tests/pull/3999 as the
test was incorrect. Rebaseline now that we are passing the test.

* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html:

Source/WebCore:

Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://html.spec.whatwg.org/#the-trackevent-interface

No new tests, updated existing tests.

* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
* html/track/TrackEvent.idl:

LayoutTests:

Update existing test to reflect behavior change. We now correctly throw a TypeError
when passing an unexpected track object type to the TrackEvent constructor.

* fast/events/constructors/track-event-constructor-expected.txt:
* fast/events/constructors/track-event-constructor.html:

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

4 years agoUnreviewed, rolling out r207409.
commit-queue@webkit.org [Tue, 18 Oct 2016 17:10:06 +0000 (17:10 +0000)]
Unreviewed, rolling out r207409.
https://bugs.webkit.org/show_bug.cgi?id=163602

Introduced many test failures and timeouts, causing release
bot to exit early (Requested by mcatanzaro on #webkit).

Reverted changeset:

"[GTK] Several tests crashing on debug bot in (anonymous
namespace)::MediaPlayerPrivateGStreamerBase::repaint"
https://bugs.webkit.org/show_bug.cgi?id=163511
http://trac.webkit.org/changeset/207409

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

4 years agoRemote Web Inspector: Timeline UI not updating while recording
commit-queue@webkit.org [Tue, 18 Oct 2016 17:07:35 +0000 (17:07 +0000)]
Remote Web Inspector: Timeline UI not updating while recording
https://bugs.webkit.org/show_bug.cgi?id=163582
<rdar://problem/28766837>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-18
Reviewed by Timothy Hatcher.

* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::frontendLoaded):
Local inspector windows keep the web view alive and toggle the
WebInspector.visible state depending on whether or not an inspector is
open. Remote Inspector windows go away when closed, so they can always
be marked as open. This matches earlier remote inspector behavior.

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

4 years ago[DOMJIT] Not emit exception case if it is not necessary
utatane.tea@gmail.com [Tue, 18 Oct 2016 16:26:17 +0000 (16:26 +0000)]
[DOMJIT] Not emit exception case if it is not necessary
https://bugs.webkit.org/show_bug.cgi?id=163589

Reviewed by Sam Weinig.

We should not emit exception case if we do not use the slow path calls.
For example, nodeType accessor does not use the slow path calls.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::emitDOMJITGetter):

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

4 years agoRebase test in fast/mediastream
nael.ouedraogo@crf.canon.fr [Tue, 18 Oct 2016 15:09:06 +0000 (15:09 +0000)]
Rebase test in fast/mediastream

[GTK] Test gardening after r206956
https://bugs.webkit.org/show_bug.cgi?id=163596

Unreviewed.

* fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt:

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

4 years agoSource/WebCore:
eric.carlson@apple.com [Tue, 18 Oct 2016 14:53:06 +0000 (14:53 +0000)]
Source/WebCore:
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>

Reviewed by Darin Adler.

Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
access happens in the UI process.

No new tests, updated results of existing tests.

* CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.

* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
(WebCore::MediaConstraintsImpl::initialize): Deleted.
* Modules/mediastream/MediaConstraintsImpl.h:

* Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
(WebCore::MediaDevicesEnumerationRequest::create):
(WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
(WebCore::MediaDevicesEnumerationRequest::start):
(WebCore::MediaDevicesEnumerationRequest::cancel):
(WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
(WebCore::MediaDevicesEnumerationRequest::finish):
* Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.

* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
(WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
(WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
(WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
* Modules/mediastream/MediaDevicesRequest.h:

* Modules/mediastream/UserMediaClient.h:
* Modules/mediastream/UserMediaController.h:
(WebCore::UserMediaController::enumerateMediaDevices): New.
(WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
(WebCore::UserMediaController::checkUserMediaPermission): Deleted.
(WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.

* Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
* Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
(WebCore::UserMediaRequest::constraintsValidated): Deleted.
(WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
(WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
(WebCore::UserMediaRequest::constraintsInvalid): Deleted.
(WebCore::UserMediaRequest::didCreateStream): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
* Modules/mediastream/UserMediaRequest.h:

* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.

* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::CaptureDevice):
(WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
(WebCore::CaptureDevice::setLabel): Ditto.
(WebCore::CaptureDevice::setGroupId): Ditto.
(WebCore::CaptureDevice::setKind): Ditto.

* platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.

* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::encode): New.
(WebCore::MediaConstraint::decode): Ditto.
(WebCore::NumericConstraint::encode): Ditto.
(WebCore::NumericConstraint::decode): Ditto.

* platform/mediastream/MediaStreamCreationClient.h: Deleted.

* platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.

* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
group id, we don't support it.

* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
* platform/mock/MockRealtimeMediaSourceCenter.h:

Source/WebKit:
Fix CMake build.

Patch by Alex Christensen <achristensen@webkit.org> on 2016-10-14

* PlatformMac.cmake:

Source/WebKit2:
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>

Reviewed by Darin Adler.

Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
access happens in the UI process.

* Scripts/webkit/messages.py:
(headers_for_type): Special case MediaConstraintsData.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
(IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
(IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
(IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
(IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
(IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
* Shared/WebCoreArgumentCoders.h:

* UIProcess/API/APIUIClient.h:  Remove UserMediaPermissionCheckProxy forward declaration.

* UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
(toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
(WKUserMediaPermissionRequestDeny): Add "reason" parameter.
* UIProcess/API/C/WKUserMediaPermissionRequest.h:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
(WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
  uint64_t to pass to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
  constraints and make sure gUM is enabled before prompting user.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
(WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send
  results of device enumeration to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::allow):
(WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
* UIProcess/UserMediaPermissionRequestProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
  Pass the audio and video constraints to the UI process.
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
  to the UI process.
(WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
(WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
(WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
(WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::enumerateMediaDevices): New.
(WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
(WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
(WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
* WebProcess/WebCoreSupport/WebUserMediaClient.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted): New.
(WebKit::WebPage::userMediaAccessWasDenied): Ditto.
(WebKit::WebPage::didCompleteMediaDeviceEnumeration):
(WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>

Reviewed by Darin Adler.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues): Enable mock capture devices.
(WTR::TestController::decidePolicyForUserMediaPermissionRequestIfPossible): Update for API changes.

LayoutTests:
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>

Reviewed by Darin Adler.

* fast/mediastream/getusermedia-expected.txt: Updated.
* fast/mediastream/getusermedia.html: Ditto.
* fast/mediastream/mock-media-source-expected.txt: Ditto.

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

4 years ago[WebIDL] Support BufferSource
zandobersek@gmail.com [Tue, 18 Oct 2016 13:15:40 +0000 (13:15 +0000)]
[WebIDL] Support BufferSource
https://bugs.webkit.org/show_bug.cgi?id=163541

Reviewed by Youenn Fablet.

Add support for the BufferSource typedef in WebIDL. The implementation
adds the necessary handling for this type in the generator scripts and
the specialization of the Converter<> template for the IDLBufferSource
struct that enables exposing ArrayBuffer or ArrayBufferView objects by
having WebCore::BufferSource objects pointing to their data.

The SourceBuffer interface in the MSE module has the appendBuffer()
operation modified to accept a BufferSource parameter, instead of
overloading it for ArrayBuffer and ArrayBufferView parameters.

The bindings generator tests cover BufferSource as both an operation
parameter and as a dictionary member.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
(WebCore::SourceBuffer::appendBufferInternal):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h: Added.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert):
* bindings/scripts/CodeGenerator.pm:
(SkipIncludeHeader):
(IsWrapperType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddClassForwardIfNeeded):
(GetBaseIDLType):
(IsHandledByDOMConvert):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
* bindings/scripts/test/TestObj.idl:

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

4 years ago[JSC] ES6 Method functions should not have prototype
caitp@igalia.com [Tue, 18 Oct 2016 12:51:33 +0000 (12:51 +0000)]
[JSC] ES6 Method functions should not have prototype
https://bugs.webkit.org/show_bug.cgi?id=162530

Reviewed by Saam Barati.

JSTests:

Fix test262 expectations about MethodDefinitions

* ChakraCore/test/strict/05.arguments_sm.baseline-jsc:
* stress/reflect-set.js:
* test262.yaml:

Source/JavaScriptCore:

ECMA-262 only adds "prototype" properties to specific syntactic function forms.
Specific items which do not contain "prototype" include (most) built-in functions (such as Math.pow),
MethodDefinitions which are not either class "constructor" methods or GeneratorMethods, AsyncFunctions,
and ArrowFunctions.

For details, see the following spec text, and the difference between GeneratorMethod evaluation and
the evaluation of other MethodDefinition forms.

- https://tc39.github.io/ecma262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation
- https://tc39.github.io/ecma262/#sec-arrow-function-definitions-runtime-semantics-evaluation
- https://tc39.github.io/ecmascript-asyncawait/#async-function-instances
- https://tc39.github.io/ecma262/#sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation

* runtime/Executable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::callerGetter):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::deleteProperty):

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* runtime/Executable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncThrowTypeErrorArgumentsCalleeAndCaller):

LayoutTests:

Update expected error message to no longer indicate "strict mode"
(which is not always true), and add additional tests for the presence
of "caller" and "arguments" on accessor MethodDefinitions.

* js/basic-strict-mode-expected.txt:
* js/caller-property-expected.txt:
* js/class-syntax-method-names-expected.txt:
* js/es6-function-properties-expected.txt:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/caller-property.js:
* js/script-tests/class-syntax-method-names.js:
* js/script-tests/es6-function-properties.js:
(k.get getter):
(k.set setter):
(get checkProperties):
* js/script-tests/non-strict-function-properties.js:

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

4 years ago[css-grid] Different width of grid container between initial load and refresh
jfernandez@igalia.com [Tue, 18 Oct 2016 12:33:28 +0000 (12:33 +0000)]
[css-grid] Different width of grid container between initial load and refresh
https://bugs.webkit.org/show_bug.cgi?id=163535

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

Grid's layout logic manages two different override sizes; one it's
designed to implement the grid item's stretching behavior, identified
with the concept of 'overrideContentLogicalSize'; there is another
override size, known as overrideContainingBlockContentLogicalSize,
used to implement the Grid Area abstraction, which will behave as
the actual containing block of any grid item.

During grid's layout logic these override sizes are set according
to the CSS style rules. This affects how the grid container and its
children are going to be sized during layout. Grid Tracks sizing
algorithm depends on these override sizes.

In order to ensure that the tracks sizing algorithm produces the
same results when it's run consecutively several times, we need to
clear these override sizes and perform a layout of the affected grid
items. Otherwise, the affected items will return sizing values which
depend on the override values set in the previous layout, which in
some cases, like orthogonal flows, may change through different runs
of the sizing algorithm.

Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):

LayoutTests:

Tests to ensure repeated layouts on grid elements produce the same results when using
orthogonal grid items.

* fast/css-grid-layout/repeating-layout-must-produce-the-same-results-expected.txt: Added.
* fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html: Added.

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

4 years agoCachedResourceLoader should not need to remove fragment identifier
commit-queue@webkit.org [Tue, 18 Oct 2016 12:30:40 +0000 (12:30 +0000)]
CachedResourceLoader should not need to remove fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=163015

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-18
Reviewed by Darin Adler.

No expected change for non-window port.
For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
before querying the memory cache.

Removing the fragment identifier from the request stored in CachedResourceRequest.
The fragment identifier is stored in a separate field.

This allows CachedResourceLoader to not care about fragment identifier.
CachedResource can then get access to it.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::finishRequestInitialization): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource):
Updated the method taking a const String& to strip the fragment identifier if needed.
Updated the method taking a const URL& to assert if the fragment identifier is present.
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseFragmentIdentifier):
(WebCore::CachedResourceRequest::clearFragmentIdentifier):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
(WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
* loader/cache/MemoryCache.h:

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

4 years agoRename setNeedsStyleRecalc to invalidateStyle
antti@apple.com [Tue, 18 Oct 2016 12:28:55 +0000 (12:28 +0000)]
Rename setNeedsStyleRecalc to invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=163542

Reviewed by Darin Adler.

Source/WebCore:

Also rename StyleChangeType enum and some related functions for clarity. For example

    element.setNeedsStyleRecalc(SyntheticStyleChange);

becomes

    element.invalidateStyleAndLayerComposition();

* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::setCSSTarget):
(WebCore::unwrapFullScreenRenderer):
(WebCore::Document::setAnimatingFullScreen):
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setFocus):
(WebCore::Element::setHovered):
(WebCore::Element::attributeChanged):
(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):

    Move public invalidation functions to Element tightening typing.
    Use separate functions instead of enum values.
    This way the call sites look nicer and only useful combinations are exposed.

(WebCore::Element::addShadowRoot):
(WebCore::checkForEmptyStyleChange):
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::needsStyleInvalidation):
(WebCore::Element::setContainsFullScreenElement):
* dom/Element.h:
(WebCore::Element::setHasFocusWithin):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::adjustStyleValidity):

    Update validity and mode separately. There was a potential bug here where
    SyntheticStyleChange could overwrite FullStyleChange (no known repro).

(WebCore::Node::updateAncestorsForStyleRecalc):
(WebCore::Node::invalidateStyle):
(WebCore::Node::insertedInto):
(WebCore::Node::setNeedsStyleRecalc): Deleted.
* dom/Node.h:
(WebCore::Node::needsStyleRecalc):
(WebCore::Node::styleValidity):
(WebCore::Node::styleResolutionShouldRecompositeLayer):
(WebCore::Node::setHasValidStyle):
(WebCore::Node::styleChangeType): Deleted.
(WebCore::Node::clearNeedsStyleRecalc): Deleted.
(WebCore::Node::setStyleChange): Deleted.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::remove):
(WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::addSlotElementByName):
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::didChangeSlot):
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):
* dom/Text.cpp:
(WebCore::Text::updateRendererAfterContentChange):
* dom/VisitedLinkState.cpp:
(WebCore::VisitedLinkState::invalidateStyleForAllLinks):
(WebCore::VisitedLinkState::invalidateStyleForLink):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
* html/FileInputType.cpp:
(WebCore::FileInputType::setValue):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
(WebCore::HTMLElement::calculateAndAdjustDirectionality):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::addInvalidDescendant):
(WebCore::HTMLFieldSetElement::removeInvalidDescendant):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::disabledStateChanged):
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
(WebCore::HTMLFormControlElement::requiredAttributeChanged):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerFormElement):
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::resetDefaultButton):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::setIndeterminate):
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
(WebCore::HTMLObjectElement::childrenChanged):
(WebCore::HTMLObjectElement::renderFallbackContent):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::setSelectedState):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState):
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
(WebCore::HTMLPlugInImageElement::finishParsingChildren):
(WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
(WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didElementStateChange):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::setRecalcListItems):
(WebCore::HTMLSelectElement::parseMultipleAttribute):
(WebCore::HTMLSelectElement::reset):
* html/HTMLTableElement.cpp:
(WebCore::isTableCellAncestor):
(WebCore::setTableCellsChanged):
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
* html/InputType.cpp:
(WebCore::InputType::setValue):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::minOrMaxAttributeChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::subtreeHasChanged):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::updateSelectedChild):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimations):
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::AnimationController::cancelAnimations):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateDragState):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::clearNeedsStyleResolution):
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleUpdate.h:
* style/StyleValidity.h: Added.

    StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
    Move to a file of its own.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::invalidateShadowTree):
* testing/Internals.cpp:
(WebCore::styleValidityToToString):
(WebCore::Internals::styleChangeType):
(WebCore::styleChangeTypeToString): Deleted.

Source/WebKit/mac:

* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView createPluginLayer]):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView createPlugin]):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
(WebKit::PluginView::pluginProcessCrashed):

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

4 years ago[css-grid] Constrain by min|max-height on auto repeat computation
svillar@igalia.com [Tue, 18 Oct 2016 09:21:58 +0000 (09:21 +0000)]
[css-grid] Constrain by min|max-height on auto repeat computation
https://bugs.webkit.org/show_bug.cgi?id=163540

Reviewed by Darin Adler.

Source/WebCore:

The max-height (if definite) is used to compute the number of auto repeat rows whenever the
height is indefinite. We were using the min-height only in case both values were indefinite.

Although not explicitly mentioned by grid specs, it's reasonable to assume that
the min-height trumps the used value of height/max-height like it always does, per CSS
2.2. Note that the number of rows still needs to fit within that size even if using
min-height, because we're just using min-height to compute the used value of the height
property. If both height and max-height are indefinite we keep doing the same, i.e., compute
the minimum number of rows that fulfill min-height (if definite).

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount):

LayoutTests:

Some new test cases to verify that min-height is used on the auto repeat tracks computation
whenever the height is indefinite and max-height is not.

* fast/css-grid-layout/grid-auto-fill-rows-expected.txt:
* fast/css-grid-layout/grid-auto-fill-rows.html:
* fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash-expected.txt:
* fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html:

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

4 years ago[DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
utatane.tea@gmail.com [Tue, 18 Oct 2016 08:13:26 +0000 (08:13 +0000)]
[DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
https://bugs.webkit.org/show_bug.cgi?id=163586

Reviewed by Saam Barati.

Source/JavaScriptCore:

C functions called from the DOMJIT slow path calls should use NativeCallFrameTracer.
This fixes the debug assertion caused in r207427.

* bytecode/DOMJITAccessCasePatchpointParams.cpp:
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
(JSC::DOMJITAccessCasePatchpointParams::emitSlowPathCalls):
* bytecode/DOMJITAccessCasePatchpointParams.h:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::emitDOMJITGetter):
* jsc.cpp:
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::slowCall):
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::slowCall):

Source/WebCore:

* domjit/JSNodeDOMJIT.cpp:
(WebCore::toWrapperSlow):

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

4 years ago[EFL] Build break since r207442
ryuan.choi@navercorp.com [Tue, 18 Oct 2016 07:11:18 +0000 (07:11 +0000)]
[EFL] Build break since r207442
https://bugs.webkit.org/show_bug.cgi?id=163587

Unreviewed.

Since r207442, setRGB is moved to private.

* rendering/RenderThemeEfl.cpp:
(WebCore::fillColorsFromEdjeClass):

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

4 years agoNetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloa...
carlosgc@webkit.org [Tue, 18 Oct 2016 06:03:55 +0000 (06:03 +0000)]
NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
https://bugs.webkit.org/show_bug.cgi?id=163545

Reviewed by Alex Christensen.

If a download started by DownloadManager::startDownload() is cancelled before
DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
* NetworkProcess/Downloads/PendingDownload.h:

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

4 years agoAdd support for WASM Memory.
keith_miller@apple.com [Tue, 18 Oct 2016 02:02:48 +0000 (02:02 +0000)]
Add support for WASM Memory.
https://bugs.webkit.org/show_bug.cgi?id=161710

Reviewed by Geoffrey Garen.

JSTests:

Add store and load opcodes to wasm.json. Additionally, add new
enums for those opcodes in the generator.

* stress/wasm/generate-wasmops-header.js:
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.LoadOpType):
(const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.StoreOpType):

Source/JavaScriptCore:

This patch add initial support for WASM memory operations. First,
it adds the concept of a WASM Module memory management object.
This object currently mmaps a 32-bit address space for WASM use,
although it marks all the memory outside the current breakpoint as
PROT_NONE. For now, we do a range check on each store and load. In
the future, we should change this to be an signal handler that
checks what module the program trapped in.

Additionally, this patch changes the way that our temporary tests
call into WASM code. There is now a true "thunk" that relocates
arguments and calls into WASM. This thunk does not tail call
because we use pinned values to memory base-pointer and
size. We use the new B3 pinned register api to pin the values.

* CMakeLists.txt:
* Configurations/ToolExecutable.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
* testWASM.cpp:
(runWASMTests):
(main):
* wasm/WASMB3IRGenerator.cpp:
(JSC::WASM::createJSWrapper):
(JSC::WASM::parseAndCompile):
* wasm/WASMB3IRGenerator.h:
* wasm/WASMCallingConvention.h:
(JSC::WASM::CallingConvention::iterate):
(JSC::WASM::CallingConvention::setupCall):
(JSC::WASM::nextJSCOffset):
* wasm/WASMFormat.h:
* wasm/WASMFunctionParser.h:
(JSC::WASM::FunctionParser<Context>::parseExpression):
* wasm/WASMMemory.cpp: Copied from Source/JavaScriptCore/wasm/WASMPlan.cpp.
(JSC::WASM::Memory::Memory):
* wasm/WASMMemory.h: Copied from Source/JavaScriptCore/wasm/WASMModuleParser.h.
(JSC::WASM::Memory::~Memory):
(JSC::WASM::Memory::memory):
(JSC::WASM::Memory::size):
(JSC::WASM::Memory::pinnedRegisters):
(JSC::WASM::Memory::mode):
(JSC::WASM::Memory::growMemory):
(JSC::WASM::Memory::offsetOfSize):
* wasm/WASMModuleParser.cpp:
(JSC::WASM::ModuleParser::parse):
(JSC::WASM::ModuleParser::parseMemory):
* wasm/WASMModuleParser.h:
(JSC::WASM::ModuleParser::functionInformation):
(JSC::WASM::ModuleParser::memory):
* wasm/WASMOps.h:
* wasm/WASMPlan.cpp:
(JSC::WASM::Plan::Plan):
* wasm/WASMPlan.h:
* wasm/WASMSections.h:

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

4 years agoAdd test and infrastructure for link popover
commit-queue@webkit.org [Tue, 18 Oct 2016 01:08:25 +0000 (01:08 +0000)]
Add test and infrastructure for link popover
https://bugs.webkit.org/show_bug.cgi?id=163406

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-10-17
Reviewed by Simon Fraser.

Source/WebKit2:

Add infrastructure to see when a link popover appears, and what URL it has loaded.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didShowForcePressPreview]):
(-[WKWebView didDismissForcePressPreview]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contentsOfUserInterfaceItem:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:didDismissPreview:committing:]):
(-[WKContentView _previewItemControllerDidCancelPreview:]):

Tools:

Added functionality test for link popovers.
Can query for what URL is loaded, and that the popover has appeared or has
been dismissed.
Added a link popover test.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::platformSetDidShowForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidDismissForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidEndFormControlInteractionCallback): Deleted.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptContext.h:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setDidShowForcePressPreviewCallback):
(WTR::UIScriptController::didShowForcePressPreviewCallback):
(WTR::UIScriptController::setDidDismissForcePressPreviewCallback):
(WTR::UIScriptController::didDismissForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidShowForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidDismissForcePressPreviewCallback):
(WTR::UIScriptController::didEndFormControlInteractionCallback): Deleted.
(WTR::UIScriptController::platformSetDidEndFormControlInteractionCallback): Deleted.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView didShowForcePressPreview]):
(-[TestRunnerWKWebView didDismissForcePressPreview]):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::platformSetDidShowForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidDismissForcePressPreviewCallback):
(WTR::UIScriptController::platformSetDidEndFormControlInteractionCallback): Deleted.

LayoutTests:

* fast/events/touch/ios/iphone7/force-press-on-link-expected.txt: Added.
* fast/events/touch/ios/iphone7/force-press-on-link.html: Added.

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

4 years agoRemove dependency cycle with UIKit
dino@apple.com [Tue, 18 Oct 2016 01:00:58 +0000 (01:00 +0000)]
Remove dependency cycle with UIKit
https://bugs.webkit.org/show_bug.cgi?id=163577
<rdar://problem/28786160>

Reviewed by Tim Horton.

Soft link against UIKit.

* Configurations/WebCoreTestSupport.xcconfig:
* testing/Internals.mm:

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

4 years agoREGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back...
timothy_horton@apple.com [Tue, 18 Oct 2016 00:45:05 +0000 (00:45 +0000)]
REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
https://bugs.webkit.org/show_bug.cgi?id=163573
<rdar://problem/28744549>

Reviewed by Dan Bernstein.

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreFromSessionState):
Update PageLoadState's canGoBack/canGoForward bits when restoring from
session state, because in the don't-navigate case, nothing else will make this happen,
and it will remain stale.

Tools:

* TestWebKitAPI/Tests/WebKit2/WKBackForwardList.mm:
(TEST):
Add a test ensuring that canGoBack returns NO after restoring session state without navigating.

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

4 years agoWeb Inspector: Add toggles for debugger pauses at console.assert failures
joepeck@webkit.org [Tue, 18 Oct 2016 00:36:12 +0000 (00:36 +0000)]
Web Inspector: Add toggles for debugger pauses at console.assert failures
https://bugs.webkit.org/show_bug.cgi?id=139542
<rdar://problem/19281600>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::disable):
(Inspector::InspectorDebuggerAgent::setPauseOnAssertions):
Toggle pause on assertions state. Default is disabled,
and disable it when frontends disconnect.

(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
Instead of using the PauseOnAllExceptions state, use this
new state specific to assertions.

* inspector/protocol/Debugger.json:
New protocol method to toggle pausing on assertions.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get assertionsBreakpoint):
(WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
New breakpoint and toggling behavior.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
New breakpoint tree element behavior.

(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
Sidebar restoration if it was selected.

* UserInterface/Images/Assertion.svg: Added.
* UserInterface/Images/gtk/Assertion.svg: Added.
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-assertion-icon .icon):
New sidebar icon for the global breakpoint.

LayoutTests:

* inspector/debugger/pause-on-assert.html:
* inspector/debugger/pause-reason.html:
These tests need to enable pause on assertions.

* inspector/debugger/setPauseOnAssertions-expected.txt: Added.
* inspector/debugger/setPauseOnAssertions.html: Added.
Specific tests for the new protocol method.

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

4 years agoCrash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
aestes@apple.com [Tue, 18 Oct 2016 00:28:34 +0000 (00:28 +0000)]
Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
https://bugs.webkit.org/show_bug.cgi?id=163476
<rdar://problem/26941395>

Reviewed by Tim Horton.

Source/WebKit2:

When custom content providers are registered and a response has a null MIME type, WebPage
will pass a null String to HashSet::contains(). This results in a null pointer dereference,
since the String hash functions do not support null Strings and unconditionally dereference
their StringImpls. Fixed by checking that Strings are non-null before calling
HashSet::contains() on m_mimeTypesWithCustomContentProviders.

Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
canPluginHandleResponseInFrame() instead of relying on m_mainFrame.

New API test: WebKit2.LoadDataWithNilMIMEType.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
of m_mainFrame->coreFrame().
(WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
canPluginHandleResponse(), and checked if mimeType is null before calling
m_mimeTypesWithCustomContentProviders.contains().
(WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
m_mimeTypesWithCustomContentProviders.contains().
* WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/LoadDataWithNilMIMEType.mm: Added.
(TEST): Added an API test that passes a nil MIMEType to
-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:].

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

4 years agoAllow creation of ExtendedColors and make Color immutable
dino@apple.com [Tue, 18 Oct 2016 00:12:00 +0000 (00:12 +0000)]
Allow creation of ExtendedColors and make Color immutable
https://bugs.webkit.org/show_bug.cgi?id=163557
<rdar://problem/28805360>

Reviewed by Darin Adler and Dave Hyatt.

Source/WebCore:

1. Support the creation of ExtendedColor objects via the
Color class.

2. Fix the remaining few places where a Color object is
modified after creation, instead creating a new Color.
Move all the mutation methods into the private section,
making Color now immutable.

Changes to Color are covered by existing tests. Changes
to ExtendedColor are covered by the ExtendedColor API test.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::fastParseColor): Return a new named Color.

* dom/Document.cpp:
(WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
where possible.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
use the string "black" here - we have a constant value.

* platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.

* platform/graphics/Color.cpp:
(WebCore::findNamedColor): Move this up in the file.
(WebCore::Color::Color): Copy in the code from setNamedColor. Also
add a constructor for ExtendedColor.
(WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
(WebCore::Color::cssText): Ditto.
(WebCore::Color::setNamedColor): Deleted.
(WebCore::Color::tagAsExtended): Deleted.

* platform/graphics/Color.h: Add a new constructor.
(WebCore::Color::setRGB): Move to private.

* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Implement serializer.
* platform/graphics/ExtendedColor.h:

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.

Tools:

API tests for ExtendedColor.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp: Added.
(TestWebKitAPI::TEST):
(TestWebKitAPI::makeColor):

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

4 years ago[WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
cdumez@apple.com [Mon, 17 Oct 2016 23:27:36 +0000 (23:27 +0000)]
[WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
https://bugs.webkit.org/show_bug.cgi?id=163569
<rdar://problem/28810836>

Reviewed by Antti Koivisto.

PendingFrameLoad objects are created to track frame loads and added to
the m_pendingFrameLoads hash map. These objects are supposed to remove
themselves from the hash map once they detect that the page load has
finished by calling PendingFrameLoad::m_loadCompletionHandler().

PendingFrameLoad::m_loadCompletionHandler() is called from
markLoadAsCompleted() when we detect that the page load has finished
via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
on the HysteresisActivity every time a subresource is loaded in the
frame. The issue is that if no subresource is ever loaded, then we
never call impulse() on the HysteresisActivity, which is therefore
never started. If it nevers starts, then it nevers stops and never
calls markLoadAsCompleted(). To address the problem, we now call
impulse() on the HysteresisActivity as soon as we construct it.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:

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

4 years agoMarking platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html as flaky...
ryanhaddad@apple.com [Mon, 17 Oct 2016 23:00:47 +0000 (23:00 +0000)]
Marking platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html as flaky on ios-simulator debug.
https://bugs.webkit.org/show_bug.cgi?id=163362

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoEnable keyboard in fullscreen.
commit-queue@webkit.org [Mon, 17 Oct 2016 22:56:15 +0000 (22:56 +0000)]
Enable keyboard in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=163146

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-10-17
Reviewed by Jer Noble.

Allow keyboard in fullscreen.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _supportsFullScreenForElement:withKeyboard:]):

Source/WebKit2:

* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::supportsFullScreen):

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

4 years agoImplement DOMRect/DOMRectReadOnly
simon.fraser@apple.com [Mon, 17 Oct 2016 22:30:34 +0000 (22:30 +0000)]
Implement DOMRect/DOMRectReadOnly
https://bugs.webkit.org/show_bug.cgi?id=163464

Reviewed by Darin Adler.

Source/WebCore:

Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
https://dev.w3.org/fxtf/geometry/

DOMRects allow negative height/width and require double storage, so we can't just
use FloatRect for storage. They also require handling of NaN and Infinity.

To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
custom min/max functions that return NaN if either argument is NaN, so add
nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.

Test: fast/dom/domrect.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMRect.h: Added.
(WebCore::DOMRect::create):
(WebCore::DOMRect::fromRect):
(WebCore::DOMRect::setX):
(WebCore::DOMRect::setY):
(WebCore::DOMRect::setWidth):
(WebCore::DOMRect::setHeight):
(WebCore::DOMRect::DOMRect):
* dom/DOMRect.idl: Added.
* dom/DOMRectInit.h: Added.
* dom/DOMRectInit.idl: Added.
* dom/DOMRectReadOnly.h: Added.
(WebCore::DOMRectReadOnly::create):
(WebCore::DOMRectReadOnly::fromRect):
(WebCore::DOMRectReadOnly::x):
(WebCore::DOMRectReadOnly::y):
(WebCore::DOMRectReadOnly::width):
(WebCore::DOMRectReadOnly::height):
(WebCore::DOMRectReadOnly::top):
(WebCore::DOMRectReadOnly::right):
(WebCore::DOMRectReadOnly::bottom):
(WebCore::DOMRectReadOnly::left):
(WebCore::DOMRectReadOnly::DOMRectReadOnly):
* dom/DOMRectReadOnly.idl: Added.

Source/WTF:

Implement min()/max() in a way that follows Math.min/Math.max, which return
NaN if either argument is NaN.

* wtf/MathExtras.h:
(WTF::nanPropagatingMin):
(WTF::nanPropagatingMax):

LayoutTests:

New test and new results for global constructor tests.

* geometry/DOMRect-001-expected.txt: Added.
* geometry/DOMRect-001.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

4 years ago[DOMJIT][JSC] Add Option::useDOMJIT
utatane.tea@gmail.com [Mon, 17 Oct 2016 22:09:29 +0000 (22:09 +0000)]
[DOMJIT][JSC] Add Option::useDOMJIT
https://bugs.webkit.org/show_bug.cgi?id=163457

Reviewed by Saam Barati.

Add an option to switch the DOMJIT optimization.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

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

4 years ago[Modern Media Controls] Basic MediaController
commit-queue@webkit.org [Mon, 17 Oct 2016 22:03:16 +0000 (22:03 +0000)]
[Modern Media Controls] Basic MediaController
https://bugs.webkit.org/show_bug.cgi?id=163539
<rdar://problem/28797542>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-17
Reviewed by Darin Adler.

Source/WebCore:

We add a new main.js file which acts as the entry point by implementing the createControls()
function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
been created. That functions creates an instance of the new MediaController class, which is
the controller object that will handle communication between the media controls and the media
element. At first, this MediaController class is very limited and assumes macOS inline
layout traits and forces a start button to be shown over the media, which can be played
to start the media and show the full controls. More functionality will be added by future patches.

Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
       media/modern-media-controls/media-controller/media-controller-constructor.html
       media/modern-media-controls/media-controller/media-controller-resize.html

* Modules/modern-media-controls/main.js: Added.
(createControls):
* Modules/modern-media-controls/media/media-controller.js: Added.
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype.handleEvent):
(MediaController.prototype.buttonWasClicked):
(MediaController.prototype._updateControlsSize):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):

LayoutTests:

Testing the properties of the new MediaController class and the availability and behavior of the
createControls() global function.

* media/modern-media-controls/media-controller/media-controller-click-to-start-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-click-to-start.html: Added.
* media/modern-media-controls/media-controller/media-controller-constructor-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-constructor.html: Added.
* media/modern-media-controls/media-controller/media-controller-resize-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-resize.html: Added.

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

4 years ago[GTK] Skip layout tests under crypto/workers/subtle
mcatanzaro@igalia.com [Mon, 17 Oct 2016 21:51:35 +0000 (21:51 +0000)]
[GTK] Skip layout tests under crypto/workers/subtle

* platform/gtk/TestExpectations:

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

4 years agoAir::IRC doesn't need to have a special-case for uncolored Tmps since they all get...
fpizlo@apple.com [Mon, 17 Oct 2016 21:45:56 +0000 (21:45 +0000)]
Air::IRC doesn't need to have a special-case for uncolored Tmps since they all get colored
https://bugs.webkit.org/show_bug.cgi?id=163548
<rdar://problem/28804381>

Reviewed by Geoffrey Garen.

Before r207408, IRC had a mode where it would silently assign the first assignable register (so
%rax, %xmm0, etc) to any tmp that was not colorable due to a pathological interference fencepost.
We reason about interference at instruction boundaries. This means that if you have, for example,
an instruction that clobbers all registers late followed by an instruction that has an early def
in the same register file, then the early def will not be colorable because it interferes with
all registers. This already happens in our tests, but IRC silently returns the first assignable
register to such tmps. For some reason the resulting code works OK - probably because this tends
to only be hit by fuzzing, which may not then stress that code enough to shake out the register
corruption. Also, this can only happen for floating point registers, so it's hard to get an
exciting crash. The worst case is that your numbers get all messed up.

This change fixes the issue:

- IRC will now crash if it can't color a tmp.

- IRC doesn't crash on our tests anymore because I added a padInterference() utility that works
  around the interference problem by inserting Nops to pad between those instructions where
  conflating their early and late actions into one interference fencepost could create an
  uncolorable graph.

See https://bugs.webkit.org/show_bug.cgi?id=163548#c2 for a detailed discussion of how the
problem can arise.

This problem almost made me want to abandon our use of interference at instruction boundaries,
and introduce something more comprehensive, like interference at various stages of an
instruction's execution. The reason why I didn't do this is that this problem only arises in well
confined corner cases: you need an instruction that does a late use or def followed by an
instruction that does an early def. Register clobbers count as defs for this equation.
Fortunately, early defs are rare, and even when they do happen, you still need the previous
instruction to have a late something. Late uses are rare and many instructions don't have defs at
all, which means that it's actually pretty common for an instruction to not have anything late.
This means that the padInterference() strategy is ideal: our algorithms stay simple because they
only have to worry about interference at boundaries, and we rarely insert any Nops in
padInterference() so the IR stays nice and compact. Those Nops get removed by any phase that does
DCE, which includes eliminateDeadCode(), allocateStack(), and reportUsedRegisters(). In practice
allocateStack() kills them.

This also finally refactors our passing of RegisterSet to pass it by value, since it's small
enough that we're not gaining anything by using references. On x86, RegisterSet ought to be
smaller than a pointer.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::extraClobberedRegs):
(JSC::B3::StackmapSpecial::extraEarlyClobberedRegs):
* b3/B3StackmapSpecial.h:
* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::extraEarlyClobberedRegs):
(JSC::B3::Air::CCallSpecial::extraClobberedRegs):
* b3/air/AirCCallSpecial.h:
* b3/air/AirInst.h:
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::extraClobberedRegs):
(JSC::B3::Air::Inst::extraEarlyClobberedRegs):
* b3/air/AirIteratedRegisterCoalescing.cpp:
(JSC::B3::Air::iteratedRegisterCoalescing):
* b3/air/AirPadInterference.cpp: Added.
(JSC::B3::Air::padInterference):
* b3/air/AirPadInterference.h: Added.
* b3/air/AirSpecial.h:
* b3/air/AirSpillEverything.cpp:
(JSC::B3::Air::spillEverything):
* jit/RegisterSet.h:
(JSC::RegisterSet::isEmpty):

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

4 years agoAdd more tests for the double->String conversion in ValueAdd constant folding
sbarati@apple.com [Mon, 17 Oct 2016 21:44:43 +0000 (21:44 +0000)]
Add more tests for the double->String conversion in ValueAdd constant folding
https://bugs.webkit.org/show_bug.cgi?id=163517

Reviewed by Yusuke Suzuki.

* microbenchmarks/string-add-constant-folding.js:
(test):

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

4 years agoWebAssembly JS API: implement basic stub
jfbastien@apple.com [Mon, 17 Oct 2016 21:36:05 +0000 (21:36 +0000)]
WebAssembly JS API: implement basic stub

Implement the global WebAssembly JavaScript object, and its constructor +
function properties as described in:
  https://github.com/WebAssembly/design/blob/master/JS.md

These don't do anything at the moment, the parent bug will take care of adding
more functionality and associated tests.

WebAssembly JS API: implement basic stub
https://bugs.webkit.org/show_bug.cgi?id=163404

Reviewed by Keith Miller.

JSTests:

* wasm.yaml:
* wasm/js-api/test_basic_api.js: Added.
(const.f.of.functionProperties.WebAssembly.f.undefined.throw.new.Error.Couldn.const.c.of.constructorProperties.WebAssembly.c.undefined.throw.new.Error.Couldn):
(const.c.of.constructorProperties.catch):

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h: register the new WebAssembly object's name and its constructor properties
* jsc.cpp: remove useless include
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): add the WebAssembly global object and its constructor properties, but only if the JSC option enables it
* runtime/Options.h: add the useWebAssembly (alias: enableWebAssembly) option, defaulting to false
* wasm/WebAssemblyObject.cpp: Added.
(JSC::WebAssemblyObject::create): boilerplate
(JSC::WebAssemblyObject::createStructure): boilerplate
(JSC::WebAssemblyObject::finishCreation): boilerplate
(JSC::WebAssemblyObject::WebAssemblyObject): boilerplate
(JSC::wasmObjectFuncvalidate): auto-throws for now
(JSC::wasmObjectFunccompile): auto-throws for now
* wasm/WebAssemblyObject.h: Added.

Tools:

* Scripts/run-jsc-stress-tests: use the new JSC option which exposes the WebAssembly object.

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

4 years agoRemove an unused HistoryItem function
andersca@apple.com [Mon, 17 Oct 2016 21:17:20 +0000 (21:17 +0000)]
Remove an unused HistoryItem function
https://bugs.webkit.org/show_bug.cgi?id=163565

Reviewed by Tim Horton.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::isAncestorOf): Deleted.
* history/HistoryItem.h:

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

4 years agoUnreviewed, build fix after r207428
utatane.tea@gmail.com [Mon, 17 Oct 2016 21:10:34 +0000 (21:10 +0000)]
Unreviewed, build fix after r207428
https://bugs.webkit.org/show_bug.cgi?id=163223

Previous build fix r207428 broke all the builds.

* bytecode/PolymorphicAccess.h:

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

4 years agoAX: [Mac] mapping for output elements
n_wang@apple.com [Mon, 17 Oct 2016 21:00:47 +0000 (21:00 +0000)]
AX: [Mac] mapping for output elements
https://bugs.webkit.org/show_bug.cgi?id=163471

Reviewed by Chris Fleizach.

Source/WebCore:

Mapped the output element to status role and exposed its text content
as AXTitle.

Test: accessibility/mac/output-element.html

* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isOutput):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXOutputText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXOutputText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXOutputText):

LayoutTests:

* accessibility/mac/output-element-expected.txt: Added.
* accessibility/mac/output-element.html: Added.

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

4 years agoUnreviewed, build fix for GTK and Windows
utatane.tea@gmail.com [Mon, 17 Oct 2016 20:57:28 +0000 (20:57 +0000)]
Unreviewed, build fix for GTK and Windows
https://bugs.webkit.org/show_bug.cgi?id=163223

Attempt to fix build failures in GTK port and Windows port.

* bytecode/PolymorphicAccess.cpp:
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::SpillState::SpillState):

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

4 years ago[DOMJIT] Use DOMJIT::Patchpoint in IC
utatane.tea@gmail.com [Mon, 17 Oct 2016 20:43:43 +0000 (20:43 +0000)]
[DOMJIT] Use DOMJIT::Patchpoint in IC
https://bugs.webkit.org/show_bug.cgi?id=163223

Reviewed by Saam Barati.

JSTests:

* stress/domjit-exception-ic.js: Added.
(shouldBe):
(access):
* stress/domjit-exception.js: Added.
(shouldBe):
(access):
* stress/domjit-getter-complex-with-incorrect-object.js: Added.
(shouldThrow):
(access):
(i.shouldThrow):
* stress/domjit-getter-complex.js: Added.
(shouldBe):
(access):
* stress/domjit-getter-try-catch-getter-as-get-by-id-register-restoration.js: Added.
(assert):
(bar):
(foo):

Source/JavaScriptCore:

This patch uses DOMJIT::Patchpoint to inline DOM accesses even in IC!
It is useful for Baseline JIT cases and GetById cases in DFG and FTL.
In AccessCase, we construct the environment that allows DOMJIT::Patchpoint
to emit code and make DOMJIT accessors inlined in IC.

To allow DOMJIT::Patchpoint to emit code, we create a mechanism to emit calls
required in DOMJIT::Patchpoint. This system is useful when we create the super-
polymorphic support[1] later. And inlining mechanism is useful even after
introducing super-polymorphic support since it can work even after we fire the
watchpoint for super-polymorphic handling.

This patch improves Dromaeo dom-traverse 8% (263.95 runs/s v.s. 244.07 runs/s).

[1]: https://bugs.webkit.org/show_bug.cgi?id=163226

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/DOMJITAccessCasePatchpointParams.cpp: Added.
(JSC::SlowPathCallGeneratorWithArguments::SlowPathCallGeneratorWithArguments):
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
(JSC::DOMJITAccessCasePatchpointParams::emitSlowPathCalls):
* bytecode/DOMJITAccessCasePatchpointParams.h: Copied from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h.
(JSC::DOMJITAccessCasePatchpointParams::DOMJITAccessCasePatchpointParams):
(JSC::DOMJITAccessCasePatchpointParams::SlowPathCallGenerator::~SlowPathCallGenerator):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::liveRegistersForCall):
(JSC::AccessGenerationState::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::calleeSaveRegisters):
(JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
(JSC::AccessGenerationState::restoreLiveRegistersFromStackForCallWithThrownException):
(JSC::AccessGenerationState::restoreLiveRegistersFromStackForCall):
(JSC::AccessGenerationState::callSiteIndexForExceptionHandlingOrOriginal):
(JSC::AccessGenerationState::originalExceptionHandler):
(JSC::AccessCase::generateImpl):
(JSC::AccessCase::emitDOMJITGetter):
(JSC::PolymorphicAccess::regenerate):
(JSC::AccessGenerationState::preserveLiveRegistersToStackForCall): Deleted.
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::SpillState::isEmpty):
(JSC::AccessGenerationState::setSpillStateForJSGetterSetter):
(JSC::AccessGenerationState::spillStateForJSGetterSetter):
(JSC::AccessGenerationState::liveRegistersForCall): Deleted.
(JSC::AccessGenerationState::numberOfStackBytesUsedForRegisterPreservation): Deleted.
(JSC::AccessGenerationState::liveRegistersToPreserveAtExceptionHandlingCallSite): Deleted.
* dfg/DFGDOMJITPatchpointParams.cpp:
* dfg/DFGDOMJITPatchpointParams.h:
* domjit/DOMJITPatchpoint.h:
* domjit/DOMJITPatchpointParams.h:
(JSC::DOMJIT::PatchpointParams::addSlowPathCall):
* ftl/FTLDOMJITPatchpointParams.cpp:
* ftl/FTLDOMJITPatchpointParams.h:
* jsc.cpp:
(WTF::DOMJITNode::checkDOMJITNode):
(WTF::DOMJITGetterComplex::DOMJITGetterComplex):
(WTF::DOMJITGetterComplex::createStructure):
(WTF::DOMJITGetterComplex::create):
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT):
(WTF::DOMJITGetterComplex::domJITNodeGetterSetter):
(WTF::DOMJITGetterComplex::finishCreation):
(WTF::DOMJITGetterComplex::functionEnableException):
(WTF::DOMJITGetterComplex::customGetter):
(GlobalObject::finishCreation):
(functionCreateDOMJITGetterComplexObject):

Source/WebCore:

Make DOMJITPatchpointParams non-const.

* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::toWrapper):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeNodeTypeDOMJIT::callDOM):

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

4 years agoMove form.reportValidity() behind InteractiveFormValidation setting
cdumez@apple.com [Mon, 17 Oct 2016 20:38:46 +0000 (20:38 +0000)]
Move form.reportValidity() behind InteractiveFormValidation setting
https://bugs.webkit.org/show_bug.cgi?id=163550

Reviewed by Darin Adler.

Source/WebCore:

Move form.reportValidity() behind InteractiveFormValidation setting for consistency
given that the two features are strongly related.

Also enable the setting by default so we can get feedback on the implementation.

Demos:
- Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
- Report validity: https://googlechrome.github.io/samples/report-validity/

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:

Source/WebKit/mac:

Enable InteractiveFormValidation setting by default and link it to
RuntimeEnabledFeatures so we can use it in the IDL.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
* WebView/WebViewData.mm:
(-[WebViewPrivate init]):

Source/WebKit2:

Enable InteractiveFormValidation setting by default and link it to
RuntimeEnabledFeatures so we can use it in the IDL.

* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

4 years agoBuild fix for HasOwnPropertyCache::Entry caused slowdown by introducing a constructor...
sbarati@apple.com [Mon, 17 Oct 2016 20:34:15 +0000 (20:34 +0000)]
Build fix for HasOwnPropertyCache::Entry caused slowdown by introducing a constructor that doesn't use move semantics for the RefPtr<UniquedStringImpl> parameter
https://bugs.webkit.org/show_bug.cgi?id=163490

Reviewed by Darin Adler.

* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::Entry::Entry):
(JSC::HasOwnPropertyCache::tryAdd):

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

4 years agoUIProcess should determine throttle state for WebContent process
barraclough@apple.com [Mon, 17 Oct 2016 20:18:38 +0000 (20:18 +0000)]
UIProcess should determine throttle state for WebContent process
https://bugs.webkit.org/show_bug.cgi?id=163556

Reviewed by Anders Carlsson.

This is a step towards merging page/process throttling code for mac & iOS.

Previously WebPage determined whether to start a UserActivity based on page activity,
visibility and the preference to disable. Now WebPage passes the activity state across
to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
the UserActivity.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
    - updateActivityToken + updateProccessSuppressionState -> updateThrottleState
(WebKit::WebPageProxy::reattachToWebProcess):
    - updateActivityToken -> updateThrottleState
(WebKit::WebPageProxy::dispatchViewStateChange):
    - updateActivityToken -> updateThrottleState
(WebKit::WebPageProxy::setPageActivityState):
    - Record activity state passed from WebPage, and update.
(WebKit::WebPageProxy::preferencesDidChange):
    - updateProccessSuppressionState -> updateThrottleState
(WebKit::WebPageProxy::updateActivityToken): Deleted.
(WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
(WebKit::WebPageProxy::updateThrottleState):
    - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
    - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
* UIProcess/WebPageProxy.h:
    - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
    - Added setPageActivityState/m_activityState to report/record page activity.
    - Added m_pageSuppressed to prevent redundant message sends.
* UIProcess/WebPageProxy.messages.in:
    - Expose SetPageActivityState message (called by WebPage).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
    - removed m_processSuppressionEnabled
    - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
(WebKit::WebPage::setPageActivityState):
    - post activity state on to WebPageProxy.
(WebKit::WebPage::setPageSuppressed):
    - Start/stop USerActivity accordingly.
(WebKit::WebPage::setViewState):
    - No longer need to monitor ViewState changes on the WebProcess side.
(WebKit::WebPage::updatePreferences):
    - No longer need to monitor preference changes on the WebProcess side.
(WebKit::WebPage::updateUserActivity): Deleted.
    - Only updated on reciept of setPageSuppressed message.
* WebProcess/WebPage/WebPage.h:
    - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
    - Added setPageSuppressed message.
* WebProcess/WebPage/WebPage.messages.in:
    - Added SetPageSuppressed message.

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

4 years ago[Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
commit-queue@webkit.org [Mon, 17 Oct 2016 19:54:04 +0000 (19:54 +0000)]
[Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
https://bugs.webkit.org/show_bug.cgi?id=163502
<rdar://problem/28792017>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-17
Reviewed by Darin Adler.

Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
may load images from the modern-media-controls directory in the WebCore.framework bundle.
We use this new method in the iconService singleton when a `mediaControlsHost` is set,
which will be set in a later patch.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::base64StringForIconAndPlatform):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
(WebCore::RenderTheme::mediaControlsScript): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):

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

4 years agoFix iOS build.
andersca@apple.com [Mon, 17 Oct 2016 19:17:36 +0000 (19:17 +0000)]
Fix iOS build.

* History/WebBackForwardList.mm:
(-[WebBackForwardList dictionaryRepresentation]):

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

4 years ago[Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
commit-queue@webkit.org [Mon, 17 Oct 2016 19:11:20 +0000 (19:11 +0000)]
[Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
https://bugs.webkit.org/show_bug.cgi?id=163501
<rdar://problem/28792014>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-17
Reviewed by Darin Adler.

Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
concatenated CSS sources for the media controls shadow root via JS. Actually using this
API will be done in a later patch. We also no longer inject those styles as a user-agent
stylesheet when the runtime flag is on since it will no longer be necessary.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shadowRootCSSText):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

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

4 years agoImplement DOMPoint/DOMPointReadOnly
simon.fraser@apple.com [Mon, 17 Oct 2016 19:06:25 +0000 (19:06 +0000)]
Implement DOMPoint/DOMPointReadOnly
https://bugs.webkit.org/show_bug.cgi?id=133916

Reviewed by Darin Adler.
Source/WebCore:

Patch mostly by Dirk Schultz <krit@webkit.org>.

Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
(although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
with Chrome).

Test: geometry/DOMPoint-001.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPoint.h: Added.
* dom/DOMPoint.idl: Added.
* dom/DOMPointInit.h: Added.
* dom/DOMPointInit.idl: Added.
* dom/DOMPointReadOnly.h: Added.
(WebCore::DOMPointReadOnly::create):
(WebCore::DOMPointReadOnly::fromPoint):
(WebCore::DOMPointReadOnly::x):
(WebCore::DOMPointReadOnly::y):
(WebCore::DOMPointReadOnly::z):
(WebCore::DOMPointReadOnly::w):
(WebCore::DOMPointReadOnly::DOMPointReadOnly):
* dom/DOMPointReadOnly.idl: Added.

LayoutTests:

New Web Platform-style test, and rebaselines.

* geometry/DOMPoint-001-expected.txt: Added.
* geometry/DOMPoint-001.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoCTTE some of the BackForwardList member functions
andersca@apple.com [Mon, 17 Oct 2016 18:35:17 +0000 (18:35 +0000)]
CTTE some of the BackForwardList member functions
https://bugs.webkit.org/show_bug.cgi?id=163555

Reviewed by Dan Bernstein.

* History/BackForwardList.h:
(BackForwardList::entries):
* History/BackForwardList.mm:
(BackForwardList::removeItem):
(BackForwardList::containsItem):
(BackForwardList::entries): Deleted.
* History/WebBackForwardList.mm:
(-[WebBackForwardList removeItem:]):
(-[WebBackForwardList containsItem:]):
(-[WebBackForwardList description]):

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

4 years ago[Modern Media Controls] Use modern-media-controls module sources for media controls...
commit-queue@webkit.org [Mon, 17 Oct 2016 18:26:49 +0000 (18:26 +0000)]
[Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
https://bugs.webkit.org/show_bug.cgi?id=163500
<rdar://problem/28792010>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-17
Reviewed by Darin Adler.

Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
directory.

Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
scripts and styles in RenderTheme when the runtime flag is on.

* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):

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

4 years agoFix typo in error message.
simon.fraser@apple.com [Mon, 17 Oct 2016 18:14:20 +0000 (18:14 +0000)]
Fix typo in error message.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):

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

4 years agoresolve-ChangeLogs: Specify --no-page to git diff
commit-queue@webkit.org [Mon, 17 Oct 2016 17:59:17 +0000 (17:59 +0000)]
resolve-ChangeLogs: Specify --no-page to git diff
https://bugs.webkit.org/show_bug.cgi?id=163441

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-17
Reviewed by Darin Adler.

resolve-ChangeLogs shows the result after resolving by invoking
'git diff'. It runs a pager for every ChangeLog if it is under
TTY.

* Scripts/resolve-ChangeLogs:
(showStatus): Specify '--no-page' to git diff.

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

4 years agoRemove WEBCORE_EXPORT from BackForwardList, it lives in WebKit now
andersca@apple.com [Mon, 17 Oct 2016 17:59:04 +0000 (17:59 +0000)]
Remove WEBCORE_EXPORT from BackForwardList, it lives in WebKit now
https://bugs.webkit.org/show_bug.cgi?id=163551

Reviewed by Tim Horton.

* History/BackForwardList.h:

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

4 years agoREGRESSION(r206189): logs error statements when API::URLRequest is canceled
mcatanzaro@igalia.com [Mon, 17 Oct 2016 17:49:14 +0000 (17:49 +0000)]
REGRESSION(r206189): logs error statements when API::URLRequest is canceled
https://bugs.webkit.org/show_bug.cgi?id=163393

Reviewed by Antti Koivisto.

Print this case at normal logging level, not as an error.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):

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

4 years ago[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadi...
cdumez@apple.com [Mon, 17 Oct 2016 17:48:28 +0000 (17:48 +0000)]
[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
https://bugs.webkit.org/show_bug.cgi?id=163547

Reviewed by Darin Adler.

Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
now that it is available in UIKit.

* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):

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

4 years agopreprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
commit-queue@webkit.org [Mon, 17 Oct 2016 17:32:18 +0000 (17:32 +0000)]
preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
https://bugs.webkit.org/show_bug.cgi?id=163435

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-17
Reviewed by Alex Christensen.

cl.exe outputs processing filenames to stderr. Suppress this
annoying messages by using open3 instead of open2.

* bindings/scripts/preprocessor.pm:
(applyPreprocessor): Use open3 in case of Windows Perl.

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

4 years agoUse the reject() helper function for conditionally throwing TypeErrors.
mark.lam@apple.com [Mon, 17 Oct 2016 16:59:06 +0000 (16:59 +0000)]
Use the reject() helper function for conditionally throwing TypeErrors.
https://bugs.webkit.org/show_bug.cgi?id=163491

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

In some places where we may conditionally throw a TypeError (e.g. when in strict
mode), we already use the reject() helper function to conditionally throw the
TypeError.  Doing so makes the code mode compact.  This patch applies this idiom
consistently in all places that throws TypeError where appropriate.

This patch also does the following:
1. Make the reject() helper function take an ASCIILiteral instead of a const char*
   because we always pass it a literal string anyway.
2. Change the reject helper() to take a ThrowScope&.  This allows the thrown
   error to be attributed to its caller.
3. When an error message string is instantiated repeatedly in more than 1 place,
   create a common copy of that literal string in JSObject.cpp (if one doesn't
   already exist) and use that common string in all those places.
4. Since I was auditing call sites of throwTypeError() to check if they should be
   using the reject() helper instead, I also fixed those up to pass the error
   message as an ASCIILiteral where appropriate.
5. In functions that I touched, change the code to not recompute the VM& when it
   is already available.

* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ArrayPrototype.cpp:
(JSC::shift):
(JSC::unshift):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncReverse):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/GetterSetter.cpp:
(JSC::callSetter):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::setLengthWithArrayStorage):
(JSC::JSArray::pop):
* runtime/JSArrayBuffer.cpp:
(JSC::JSArrayBuffer::put):
(JSC::JSArrayBuffer::defineOwnProperty):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::putToPrimitiveByIndex):
* runtime/JSDataView.cpp:
(JSC::JSDataView::put):
(JSC::JSDataView::defineOwnProperty):
* runtime/JSFunction.cpp:
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndex):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::defineOwnProperty):
* runtime/JSObject.cpp:
(JSC::ordinarySetSlow):
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::putInline):
* runtime/JSProxy.cpp:
(JSC::JSProxy::setPrototype):
* runtime/JSSymbolTableObject.h:
(JSC::symbolTablePut):
* runtime/Lookup.h:
(JSC::putEntry):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):
* runtime/RegExpObject.h:
(JSC::RegExpObject::setLastIndex):
* runtime/Reject.h:
(JSC::reject):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::putEntry):
(JSC::SparseArrayValueMap::putDirect):
(JSC::SparseArrayEntry::put):
* runtime/StringObject.cpp:
(JSC::StringObject::put):
(JSC::StringObject::putByIndex):
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):

Source/WebCore:

No new tests because this patch does not introduce new behavior.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaKeyGenParams):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):

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

4 years agoRebaseline mathml/mathml-in-dashboard.html for mac.
ryanhaddad@apple.com [Mon, 17 Oct 2016 16:56:19 +0000 (16:56 +0000)]
Rebaseline mathml/mathml-in-dashboard.html for mac.

Unreviewed test gardening.

* platform/mac/mathml/mathml-in-dashboard-expected.txt: Added.

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

4 years ago[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivat...
commit-queue@webkit.org [Mon, 17 Oct 2016 16:56:19 +0000 (16:56 +0000)]
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511

Patch by Miguel Gomez <magomez@igalia.com> on 2016-10-17
Reviewed by Carlos Garcia Campos.

Perform the video repaint in the main thread when accelerated compositing is disabled.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

4 years agoAir::IRC needs to place all Tmps on some worklist, even if they have no interference...
fpizlo@apple.com [Mon, 17 Oct 2016 16:19:10 +0000 (16:19 +0000)]
Air::IRC needs to place all Tmps on some worklist, even if they have no interference edges
https://bugs.webkit.org/show_bug.cgi?id=163509

Reviewed by Mark Lam.

The worklist building function in IRC skips temporaries that have no degree. This doesn't appear
to be necessary. This has been there since the original IRC commit. It hasn't caused bugs because
ordinarily, the only way to have a tmp with no degree is to not have any mention of that tmp. But
while working on bug 163371, I hit a crazy corner case where a temporary would have no
interference edges (i.e. no degree). Here's how it happens:

A spill tmp from a previous iteration of IRC may have no degree: imagine a tmp that is live
everywhere and interferes with everyone, but has one use like:

Move %ourTmp, %someOtherTmp

Where there are no other tmps live.  After spill conversion, this may look like:

Move (ourSpill), %newTmp
Move %newTmp, %someOtherTmp

Of course, we'd rather not get this kind of spill code but it's totally possible because we now
have a bunch of random conditions under which we won't slap the spill address directly into the
Move.

After this happens, assuming that the only thing live was %someOtherTmp, we will have zero degree
for %newTmp because the Move is coalescable and does not contribute to interference.

Then, we might coalesce %someOtherTmp with %newTmp.  Once this happens, if we make the %newTmp be
the master, we're in deep trouble because %newTmp is not on any worklist.

I don't know how to reproduce this except through the patch in bug 163371. Removing the two lines
of code that skipped no-degree tmps causes no regressions, and resolves the problem I was having.

* b3/air/AirIteratedRegisterCoalescing.cpp:

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

4 years agoEleminate code duplication between ResourceRequest encoding/decoding implementations
annulen@yandex.ru [Mon, 17 Oct 2016 11:59:58 +0000 (11:59 +0000)]
Eleminate code duplication between ResourceRequest encoding/decoding implementations
https://bugs.webkit.org/show_bug.cgi?id=163507

Reviewed by Carlos Garcia Campos.

ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
ditto for decoding implementations.

Source/WebCore:

No new tests needed.

* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodeBase):
(WebCore::ResourceRequestBase::decodeBase):
(WebCore::ResourceRequestBase::encodeWithoutPlatformData):
(WebCore::ResourceRequestBase::decodeWithoutPlatformData):
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData):
(WebCore::ResourceRequest::decodeWithPlatformData):

Source/WebKit2:

* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

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

4 years agoMove user agent quirks to cross-platform location
mcatanzaro@igalia.com [Mon, 17 Oct 2016 11:30:17 +0000 (11:30 +0000)]
Move user agent quirks to cross-platform location
https://bugs.webkit.org/show_bug.cgi?id=163508

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.

* PlatformGTK.cmake:
* platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
* platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
(WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
only apply to sites if the base domain matches google.*, not any base domain that starts
with google.
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
* platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
(WebCore::UserAgentQuirks::UserAgentQuirks):
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
* platform/efl/UserAgentEfl.cpp:
(WebCore::standardUserAgentForURL):
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::standardUserAgentForURL):
(): Deleted.
(WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
(WebCore::UserAgentQuirks::add): Deleted.
(WebCore::UserAgentQuirks::contains): Deleted.
(WebCore::UserAgentQuirks::isEmpty): Deleted.
(WebCore::urlRequiresChromeBrowser): Deleted.
(WebCore::urlRequiresMacintoshPlatform): Deleted.

Source/WebKit2:

#include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.

* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/efl/WebPageProxyEfl.cpp:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:

Tools:

Move the test to a cross-platform location and improve it to better check the full list of
sites we have defined quirks for.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp.
(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::TEST):

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

4 years ago[SOUP] Downloads should always sniff contents
carlosgc@webkit.org [Mon, 17 Oct 2016 10:52:02 +0000 (10:52 +0000)]
[SOUP] Downloads should always sniff contents
https://bugs.webkit.org/show_bug.cgi?id=163538

Reviewed by Michael Catanzaro.

Source/WebKit2:

It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
sniff the contents to guess the mime type.

* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().

Tools:

Add a test case to check that the MIME type is correctly guessed for downloads.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(writeNextChunk):
(serverCallback):
(testDownloadMIMEType):
(beforeAll):
(writeNextChunkIdle): Deleted.

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

4 years ago[GTK] Switch to use API::DownloadClient instead of the C API client
carlosgc@webkit.org [Mon, 17 Oct 2016 10:45:15 +0000 (10:45 +0000)]
[GTK] Switch to use API::DownloadClient instead of the C API client
https://bugs.webkit.org/show_bug.cgi?id=163537

Reviewed by Michael Catanzaro.

The code is simpler and we avoid all the toImpl/toAPI.

* UIProcess/API/gtk/WebKitDownloadClient.cpp:
(attachDownloadClientToContext):
(didStart):
(didReceiveResponse):
(didReceiveData):
(decideDestinationWithSuggestedFilename):
(didCreateDestination):
(didFail):
(didCancel):
(didFinish):

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

4 years ago[GTK] gobject-introspection on package build with webkit2gtk fails without active...
berto@igalia.com [Mon, 17 Oct 2016 09:06:17 +0000 (09:06 +0000)]
[GTK] gobject-introspection on package build with webkit2gtk fails without active X session
https://bugs.webkit.org/show_bug.cgi?id=163105

Reviewed by Carlos Garcia Campos.

Don't call XCompositeQueryExtension() or XDamageQueryExtension()
if m_display is NULL.

* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXComposite):
(WebCore::PlatformDisplayX11::supportsXDamage):

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

4 years ago[css-grid] Disable CSS Grid Layout runtime flag by default
rego@igalia.com [Mon, 17 Oct 2016 07:23:07 +0000 (07:23 +0000)]
[css-grid] Disable CSS Grid Layout runtime flag by default
https://bugs.webkit.org/show_bug.cgi?id=163432

Reviewed by Darin Adler.

It was enabled in r201042, but now Safari Technology Preview
has a UI to switch runtime flags so it doesn't need to be enabled
by default anymore.

* Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
by default.

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

4 years agoAX: [Mac] roleDescription for AXTextField input types
n_wang@apple.com [Mon, 17 Oct 2016 05:58:18 +0000 (05:58 +0000)]
AX: [Mac] roleDescription for AXTextField input types
https://bugs.webkit.org/show_bug.cgi?id=163419
<rdar://problem/28766192>

Reviewed by Darin Adler.

Source/WebCore:

Provided more detailed role description for input types that
exposed as standard text fields on the mac.

Changes are covered in modified test expectation.

* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):

LayoutTests:

* platform/mac/accessibility/roles-exposed-expected.txt:

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

4 years agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Mon, 17 Oct 2016 03:41:01 +0000 (03:41 +0000)]
Unreviewed GTK test gardening

* mathml/mathml-in-dashboard-expected.txt:
* platform/gtk/TestExpectations:

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

4 years agoFix Perl warning about masked variable following <http://trac.webkit.org/changeset...
dbates@webkit.org [Mon, 17 Oct 2016 03:03:23 +0000 (03:03 +0000)]
Fix Perl warning about masked variable following <trac.webkit.org/changeset/207382>
(https://bugs.webkit.org/show_bug.cgi?id=163456)

* Scripts/prepare-ChangeLog:
(actuallyGenerateFunctionLists):

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

4 years agoUpdate WebKit localizable strings
cdumez@apple.com [Mon, 17 Oct 2016 02:12:32 +0000 (02:12 +0000)]
Update WebKit localizable strings
https://bugs.webkit.org/show_bug.cgi?id=163513

Reviewed by Dan Bernstein.

Update WebKit localizable strings as it was missing the "too short" one needed
by form validation. This was causing a "Localized string not found" message to
be shown when testing the following sample on WebKit ToT:
- https://googlechrome.github.io/samples/report-validity/

* English.lproj/Localizable.strings:

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

4 years agoREGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to...
cdumez@apple.com [Mon, 17 Oct 2016 01:28:51 +0000 (01:28 +0000)]
REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
https://bugs.webkit.org/show_bug.cgi?id=163506
<rdar://problem/28792483>

Reviewed by Darin Adler.

As per the NSEvent documentation [1], calling [NSEvent characters] is only
valid on key up / key down events and will raise an NSInternalInconsistencyException
if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
is called with the third kind of key event (NSFlagsChanged) which is used for
detecting modifier keys. We normally detect the modifier key and return early before
calling [NSEvent characters]. However, in some rare cases, we fail to detect the
modifier key and we fall through.

To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
fail to detect the modifier key and before calling [NSEvent characters].

[1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters

No new test, not easily testable.

* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):

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

4 years agoMove CSS classes from ExceptionCode to Exception
darin@apple.com [Mon, 17 Oct 2016 00:16:05 +0000 (00:16 +0000)]
Move CSS classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163494

Reviewed by Sam Weinig.

Source/WebCore:

Removed the "get" prefix from the names of many CSSPrimitiveValue
functions to match WebKit coding style and to disambiguate them
from the public CSS DOM functions that raise exceptions.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::propertyNamePrefix): Use enum class.
(WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
(WebCore::stylePropertyGetter): Refactor to simplify structure.
(WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
(WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
and use propagateException to handle ExcpetionOr.
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
(WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
initialize a global here.

* bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
functions returning ExceptionOr<String>.

* bindings/scripts/gobject-generate-headers.pl: Deleted.

* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Use pairValue.
(WebCore::convertToCenterCoordinate): Use valueID and pairValue.
(WebCore::cssValueToBasicShapeRadius): Ditto.
* css/CSSBasicShapes.cpp:
(WebCore::serializePositionOffset): Ditto.
(WebCore::buildSerializablePositionOffset): Ditto.
(WebCore::CSSBasicShapeCircle::cssText): Ditto.
(WebCore::CSSBasicShapeEllipse::cssText): Ditto.
(WebCore::updateCornerRadiusWidthAndHeight): Ditto.
* css/CSSBorderImageSliceValue.h: Use quadValue.
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory): Use floatValue and doubleValue.

* css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
* css/CSSCharsetRule.idl: Use non-legacy exceptions.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
(WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
(WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
(WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
a Ref instead of a RefPtr.
* css/CSSComputedStyleDeclaration.h: Updated for above changes.

* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
(WebCore::CSSCrossfadeValue::image): Ditto.
(WebCore::CSSCrossfadeValue::blend): Use doubleValue.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStyleMask): Use valueID.
(WebCore::CSSFontFace::calculateWeightMask): Ditto.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
(WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
(WebCore::CSSFontFaceSet::check): Ditto.
* css/CSSFontFaceSet.h: Updated for above changes.

* css/CSSGradientValue.cpp:
(WebCore::compareStops): Use doubleValue.
(WebCore::CSSGradientValue::addStops): Use floatValue.
(WebCore::positionFromValue): Use floatValue and valudID.
(WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
(WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
(WebCore::CSSRadialGradientValue::createGradient): Use valueID.

* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
(WebCore::CSSGroupingRule::deleteRule): Ditto.
* css/CSSGroupingRule.h: Updated for above changes.

* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.

* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::fillImageSet): Use floatValue.

* css/CSSMediaRule.idl: Use non-legacy exceptions.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
(WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
since getDoubleValue is unused, moving the call to clampTo into this function.
Also changed this to use ExceptionOr.
(WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
(WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
and an out argument to return the value and check for type failure.
(WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getStringValue): Ditto.
(WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
(WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
(WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
(WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getPairValue): Deleted.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
* css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
out of the class definition. Updated for the above changes.
* css/CSSPrimitiveValue.idl: Use non-legacy exceptions.

* css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.

* css/CSSRule.cpp:
(WebCore::CSSRule::setCssText): Use ExceptionOr.
* css/CSSRule.h: Updated for above change.
* css/CSSRule.idl: Use non-legacy exceptions.

* css/CSSStyleDeclaration.h: Use ExceptionOr.
* css/CSSStyleDeclaration.idl: Use non-legacy exceptions.

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
(WebCore::CSSStyleSheet::insertRule): Ditto.
(WebCore::CSSStyleSheet::deleteRule): Ditto.
(WebCore::CSSStyleSheet::addRule): Ditto.
* css/CSSStyleSheet.h: Updated for the above changes.
* css/CSSStyleSheet.idl: Use non-legacy exceptions.

* css/CSSSupportsRule.idl: Use non-legacy exceptions.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
(WebCore::convertToLengthSize): Ditto.
(WebCore::CSSToStyleMap::mapFillSize): Ditto.
(WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
(WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
(WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
(WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
(WebCore::CSSToStyleMap::mapAnimationName): Ditto.
(WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
(WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.

* css/CSSValue.h: Use ExceptionOr.
* css/CSSValue.idl: Use non-legacy exceptions.

* css/Counter.h: Use stringValue instead of getStringValue, etc.

* css/FontFace.cpp:
(WebCore::FontFace::create): Use ExceptionOr.
(WebCore::FontFace::setFamily): Ditto.
(WebCore::FontFace::setStyle): Ditto.
(WebCore::FontFace::setWeight): Ditto.
(WebCore::FontFace::setStretch): Ditto.
(WebCore::FontFace::setUnicodeRange): Ditto.
(WebCore::FontFace::setVariant): Ditto.
(WebCore::FontFace::setFeatureSettings): Ditto.
* css/FontFace.h: Updated for above changes.
* css/FontFace.idl: Use non-legacy exceptions.

* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load): Use ExceptionOr.
(WebCore::FontFaceSet::check): Ditto.
* css/FontFaceSet.h: Updated for above changes.
* css/FontFaceSet.idl: Use non-legacy exceptions.

* css/FontVariantBuilder.cpp:
(WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
(WebCore::extractFontVariantNumeric): Ditto.
(WebCore::extractFontVariantEastAsian): Ditto.

* css/MediaList.cpp:
(WebCore::MediaList::setMediaText): Use ExceptionOr.
(WebCore::MediaList::deleteMedium): Ditto.
(WebCore::MediaList::appendMedium): Ditto.
* css/MediaList.h: Updated for above changes.
* css/MediaList.idl: Use non-legacy exceptions.

* css/MediaQueryEvaluator.cpp:
(WebCore::doubleValue): Use valueID instead of getValueID, etc.
(WebCore::colorGamutEvaluate): Ditto.
(WebCore::invertedColorsEvaluate): Ditto.
(WebCore::orientationEvaluate): Ditto.
(WebCore::evaluateResolution): Ditto.
(WebCore::computeLength): Ditto.
(WebCore::viewModeEvaluate): Ditto.
(WebCore::hoverEvaluate): Ditto.
(WebCore::pointerEvaluate): Ditto.
(WebCore::prefersReducedMotionEvaluate): Ditto.

* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
* css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
Also marked a couple additional functions private.

* css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
* css/StyleBuilderCustom.h: Ditto.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
(WebCore::StyleResolver::createFilterOperations): Ditto.
* css/TransformFunctions.cpp:
(WebCore::transformsForValue): Ditto.
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.

* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
getting rid of the one that uses an ExceptionCode.
(WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
(WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
(WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
(WebCore::WebKitCSSMatrix::scale): Ditto.
(WebCore::WebKitCSSMatrix::rotate): Ditto.
(WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
(WebCore::WebKitCSSMatrix::skewX): Ditto.
(WebCore::WebKitCSSMatrix::skewY): Ditto.
(WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
* css/WebKitCSSMatrix.h: Updated for above changes.
* css/WebKitCSSMatrix.idl: Use non-legacy extensions.

* css/makeprop.pl:
(handleCurrentColorValue): Use valueID instead of getValueID.
(generateValueSetter): Ditto.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
(WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
(WebCore::CSSParser::parseFillPosition): Ditto.
(WebCore::CSSParser::parseFillRepeat): Ditto.
(WebCore::CSSParser::parseGridPosition): Ditto.
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
(WebCore::isGridTrackFixedSized): Ditto.
(WebCore::CSSParser::parseRadialGradient): Ditto.
(WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.

* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
setPrimitiveType here. The createParserOperator returns an object that
already has the correct primitive type.

* css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
getXXXValue functions, but not sure if it's right since it is commented out
code that I did not compile.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
(WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
(WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.

* dom/Range.cpp: Added now-needed include of ExceptionCode.h.
* dom/SelectorQuery.cpp: Ditto.

* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier): Use valueID instead of getValueID, etc.
(WebCore::ApplyStyleCommand::computedFontSize): Ditto.
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty): Ditto.
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
(WebCore::EditingStyle::extractFontSizeDelta): Ditto.
(WebCore::EditingStyle::textDirection): Ditto.
(WebCore::EditingStyle::prepareToApplyAt): Ditto.
(WebCore::EditingStyle::textDirectionForSelection): Ditto.
(WebCore::fontWeightIsBold): Ditto.
(WebCore::legacyFontSizeFromCSSValue): Ditto.
(WebCore::isTransparentColorValue): Ditto.
(WebCore::hasTransparentBackgroundColor): Ditto.
(WebCore::backgroundColorInEffect): Ditto.

* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
what we do by default for things returning ExceptionOr.
* editing/RemoveCSSPropertyCommand.cpp:
(WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
(WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.

* editing/cocoa/HTMLConverter.mm:
(floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
* editing/markup.cpp:
(WebCore::propertyMissingOrEqualToNone): Ditto.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
(WebCore::InspectorStyleSheet::deleteRule): Ditto.
(WebCore::InspectorStyleSheet::setStyleText): Ditto.

* svg/SVGLength.cpp:
(WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.

Source/WebKit/mac:

* DOM/DOMCSSMediaRule.mm:
(-[DOMCSSMediaRule insertRule:index:]): Use raiseOnDOMError
the new way to handle ExceptionOr instead of ExceptionCode.
(-[DOMCSSMediaRule deleteRule:]): Ditto.
* DOM/DOMCSSPrimitiveValue.mm:
(-[DOMCSSPrimitiveValue setFloatValue:floatValue:]): Ditto.
(-[DOMCSSPrimitiveValue getFloatValue:]): Ditto.
(-[DOMCSSPrimitiveValue setStringValue:stringValue:]): Ditto.
(-[DOMCSSPrimitiveValue getStringValue]): Ditto.
(-[DOMCSSPrimitiveValue getCounterValue]): Ditto.
(-[DOMCSSPrimitiveValue getRectValue]): Ditto.
(-[DOMCSSPrimitiveValue getRGBColorValue]): Ditto.
* DOM/DOMCSSRule.mm:
(-[DOMCSSRule setCssText:]): Ditto.
* DOM/DOMCSSStyleDeclaration.mm:
(-[DOMCSSStyleDeclaration setCssText:]): Ditto.
(-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
(-[DOMCSSStyleDeclaration setProperty:value:priority:]): Ditto.
* DOM/DOMCSSStyleSheet.mm:
(-[DOMCSSStyleSheet insertRule:index:]): Ditto.
(-[DOMCSSStyleSheet deleteRule:]): Ditto.
(-[DOMCSSStyleSheet addRule:style:index:]): Ditto.
(-[DOMCSSStyleSheet removeRule:]): Ditto.
* DOM/DOMCSSValue.mm:
(-[DOMCSSValue setCssText:]): Ditto.
* DOM/DOMMediaList.mm:
(-[DOMMediaList setMediaText:]): Ditto.
(-[DOMMediaList deleteMedium:]): Ditto.
(-[DOMMediaList appendMedium:]): Ditto.

* DOM/ExceptionHandlers.h: Added an overload of raiseDOMException
that works with a WebCore::Exception&& and overloads of
raiseOnDOMError that work with WebCore::ExceptionOr&&.
* DOM/ExceptionHandlers.mm:
(raiseDOMException): Implemented the new version.

Source/WebKit/win:

* DOMCSSClasses.cpp:
(DOMCSSStyleDeclaration::setCssText): Remove ExceptionCode handling.
(DOMCSSStyleDeclaration::setProperty): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
(webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
(webkit_dom_css_style_declaration_remove_property): Ditto.
(webkit_dom_css_style_declaration_set_property): Ditto.
(webkit_dom_css_style_declaration_set_css_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
(webkit_dom_css_style_sheet_insert_rule): Ditto.
(webkit_dom_css_style_sheet_delete_rule): Ditto.
(webkit_dom_css_style_sheet_add_rule): Ditto.
(webkit_dom_css_style_sheet_remove_rule): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(webkit_dom_css_value_set_css_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
(webkit_dom_media_list_delete_medium): Ditto.
(webkit_dom_media_list_append_medium): Ditto.
(webkit_dom_media_list_set_media_text): Ditto.

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

4 years ago[Modern Media Controls] Styles for StartButton are missing
commit-queue@webkit.org [Sun, 16 Oct 2016 22:11:41 +0000 (22:11 +0000)]
[Modern Media Controls] Styles for StartButton are missing
https://bugs.webkit.org/show_bug.cgi?id=163499
<rdar://problem/28792009>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-16
Reviewed by Darin Adler.

Source/WebCore:

Add styling for StartButton so that instances are always displayed in the center of their container.

Test: media/modern-media-controls/start-button/start-button-styles.html

* Modules/modern-media-controls/controls/start-button.css: Added.
(button.start):
(button.start > *):
(button.start > div):
(button.start > img):
(button.start:active > img):

LayoutTests:

New test checking StartButton instances have the right CSS styles applied to their DOM structure.

* media/modern-media-controls/start-button/start-button-styles-expected.txt: Added.
* media/modern-media-controls/start-button/start-button-styles.html: Added.

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

4 years agoImplement serializer = { attribute }
simon.fraser@apple.com [Sun, 16 Oct 2016 18:59:31 +0000 (18:59 +0000)]
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466

Follow-up fix to die if "serializer {...}" lists an attribute not present
on the interface. I don't think this is testable with the current bindings tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):

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

4 years agoAdd the "Geometry Interfaces" to features.json.
simon.fraser@apple.com [Sun, 16 Oct 2016 18:47:05 +0000 (18:47 +0000)]
Add the "Geometry Interfaces" to features.json.

* features.json:

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

4 years ago[EFL] Meter tests have been failed since r207280
gyuyoung.kim@webkit.org [Sun, 16 Oct 2016 14:30:37 +0000 (14:30 +0000)]
[EFL] Meter tests have been failed since r207280

Unreviewed EFL gardening. And add new baseline for meter-element.html.

* platform/efl/TestExpectations: Mark 2 tests to failure.
* platform/efl/fast/dom/HTMLMeterElement/meter-element-expected.txt: Added.

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

4 years ago[GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
carlosgc@webkit.org [Sun, 16 Oct 2016 09:31:13 +0000 (09:31 +0000)]
[GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
https://bugs.webkit.org/show_bug.cgi?id=163443

Reviewed by Michael Catanzaro.

Adopt the reference returned by webkitWebsiteDataManagerCreate().

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):

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

4 years agoUnreviewed. Fix GTK+ unit test /webkit2/WebKitWebContext/languages after r206949.
carlosgc@webkit.org [Sun, 16 Oct 2016 09:27:44 +0000 (09:27 +0000)]
Unreviewed. Fix GTK+ unit test /webkit2/WebKitWebContext/languages after r206949.

After r206949 navigator.language returns en-US instead of en-us. Language tags in Accept-Language header are
actually case-insensitive, so we should actually do case-insensitive comparisons, but we only have
g_assert_cmpstr for tests.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextLanguages):

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

4 years ago[GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResour...
carlosgc@webkit.org [Sun, 16 Oct 2016 09:11:18 +0000 (09:11 +0000)]
[GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
https://bugs.webkit.org/show_bug.cgi?id=163389

Reviewed by Michael Catanzaro.

Source/WebKit2:

Update the page URI also when the load is committed.

* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(getDocumentLoaderURL):
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didCommitLoadForFrame):
(webkitWebPageCreate):
(getProvisionalURLForFrame): Deleted.

Tools:

Update /webkit2/WebKitWebPage/get-uri test to check that web view and page uri always match even when request is
modified by WebKitWebPage::send-request signal.

* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(testWebPageURI):

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

4 years agoDocument request not updated after willSendRequest is called for a redirect
carlosgc@webkit.org [Sun, 16 Oct 2016 08:35:18 +0000 (08:35 +0000)]
Document request not updated after willSendRequest is called for a redirect
https://bugs.webkit.org/show_bug.cgi?id=163436

Reviewed by Michael Catanzaro.

Source/WebCore:

The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.

Covered by GTK+ unit tests.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
and called for a redirection.

Tools:

Update /webkit2/WebKitWebView/active-uri test to check the active URI also when modified by
WebKitPage::send-request signal in a web extension.

* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(testWebViewActiveURI):
(serverCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(sendRequestCallback):
* TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp:
(loadChangedCallback):

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

4 years agoAdd a $vm.getpid() method.
mark.lam@apple.com [Sun, 16 Oct 2016 01:44:18 +0000 (01:44 +0000)]
Add a $vm.getpid() method.
https://bugs.webkit.org/show_bug.cgi?id=163493

Reviewed by Saam Barati.

This is especially useful when we need to know the pid of an instance of jsc in
the foreground that we're trying to attach a debugger to while the JSC tests are
running in the background with a gazillion other jsc processes live at the same
time.

Currently, $vm.getpid() is only supported on non-Windows platforms.
According to https://msdn.microsoft.com/en-us/library/ms235372.aspx, getpid() is
deprecated.  According to https://msdn.microsoft.com/en-us/library/t2y34y40.aspx,
_getpid() cannot be used in applications that execute in the Windows Runtime.

Since this is only a debugging tool and is not a required feature, I'll defer
the Windows implementation of this function till the time when someone actually
needs it.

* tools/JSDollarVMPrototype.cpp:
(JSC::functionGetPID):
(JSC::JSDollarVMPrototype::finishCreation):

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

4 years agoDelete the animated image catchup code
commit-queue@webkit.org [Sun, 16 Oct 2016 00:19:22 +0000 (00:19 +0000)]
Delete the animated image catchup code
https://bugs.webkit.org/show_bug.cgi?id=163410

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-10-15
Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes two issues in the animated image workflow:

1) Setting the animation timer should follow the following rules:

    -- Initial case: Which happens before drawing the first frame. We
    should set the timer to fire after the current_frame_duration.

    -- Late case (Slow animation): This happens if the current_time is
    past the next_frame_desired_time. In this case we should fire the
    timer immediately.

    -- Early case (Fast animation): This happens when there is still time
    before the next_frame_desired_time. In this case we should set the
    timer to fire after the difference between the next_frame_desired_time
    and the current_time.

2) Deleting the code for catching up the current_frame:

    This code used to run in the slow animation case. It was never used
    on iOS. It was trying to adjust the current_frame according to the
    current_time as if there were no delay. It turned out that this might
    cause a bigger delay because most likely the decoder decodes the image
    frames incrementally; i.e. to decode frame k, it has to have frame
    (k - 1) decoded.

Test: fast/images/ordered-animated-image-frames.html

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Remove the iOS specific code.
(WebCore::BitmapImage::startAnimation): Move the animation finishing code from
BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
duration code as it is described above.

(WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
into this function.

(WebCore::BitmapImage::resetAnimation):

(WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
* platform/graphics/BitmapImage.h:

* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
(WebCore::Image::startAnimation):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::startAnimation):
* svg/graphics/SVGImage.h:
Remove the catchup code form the Image and SVGImage classes.

LayoutTests:

This animated gif has one red frame, one green frame and two red frames.
The test page renders only two frames from this this image on a canvas. The
test passes if the second frame (the green one) is rendered on the canvas
even if drawImage() is called after the duration of the first frame.

* fast/images/ordered-animated-image-frames-expected.html: Added.
* fast/images/ordered-animated-image-frames.html: Added.
* fast/images/resources/animated-red-green-blue.gif: Added.

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

4 years agoREGRESSION (r191699): Contextual menu in Mail compose view doesn’t include any of...
mitz@apple.com [Sat, 15 Oct 2016 23:53:20 +0000 (23:53 +0000)]
REGRESSION (r191699): Contextual menu in Mail compose view doesn’t include any of the standard submenus
https://bugs.webkit.org/show_bug.cgi?id=163492
<rdar://problem/28654799>

Reviewed by Darin Adler.

Source/WebKit/mac:

Test: TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm

* WebView/WebHTMLView.mm:
(createMenuItem): Set the tag for items that have submenus as well.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm: Added.
(-[ContextMenuDefaultItemsHaveTagsDelegate webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):

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

4 years agoMove Web SQL database and WebSockets off legacy exceptions
darin@apple.com [Sat, 15 Oct 2016 23:23:33 +0000 (23:23 +0000)]
Move Web SQL database and WebSockets off legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163284

Reviewed by Chris Dumez.

* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
* Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
* Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.

* Modules/webdatabase/SQLResultSet.cpp:
(WebCore::SQLResultSet::SQLResultSet): Move initialization of
many data members into the class definition.
(WebCore::SQLResultSet::insertId): Use ExceptionOr.
(WebCore::SQLResultSet::rowsAffected): Moved into class definition.
(WebCore::SQLResultSet::rows): Ditto.
(WebCore::SQLResultSet::setInsertId): Ditto.
(WebCore::SQLResultSet::setRowsAffected): Ditto.

* Modules/webdatabase/SQLResultSet.h: Updated for above.

* Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
Added a FIXME about the mismatch between long and int64_t.

* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::execute): Use reference instead of pointer.

* Modules/websockets/WebSocket.cpp:
(WebCore::isValidProtocolString): Use StringView.
(WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
spelling error in the name of this function.
(WebCore::WebSocket::WebSocket): Move initialization of many data
members into the class definition.
(WebCore::WebSocket::create): Use ExceptionOr.
(WebCore::WebSocket::connect): Ditto.
(WebCore::WebSocket::send): Ditto.
(WebCore::WebSocket::close): Ditto.
(WebCore::WebSocket::binaryType): Update to use enum class.
(WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
use enum class.
(WebCore::WebSocket::didReceiveBinaryData): Ditto.

* Modules/websockets/WebSocket.h: Updated for above. Changed the
BinaryType enum into an enum class.

* Modules/websockets/WebSocket.idl: Use non-legacy exceptions.

* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
Updated for name change to subprotocolSeparator.

* dom/ExceptionOr.h: Added a constructor for scalar types that does not
require an rvalue reference. We can refine this more later, but for now
this is sufficient to obviate the need for WTFMove where it otherwise would
have been needed in the code above.

* inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.

* page/DOMWindow.idl: Touched this file to work around bugs in the dependency
analysis of the current CMake build system, since otherwise it doesn't process the
change to the partial interface WebSocket. Edited lots of comments, removed many
others, and tweaked formatting.

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

4 years agoTest that duplicate axis values in font-variation-settings are resolved correctly
mmaxfield@apple.com [Sat, 15 Oct 2016 23:21:32 +0000 (23:21 +0000)]
Test that duplicate axis values in font-variation-settings are resolved correctly
https://bugs.webkit.org/show_bug.cgi?id=163489

Reviewed by Darin Adler.

* fast/text/variations/duplicate-axis-expected.html: Added.
* fast/text/variations/duplicate-axis.html: Added.

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

4 years agoprepare-ChangeLog erroneously said that a python __init__ method was deleted
dbates@webkit.org [Sat, 15 Oct 2016 22:04:08 +0000 (22:04 +0000)]
prepare-ChangeLog erroneously said that a python __init__ method was deleted
https://bugs.webkit.org/show_bug.cgi?id=163456

Reviewed by Simon Fraser.

Fixes an issue where prepare-ChangeLog may list as deleted functions that are
immediately above added code.

Currently prepare-ChangeLog makes use of the same overlap detection algorithm
to compute the list of deleted functions as it does to compute added and modified
functions. We consider a function deleted if its entire function body and signature
are removed. It is sufficient to compare the list of functions before the patch
is applied and the list of functions are the patch is applied to identify
these functions.

* Scripts/prepare-ChangeLog: Fix some style nits, including using Camel Case for
variable names.
(actuallyGenerateFunctionLists): Modified to call computeModifiedFunctions(). Always
compute the list of functions in the file after the patch regardless of whether the
patch only contains deletions. We will compare this list against the list of functions
before the patch was applied to determine the deleted functions.
(computeModifiedFunctions): Renamed; formerly named generateFunctionListsByRanges.
Removed out argument for the seen functions as we no longer make use of when computing
the list of deleted functions.
(diffCommand): Update comment.
(generateFunctionListsByRanges): Deleted.
* Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl: Added more unit tests.

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

4 years agoMessageEvent's source property should be a (DOMWindow or MessagePort)? rather than...
weinig@apple.com [Sat, 15 Oct 2016 21:52:09 +0000 (21:52 +0000)]
MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
https://bugs.webkit.org/show_bug.cgi?id=163475

Reviewed by Simon Fraser.

Source/WebCore:

Start fleshing out union support, starting with MessageEvent.
- Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
  used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
  possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.

* bindings/generic/IDLTypes.h:
Switch IDLInterface to use RefPtr<T> as its implementation type.

* bindings/js/JSDOMConvert.h:
(WebCore::Detail::VariadicConverterBase::convert):
- Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
  and window shell, and not always an optimization, e.g. in the case of a single interface.
- Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
  handles window and window shell correctly.
- Also fix an issue where we would wrongly assert that one interface had to match.

* bindings/js/JSDOMWrapper.h:
(WebCore::isJSDOMWrapperType): Deleted.
Remove unused predicate.

* bindings/scripts/IDLParser.pm:
(parseType):
Add missing support for nullable unions.

* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add new tests for unions (both non-null and nullable) in dictionaries.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
* dom/ContainerNode.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):
* dom/Node.h:
Add using declaration for NodeOrString and change it to use RefPtr<Node>.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::source):
(WebCore::isValidSource): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::event):
Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
observable, and will rectified in subsequent patches.

Source/WTF:

* wtf/Variant.h:
Add missing return statement that was tripping up some compilers.

LayoutTests:

* fast/dom/message-port-deleted-by-accessor.html:
Switch source parameter to null to avoid accidental type error.

* fast/events/constructors/message-event-constructor-expected.txt:
* fast/events/constructors/message-event-constructor.html:
Update test expect a thrown type error, as is now expected, for non-window or MessagePort EventTargets.

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

4 years agoAdd support for reportValidity() on form and form control elements
cdumez@apple.com [Sat, 15 Oct 2016 21:31:59 +0000 (21:31 +0000)]
Add support for reportValidity() on form and form control elements
https://bugs.webkit.org/show_bug.cgi?id=163479

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-reportValidity-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validate-expected.txt:

Source/WebCore:

Add support for reportValidity() on form and form control elements:
- https://html.spec.whatwg.org/#dom-form-reportvalidity
- https://html.spec.whatwg.org/#dom-cva-reportvalidity

Firefox and Chrome already support this.

Demo: https://googlechrome.github.io/samples/report-validity/

No new tests, rebaselined existing tests.

* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
Add reportValidity() operation.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::checkValidity):

(WebCore::HTMLFormControlElement::reportValidity):
Add implementation for reportValidity() for form control elements.
First, it calls checkValidity() and returns early if there is no
constraint violation. if the JS canceled the 'invalid' event
fired by checkValidity(), then return early as well, as per the
specification. If the element is focusable, we scroll to it,
focus it and show the validation message. Otherwise, we log a
error message to the console. The last part of the behavior
matches what we already did in HTMLFormElement::validateInteractively()
and complies with the behavior in the specification.

(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
Add utility function to scroll to the form control element, focus
it and show its validation message. This code was moved from
HTMLFormElement::validateInteractively() so that it could be reused
in HTMLFormControlElement::reportValidity().

* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::validateInteractively):
Move the early abort checks to the existing call site (prepareForSubmission)
so that we can reuse this method for reportValidity().

(WebCore::HTMLFormElement::prepareForSubmission):
Only call validateInteractively() if we really should validate. Those checks
used to be in validateInteractively() but I moved them here so we could more
easily reuse validateInteractively().

(WebCore::HTMLFormElement::checkValidity):
(WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
Update Vector type to be a Vector of HTMLFormControlElement given that we
only add HTMLFormControlElement objects to it and that it results it simpler
code.

(WebCore::HTMLFormElement::reportValidity):
Add implementation for reportValidity() for form elements. The
implementation calls our already existing validateInteractively()
method, as per the specification.

* html/HTMLFormElement.h:

* html/HTMLObjectElement.h:
reportValidity() returns true unconditionally for object elements,
similarly to checkValidity().

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

4 years agoSort the project file.
simon.fraser@apple.com [Sat, 15 Oct 2016 21:18:56 +0000 (21:18 +0000)]
Sort the project file.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoImplement serializer = { attribute }
simon.fraser@apple.com [Sat, 15 Oct 2016 21:15:17 +0000 (21:15 +0000)]
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466

Reviewed by Darin Adler.

Fix the code generator to generate code for serializer = { attribute }.
In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
to detect these; it needs to create the domSerializable() now. Basic support
for isSerializableAttribute() is added (primitive types only).

GenerateSerializerFunction is fixed to output code for the serializable attributes
in the order specified in "serializer = {}", as specified in WebIDL.

Removed custom serialization for ClientRect and PerformanceTiming.

Other minor cleanup to always get $interfaceName from $interface->name, and to fix
ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Removed.
* bindings/js/JSPerformanceTimingCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateSerializerFunction):
* bindings/scripts/IDLParser.pm:
(parseSerializerRest):
(parseSerializationPattern):
(parseSerializationAttributes):
(isSerializableAttribute):
(applyMemberList):
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
* bindings/scripts/test/JS/JSTestSerialization.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
* dom/ClientRect.idl:
* page/PerformanceTiming.idl:

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

4 years agoAssertion failed under operationToLowerCase with a rope with zero length
sbarati@apple.com [Sat, 15 Oct 2016 20:56:24 +0000 (20:56 +0000)]
Assertion failed under operationToLowerCase with a rope with zero length
https://bugs.webkit.org/show_bug.cgi?id=163314

Reviewed by Mark Lam.

JSTests:

* stress/to-lower-case-intrinsic-on-empty-rope.js: Added.
(assert):
(returnRope.helper):
(returnRope):
(lower):

Source/JavaScriptCore:

There are some ways to get JSC to create empty rope strings. ToLowerCase
inside the DFG/FTL goes to the slow path when the argument is a rope.
operationToLowerCase was calling into a WTF string function that
assumed we are passing it a this value that has non-zero length.
However, we were calling it with a string that did have zero length.
To fix this, we make operationToLowerCase return the empty JSString
if it is going to make a string with zero length.

* dfg/DFGOperations.cpp:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionIsRope):

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

4 years ago[GTK] Restore user agent quirk for Yahoo
mcatanzaro@igalia.com [Sat, 15 Oct 2016 15:04:01 +0000 (15:04 +0000)]
[GTK] Restore user agent quirk for Yahoo
https://bugs.webkit.org/show_bug.cgi?id=163481

Reviewed by Carlos Garcia Campos.

finance.yahoo.com is sending a mobile version in response to our standard user agent.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):

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

4 years agoSetting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
cdumez@apple.com [Sat, 15 Oct 2016 14:53:23 +0000 (14:53 +0000)]
Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=163472

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline w3c test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/media-elements/volume_nonfinite-expected.txt:

Source/WebCore:

Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
- https://html.spec.whatwg.org/#dom-media-volume

This is because the attribute is of type double (not unrestricted double in the IDL).

Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.

No new tests, rebaselined existing test.

* html/HTMLMediaElement.idl:

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

4 years agoCounterNode::resetRenderers is so inefficient.
zalan@apple.com [Sat, 15 Oct 2016 14:24:33 +0000 (14:24 +0000)]
CounterNode::resetRenderers is so inefficient.
https://bugs.webkit.org/show_bug.cgi?id=163480

Reviewed by Simon Fraser.

CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
and sets the dirty bit on them.
This patch does all that in a loop, instead of traversing the linked tree on each removal.

No change in functionality.

* rendering/CounterNode.cpp:
(WebCore::CounterNode::CounterNode):
(WebCore::CounterNode::~CounterNode):
(WebCore::CounterNode::nextInPreOrderAfterChildren):
(WebCore::CounterNode::lastDescendant):
(WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
(WebCore::CounterNode::removeRenderer):
(WebCore::CounterNode::resetRenderers):
(WebCore::CounterNode::insertAfter):
(WebCore::CounterNode::removeChild):
* rendering/CounterNode.h:
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::RenderCounter):
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::originalText):
(WebCore::updateCounters):
(WebCore::RenderCounter::invalidate): Deleted.
* rendering/RenderCounter.h:

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

4 years ago[Modern Media Controls] macOS inline controls
commit-queue@webkit.org [Sat, 15 Oct 2016 09:15:41 +0000 (09:15 +0000)]
[Modern Media Controls] macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=163444
<rdar://problem/27989473>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-15
Reviewed by Dean Jackson.

Source/WebCore:

Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.

Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
       media/modern-media-controls/macos-media-controls/macos-media-controls.html

* Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
(.media-controls.mac.inline > .controls-bar):
(.media-controls.mac.inline > .controls-bar > *):
(.media-controls.mac.inline button):
(.media-controls.mac.inline button:active):
(.media-controls.mac.inline > .controls-bar button):
(.media-controls.mac.inline > .controls-bar,):
(.media-controls.mac.inline button.play-pause):
(.media-controls.mac.inline button.skip-back):
(.media-controls.mac.inline .scrubber.slider):
(.media-controls.mac.inline button.mute):
(.media-controls.mac.inline button.airplay):
(.media-controls.mac.inline button.pip):
(.media-controls.mac.inline button.tracks):
(.media-controls.mac.inline button.fullscreen):
(.media-controls.mac.inline .time-label):
(.media-controls.mac.inline .volume-slider-container):
(.media-controls.mac.inline .volume-slider-container:before):
(.media-controls.mac.inline .volume.slider):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
(MacOSInlineMediaControls.prototype.layout):
(MacOSInlineMediaControls.prototype.handleEvent):
* Modules/modern-media-controls/controls/macos-media-controls.js: Added.
(MacOSMediaControls):

LayoutTests:

Testing the properties of the new MacOSMediaControls and MacOSInlineMediaControls classes.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html: Added.
* media/modern-media-controls/macos-media-controls/macos-media-controls-expected.txt: Added.
* media/modern-media-controls/macos-media-controls/macos-media-controls.html: Added.

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

4 years ago100% CPU on homedepot.com page
antti@apple.com [Sat, 15 Oct 2016 08:27:19 +0000 (08:27 +0000)]
100% CPU on homedepot.com page
https://bugs.webkit.org/show_bug.cgi?id=163452
<rdar://problem/28730708>

Reviewed by Simon Fraser.

Source/WebCore:

The site has a keyframe animation on body. Currently this causes the animation to invalidate the
style of the entire document.

Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
that causes full subtree invalidation. However animation only ever affect individual elements and
the normal style resolution mechanism should be able to deal with things like inheritance as needed.

Test: fast/animation/animation-style-update-size.html

* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* dom/Document.h:
(WebCore::Document::lastStyleUpdateSizeForTesting):

    Testing support.

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):

    Don't force subtree style resolution for SyntheticStyleChange.

* style/StyleUpdate.h:
(WebCore::Style::Update::size):
* testing/Internals.cpp:
(WebCore::Internals::lastStyleUpdateSize):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/animation/animation-style-update-size-expected.txt: Added.
* fast/animation/animation-style-update-size.html: Added.

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

4 years agoWeb Inspector: Cleanup parts of DebuggerManager
joepeck@webkit.org [Sat, 15 Oct 2016 07:22:03 +0000 (07:22 +0000)]
Web Inspector: Cleanup parts of DebuggerManager
https://bugs.webkit.org/show_bug.cgi?id=163400

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.restoreBreakpointsSoon):

(WebInspector.DebuggerManager.prototype.get paused):
(WebInspector.DebuggerManager.prototype.get pauseReason):
(WebInspector.DebuggerManager.prototype.get pauseData):
(WebInspector.DebuggerManager.prototype.get callFrames):
(WebInspector.DebuggerManager.prototype.get activeCallFrame):
(WebInspector.DebuggerManager.prototype.set activeCallFrame):
Put simple accessors at the top.

(WebInspector.DebuggerManager.prototype.get allExceptionsBreakpoint):
(WebInspector.DebuggerManager.prototype.get allUncaughtExceptionsBreakpoint):
(WebInspector.DebuggerManager.prototype.get breakpoints):
(WebInspector.DebuggerManager.prototype.breakpointForIdentifier):
(WebInspector.DebuggerManager.prototype.breakpointsForSourceCode):
(WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DebuggerManager.prototype.isBreakpointEditable):
(WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
Group public breakpoint state and access methods.

(WebInspector.DebuggerManager.prototype.scriptForIdentifier):
(WebInspector.DebuggerManager.prototype.scriptsForURL):
(WebInspector.DebuggerManager.prototype.get searchableScripts):
(WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
Group public script access methods.

(WebInspector.DebuggerManager.prototype.pause):
(WebInspector.DebuggerManager.prototype.resume):
(WebInspector.DebuggerManager.prototype.stepOver):
(WebInspector.DebuggerManager.prototype.stepInto):
(WebInspector.DebuggerManager.prototype.stepOut):
(WebInspector.DebuggerManager.prototype.continueToLocation):
(WebInspector.DebuggerManager.prototype.addBreakpoint):
(WebInspector.DebuggerManager.prototype.removeBreakpoint):
Group and modernize public methods that perform actions.

(WebInspector.DebuggerManager.prototype.nextBreakpointActionIdentifier):
Misc. methods.

(WebInspector.DebuggerManager.prototype.breakpointResolved):
(WebInspector.DebuggerManager.prototype.reset):
(WebInspector.DebuggerManager.prototype.playBreakpointActionSound):
(WebInspector.DebuggerManager.prototype.scriptDidParse):
(WebInspector.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
(WebInspector.DebuggerManager.prototype._setBreakpoint):
(WebInspector.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
(WebInspector.DebuggerManager.prototype._updateBreakOnExceptionsState):
(WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
Minor cleanup in protected and private methods.

* UserInterface/Models/BreakpointAction.js:
(WebInspector.BreakpointAction):
Getting the next identifier is an action so it should be a function call.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
Remove unused parameter.

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

4 years agoREGRESSION (r206973): Running "webkit-patch suggest-reviewers" throws an AttributeErr...
simon.fraser@apple.com [Sat, 15 Oct 2016 04:18:19 +0000 (04:18 +0000)]
REGRESSION (r206973): Running "webkit-patch suggest-reviewers" throws an AttributeError: 'NoneType' object has no attribute 'full_name'
https://bugs.webkit.org/show_bug.cgi?id=163478

Reviewed by Daniel Bates.

Handle a None other in Contributor.__eq__.

* Scripts/webkitpy/common/config/committers.py:
(Contributor.__eq__):

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

4 years ago[JSC] op_negate should with any type
commit-queue@webkit.org [Sat, 15 Oct 2016 02:19:16 +0000 (02:19 +0000)]
[JSC] op_negate should with any type
https://bugs.webkit.org/show_bug.cgi?id=162587

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-10-14
Reviewed by Saam Barati.

JSTests:

* stress/arith-abs-to-arith-negate-range-optimizaton.js: Added.
Cover OSR Exits when converting Math.abs() into ArithNegate.

* stress/arith-negate-on-various-types.js: Added.
Cover ArithNegate with all types.

Source/JavaScriptCore:

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
ArithNegate is quite simple. If the input is double, the output
is double. The other cases are set from the LLInt slow case.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

* dfg/DFGIntegerRangeOptimizationPhase.cpp:
Tweak a bit the IntegerRangeOptimizationPhase when simplifying
ArithAbs to ArithNegate.
We should not do the conversion if the target nodes OSR Exits
on different input than the source node.

In particular, Checked ArithNegate exits on zero while
ArithAbs has not problem with it.
Unchecked ArithAbs() do not OSR Exit on INT_MIN, ArithNeg
should not either.

* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithNegate):
(JSC::DFG::SpeculativeJIT::compileMathIC):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMathIC):
(JSC::FTL::DFG::LowerDFGToB3::compileArithNegate):

* jit/JITNegGenerator.cpp:
(JSC::JITNegGenerator::generateFastPath):
* jit/JITOperations.cpp:
Add result profiling in baseline to have types we can use
in DFG and FTL.

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