WebKit-https.git
2 years ago[CSS Parser] Turn back on a bunch of layout tests
hyatt@apple.com [Wed, 7 Dec 2016 17:18:45 +0000 (17:18 +0000)]
[CSS Parser] Turn back on a bunch of layout tests
https://bugs.webkit.org/show_bug.cgi?id=165529

Reviewed by Zalan Bujtas.

Source/WebCore:

Fixes fast/css/transform-origin-parsing.html.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
The implicit check was relying on a null check of the z value, but
we called releaseNonNull on it already. This meant all z properties were
marked as implicit incorrectly. Fix by storing whether or not we had a z
value in a local variable.

LayoutTests:

* TestExpectations:
* css3/parsing-css3-nthchild-expected.txt:
* css3/parsing-css3-nthchild.html:
* css3/scroll-snap/scroll-snap-position-values-expected.txt:
* css3/scroll-snap/scroll-snap-position-values.html:
* editing/execCommand/insert-list-with-noneditable-content-expected.txt:
* fast/css/object-position/parsing-object-position-expected.txt:
* fast/css/object-position/parsing-object-position.html:
* fast/css/parsing-css-number-types-expected.txt:
* fast/css/parsing-css-wrap-expected.txt:
* fast/css/script-tests/transform-origin-parsing.js:
* fast/css/transform-inline-style-remove-expected.txt:
* fast/css/transform-origin-parsing-expected.txt:
* fast/css/variables/custom-property-dynamic-update-expected.html:
* fast/events/mouse-cursor-expected.txt:
* fast/inspector-support/style-expected.txt:
* platform/mac/svg/webarchive/svg-script-subresouces-expected.txt:

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

2 years agoVersioning.
matthew_hanson@apple.com [Wed, 7 Dec 2016 16:48:03 +0000 (16:48 +0000)]
Versioning.

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

2 years agoRebaseline fast/table/003.html after r209421.
ryanhaddad@apple.com [Wed, 7 Dec 2016 16:35:35 +0000 (16:35 +0000)]
Rebaseline fast/table/003.html after r209421.
https://bugs.webkit.org/show_bug.cgi?id=165513

Unreviewed test gardening.

* platform/ios-simulator/fast/table/003-expected.txt:

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

2 years ago[iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
akling@apple.com [Wed, 7 Dec 2016 16:27:34 +0000 (16:27 +0000)]
[iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
<https://webkit.org/b/165527>

Reviewed by Antti Koivisto.

This code no longer does anything, as the page cache is hard capped
at 0 entries while under memory pressure.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

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

2 years ago[JSC] Merge PromiseReactions
utatane.tea@gmail.com [Wed, 7 Dec 2016 15:32:27 +0000 (15:32 +0000)]
[JSC] Merge PromiseReactions
https://bugs.webkit.org/show_bug.cgi?id=165526

Reviewed by Sam Weinig.

Our promise implementation has two arrays per Promise; promiseFulfillReactions and promiseRejectReactions.
And everytime we call `promise.then`, we create two promise reactions for fullfill and reject.
However, these two reactions and the arrays for reactions can be merged into one array and one reaction.
It reduces the unnecessary object allocations.

No behavior change.

* builtins/BuiltinNames.h:
* builtins/PromiseOperations.js:
(globalPrivate.newPromiseReaction):
(globalPrivate.triggerPromiseReactions):
(globalPrivate.rejectPromise):
(globalPrivate.fulfillPromise):
(globalPrivate.promiseReactionJob):
(globalPrivate.initializePromise):
* builtins/PromisePrototype.js:
(then):
* runtime/JSPromise.cpp:
(JSC::JSPromise::finishCreation):

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

2 years ago[GTK][jhbuild] missing dependency on libvpx in gst-plugins-good
philn@webkit.org [Wed, 7 Dec 2016 13:38:57 +0000 (13:38 +0000)]
[GTK][jhbuild] missing dependency on libvpx in gst-plugins-good
https://bugs.webkit.org/show_bug.cgi?id=165525

Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules: gst-plugins-good should depend on the
libvpx package built within jhbuild.

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

2 years agoUnreviewed, GTK build fix after r209407.
philn@webkit.org [Wed, 7 Dec 2016 11:14:48 +0000 (11:14 +0000)]
Unreviewed, GTK build fix after r209407.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage):
* UIProcess/LegacySessionStateCodingNone.cpp:
(WebKit::decodeLegacySessionState):

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

2 years ago[GTK][jhbuild] gst-plugins-bad fails to build with OpenSSL 1.1.0
philn@webkit.org [Wed, 7 Dec 2016 09:15:37 +0000 (09:15 +0000)]
[GTK][jhbuild] gst-plugins-bad fails to build with OpenSSL 1.1.0
https://bugs.webkit.org/show_bug.cgi?id=165520

Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules: Added missing dependency on openh264 in
gst-plugins-bad, along with 2 upstream patches fixing the build
against OpenSSL 1.1.0.
* gtk/patches/gst-plugins-bad-0001-dtls-port-to-OpenSSL-1.1.0.patch: Added.
* gtk/patches/gst-plugins-bad-0002-dtlscertificate-Fix-error-checking-in-RSA_generate_k.patch: Added.

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

2 years ago[Modern Media Controls] Use tap and pinch gestures on iOS
graouts@webkit.org [Wed, 7 Dec 2016 07:48:23 +0000 (07:48 +0000)]
[Modern Media Controls] Use tap and pinch gestures on iOS
https://bugs.webkit.org/show_bug.cgi?id=165518

Reviewed by Dean Jackson.

Source/WebCore:

We now use touch events to identify taps and pinches on media controls to respond immediately
to user interaction on buttons and enter fullscreen when pinching out.

* Modules/modern-media-controls/controls/button.css:
(button):
* Modules/modern-media-controls/controls/button.js:
(Button):
(Button.prototype.handleEvent):
(Button.prototype.gestureRecognizerStateDidChange):
(Button.prototype._notifyDelegateOfActivation):
(Button.prototype._handleUIEvent): Deleted.
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set fadesWhileIdle):
(ControlsBar.prototype.gestureRecognizerStateDidChange):
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js: Added.
(GestureRecognizer):
(GestureRecognizer.prototype.get state):
(GestureRecognizer.prototype.set state):
(GestureRecognizer.prototype.get target):
(GestureRecognizer.prototype.set target):
(GestureRecognizer.prototype.get numberOfTouches):
(GestureRecognizer.prototype.get enabled):
(GestureRecognizer.prototype.set enabled):
(GestureRecognizer.prototype.reset):
(GestureRecognizer.prototype.locationInElement):
(GestureRecognizer.prototype.locationInClient):
(GestureRecognizer.prototype.locationOfTouchInElement):
(GestureRecognizer.prototype.touchesBegan):
(GestureRecognizer.prototype.touchesMoved):
(GestureRecognizer.prototype.touchesEnded):
(GestureRecognizer.prototype.touchesCancelled):
(GestureRecognizer.prototype.gestureBegan):
(GestureRecognizer.prototype.gestureChanged):
(GestureRecognizer.prototype.gestureEnded):
(GestureRecognizer.prototype.enterPossibleState):
(GestureRecognizer.prototype.enterBeganState):
(GestureRecognizer.prototype.enterEndedState):
(GestureRecognizer.prototype.enterCancelledState):
(GestureRecognizer.prototype.enterFailedState):
(GestureRecognizer.prototype.enterChangedState):
(GestureRecognizer.prototype.enterRecognizedState):
(GestureRecognizer.prototype.handleEvent):
(GestureRecognizer.prototype._initRecognizer):
(GestureRecognizer.prototype._updateBaseListeners):
(GestureRecognizer.prototype._removeTrackingListeners):
(GestureRecognizer.prototype._updateTargetTouches):
(GestureRecognizer.prototype._updateKeyboardModifiers):
* Modules/modern-media-controls/gesture-recognizers/pinch.js: Added.
(PinchGestureRecognizer):
(PinchGestureRecognizer.prototype.get velocity):
(PinchGestureRecognizer.prototype.touchesBegan):
(PinchGestureRecognizer.prototype.touchesMoved):
(PinchGestureRecognizer.prototype.touchesEnded):
(PinchGestureRecognizer.prototype.gestureBegan):
(PinchGestureRecognizer.prototype.gestureChanged):
(PinchGestureRecognizer.prototype.gestureEnded):
(PinchGestureRecognizer.prototype.reset):
(PinchGestureRecognizer.prototype._recordGesture):
(PinchGestureRecognizer.prototype._updateStateWithEvent):
(PinchGestureRecognizer.prototype._distance):
* Modules/modern-media-controls/gesture-recognizers/tap.js: Added.
(TapGestureRecognizer):
(TapGestureRecognizer.prototype.touchesBegan):
(TapGestureRecognizer.prototype.touchesMoved):
(TapGestureRecognizer.prototype.touchesEnded):
(TapGestureRecognizer.prototype.reset):
(TapGestureRecognizer.prototype.locationInElement):
(TapGestureRecognizer.prototype.locationInClient):
(TapGestureRecognizer.prototype._clearTimer):
(TapGestureRecognizer.prototype._rewindTimer):
(TapGestureRecognizer.prototype._timerFired):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport):
(ControlsVisibilitySupport.prototype.handleEvent):
(ControlsVisibilitySupport.prototype.syncControl): Deleted.
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport):
(FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
(FullscreenSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.handleEvent):
(MediaControllerSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/mute-support.js:
(MuteSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/skip-back-support.js:
(SkipBackSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.buttonWasClicked): Deleted.

LayoutTests:

With the addition of new gesture recognizer source files, some tests were failing
due to linking to only a subset of the modern media controls resources.

* media/modern-media-controls/airplay-button/airplay-button.html:
* media/modern-media-controls/aspect-ratio-button/aspect-ratio-button.html:
* media/modern-media-controls/button/button.html:
* media/modern-media-controls/buttons-container/buttons-container-buttons-property.html:
* media/modern-media-controls/buttons-container/buttons-container-constructor.html:
* media/modern-media-controls/buttons-container/buttons-container-layout.html:
* media/modern-media-controls/fullscreen-button/fullscreen-button.html:
* media/modern-media-controls/icon-button/icon-button-active-state.html:
* media/modern-media-controls/icon-button/icon-button.html:
* media/modern-media-controls/mute-button/mute-button.html:
* media/modern-media-controls/pip-button/pip-button.html:
* media/modern-media-controls/placard/placard.html:
* media/modern-media-controls/play-pause-button/play-pause-button.html:
* media/modern-media-controls/skip-back-button/skip-back-button.html:
* media/modern-media-controls/start-button/start-button-styles.html:
* media/modern-media-controls/start-button/start-button.html:
* media/modern-media-controls/tracks-button/tracks-button.html:

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

2 years agoApply styling to media documents with modern controls
dino@apple.com [Wed, 7 Dec 2016 06:07:42 +0000 (06:07 +0000)]
Apply styling to media documents with modern controls
https://bugs.webkit.org/show_bug.cgi?id=165499
<rdar://problems/29543847>

Reviewed by Antoine Quint.

Forgot to commit most of the changes in MediaDocument.cpp :(

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

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

2 years agoUnreviewed, rolling out r209422.
ryanhaddad@apple.com [Wed, 7 Dec 2016 05:31:57 +0000 (05:31 +0000)]
Unreviewed, rolling out r209422.

This change caused assertion failures during API tests.

Reverted changeset:

"[MediaStream][Mac] Revoke sandbox extensions when capture
ends"
https://bugs.webkit.org/show_bug.cgi?id=165476
http://trac.webkit.org/changeset/209422

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

2 years agoMarking http/tests/security/module-incorrect-mime-types.html as flaky on ios-simulato...
ryanhaddad@apple.com [Wed, 7 Dec 2016 05:18:56 +0000 (05:18 +0000)]
Marking http/tests/security/module-incorrect-mime-types.html as flaky on ios-simulator-wk2.
https://bugs.webkit.org/show_bug.cgi?id=165344

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoTwo tiled drawing tests failing with visual viewports enabled.
simon.fraser@apple.com [Wed, 7 Dec 2016 05:14:28 +0000 (05:14 +0000)]
Two tiled drawing tests failing with visual viewports enabled.
https://bugs.webkit.org/show_bug.cgi?id=165489

Reviewed by Dean Jackson.
Source/WebCore:

computeLayoutViewportOrigin() gets called for iframes when the layout viewport
is zero-sized, but the visual viewport is non-zero. It doesn't really make sense
to compute a layout viewport when the visual viewport is larger than the layout
viewport, but if this happens just anchor the layout viewport at the origin
of the visual viewport.

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

LayoutTests:

Unfail and rebaseline.

* platform/mac-wk2/TestExpectations:
* tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:

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

2 years agoRemove various stray uses of WebCore::Dictionary
darin@apple.com [Wed, 7 Dec 2016 04:58:23 +0000 (04:58 +0000)]
Remove various stray uses of WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=165358

Reviewed by Sam Weinig.

I discovered three completely unused classes in the MediaStream code:
MediaTrackConstraint, MediaTrackConstraintSet, and MediaTrackConstraints.
While there is some chance we may implement these at some point, they are
likely to be dictionaries or some other kind of data structure rather than
clases, and there is no reason to keep the current classes.

* CMakeLists.txt: Removed MediaTrackConstraint, MediaTrackConstraintSet,
and MediaTrackConstraints.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.

* Modules/indexeddb/IDBDatabase.h: Removed include of Dictionary.h.
* Modules/indexeddb/IDBObjectStore.cpp: Added include of HeapInlines.h.
* Modules/indexeddb/IDBRequest.cpp: Added include of StrongInlines.h.
* Modules/indexeddb/IDBTransaction.cpp: Added include of SerializedScriptValue.h.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getConstraints): Deleted.
This function is implemented entirely in the bindings layer.
* Modules/mediastream/MediaStreamTrack.h: Removed getConstraints.

* Modules/mediastream/MediaTrackConstraint.cpp: Removed.
* Modules/mediastream/MediaTrackConstraint.h: Removed.
* Modules/mediastream/MediaTrackConstraint.idl: Removed.
* Modules/mediastream/MediaTrackConstraintSet.cpp: Removed.
* Modules/mediastream/MediaTrackConstraintSet.h: Removed.
* Modules/mediastream/MediaTrackConstraintSet.idl: Removed.
* Modules/mediastream/MediaTrackConstraints.cpp: Removed.
* Modules/mediastream/MediaTrackConstraints.h: Removed.
* Modules/mediastream/MediaTrackConstraints.idl: Removed.

* Modules/mediastream/NavigatorUserMedia.idl: Use the type names from the latest
getUserMedia specification for the arguments to webkitGetUserMedia; not sure they
are precisely correct for this legacy function, but since this is a JSBuiltin,
it's all ignored anyway. Just important not to call anything "Dictionary".

* WebCore.xcodeproj/project.pbxproj: Removed MediaTrackConstraint, MediaTrackConstraintSet,
and MediaTrackConstraints.

* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection): Use uncheckedArgument, since
the code explicitly checks the number of arguments.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.

* bindings/js/JSFontFaceCustom.cpp: Removed include of Dictionary.h.
* dom/Document.cpp: Ditto.
* dom/Element.cpp: Ditto.

* dom/Element.h: Removed forward declaration of Dictionary.

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

2 years agoAfter preventing a beforeinput event, an input event is fired when formatting rich...
wenson_hsieh@apple.com [Wed, 7 Dec 2016 04:36:55 +0000 (04:36 +0000)]
After preventing a beforeinput event, an input event is fired when formatting rich text
https://bugs.webkit.org/show_bug.cgi?id=165435
<rdar://problem/29522314>

Reviewed by Ryosuke Niwa.

Source/WebCore:

This regressed after I refactored some input event event dispatch logic when formatting text in r208461.
I moved the logic for dispatching input events when applying styles into Editor::applyStyle, but left out an
early return after firing the beforeinput event if the default behavior was prevented, which caused us to
continue on and dispatch an input event. The fix is to bail from applyStyle if default was prevented.

Augmented an existing layout test to cover this case.

* editing/Editor.cpp:
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):

LayoutTests:

Augmented a layout test to verify that when preventing beforeinput events, a corresponding input event is not
fired in addition to the style not being applied to the text.

* fast/events/before-input-prevent-biu.html:

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

2 years agoFix behavior of background-attachment:fixed with visual viewports
simon.fraser@apple.com [Wed, 7 Dec 2016 04:26:50 +0000 (04:26 +0000)]
Fix behavior of background-attachment:fixed with visual viewports
https://bugs.webkit.org/show_bug.cgi?id=165465

Fixed backgrounds are working correctly. Unskip and land a new image result for this test.

* TestExpectations:
* tiled-drawing/scrolling/fixed-background/fixed-body-background-zoomed-expected.png:

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

2 years agoInclude default value in Experimental Feature information
dino@apple.com [Wed, 7 Dec 2016 04:24:02 +0000 (04:24 +0000)]
Include default value in Experimental Feature information
https://bugs.webkit.org/show_bug.cgi?id=165509
<rdar://problems/29547177>

Reviewed by Tim Horton.

Add a defaultValue member variable to experimental
features, both the C++ and ObjC interfaces.

* UIProcess/API/APIExperimentalFeature.cpp:
(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):
* UIProcess/API/APIExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
(-[_WKExperimentalFeature description]):
(-[_WKExperimentalFeature defaultValue]):
* UIProcess/WebPreferences.cpp:
(WebKit::createExperimentalFeaturesVector):

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

2 years agoGetByID IC is wrongly unwrapping the global proxy this value for getter/setters.
mark.lam@apple.com [Wed, 7 Dec 2016 03:12:05 +0000 (03:12 +0000)]
GetByID IC is wrongly unwrapping the global proxy this value for getter/setters.
https://bugs.webkit.org/show_bug.cgi?id=165401

Reviewed by Saam Barati.

Source/JavaScriptCore:

When the this value for a property access is the JS global and that property
access is via a GetterSetter, the underlying getter / setter functions would
expect the this value they receive to be the JSProxy instance instead of the
JSGlobalObject.  This is consistent with how the LLINT and runtime code behaves.
The IC code should behave the same way.

Also added some ASSERTs to document invariants in the code, and help detect
bugs sooner if the code gets changed in a way that breaks those invariants in
the future.

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

LayoutTests:

Set the test loose now that this bug is fixed.

* TestExpectations:
* js/script-tests/prototype-assignment.js:

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

2 years ago[Modern Media Controls] Instantiate iOS media controls
commit-queue@webkit.org [Wed, 7 Dec 2016 03:03:16 +0000 (03:03 +0000)]
[Modern Media Controls] Instantiate iOS media controls
https://bugs.webkit.org/show_bug.cgi?id=165498

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

Add support for the modern media controls runtime flags in RenderThemeIOS and, when instantiating iOS controls,
return an IOSInlineMediaControls class.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._controlsClass):
(MediaController):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsStyleSheet):
(WebCore::RenderThemeIOS::mediaControlsScript):
(WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform):

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

2 years agoDumpRenderTree ASSERT in JSC::ExecutableBase::isHostFunction seen on bots
commit-queue@webkit.org [Wed, 7 Dec 2016 02:52:35 +0000 (02:52 +0000)]
DumpRenderTree ASSERT in JSC::ExecutableBase::isHostFunction seen on bots
https://bugs.webkit.org/show_bug.cgi?id=165497
<rdar://problem/29538973>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-06
Reviewed by Saam Barati.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
Defer collection when extracting and processing the samples to avoid
any objects held by the samples from getting collected while processing.
This is because while processing we call into functions that can
allocate and we must prevent those functions from syncing with the
GC thread which may collect other sample data yet to be processed.

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

2 years agoApply styling to media documents with modern controls
dino@apple.com [Wed, 7 Dec 2016 01:23:54 +0000 (01:23 +0000)]
Apply styling to media documents with modern controls
https://bugs.webkit.org/show_bug.cgi?id=165499
<rdar://problems/29543847>

Reviewed by Antoine Quint.

Source/WebCore:

Existing MediaDocuments got styling from the injected style
sheet, which had rules for such documents. The modern media controls
use a scoped style rule, so we can't touch the document style. Instead,
inline the style directly from MediaDocument.

Test: media/modern-media-controls/media-documents/background-color-and-centering.html

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

LayoutTests:

Make sure that the small test video has the correct background,
and is not anchored to the top left of the page.

* media/modern-media-controls/media-documents/background-color-and-centering-expected.html: Added.
* media/modern-media-controls/media-documents/background-color-and-centering.html: Added.

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

2 years agoMove RenderElement::rendererForRootBackground to RenderView.
zalan@apple.com [Wed, 7 Dec 2016 01:15:42 +0000 (01:15 +0000)]
Move RenderElement::rendererForRootBackground to RenderView.
https://bugs.webkit.org/show_bug.cgi?id=165454

Reviewed by Simon Fraser.

Currently RenderElement::rendererForRootBackground can only be called on document element's renderer.
This patch removes this limitation and moves the functionality from RenderElement to RenderView.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::calculateExtendedBackgroundMode):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::rendererForRootBackground): Deleted.
* rendering/RenderElement.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::rendererBackgroundColor):
* rendering/RenderView.cpp:
(WebCore::RenderView::rendererForRootBackground):
(WebCore::rendererObscuresBackground):
(WebCore::RenderView::paintBoxDecorations):
(WebCore::RenderView::rootBackgroundIsEntirelyFixed):
* rendering/RenderView.h:

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

2 years ago[Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
jiewen_tan@apple.com [Wed, 7 Dec 2016 01:15:20 +0000 (01:15 +0000)]
[Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
https://bugs.webkit.org/show_bug.cgi?id=129978
<rdar://problem/21799829>

LayoutTests/imported/w3c:

Reviewed by Brent Fulgham.

* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:

Source/WebCore:

This is part 1 of Bug 129978. In this patch, it adds the SPKI format support for
SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
RSASSA-PKCS1-v1_5 and RSA-OAEP.

Reviewed by Brent Fulgham.

Tests: crypto/subtle/rsa-import-jwk-key-export-spki-key.html
       crypto/subtle/rsa-import-spki-key-export-jwk-key.html
       crypto/subtle/rsa-import-spki-key-export-spki-key.html
       crypto/subtle/rsa-import-spki-small-key.html
       crypto/subtle/rsa-oaep-generate-export-key-spki.html
       crypto/subtle/rsa-oaep-import-spki-key.html
       crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html
       crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html
       crypto/workers/subtle/rsa-export-spki-key.html
       crypto/workers/subtle/rsa-import-spki-key.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toKeyData):
* crypto/CommonCryptoUtilities.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::exportSpki):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::bytesUsedToEncodedLength):
(WebCore::bytesNeededForEncodedLength):
(WebCore::addEncodedASN1Length):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::exportSpki):

LayoutTests:

Reviewed by Brent Fulgham.

* crypto/subtle/import-key-malformed-parameters-expected.txt:
* crypto/subtle/import-key-malformed-parameters.html:
* crypto/subtle/rsa-export-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-export-key-malformed-parameters.html:
* crypto/subtle/rsa-import-jwk-key-export-spki-key-expected.txt: Added.
* crypto/subtle/rsa-import-jwk-key-export-spki-key.html: Added.
* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-import-key-malformed-parameters.html:
* crypto/subtle/rsa-import-spki-key-export-jwk-key-expected.txt: Added.
* crypto/subtle/rsa-import-spki-key-export-jwk-key.html: Added.
* crypto/subtle/rsa-import-spki-key-export-spki-key-expected.txt: Added.
* crypto/subtle/rsa-import-spki-key-export-spki-key.html: Added.
* crypto/subtle/rsa-import-spki-small-key-expected.txt: Added.
* crypto/subtle/rsa-import-spki-small-key.html: Added.
* crypto/subtle/rsa-oaep-generate-export-key-spki-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-export-key-spki.html: Added.
* crypto/subtle/rsa-oaep-import-spki-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-spki-key.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html: Added.
* crypto/workers/subtle/resources/rsa-export-spki-key.js: Added.
* crypto/workers/subtle/resources/rsa-import-spki-key.js: Added.
* crypto/workers/subtle/rsa-export-spki-key-expected.txt: Added.
* crypto/workers/subtle/rsa-export-spki-key.html: Added.
* crypto/workers/subtle/rsa-import-spki-key-expected.txt: Added.
* crypto/workers/subtle/rsa-import-spki-key.html: Added.

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

2 years agoFix editing text flakiness introduced in r209411
simon.fraser@apple.com [Wed, 7 Dec 2016 00:46:23 +0000 (00:46 +0000)]
Fix editing text flakiness introduced in r209411
https://bugs.webkit.org/show_bug.cgi?id=165500

Reviewed by Dean Jackson.

The "insideFixed" out param was left uninitialized sometimes. This affected FrameSelection's
m_caretInsidePositionFixed, which caused problems in these tests.

Tested by editing tests in WK1.

* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):

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

2 years agoUnreviewed, rolling out r209391.
commit-queue@webkit.org [Wed, 7 Dec 2016 00:46:02 +0000 (00:46 +0000)]
Unreviewed, rolling out r209391.
https://bugs.webkit.org/show_bug.cgi?id=165501

requires explicit nullptr checks so missing env vars don't
flip AC mode (Requested by mcatanzaro on #webkit).

Reverted changeset:

"[GTK] Process accelerated compositing env variables only if
they are really enabled"
https://bugs.webkit.org/show_bug.cgi?id=165300
http://trac.webkit.org/changeset/209391

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

2 years agoCorrect SDKROOT values in xcconfig files
ap@apple.com [Wed, 7 Dec 2016 00:34:49 +0000 (00:34 +0000)]
Correct SDKROOT values in xcconfig files
https://bugs.webkit.org/show_bug.cgi?id=165487
rdar://problem/29539209

Reviewed by Dan Bernstein.

Fix suggested by Dan Bernstein.

Source/bmalloc:

* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* Configurations/DebugRelease.xcconfig:

Source/ThirdParty:

* gtest/xcode/Config/DebugProject.xcconfig:
* gtest/xcode/Config/ReleaseProject.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/DebugRelease.xcconfig:

Source/WebCore:

* Configurations/DebugRelease.xcconfig:

Source/WebInspectorUI:

* Configurations/DebugRelease.xcconfig:

Source/WebKit/mac:

* Configurations/DebugRelease.xcconfig:

Source/WebKit2:

* Configurations/DebugRelease.xcconfig:

Source/WTF:

* Configurations/DebugRelease.xcconfig:

Tools:

* ContentExtensionTester/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* WebEditingTester/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:

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

2 years agoRemove old Wasm object model
sbarati@apple.com [Wed, 7 Dec 2016 00:27:58 +0000 (00:27 +0000)]
Remove old Wasm object model
https://bugs.webkit.org/show_bug.cgi?id=165481

Reviewed by Keith Miller and Mark Lam.

Source/JavaScriptCore:

It's confusing to see code that consults both the old
Wasm object model alongside the new one. The old object
model is not a thing, and it's not being used. Let's
remove it now to prevent further confusion.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::replacement):
(JSC::CodeBlock::computeCapabilityLevel):
(JSC::CodeBlock::updateAllPredictions):
* bytecode/CodeBlock.h:
* bytecode/WebAssemblyCodeBlock.cpp: Removed.
* bytecode/WebAssemblyCodeBlock.h: Removed.
* dfg/DFGCapabilities.cpp:
(JSC::DFG::isSupportedForInlining):
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
(JSC::UnwindFunctor::operator()):
(JSC::isWebAssemblyExecutable): Deleted.
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setUpCall):
* runtime/ExecutableBase.cpp:
(JSC::ExecutableBase::clearCode):
* runtime/ExecutableBase.h:
(JSC::ExecutableBase::isWebAssemblyExecutable): Deleted.
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::isBuiltinFunction):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* runtime/WebAssemblyExecutable.cpp: Removed.
* runtime/WebAssemblyExecutable.h: Removed.

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):

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

2 years ago[Modern Media Controls] Media controls use the fullscreen layout after going from...
graouts@webkit.org [Tue, 6 Dec 2016 23:48:40 +0000 (23:48 +0000)]
[Modern Media Controls] Media controls use the fullscreen layout after going from inline to fullscreen to PiP to inline
https://bugs.webkit.org/show_bug.cgi?id=165494

Reviewed by Dean Jackson.

We would only call _updateControlsIfNeeded() when entering or leaving fullscreen, so we going from fullscreen to PiP to
inline would retain fullscreen controls since we would not check for the event that indicates we went back from PiP to
inline. On platforms that support it, we listen to the "webkitpresentationmodechanged" event
to update the controls, and only "webkitfullscreenchange" on others (ie. Yosemite).

Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):

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

2 years ago[Modern Media Controls] Rendering issues with controls bar when captions are on
graouts@webkit.org [Tue, 6 Dec 2016 23:45:02 +0000 (23:45 +0000)]
[Modern Media Controls] Rendering issues with controls bar when captions are on
https://bugs.webkit.org/show_bug.cgi?id=165390

Reviewed by Dean Jackson.

We would face some layout issues with captions due to RenderImage::layoutShadowControls()
expecting a single RenderBox in the media controls shadow root, which was the case with
legacy media controls, but no longer the case with modern media controls. We now host
both the captions and the media controls elements under a single container, and add
an asertion in RenderImage to check that a single RenderBox child exists.

Test: media/modern-media-controls/media-controller/media-controller-single-container.html

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container):
(.media-controls-container,):
(.media-controls-container > *):
(.media-controls):
* Modules/modern-media-controls/controls/text-tracks.css:
(video::-webkit-media-text-track-container):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype._updateControlsIfNeeded):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):

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

2 years ago[Modern Media Controls] Automatically hide the controls bar when the mouse is idle
graouts@webkit.org [Tue, 6 Dec 2016 23:39:21 +0000 (23:39 +0000)]
[Modern Media Controls] Automatically hide the controls bar when the mouse is idle
https://bugs.webkit.org/show_bug.cgi?id=165492

Reviewed by Dean Jackson.

We now automatically hide the controls bar. When the media is no longer paused, the controls remain
visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouses over the
media, the controls become visible and automatically hide 4 seconds after the last time the user has
moved his mouse over the media. When the user mouses out of the media, the controls automatically hide.
When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
remain visible regardless of the mouse position.

Tests: media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html
       media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html
       media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html
       media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html
       media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html
       media/modern-media-controls/media-controller/media-controller-auto-hide.html

* Modules/modern-media-controls/controls/controls-bar.css: Added.
(.controls-bar):
(.controls-bar.faded):
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.get userInteractionEnabled):
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype.get fadesWhileIdle):
(ControlsBar.prototype.set fadesWhileIdle):
(ControlsBar.prototype.get visible):
(ControlsBar.prototype.set visible):
(ControlsBar.prototype.get faded):
(ControlsBar.prototype.set faded):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype.commitProperty):
(ControlsBar.prototype._cancelAutoHideTimer):
(ControlsBar.prototype._rewindAutoHideTimer):
(ControlsBar.prototype._autoHideTimerFired):
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype.syncControl):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):

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

2 years agoPureNaN: fix typo
jfbastien@apple.com [Tue, 6 Dec 2016 23:29:28 +0000 (23:29 +0000)]
PureNaN: fix typo
https://bugs.webkit.org/show_bug.cgi?id=165493

Reviewed by Mark Lam.

* runtime/PureNaN.h:

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

2 years agoTest fast/selectors/040.html fails on iOS Simulator following <https://trac.webkit...
dbates@webkit.org [Tue, 6 Dec 2016 23:24:46 +0000 (23:24 +0000)]
Test fast/selectors/040.html fails on iOS Simulator following <https://trac.webkit.org/changeset/209404>
(https://bugs.webkit.org/show_bug.cgi?id=79694)

Skip test fast/selectors/040.html as we do not visually highlight a programmatic selection on iOS from
observation.

* platform/ios-simulator/TestExpectations:

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

2 years agoCan not select whole line when using flexbox
zalan@apple.com [Tue, 6 Dec 2016 23:06:42 +0000 (23:06 +0000)]
Can not select whole line when using flexbox
https://bugs.webkit.org/show_bug.cgi?id=165299

Reviewed by David Hyatt.

Source/WebCore:

RootInlineBox::selectionTopAdjustedForPrecedingBlock assumes that the preceding block is
always above the current line. However in certain layout contexts (flex as an example) the block before
could just be on the same line as the current one.

This patch checks if we actually need to adjust the selection top to avoid vertical selection overlap.

Test: fast/flexbox/flexbox-fail-to-select-same-line.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Deleted.
* rendering/RenderBlock.h:
* rendering/RootInlineBox.cpp:
(WebCore::blockBeforeWithinSelectionRoot):
(WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock):

LayoutTests:

* fast/flexbox/flexbox-fail-to-select-same-line-expected.html: Added.
* fast/flexbox/flexbox-fail-to-select-same-line.html: Added.

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

2 years agoAdd more assertions to ElementQueue diagnose a bug
rniwa@webkit.org [Tue, 6 Dec 2016 23:01:56 +0000 (23:01 +0000)]
Add more assertions to ElementQueue diagnose a bug
https://bugs.webkit.org/show_bug.cgi?id=164814

Reviewed by Alexey Proskuryakov.

Set m_invoking in release builds now that assertions are also run in release builds.

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):

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

2 years agoYouTube sometimes pauses when switching tabs
jer.noble@apple.com [Tue, 6 Dec 2016 22:48:17 +0000 (22:48 +0000)]
YouTube sometimes pauses when switching tabs
https://bugs.webkit.org/show_bug.cgi?id=165468

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-session-restrictions.html

The bitfield which represents the restrictions for "VideoAudio" media type was unititialized,
leading to what was effectively a random set of restrictions at runtime.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::resetRestrictions):
* testing/Internals.cpp:
(WebCore::mediaTypeFromString):
(WebCore::Internals::setMediaSessionRestrictions):
(WebCore::Internals::mediaSessionRestrictions):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/media-session-restrictions.html: Added.
* platform/ios-simulator/media/media-session-restrictions-expected.txt: Added.
* platform/mac/media/media-session-restrictions-expected.txt: Added.

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

2 years agoIntroduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
mark.lam@apple.com [Tue, 6 Dec 2016 22:43:16 +0000 (22:43 +0000)]
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
https://bugs.webkit.org/show_bug.cgi?id=165227
<rdar://problem/29442665>

Reviewed by Saam Barati.

JSTests:

* stress/get-from-scope-dynamic-onto-proxy.js:
- Updated error message.

* stress/proxy-dont-infinite-loop.js: Removed.
* stress/proxy-json-path.js: Removed.
* stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed.
- Removed these tests because the issue they are testing relies on being able to
  set Object.prototype.__proto__ to something else (which is now not possible).

Source/JavaScriptCore:

* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):
- This is where we check for immutable prototype exotic objects and refuse to set
  the prototype if needed.
  See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::isImmutablePrototypeExoticObject):
* runtime/Structure.h:
- Add flag for declaring immutable prototype exotic objects.

* runtime/ObjectPrototype.h:
- Declare that Object.prototype is an immutable prototype exotic object.
  See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object.

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorSetPrototypeOf):
- Use better error messages.

Source/WebCore:

Make all objects in window.__proto__'s prototype chain immutable prototype exotic
objects.  This gives us roughly equivalent behavior to other browsers.

Firefox's behavior differ slightly in that Firefox will fail any attempted
assignment their __proto__, while the immutable prototype exotic objects will
only fail if the assignment is of a different value.  See
https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects.

Chrome differs in that assignment to window.__proto__ is also handled like an
immutable prototype exotic object.  Instead we adhere to the current HTML spec
that says that the assignment should fail unconditionally.  See
https://html.spec.whatwg.org/#the-windowproxy-exotic-object and
https://html.spec.whatwg.org/#windowproxy-setprototypeof.

If the HTML spec is changed to make the WindowProxy and Location objects into
immutable prototype exotic objects later, we can update to match the spec then.

Test: js/prototype-assignment.html

* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bindings/scripts/IDLAttributes.txt:
* dom/EventTarget.idl:
* page/DOMWindow.idl:

LayoutTests:

The new prototype-assignment.js test is currently only enabled for LLInt only
run in the JSC tests until webkit.org/b/165401 is fixed.

* TestExpectations:
- Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed.

* http/tests/security/window-named-valueOf-expected.txt:
* js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt:
* js/dom/proxy-is-not-allowed-in-global-prototype-chain.html:
- Updated error messages.

* js/prototype-assignment-expected.txt: Added.
* js/prototype-assignment.html: Added.
* js/script-tests/prototype-assignment.js: Added.
(else):
(reportError):
(shouldEqual):
(shouldThrow):
(stringify):
(makeTestID):
(doInternalSetPrototypeOf):
(ordinarySetPrototypeOf):
(setImmutablePrototype):
(windowProxySetPrototypeOf):
(initSetterExpectation):
(throwIfNoExceptionPending):
(objectSetPrototypeOf):
(setUnderscoreProto):
(reflectSetPrototypeOf):
(newObjectProto.toString):
(this.testObject.targets.push.value):
(this.testProxy.targets.push.setPrototypeOf):
(Symbol):
(test):
(runTests):
* js/setPrototypeOf-expected.txt:

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

2 years ago[Cocoa] Add some memory usage related information to sysdiagnose state dumps
akling@apple.com [Tue, 6 Dec 2016 22:38:45 +0000 (22:38 +0000)]
[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>

Reviewed by Darin Adler.

Follow-up to address two more review comments.

Source/WebCore:

* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::javaScriptObjectCounts): Use WTFMove() when returning the
HashCountedSet to avoid making an extra copy.

Source/WebKit2:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.

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

2 years ago[MediaStream][Mac] Revoke sandbox extensions when capture ends
eric.carlson@apple.com [Tue, 6 Dec 2016 22:32:45 +0000 (22:32 +0000)]
[MediaStream][Mac] Revoke sandbox extensions when capture ends
https://bugs.webkit.org/show_bug.cgi?id=165476

Reviewed by Brady Eidson.

Track media capture by process so it is possible to revoke the sandbox extensions issued to
a web process when capture stops.

* CMakeLists.txt: Add new files.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
  with process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox
  extension code to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
  change to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp: Added.
(WebKit::ProcessState::ProcessState):
(WebKit::ProcessState::managers):
(WebKit::ProcessState::sandboxExtensionsGranted):
(WebKit::ProcessState::setSandboxExtensionsGranted):
(WebKit::stateMap):
(WebKit::processState):
(WebKit::ProcessState::addRequestManager):
(WebKit::ProcessState::removeRequestManager):
(WebKit::UserMediaProcessManager::singleton):
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::startedCaptureSession):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/UserMediaProcessManager.h: Added.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
  manager proxy.
* UIProcess/WebPageProxy.h:

* WebKit2.xcodeproj/project.pbxproj: Add new files.

* WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
(WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
(WebKit::MediaDeviceSandboxExtensions::encode):
(WebKit::MediaDeviceSandboxExtensions::decode):
(WebKit::MediaDeviceSandboxExtensions::operator[]):
(WebKit::MediaDeviceSandboxExtensions::size):
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
  is now in a HashMap, not a Vector.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
  IDs with extensions so they can be revoked later.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

2 years agoREGRESSION (Safari 10): Scrolling not working inside height 100% table
hyatt@apple.com [Tue, 6 Dec 2016 22:31:45 +0000 (22:31 +0000)]
REGRESSION (Safari 10): Scrolling not working inside height 100% table
https://bugs.webkit.org/show_bug.cgi?id=164366
<rdar://problem/29095535>

Reviewed by Zalan Bujtas.

Source/WebCore:

Added fast/table/overflow-percent-height-regression.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight):
This patch wasn't merged correctly from Blink. The value returned needed
to be 0, not unset.

LayoutTests:

* fast/table/overflow-percent-height-regression-expected.html: Added.
* fast/table/overflow-percent-height-regression.html: Added.

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

2 years agoRebaseline fast/shadow-dom/slotted-pseudo-element-css-text.html after r209396.
ryanhaddad@apple.com [Tue, 6 Dec 2016 22:21:36 +0000 (22:21 +0000)]
Rebaseline fast/shadow-dom/slotted-pseudo-element-css-text.html after r209396.

Unreviewed test gardening.

* fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt:

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

2 years agoMark two tiled-drawing tests as flakey. Layout viewport rect computation has issues...
simon.fraser@apple.com [Tue, 6 Dec 2016 22:10:19 +0000 (22:10 +0000)]
Mark two tiled-drawing tests as flakey. Layout viewport rect computation has issues in subframes,
covered by https://bugs.webkit.org/show_bug.cgi?id=165489.

* platform/mac-wk2/TestExpectations:
* tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt:

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

2 years agoAdd a new MachMessage class and use it for sending outgoing messages
andersca@apple.com [Tue, 6 Dec 2016 21:59:51 +0000 (21:59 +0000)]
Add a new MachMessage class and use it for sending outgoing messages
https://bugs.webkit.org/show_bug.cgi?id=165484

Reviewed by Sam Weinig.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage):
Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
(which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.

(IPC::machMessageSize): Deleted.
This has been moved to MachMessage::messageSize().

* Platform/IPC/mac/MachMessage.cpp: Added.
(IPC::MachMessage::create):
Allocate extra memory to store the actual buffer.

(IPC::MachMessage::MachMessage):
Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.

(IPC::MachMessage::header):
Return the header.

* Platform/IPC/mac/MachMessage.h: Added.
(IPC::MachMessage::length):

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

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

2 years agoREGRESSION: media/track LayoutTests are flaky failures
weinig@apple.com [Tue, 6 Dec 2016 21:52:18 +0000 (21:52 +0000)]
REGRESSION: media/track LayoutTests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=165432

Reviewed by Antoine Quint.

RenderThemeMac was caching the media controls script / style sheets
and not being invalidated when the RuntimeEnabledFeatures changed. So,
we can just cache both.

* bindings/generic/RuntimeEnabledFeatures.h:
Initialize m_areModernMediaControlsEnabled to false.

* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
Have separate caches for the modern and legacy media control scripts/style sheets.

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

2 years agoDumpRenderTree crashed in com.apple.WebCore: WebCore::MockMediaEndpoint::generateDtls...
weinig@apple.com [Tue, 6 Dec 2016 21:45:00 +0000 (21:45 +0000)]
DumpRenderTree crashed in com.apple.WebCore: WebCore::MockMediaEndpoint::generateDtlsInfo const + 23
https://bugs.webkit.org/show_bug.cgi?id=165486
<rdar://problem/29149588>

Reviewed by Tim Horton.

The MockMediaEndpoint can be destroyed before the task created in MockMediaEndpoint::generateDtlsInfo()
gets a chance to run, so guard it with a weak pointer.

* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::generateDtlsInfo):
* platform/mock/MockMediaEndpoint.h:

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

2 years agoAdd HTML interactive form validation blacklist for some WebKit-specific sites
cdumez@apple.com [Tue, 6 Dec 2016 21:40:02 +0000 (21:40 +0000)]
Add HTML interactive form validation blacklist for some WebKit-specific sites
https://bugs.webkit.org/show_bug.cgi?id=165470
<rdar://problem/29509424>

Reviewed by Simon Fraser.

Add HTML interactive form validation blacklist for some WebKit-specific sites
expecting our old behavior, until they get a chance to be updated.

* html/HTMLFormElement.cpp:
(WebCore::isURLBlacklistedForInteractiveFormValidation):
(WebCore::HTMLFormElement::prepareForSubmission):

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

2 years agoUnreviewed, rollout r209050.
cdumez@apple.com [Tue, 6 Dec 2016 21:34:38 +0000 (21:34 +0000)]
Unreviewed, rollout r209050.

This change may impact other popovers than the HTML validation one.
The previous code is safer.

* platform/ValidationBubble.h:
* platform/ios/ValidationBubbleIOS.mm:
(-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
(WebCore::ValidationBubble::setAnchorRect):
* platform/spi/ios/UIKitSPI.h:

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

2 years agoREGRESSION(r209399): Causes crashes when dumping JIT disassembly
msaboff@apple.com [Tue, 6 Dec 2016 21:03:43 +0000 (21:03 +0000)]
REGRESSION(r209399): Causes crashes when dumping JIT disassembly
https://bugs.webkit.org/show_bug.cgi?id=165483

Reviewed by Geoffrey Garen.

Fixed the RELEASE_ASSERT() to check that the 6 character string is terminated by a null
character.

* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger):

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

2 years agoREGRESSION (r209396): animations/font-variations/font-variation-settings* tests timin...
hyatt@apple.com [Tue, 6 Dec 2016 20:33:49 +0000 (20:33 +0000)]
REGRESSION (r209396): animations/font-variations/font-variation-settings* tests timing out
https://bugs.webkit.org/show_bug.cgi?id=165475

Reviewed by Myles C. Maxfield.

The new parser only allows strings for @keyframe names when @-webkit-keyframe is used. Patch
the tests to use identifiers instead.

* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:

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

2 years agoImprove the behavior of scroll-into-view when the target is inside position:fixed
simon.fraser@apple.com [Tue, 6 Dec 2016 20:00:28 +0000 (20:00 +0000)]
Improve the behavior of scroll-into-view when the target is inside position:fixed
https://bugs.webkit.org/show_bug.cgi?id=165354

Reviewed by Zalan Bujtas.
Source/WebCore:

The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the
target was inside position:fixed, resulting in unwanted scrolls.

Fix this by plumbing through from the call sites a "insideFixed" flag which we get
when we call localToAbsolute(), and use this flag to avoid scrolling at all if
unzoomed.

If zoomed and we're focussing something inside position:fixed, and if visual viewports
are enabled, we can compute the visual viewport required to reveal the target rect,
which gives us the ideal scroll position.

Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
frameView.visibleContentRect() gives an unscaled rect on those platforms.

Not all callers of scrollRectToVisible() are fixed, but those that are not will get
the current behavior.

Tests: fast/overflow/scroll-anchor-in-position-fixed.html
       fast/visual-viewport/zoomed-scroll-into-view-fixed.html
       fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html

* dom/Element.cpp:
(WebCore::Element::scrollIntoView):
(WebCore::Element::scrollIntoViewIfNeeded):
(WebCore::Element::scrollIntoViewIfNotVisible):
(WebCore::Element::updateFocusAppearance):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::absoluteCaretBounds):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::revealSelection):
* editing/FrameSelection.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteCaretBounds):
* editing/VisiblePosition.h:
* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):
* editing/htmlediting.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect):
(WebCore::FrameView::scrollToAnchor):
* page/PrintContext.cpp:
(WebCore::PrintContext::outputLinkedDestinations):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner):
(WebCore::RenderElement::getTrailingCorner):
(WebCore::RenderElement::absoluteAnchorRect):
(WebCore::RenderElement::anchorRect): Deleted.
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose):
(WebCore::RenderLayer::autoscroll):
* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::scrollRectToVisible):
* rendering/RenderObject.h:

Source/WebKit/mac:

Plumb through 'insideFixed'. We don't get compute it, so behavior from
these call sites won't change.

* WebView/WebFrame.mm:
(-[WebFrame _scrollDOMRangeToVisible:]):
(-[WebFrame _scrollDOMRangeToVisible:withInset:]):

LayoutTests:

* fast/overflow/scroll-anchor-in-position-fixed-expected.txt: Added.
* fast/overflow/scroll-anchor-in-position-fixed.html: Added.
* fast/transforms/selection-bounds-in-transformed-view.html:
* fast/visual-viewport/zoomed-scroll-into-view-fixed-expected.txt: Added.
* fast/visual-viewport/zoomed-scroll-into-view-fixed.html: Added.
* fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed-expected.txt: Added.
* fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html: Added.
* platform/ios-simulator/TestExpectations:

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

2 years ago[Cocoa] REGRESSION(r205396): Intermediate CTRuns with initial advances get double...
mmaxfield@apple.com [Tue, 6 Dec 2016 19:54:49 +0000 (19:54 +0000)]
[Cocoa] REGRESSION(r205396): Intermediate CTRuns with initial advances get double counted when glyph origins are enabled
https://bugs.webkit.org/show_bug.cgi?id=165084

Reviewed by Simon Fraser.

Source/WebCore:

When glyph origins are not enabled, an intermediate CTRun's initial advance is simply added
to the previous glyph's advance. However, when glyph origins are enabled, this shouldn't
occur.

Test: fast/text/initial-advance-in-intermediate-run-complex.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

LayoutTests:

* fast/text/initial-advance-in-intermediate-run-complex-expected.html: Added.
* fast/text/initial-advance-in-intermediate-run-complex.html: Added.
* platform/ios-simulator/TestExpectations: Disable the test on iOS because it relies
on Arial being used to draw Arabic, which we explicitly don't allow.

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

2 years agoEnable visual viewports by default on Mac, and iOS Wk2
simon.fraser@apple.com [Tue, 6 Dec 2016 19:39:32 +0000 (19:39 +0000)]
Enable visual viewports by default on Mac, and iOS Wk2
https://bugs.webkit.org/show_bug.cgi?id=165452

Reviewed by Zalan Bujtas.

Source/WebCore:

Some tests revealed an issue where, during scrollbar updates, the visual viewport would be
15px wider than the layout viewport, which results in the layout viewport shifting 15px to the
right. Prevent this by disallowing viewport updates during the AdjustViewSize phase; we'll
be called again in postLayoutTasks.

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

Source/WebKit/mac:

Turn visual viewports on by default for WK1 on Mac.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

Turn visual viewports on by default for WK2.

* Shared/WebPreferencesDefinitions.h:

LayoutTests:

Skip, fix or adjust tests for visual viewports.

* TestExpectations:
* animations/trigger-container-scroll-boundaries.html:
* animations/trigger-container-scroll-empty.html:
* animations/trigger-container-scroll-simple.html:
* compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-expected.txt:
* compositing/layer-creation/fixed-position-out-of-view-scaled-scroll-expected.txt:
* fast/scrolling/ios/remove-scrolling-role-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed.html:
* platform/ios-simulator-wk2/compositing/geometry/fixed-in-composited-expected.txt: Removed.
* platform/ios-simulator-wk2/compositing/geometry/limit-layer-bounds-fixed-expected.txt:
* platform/ios-simulator-wk2/compositing/geometry/limit-layer-bounds-fixed-positioned-expected.txt:
* platform/ios-simulator-wk2/compositing/layer-creation/fixed-position-under-transform-expected.txt:
* platform/ios-simulator-wk2/compositing/layer-creation/no-compositing-for-sticky-expected.txt:
* platform/ios-simulator-wk2/fast/overflow/position-fixed-transform-clipping-expected.txt:
* platform/ios-simulator/compositing/absolute-inside-out-of-view-fixed-expected.txt:
* platform/ios-simulator/compositing/geometry/fixed-in-composited-expected.txt:
* scrollingcoordinator/ios/non-stable-viewport-scroll-expected.txt:
* scrollingcoordinator/ios/ui-scrolling-tree-expected.txt:
* tiled-drawing/fixed-layout-size-fixed-attachment-cover.html:
* tiled-drawing/fixed-layout-size-fixed-attachment-local.html:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed-background/fixed-body-background-zoomed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt:
* tiled-drawing/scrolling/frames/frameset-frame-scrollability-expected.txt:
* tiled-drawing/scrolling/frames/frameset-nested-frame-scrollability-expected.txt:
* tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

2 years agoWebKitTestRunner: Plugins are disabled in new windows
dbates@webkit.org [Tue, 6 Dec 2016 19:35:56 +0000 (19:35 +0000)]
WebKitTestRunner: Plugins are disabled in new windows
https://bugs.webkit.org/show_bug.cgi?id=165410

Reviewed by Alex Christensen.

Source/WebKit2:

Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
Instead we will update WebKitTestRunner to make use of the SPI
WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
all windows.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetPluginsEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPluginsEnabled): Deleted.

Tools:

Currently WebKitTestRunner only enables plugins in the main window. So, a test that opens
a new window and loads a plugin will fail. We should enable plugins in all windows by
default. Moreover toggling testRunner.setPluginsEnabled() should effect all windows.

Making these changes is a step towards running plugins/open-and-close-window-with-plugin.html
in WebKitTestRunner (we still need to fix <https://bugs.webkit.org/show_bug.cgi?id=46714>) and
will make the behavior of WebKitTestRunner more closely match the behavior DumpRenderTree.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting): Call TestRunner::setPluginsEnabled() instead of
WKBundleSetPluginsEnabled().
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPluginsEnabled): Take a similar approach as TestRunner::setXSSAuditorEnabled()
and make use of WKBundleOverrideBoolPreferenceForTestRunner().

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

2 years agoDon't memcpy out of line data
andersca@apple.com [Tue, 6 Dec 2016 19:20:19 +0000 (19:20 +0000)]
Don't memcpy out of line data
https://bugs.webkit.org/show_bug.cgi?id=165434

Reviewed by Sam Weinig.

Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
by invoking the data deallocator.

* Platform/IPC/Decoder.cpp:
(IPC::copyBuffer):
Add a new helper.

(IPC::Decoder::Decoder):
Copy the buffer if the deallocator is null.

(IPC::Decoder::~Decoder):
Invoke the deallocator or call fastFree if it is null.

(IPC::Decoder::unwrapForTesting):
Update constructor.

(IPC::roundUpToAlignment):
(IPC::Decoder::alignBufferPosition):
(IPC::Decoder::decodeVariableLengthByteArray):
(IPC::decodeValueFromBuffer):
Change all these to deal with const pointers.

* Platform/IPC/Decoder.h:
Add new members.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::createMessageDecoder):
When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
and then immediately throwing the original away.

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

2 years agoSkip modern-media-controls tests until flakiness can be resolved.
ryanhaddad@apple.com [Tue, 6 Dec 2016 19:07:56 +0000 (19:07 +0000)]
Skip modern-media-controls tests until flakiness can be resolved.
https://bugs.webkit.org/show_bug.cgi?id=164784

Unreviewed test gardening.

* TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoAlmost half-second stall scrolling apple.com because of synchronous getPositionInform...
timothy_horton@apple.com [Tue, 6 Dec 2016 18:24:28 +0000 (18:24 +0000)]
Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165403
<rdar://problem/29493285>

Reviewed by Enrica Casucci.

When retrieving interaction information, we don't always need to do
snapshots for 3D Touch or the action sheet, especially if we're
synchronously blocking the UI process main thread waiting for the reply.

Add a new InteractionInformationRequest, which allows callers of
getPositionInformation and requestPositionInformation to specify which
optional pieces of information they would like to compute.

* Shared/AssistedNodeInformation.h:
Fix a incorrect comment.

* Shared/ios/InteractionInformationRequest.cpp: Added.
(WebKit::InteractionInformationRequest::encode):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
* Shared/ios/InteractionInformationRequest.h: Added.
(WebKit::InteractionInformationRequest::InteractionInformationRequest):
* WebKit2.xcodeproj/project.pbxproj:
Add InteractionInformationRequest, which encapsulates all of the
parameters required to generate an InteractionInformationAtPosition.
Previously, that was just a point, but now we have two new parameters:
whether we should generate a snapshot of the element, and whether
we should generate a TextIndicator if the element is a link.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
(WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
Adopt InteractionInformationRequest.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::getPositionInformation):
(WebKit::WebPageProxy::requestPositionInformation):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Adopt InteractionInformationRequest.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView ensurePositionInformationIsUpToDate:]):
If we have a outstanding asynchronous position information request
for the current point, instead of sending a second separate request,
just wait for the async one to come in.

(-[WKContentView requestAsynchronousPositionInformationUpdate:]):
If asked to do an asynchronous request with more optional bits than
the current otherwise-valid response's request, update the position information.

(-[WKContentView gestureRecognizerShouldBegin:]):
The design of this mechanism is that during the highlight long press,
we do an async position information update, and then when we actually
begin a 3D Touch gesture, we hope to already have the requisite snapshots
ready (so that we can avoid synchronously blocking for them, there).
So, in the highlight long-press async request, ask for all the goodies.

(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView pointIsInAssistedNode:]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _positionInformationDidChange:]):
If we get a position information update for the same point, but with less
goodies attached (the snapshot/link indicator), copy them over from the old
position information, so that we never accidentally "downgrade" our info.

(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
More adoption.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Adopt InteractionInformationRequest.

(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::requestPositionInformation):
Copy the request into the response.
Only snapshot if the request wants a snapshot.
Only make a link indicator if the request wants one.

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

2 years agoMake fast/selectors/040.html actually test background-color painting for ::selection...
dbates@webkit.org [Tue, 6 Dec 2016 17:58:39 +0000 (17:58 +0000)]
Make fast/selectors/040.html actually test background-color painting for ::selection when run in DRT
https://bugs.webkit.org/show_bug.cgi?id=79694

Reviewed by Beth Dakin.

Currently the test case fast/selectors/040.html doesn't actually test that we
honor the background-color of ::selection when run in DRT. In particular, it
doesn't programmatically select any text and hence the DRT results reflect a
paragraph of non-selected text. Instead, we should programmatically select the
test paragraph so that DRT can capture the painting of background-color for ::selection.

* fast/selectors/040-expected.html: Added.
* fast/selectors/040.html:
* platform/efl/fast/selectors/040-expected.png: Removed.
* platform/efl/fast/selectors/040-expected.txt: Removed.
* platform/gtk/fast/selectors/040-expected.png: Removed.
* platform/gtk/fast/selectors/040-expected.txt: Removed.
* platform/ios-simulator/fast/selectors/040-expected.txt: Removed.
* platform/mac/fast/selectors/040-expected.png: Removed.
* platform/mac/fast/selectors/040-expected.txt: Removed.
* platform/win/fast/selectors/040-expected.txt: Removed.

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

2 years agoCleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style...
dbates@webkit.org [Tue, 6 Dec 2016 17:46:48 +0000 (17:46 +0000)]
Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
https://bugs.webkit.org/show_bug.cgi?id=165451

Reviewed by Alex Christensen.

Source/WebCore:

Rename Document::shouldEnforceHTTP0_9Sandbox() and ResourceResponseBase::isHttpVersion0_9()
to Document::shouldEnforceHTTP09Sandbox() and ResourceResponseBase::isHTTP09, respectively,
to conform to the WebKit Code Style Guidelines.

* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::shouldEnforceHTTP09Sandbox): Renamed; formerly named shouldEnforceHTTP0_9Sandbox
* dom/Document.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isHTTP09): Renamed; formerly named isHttpVersion0_9.
* platform/network/ResourceResponseBase.h:

Source/WebKit2:

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):

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

2 years agoRemove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
dbates@webkit.org [Tue, 6 Dec 2016 17:46:23 +0000 (17:46 +0000)]
Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
https://bugs.webkit.org/show_bug.cgi?id=165408

Reviewed by Alex Christensen.

InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:

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

2 years agoTest insecure-xhr-sync-in-main-frame.html fails with CORS error if run before r203542
dbates@webkit.org [Tue, 6 Dec 2016 17:45:54 +0000 (17:45 +0000)]
Test insecure-xhr-sync-in-main-frame.html fails with CORS error if run before r203542
https://bugs.webkit.org/show_bug.cgi?id=165407

Reviewed by Alexey Proskuryakov.

Make the test insecure-xhr-sync-in-main-frame.html demonstrate a mixed content failure
instead of a CORS failure when run before r203542.

In r203542 the test http/tests/security/mixedContent/insecure-xhr-sync-in-main-frame.html
was added to ensure that we block loading insecure data via XHR from an HTTPS page. When
this test is run prior to r203542 it fails due to a CORS errors as opposed to showing
the intended JavaScript alert failure message. The CORS error is due to loading a
cross-origin resource that did not return an appropriate Access-Control-Allow-Origin header
to allow reading of the response.

* http/tests/security/mixedContent/insecure-xhr-sync-in-main-frame-expected.txt: Update expected result
based on the change below.
* http/tests/security/mixedContent/resources/insecure-xhr-sync-in-main-frame-window.html:
Load a resource that returns "Access-Control-Allow-Origin: *" so that origin (http, 127.0.0.1, 8000)
can read the response returned from origin (https, 127.0.0.1, 8443).

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

2 years agoUse Vector::uncheckedAppend() in more places
dbates@webkit.org [Tue, 6 Dec 2016 17:42:37 +0000 (17:42 +0000)]
Use Vector::uncheckedAppend() in more places
https://bugs.webkit.org/show_bug.cgi?id=164952

Reviewed by Darin Adler.

We can use Vector::uncheckedAppend() whenever the number of items that will be appended
to a vector is equal to or less than its capacity. Using Vector::uncheckedAppend() is
more efficient than Vector::append() as it avoids checking the capacity of the vector
before appending a value to the end of it.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
* contentextensions/DFAMinimizer.cpp:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::copyPropertiesInSet): Use Vector::uncheckedAppend() and inline
the assignment of the temporary variable value into the if condition to limit its scope
as it is referenced exactly once in the loop body.
* css/StyleRule.cpp:
(WebCore::StyleRuleGroup::StyleRuleGroup): Use Vector::uncheckedAppend() and write for-loop
using a C++11 range-based for-loop.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setLangArgumentList):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
* dom/DocumentMarkerController.cpp:
(WebCore::updateRenderedRectsForMarker):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::convertToLayoutUnits):
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::AudioBus):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/PathUtilities.cpp:
(WebCore::polygonsForRect):
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::bestSourcesForTypeAndConstraints):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formCreate):

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

2 years agoUse ASCIICType more, and improve it a little bit
darin@apple.com [Tue, 6 Dec 2016 17:18:20 +0000 (17:18 +0000)]
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.

* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.

Source/WebCore:

* css/CSSGrammar.y.in: Use isASCIIDigit.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.

* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.

* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.

* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.

Source/WebKit2:

* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.

Source/WTF:

* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.

* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.

* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.

* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.

* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.

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

2 years agoRebaseline bindings tests after r209390.
ryanhaddad@apple.com [Tue, 6 Dec 2016 17:14:03 +0000 (17:14 +0000)]
Rebaseline bindings tests after r209390.

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestObj.h:

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

2 years agoPDF markup/annotations visible in Mail on macOS but not on iOS
timothy_horton@apple.com [Tue, 6 Dec 2016 16:55:49 +0000 (16:55 +0000)]
PDF markup/annotations visible in Mail on macOS but not on iOS
https://bugs.webkit.org/show_bug.cgi?id=165444
<rdar://problem/28942896>

Reviewed by Simon Fraser.

No new tests, but enabled an existing test for this feature.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/spi/cg/CoreGraphicsSPI.h:
Make use of CGContextDrawPDFPageWithAnnotations where available,
to paint the page with annotations.

* platform/ios-simulator/TestExpectations:

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

2 years ago[CSS Parser] Turn on the new CSS parser
hyatt@apple.com [Tue, 6 Dec 2016 16:54:30 +0000 (16:54 +0000)]
[CSS Parser] Turn on the new CSS parser
https://bugs.webkit.org/show_bug.cgi?id=165213

Reviewed by Zalan Bujtas.

Source/WebCore:

* page/Settings.in:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:

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

2 years agoTried to fix the USE(APPLE_INTERNAL_SDK) build after r209385.
mitz@apple.com [Tue, 6 Dec 2016 16:50:12 +0000 (16:50 +0000)]
Tried to fix the USE(APPLE_INTERNAL_SDK) build after r209385.

* platform/spi/cocoa/NSTouchBarSPI.h:

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

2 years ago[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
jer.noble@apple.com [Tue, 6 Dec 2016 16:40:56 +0000 (16:40 +0000)]
[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
https://bugs.webkit.org/show_bug.cgi?id=165377

Reviewed by Darin Adler.

Introduce the concept of "force cursor to become visible" when requesting the pointer be
unlocked.  ESC events will cause the pointer to become visible, while normal key events
will not.

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
(WebCore::PointerLockController::documentDetached):
(WebCore::PointerLockController::didLosePointerLock):
* page/PointerLockController.h:

Drive-by fix: apply Darin's feedback to existing functions:

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/Element.cpp:
(WebCore::Element::removedFrom):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementRemoved):
(WebCore::PointerLockController::documentDetached):

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

2 years ago[CSS Parser] Avoid more test
hyatt@apple.com [Tue, 6 Dec 2016 15:55:07 +0000 (15:55 +0000)]
[CSS Parser] Avoid more test
https://bugs.webkit.org/show_bug.cgi?id=165463

Reviewed by Zalan Bujtas.

* TestExpectations:

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

2 years agoAdd storeFence support for ARMv7
ossy@webkit.org [Tue, 6 Dec 2016 15:34:22 +0000 (15:34 +0000)]
Add storeFence support for ARMv7
https://bugs.webkit.org/show_bug.cgi?id=164733

Reviewed by Saam Barati.

* assembler/ARMAssembler.h:
(JSC::ARMAssembler::dmbISHST): Added.
* assembler/ARMv7Assembler.h: Typo fixed, DMB has only T1 encoding.
(JSC::ARMv7Assembler::dmbSY):
(JSC::ARMv7Assembler::dmbISHST): Added.
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::storeFence):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::storeFence):

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

2 years ago[GTK] Process accelerated compositing env variables only if they are really enabled
tpopela@redhat.com [Tue, 6 Dec 2016 12:16:06 +0000 (12:16 +0000)]
[GTK] Process accelerated compositing env variables only if they are really enabled
https://bugs.webkit.org/show_bug.cgi?id=165300

Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
(eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).

Reviewed by Michael Catanzaro.

* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):

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

2 years ago[WebIDL] Add support for converting dictionaries to JS
commit-queue@webkit.org [Tue, 6 Dec 2016 07:59:02 +0000 (07:59 +0000)]
[WebIDL] Add support for converting dictionaries to JS
https://bugs.webkit.org/show_bug.cgi?id=165367

Patch by Sam Weinig <sam@webkit.org> on 2016-12-06
Reviewed by Darin Adler and Alex Christensen.

Source/WebCore:

- Adds support for converting dictionary types to JSValues via JSDOMConvert.
- Adopts that functionality to correct the CryptoKeyPair implementation, which
  is supposed to be a dictionary.
  (While doing this, I also update places that were passing both a CryptoKey
  and CryptoKeyPair to use a Variant, since they always only wanted one.)
- Re-works DOMPromise and DeferredPromise to be based on JSDOMConvert and IDLTypes.

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Remove JSCryptoKeyPairCustom.cpp and CryptoKeyPair.cpp.

* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
* Modules/mediasource/MediaSource.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* bindings/js/JSMediaDevicesCustom.cpp:
* html/MediaController.cpp:
* html/track/TextTrack.cpp:
Add some missing includes.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::text):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::loadingFailed):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolveWithData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchResponse.h:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::PeerConnectionBackend::addIceCandidate):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::deny):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::suspend):
(WebCore::AudioContext::resume):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::whenDefinedPromise):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::notifyFinished):
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
* css/FontFaceSet.h:
* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::addElementDefinition):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
* html/HTMLMediaElement.h:
Update to use new IDLType based promises.

* bindings/generic/IDLTypes.h:
Add a new type, ParameterType, to use as the parameter to
DOMPromise/DeferredPromise.

* bindings/js/JSCryptoKeyPairCustom.cpp:
Removed.

* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLDictionary<T>>::convert):
Add JSConverter specialization for IDLDictionary. Have it simply forward to a generated
convertDictionaryToJS function, following the convention set in place by IDLEnumeration.

* bindings/js/JSDOMPromise.cpp:
* bindings/js/JSDOMPromise.h:
Re-write to be based on IDLTypes and JSDOMConvert, simplifying the implementation.

* bindings/js/JSSubtleCryptoCustom.cpp:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
Update for variant based KeyOrKeyPair.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionaryImplementationContent):
Add generation of the convertDictionaryToJS function. I made it require the JSGenerateToJSObject
extended attribute for now, as the majority of dictionaries do not need this code generated for them.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:
Add JSGenerateToJSObject to a dictionary to test generation in bindings tests.

* crypto/CryptoAlgorithm.h:
Change KeyOrKeyPairCallback to take a Variant<RefPtr<CryptoKey>, CryptoKeyPair>, rather
than two separate arguments.

* crypto/CryptoKeyPair.cpp:
Removed.

* crypto/CryptoKeyPair.h:
Convert to a struct.

* crypto/CryptoKeyPair.idl:
Convert to a dictionary.

* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
Update for new signature of KeyOrKeyPairCallback.

Source/WebKit2:

* CMakeLists.txt:
Add missing directories to look in for headers.

LayoutTests:

* crypto/subtle/rsa-oaep-generate-key-expected.txt:
* crypto/subtle/rsa-oaep-generate-key.html:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-expected.txt:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable-expected.txt:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html:
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt:
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html:
* crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt:
* crypto/webkitSubtle/rsa-oaep-key-manipulation.html:
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt:
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt:
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html:
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html:
* crypto/workers/subtle/resources/rsa-generate-key.js:
* crypto/workers/subtle/rsa-generate-key-expected.txt:
Update tests and expected results to show that CryptoKeyPair is now a vanilla object, not a platform object.

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

2 years ago[CSS Parser] Reject invalid hex colors on the fast path
hyatt@apple.com [Tue, 6 Dec 2016 07:34:35 +0000 (07:34 +0000)]
[CSS Parser] Reject invalid hex colors on the fast path
https://bugs.webkit.org/show_bug.cgi?id=165461

Reviewed by Zalan Bujtas.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
Make sure to check for success. There was even a FIXME in the code about this!
Matches our old parser's behavior.

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

2 years ago[Modern Media Controls] Controls bar in fullscreen cannot be dragged
commit-queue@webkit.org [Tue, 6 Dec 2016 06:55:43 +0000 (06:55 +0000)]
[Modern Media Controls] Controls bar in fullscreen cannot be dragged
https://bugs.webkit.org/show_bug.cgi?id=165448

Patch by Antoine Quint <graouts@apple.com> on 2016-12-05
Reviewed by Simon Fraser.

Source/WebCore:

We weren't listening to mousemove and mouseup events on the right event target, window in the context
of a fullscreen shadow root makes no sense. We now listen to those events on the media controls, which
we size to fit the whole of the media element's bounds. We then apply a transform to the controls bar
to apply the dragging distance.

Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.get translation):
(ControlsBar.prototype.set translation):
(ControlsBar.prototype.commitProperty):
(ControlsBar): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen):
(.media-controls.mac.fullscreen > .controls-bar):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):
(MacOSFullscreenMediaControls.prototype._handleMousemove):
(MacOSFullscreenMediaControls.prototype._handleMouseup):

LayoutTests:

Add a new test that simulates a dragging interaction of the controls bar in fullscreen.

* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html: Added.
* platform/ios-simulator/TestExpectations:

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

2 years ago[CSS Parser] Allow calc in SVG attributes
hyatt@apple.com [Tue, 6 Dec 2016 05:44:10 +0000 (05:44 +0000)]
[CSS Parser] Allow calc in SVG attributes
https://bugs.webkit.org/show_bug.cgi?id=165459

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeLength):

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

2 years agoBuild fix followup to r209379:
hyatt@apple.com [Tue, 6 Dec 2016 05:39:15 +0000 (05:39 +0000)]
Build fix followup to r209379:

STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476

Patch by Brady Eidson <beidson@apple.com> on 2016-12-05
Rubberstamped by Tim Horton.

No new tests (No behavior change).

* platform/spi/cocoa/NSTouchBarSPI.h: Strategically relocate NS_ASSUME_NONNULL* macros.

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

2 years agoBuild fix followup to r209379:
beidson@apple.com [Tue, 6 Dec 2016 05:34:54 +0000 (05:34 +0000)]
Build fix followup to r209379:

STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476

Rubberstamped by Tim Horton.

No new tests (No behavior change).

* platform/spi/cocoa/NSTouchBarSPI.h: Strategically relocate NS_ASSUME_NONNULL* macros.

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

2 years ago[CSS Parser] Fix dashboard region parsing
hyatt@apple.com [Tue, 6 Dec 2016 04:46:52 +0000 (04:46 +0000)]
[CSS Parser] Fix dashboard region parsing
https://bugs.webkit.org/show_bug.cgi?id=165456

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitDashboardRegion):
Make sure to reject whitespace by itself as well as unclosed dashboard-region functions.

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

2 years ago[CSS Parser] Properly reject large numeric values
hyatt@apple.com [Tue, 6 Dec 2016 04:34:51 +0000 (04:34 +0000)]
[CSS Parser] Properly reject large numeric values
https://bugs.webkit.org/show_bug.cgi?id=165455

Reviewed by Zalan Bujtas.

The new parser clamped numeric values in both the slow and fast paths to the max
and min float values. The old parser simply allowed the values to be inf, and then
had std::isinf checks to reject.

Blink rejects also even though it clamps, but I could not discern the mechanism by
which they did so. Therefore I am changing the new parser to exactly match the old
parser. Numeric values are no longer clamped, but instead are allowed to be inf, and
isinf checks now exist in the new parser in the same places they do in the old parser.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleLength):
(WebCore::parseSimpleLengthValue):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::CSSParserToken):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):

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

2 years agoSTP 19 fails to launch on 16B255
rmondello@apple.com [Tue, 6 Dec 2016 03:30:07 +0000 (03:30 +0000)]
STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476

Reviewed by Tim Horton.

* platform/spi/cocoa/NSTouchBarSPI.h: Re-declare the SPI symbols as weak. The cited crash itself is for a
    symbol we weren't handling here, but is part of the same group. Re-declare all four of these symbols to
    be safe.

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

2 years agoTry to fix the iOS Simulator build.
timothy_horton@apple.com [Tue, 6 Dec 2016 03:14:54 +0000 (03:14 +0000)]
Try to fix the iOS Simulator build.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):

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

2 years agoMinor reformat and renames in -didUpdateVisibleRect:
simon.fraser@apple.com [Tue, 6 Dec 2016 02:43:59 +0000 (02:43 +0000)]
Minor reformat and renames in -didUpdateVisibleRect:
https://bugs.webkit.org/show_bug.cgi?id=165365

Reviewed by Dave Hyatt.

didUpdateVisibleRect:... has lots of parameters. Put one on each line.

Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

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

2 years ago[CSS Parser] Skip more bad tests
hyatt@apple.com [Tue, 6 Dec 2016 02:41:30 +0000 (02:41 +0000)]
[CSS Parser] Skip more bad tests
https://bugs.webkit.org/show_bug.cgi?id=165449

Reviewed by Zalan Bujtas.

* TestExpectations:
The font tests have illegal declarations where the
ordering of the sub-properties is all wrong. Skip for
now until we can rewrite them.

The negative-calc value test is wrong, since tab-size
takes only positive integers, so a calc that resolves
to a negative number must be rejected. Avoid the test
for now until we can rewrite it.

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

2 years agoERROR: post-layout: dirty renderer(s) - Encountered with LayoutTest media/modern...
commit-queue@webkit.org [Tue, 6 Dec 2016 02:37:43 +0000 (02:37 +0000)]
ERROR: post-layout: dirty renderer(s) - Encountered with LayoutTest media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html
https://bugs.webkit.org/show_bug.cgi?id=165312

Patch by Antoine Quint <graouts@apple.com> on 2016-12-05
Reviewed by Simon Fraser.

Source/WebCore:

Reverting part of the code added in https://bugs.webkit.org/show_bug.cgi?id=165287 that triggered
an assertion. We go back to removing previous media controls as we add new ones when the fullscreen
status changes, and simply hide the controls during the animated transition using a CSS pseudo-class.
This also fixes an issue where we wouldn't have removed the previous controls should we have entered
fullscreen in a different way than clicking on the fullscreen button in the media controls.

We restore testing coverage that was fixed due to this assertion.

* Modules/modern-media-controls/controls/media-controls.css:
(:host(:-webkit-animating-full-screen-transition) .media-controls):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.fadeIn):
(MediaControls.prototype.presentInElement): Deleted.
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.buttonWasClicked):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):

LayoutTests:

Restore previously skipped tests.

* platform/mac/TestExpectations:

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

2 years ago[CSS Parser] Tweak more layout tests to pass
hyatt@apple.com [Tue, 6 Dec 2016 02:30:38 +0000 (02:30 +0000)]
[CSS Parser] Tweak more layout tests to pass
https://bugs.webkit.org/show_bug.cgi?id=165447

Reviewed by Zalan Bujtas.

* TestExpectations:
Add a few more tests to avoid.

* fast/css/parsing-font-variant-ligatures-expected.txt:
* fast/css/parsing-font-variant-ligatures.html:
Remove the assumption that multiple occurrences of the
same value are allowed.

* fast/filter-image/parse-filter-image-expected.txt:
* fast/filter-image/parse-filter-image.html:
Change the test to require url(), since you cannot omit it
and expect the filter to parse properly.

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

2 years agoMediaDocuments crash with modern media controls
dino@apple.com [Tue, 6 Dec 2016 02:19:40 +0000 (02:19 +0000)]
MediaDocuments crash with modern media controls
https://bugs.webkit.org/show_bug.cgi?id=165446
<rdar://problem/29524959>

Reviewed by Antoine Quint.

Source/WebCore:

The modern media controls inject a <style> element into
the document, which exposed a bug when used in MediaDocuments.
Such documents were not getting a charset, and the hash table
for the CSSParserContexts was crashing.

Test: media/modern-media-controls/media-documents/insert-style-should-not-crash.html

* css/parser/CSSParserMode.h: Guard against an empty charset.
(WebCore::CSSParserContextHash::hash):
* dom/InlineStyleSheetOwner.cpp: Ask for the charset with fallback.
(WebCore::parserContextForElement):

LayoutTests:

* media/modern-media-controls/media-documents/insert-style-should-not-crash-expected.txt: Added.
* media/modern-media-controls/media-documents/insert-style-should-not-crash.html: Added.

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

2 years ago[CSS Parser] Avoid more tests
hyatt@apple.com [Tue, 6 Dec 2016 02:08:20 +0000 (02:08 +0000)]
[CSS Parser] Avoid more tests
https://bugs.webkit.org/show_bug.cgi?id=165445

Reviewed by Tim Horton.

* TestExpectations:
Just skip the custom property test, since it's a ref test.

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

2 years ago[CSS Parser] shape-rendering supports crispEdges rather than crisp-edges
hyatt@apple.com [Tue, 6 Dec 2016 01:56:33 +0000 (01:56 +0000)]
[CSS Parser] shape-rendering supports crispEdges rather than crisp-edges
https://bugs.webkit.org/show_bug.cgi?id=165443

Reviewed by Tim Horton.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

2 years ago[CSS Parser] Support setting of custom properties from the CSS OM
hyatt@apple.com [Tue, 6 Dec 2016 01:45:29 +0000 (01:45 +0000)]
[CSS Parser] Support setting of custom properties from the CSS OM
https://bugs.webkit.org/show_bug.cgi?id=165442

Reviewed by Tim Horton.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCustomPropertyValue):
Call in to a new function in CSSParserImpl that can handle
custom property parsing.

* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseCustomPropertyValue):
New function that is similar to parseValue, but handling custom
properties.

(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeCustomPropertyValue):
(WebCore::CSSParserImpl::consumeVariableValue): Deleted.
* css/parser/CSSParserImpl.h:
Rename consumeVariableValue to consumeCustomPropertyValue, since that
is more clear. consumeVariableValue sounds like you might be resolving
a variable reference rather than parsing a custom property's value.

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

2 years agoAdopt CAMachPort-as-layer-contents
timothy_horton@apple.com [Tue, 6 Dec 2016 01:07:04 +0000 (01:07 +0000)]
Adopt CAMachPort-as-layer-contents
https://bugs.webkit.org/show_bug.cgi?id=141687
<rdar://problem/19393233>

Reviewed by Darin Adler.

No new tests, just a performance bump.

* platform/spi/cocoa/QuartzCoreSPI.h:
Add some SPI.

* Shared/mac/RemoteLayerBackingStore.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::decode):
On the UI process side, instead of actually looking up the surface,
just keep the MachSendRight around, to later be turned into a CAMachPort.

(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
Make a CAMachPort and leak our send right into it. CAMachPort
will adopt the port and destroy it when needed.

(WebKit::RemoteLayerBackingStore::setBufferVolatility):
Tiny style fix.

* Shared/mac/RemoteLayerTreePropertyApplier.h:
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::prepareForAppSuspension):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
Two supporting changes in order to fix the two regressions that this
caused when we tried to land it two years ago:

When an app is being suspended, resolve all CAMachPort backing store
into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
+1 on their respective IOSurface's use count, causing us to fail to
mark them volatile, keeping the app alive for more time (re-trying the
volatility change), and increasing the likelihood of background jetsam.

If the debugging tile map is enabled, do not use CAMachPort, because
we don't have a great way to plumb the same CAMachPort to two layers
(and it doesn't seem to work even if you do). Instead, just map the
IOSurface into the UI process like we used to.

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

2 years ago[CSS Parser] calcs on column-width that resolve to 0 should be discarded
hyatt@apple.com [Tue, 6 Dec 2016 01:04:59 +0000 (01:04 +0000)]
[CSS Parser] calcs on column-width that resolve to 0 should be discarded
https://bugs.webkit.org/show_bug.cgi?id=165439

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeColumnWidth):

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

2 years agoWeb Inspector: remove ASSERT from InspectorDebuggerAgent::derefAsyncCallData
mattbaker@apple.com [Tue, 6 Dec 2016 01:01:50 +0000 (01:01 +0000)]
Web Inspector: remove ASSERT from InspectorDebuggerAgent::derefAsyncCallData
https://bugs.webkit.org/show_bug.cgi?id=165413
<rdar://problem/29517587>

Reviewed by Brian Burg.

DOMTimer::removeById can call into InspectorInstrumentation with an
invalid identifier, so don't assert that async call data exists.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::derefAsyncCallData):

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

2 years agoWeb Inspector: Object.shallowEqual([{}], [{}]) should return true
mattbaker@apple.com [Tue, 6 Dec 2016 00:21:19 +0000 (00:21 +0000)]
Web Inspector: Object.shallowEqual([{}], [{}]) should return true
https://bugs.webkit.org/show_bug.cgi?id=165397

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(value):
Array.shallowEqual should compare array items using strict equivalence,
and on failure defer to Object.shallowEqual.

LayoutTests:

Added passing and failing inputs for TestHarness.prototype.expectShallowEqual.

* inspector/unit-tests/test-harness-expect-functions-expected.txt:
* inspector/unit-tests/test-harness-expect-functions.html:

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

2 years agoAdd an IndexedDB perf test to PerformanceTests.
beidson@apple.com [Tue, 6 Dec 2016 00:10:58 +0000 (00:10 +0000)]
Add an IndexedDB perf test to PerformanceTests.
https://bugs.webkit.org/show_bug.cgi?id=165430

Reviewed by Alex Christensen.

* IndexedDB/index-multientry.html: Added.

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

2 years agopointer lock needs to be feature detectable
dino@apple.com [Mon, 5 Dec 2016 23:48:15 +0000 (23:48 +0000)]
pointer lock needs to be feature detectable
https://bugs.webkit.org/show_bug.cgi?id=165426
<rdar://problem/29486715>

Reviewed by Antoine Quint.

Source/WebCore:

Annotate the public-facing API for pointer-lock, so
that it is hidden when not available.

Also move the Setting to a RuntimeEnabledFeature, since
pointer-lock is exposed from WebKit as a feature.

Tests: pointer-lock/pointerlock-interface-disabled.html
       pointer-lock/pointerlock-interface.html

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
(WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
* dom/Document.idl:
* dom/Element.idl:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:

Source/WebKit/mac:

Set the RuntimeEnabledFeature as preferences
change.

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

Source/WebKit2:

Set the RuntimeEnabledFeature as preferences
change.

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

Tools:

Expose the comment line to turn on/off pointer lock.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

Websites/webkit.org:

We can now accurately detect pointer-lock.

* experimental-features.html:

LayoutTests:

Checks that the API is hidden when the feature is turned off.

* pointer-lock/pointerlock-interface-disabled-expected.txt: Added.
* pointer-lock/pointerlock-interface-disabled.html: Added.
* pointer-lock/pointerlock-interface-expected.txt: Added.
* pointer-lock/pointerlock-interface.html: Added.

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

2 years ago[CSS Parser] Skip a grid test
hyatt@apple.com [Mon, 5 Dec 2016 23:39:59 +0000 (23:39 +0000)]
[CSS Parser] Skip a grid test
https://bugs.webkit.org/show_bug.cgi?id=165427

Reviewed by Zalan Bujtas.

* TestExpectations:

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

2 years ago2016-12-05 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Mon, 5 Dec 2016 23:38:36 +0000 (23:38 +0000)]
2016-12-05  Geoffrey Garen  <ggaren@apple.com>

        Fixed a bug in my last patch.

        Unreviewed.

        * bytecode/UnlinkedFunctionExecutable.h: Restore the conversion to
        one-based counting.

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

2 years agoMoved start and end column linking into helper functions
ggaren@apple.com [Mon, 5 Dec 2016 23:27:59 +0000 (23:27 +0000)]
Moved start and end column linking into helper functions
https://bugs.webkit.org/show_bug.cgi?id=165422

Reviewed by Sam Weinig.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::link):
* bytecode/UnlinkedFunctionExecutable.h:

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

2 years agoReduce number of platformMemoryUsage calls
krollin@apple.com [Mon, 5 Dec 2016 23:27:50 +0000 (23:27 +0000)]
Reduce number of platformMemoryUsage calls
https://bugs.webkit.org/show_bug.cgi?id=164375

Reviewed by Darin Adler.

Removed the calls to WTF::releaseFastMallocFreeMemory (it's already
called elsewhere in the free-all-memory pipeline) and
malloc_zone_pressure_relief (it should be called by the OS on its own
terms).

No new tests -- no new or changed features.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):

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

2 years ago[CSS Parser] Avoid more invalid tests
hyatt@apple.com [Mon, 5 Dec 2016 23:19:14 +0000 (23:19 +0000)]
[CSS Parser] Avoid more invalid tests
https://bugs.webkit.org/show_bug.cgi?id=165424

Reviewed by Dean Jackson.

* TestExpectations:
Avoid the aspect-ratio test, since it thinks whitespace should not be allowed, even though
it should be. Avoid a couple of grid tests that assume the grid breadth can't be 0fr, even
though it can be. Non-negative means < 0, not <= 0 like the old parser assumes.

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

2 years agoFix JSC files so that we can build a release build with NDEBUG #undef'ed.
mark.lam@apple.com [Mon, 5 Dec 2016 23:04:57 +0000 (23:04 +0000)]
Fix JSC files so that we can build a release build with NDEBUG #undef'ed.
https://bugs.webkit.org/show_bug.cgi?id=165409

Reviewed by Keith Miller.

This allows us to run a release build with DEBUG ASSERTs enabled.

* bytecode/BytecodeLivenessAnalysis.cpp:
* bytecode/UnlinkedEvalCodeBlock.cpp:
* bytecode/UnlinkedFunctionCodeBlock.cpp:
* bytecode/UnlinkedModuleProgramCodeBlock.cpp:
* bytecode/UnlinkedProgramCodeBlock.cpp:
* runtime/EvalExecutable.cpp:

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

2 years agoRenamed source => parentSource
ggaren@apple.com [Mon, 5 Dec 2016 23:00:36 +0000 (23:00 +0000)]
Renamed source => parentSource
https://bugs.webkit.org/show_bug.cgi?id=165419

Reviewed by Saam Barati.

This should help clarify that a FunctionExecutable holds the source
code to its *parent* scope, and not its own SourceCode.

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::link):
* bytecode/UnlinkedFunctionExecutable.h:

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