[Modern Media Controls] UI Library: StatusLabel
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-09  Antoine Quint  <graouts@apple.com>
2
3         [Modern Media Controls] UI Library: StatusLabel
4         https://bugs.webkit.org/show_bug.cgi?id=164544
5         <rdar://problem/29179541>
6
7         Reviewed by Dean Jackson.
8
9         We add a new StatusLabel class to display a string of text in place of the TimeControl.
10         A followup patch will add the logic to display "Error", "Loading" and "Live Broadcast"
11         test under the right media state.
12
13         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html
14                media/modern-media-controls/status-label/status-label.html
15
16         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
17         (.media-controls.mac.inline .time-label,):
18         (.media-controls.mac.inline .time-label): Deleted.
19         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
20         (MacOSInlineMediaControls.prototype.layout):
21         * Modules/modern-media-controls/controls/media-controls.js:
22         (MediaControls.):
23         * Modules/modern-media-controls/controls/status-label.css: Added.
24         (.status-label):
25         * Modules/modern-media-controls/controls/status-label.js: Added.
26         (StatusLabel.prototype.get text):
27         (StatusLabel.prototype.set text):
28         (StatusLabel.prototype.commitProperty):
29         * Modules/modern-media-controls/js-files:
30         * WebCore.xcodeproj/project.pbxproj:
31
32 2016-11-09  Chris Dumez  <cdumez@apple.com>
33
34         [Mac] Stop using deprecated AppKit enumeration values
35         https://bugs.webkit.org/show_bug.cgi?id=164494
36
37         Reviewed by Darin Adler.
38
39         Stop using deprecated AppKit enumeration values.
40
41         * editing/cocoa/HTMLConverter.mm:
42         (HTMLConverter::computedAttributesForElement):
43         (HTMLConverter::_processElement):
44         (HTMLConverter::_addMarkersToList):
45         * page/mac/EventHandlerMac.mm:
46         (WebCore::EventHandler::keyEvent):
47         (WebCore::lastEventIsMouseUp):
48         (WebCore::EventHandler::passSubframeEventToSubframe):
49         (WebCore::EventHandler::widgetDidHandleWheelEvent):
50         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
51         * page/mac/TextIndicatorWindow.mm:
52         (WebCore::TextIndicatorWindow::setTextIndicator):
53         * platform/graphics/mac/IconMac.mm:
54         (WebCore::Icon::paint):
55         * platform/mac/CursorMac.mm:
56         (WebCore::createCustomCursor):
57         * platform/mac/DragImageMac.mm:
58         (WebCore::dissolveDragImageToFraction):
59         (WebCore::createDragImageFromImage):
60         * platform/mac/EventLoopMac.mm:
61         (WebCore::EventLoop::cycle):
62         * platform/mac/PasteboardMac.mm:
63         (WebCore::Pasteboard::setDragImage):
64         * platform/mac/PlatformEventFactoryMac.mm:
65         (WebCore::globalPointForEvent):
66         (WebCore::pointForEvent):
67         (WebCore::mouseButtonForEvent):
68         (WebCore::mouseEventTypeForEvent):
69         (WebCore::clickCountForEvent):
70         (WebCore::isKeypadEvent):
71         (WebCore::windowsKeyCodeForKeyEvent):
72         (WebCore::isKeyUpEvent):
73         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
74         * platform/mac/ScrollbarThemeMac.mm:
75         (WebCore::scrollbarControlSizeToNSControlSize):
76         * platform/mac/ThemeMac.mm:
77         (-[WebCoreThemeView window]):
78         (WebCore::controlSizeForFont):
79         (WebCore::controlSizeFromPixelSize):
80         (WebCore::setUpButtonCell):
81         (WebCore::stepperControlSizeForFont):
82         (WebCore::paintStepper):
83         (WebCore::ThemeMac::minimumControlSize):
84         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
85         (-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
86         (-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
87         (-[WebVideoFullscreenHUDWindowController init]):
88         (-[WebVideoFullscreenHUDWindowController keyDown:]):
89         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
90         * platform/mac/WebWindowAnimation.mm:
91         (WebWindowAnimationDurationFromDuration):
92         * rendering/RenderThemeMac.mm:
93         (WebCore::RenderThemeMac::updateCachedSystemFontDescription):
94         (WebCore::RenderThemeMac::controlSizeForFont):
95         (WebCore::RenderThemeMac::controlSizeForCell):
96         (WebCore::RenderThemeMac::controlSizeForSystemFont):
97         (WebCore::RenderThemeMac::paintProgressBar):
98         (WebCore::RenderThemeMac::popupMenuSize):
99         (WebCore::RenderThemeMac::sliderThumbHorizontal):
100         (WebCore::RenderThemeMac::sliderThumbVertical):
101
102 2016-11-08  Antoine Quint  <graouts@apple.com>
103
104         [Modern Media Controls] UI Library: iOS inline controls
105         https://bugs.webkit.org/show_bug.cgi?id=164513
106         <rdar://problem/27989475>
107
108         Reviewed by Dean Jackson.
109
110         We introduce a new IOSInlineMediaControls class which can be used to instantiate media controls
111         for inline playback on iOS.
112
113         Tests: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html
114                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor.html
115                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles.html
116                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html
117                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles.html
118                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls.html
119
120         * Modules/modern-media-controls/controls/ios-inline-media-controls.css: Added.
121         (.media-controls.ios.inline > .controls-bar):
122         (.media-controls.ios.inline .time-control):
123         (.media-controls.ios.inline button):
124         (.media-controls.ios.inline button:active):
125         (.media-controls.ios.inline > .controls-bar button):
126         (.media-controls.ios.inline .buttons-container.right):
127         (.media-controls.ios.inline button.play-pause):
128         (.media-controls.ios.inline button.skip-back):
129         (.media-controls.ios.inline .scrubber.slider):
130         (.media-controls.ios.inline button.airplay):
131         (.media-controls.ios.inline button.pip):
132         (.media-controls.ios.inline button.fullscreen):
133         (.media-controls.ios.inline .time-label):
134         (.media-controls.ios.inline .scrubber.slider > .fill):
135         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
136         * Modules/modern-media-controls/controls/ios-inline-media-controls.js: Added.
137         (IOSInlineMediaControls.prototype.layout):
138         (IOSInlineMediaControls):
139         * Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Added.
140         * Modules/modern-media-controls/js-files:
141         * WebCore.xcodeproj/project.pbxproj:
142
143 2016-11-09  Beth Dakin  <bdakin@apple.com>
144
145         Support TouchBar in WebKit
146         https://bugs.webkit.org/show_bug.cgi?id=164437
147         -and corresponding-
148         rdar://problem/28876524
149
150         Reviewed by Darin Adler.
151
152         * WebCore.xcodeproj/project.pbxproj:
153         * platform/spi/cocoa/AVKitSPI.h:
154         * platform/spi/cocoa/NSTouchBarSPI.h: Added.
155         * platform/spi/mac/NSSpellCheckerSPI.h:
156
157 2016-11-09  Chris Dumez  <cdumez@apple.com>
158
159         Use Blob URL instead of webkit-fake-url when pasting an image
160         https://bugs.webkit.org/show_bug.cgi?id=49141
161
162         Reviewed by Darin Adler.
163
164         Use Blob URL instead of webkit-fake-url when pasting an image.
165
166         Tests: editing/pasteboard/paste-image-as-blob-url.html
167                editing/pasteboard/paste-image-using-image-data.html
168
169         * editing/Editor.h:
170         * editing/mac/EditorMac.mm:
171         (WebCore::Editor::WebContentReader::readImage):
172         (WebCore::Editor::createFragmentForImageAndURL):
173
174 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
175
176         Fix error message when SQLite initialization fails
177         https://bugs.webkit.org/show_bug.cgi?id=164462
178
179         Reviewed by Darin Adler.
180
181         * platform/sql/SQLiteDatabase.cpp:
182         (WebCore::initializeSQLiteIfNecessary):
183
184 2016-11-08  Antoine Quint  <graouts@apple.com>
185
186         [Modern Media Controls] UI Library: macOS fullscreen controls
187         https://bugs.webkit.org/show_bug.cgi?id=164414
188         <rdar://problem/27989474>
189
190         Reviewed by Dean Jackson.
191
192         We introduce a new MacOSFullscreenMediaControls class which can be used to instantiate media controls
193         for fullscreen playback on macOS. These controls can be dragged by the user.
194
195         Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html
196                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
197                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html
198                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html
199                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-right-container-margin.html
200                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html
201                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html
202
203         * Modules/modern-media-controls/controls/button.js:
204         (Button.prototype.set enabled):
205
206             Correctly notify the layoutDelegate when the enabled property changes, regardless of whether
207             the flag is on.
208
209         * Modules/modern-media-controls/controls/icon-button.js:
210         (IconButton.prototype._updateImage):
211         (IconButton):
212
213             Correctly notify the layout delegate when the image metrics have changed so that it may perform
214             a layout. This issues became apparent with the new tests on Yosemite and caused some flakyness.
215
216         * Modules/modern-media-controls/controls/icon-service.js:
217         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
218         (const.iconService.new.IconService):
219
220             Fix a typo.
221
222         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: Added.
223         (.media-controls.mac.fullscreen > .controls-bar):
224         (.media-controls.mac.fullscreen .volume.slider):
225         (.media-controls.mac.fullscreen .buttons-container):
226         (.media-controls.mac.fullscreen .buttons-container.center):
227         (.media-controls.mac.fullscreen > .controls-bar button):
228         (.media-controls.mac.fullscreen button.rewind):
229         (.media-controls.mac.fullscreen button.play-pause):
230         (.media-controls.mac.fullscreen button.forward):
231         (.media-controls.mac.fullscreen .buttons-container.right):
232         (.media-controls.mac.fullscreen button.airplay):
233         (.media-controls.mac.fullscreen button.aspect-ratio):
234         (.media-controls.mac.fullscreen button.pip):
235         (.media-controls.mac.fullscreen button.tracks):
236         (.media-controls.mac.fullscreen button.fullscreen):
237         (.media-controls.mac.fullscreen .time-control):
238         (.media-controls.mac.fullscreen .time-label):
239         (.media-controls.mac.fullscreen .scrubber):
240         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: Added.
241         (MacOSFullscreenMediaControls.prototype.layout):
242         (MacOSFullscreenMediaControls):
243         * Modules/modern-media-controls/controls/macos-media-controls.js:
244         (MacOSMediaControls):
245         
246             Allow the layoutTraits property to be set to something other than just LayoutTraits.macOS
247             so that MacOSFullscreenMediaControls may set the LayoutTraits.Fullscreen bit.
248         
249         * Modules/modern-media-controls/js-files:
250         
251             Add a reference to the new macos-fullscreen-media-controls.js file.
252         
253         * WebCore.xcodeproj/project.pbxproj:
254
255             Add references to the new macos-fullscreen-media-controls.js and
256             macos-fullscreen-media-controls.css files.
257
258 2016-11-09  Chris Dumez  <cdumez@apple.com>
259
260         Shave 16 bytes off HTMLInputElement
261         https://bugs.webkit.org/show_bug.cgi?id=164488
262
263         Reviewed by Sam Weinig.
264
265         Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
266         better.
267
268         * html/HTMLFormControlElement.h:
269         * html/HTMLTextFormControlElement.cpp:
270         (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
271         * html/HTMLTextFormControlElement.h:
272
273 2016-11-09  Youenn Fablet  <youenn@apple.com>
274
275         [WebRTC] Introduce asynchronous backend for other RTCPeerConnection API
276         https://bugs.webkit.org/show_bug.cgi?id=164409
277
278         Reviewed by Eric Carlson.
279
280         Covered by existing tests.
281
282         Following on createOffer changes, applying the same changes to createAnswer, setLocalDescription, setRemoteDescription and addIceCandidate.
283         Also refactored ICE candidate event generation (done at PeerConnectionBackend).
284         Updated stop implementation to clean any promise that may be stored in PeerConnectionBackend.
285
286         The goal of this is to be more aligned with https://www.w3.org/TR/webrtc/.
287         Implementation of the various functions such as //www.w3.org/TR/webrtc/#set-description would be done in PeerConnectionBackend.
288         This will require additional code moved from MediaEndpointPeerConnection up to PeerConnectionBackend.
289
290         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
291         (WebCore::MediaEndpointPeerConnection::createOfferTask):
292         (WebCore::MediaEndpointPeerConnection::doCreateAnswer):
293         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
294         (WebCore::MediaEndpointPeerConnection::doSetLocalDescription):
295         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
296         (WebCore::MediaEndpointPeerConnection::doSetRemoteDescription):
297         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
298         (WebCore::MediaEndpointPeerConnection::doAddIceCandidate):
299         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
300         (WebCore::MediaEndpointPeerConnection::doStop):
301         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
302         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
303         (WebCore::MediaEndpointPeerConnection::createAnswer): Deleted.
304         (WebCore::MediaEndpointPeerConnection::setLocalDescription): Deleted.
305         (WebCore::MediaEndpointPeerConnection::setRemoteDescription): Deleted.
306         (WebCore::MediaEndpointPeerConnection::addIceCandidate): Deleted.
307         (WebCore::MediaEndpointPeerConnection::stop): Deleted.
308         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState): Deleted.
309         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState): Deleted.
310         * Modules/mediastream/MediaEndpointPeerConnection.h:
311         * Modules/mediastream/PeerConnectionBackend.cpp:
312         (WebCore::PeerConnectionBackend::createOffer):
313         (WebCore::PeerConnectionBackend::createOfferFailed):
314         (WebCore::PeerConnectionBackend::createAnswer):
315         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
316         (WebCore::PeerConnectionBackend::createAnswerFailed):
317         (WebCore::isLocalDescriptionTypeValidForState):
318         (WebCore::PeerConnectionBackend::setLocalDescription):
319         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
320         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
321         (WebCore::isRemoteDescriptionTypeValidForState):
322         (WebCore::PeerConnectionBackend::setRemoteDescription):
323         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
324         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
325         (WebCore::PeerConnectionBackend::addIceCandidate):
326         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
327         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
328         (WebCore::PeerConnectionBackend::fireICECandidateEvent):
329         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
330         (WebCore::PeerConnectionBackend::stop):
331         * Modules/mediastream/PeerConnectionBackend.h:
332
333 2016-11-09  Eric Carlson  <eric.carlson@apple.com>
334
335         [MediaStream][Mac] Mark captured video frames as ready for display immediately
336         https://bugs.webkit.org/show_bug.cgi?id=164482
337         <rdar://problem/29139073>
338
339         Reviewed by Jer Noble.
340
341         * platform/cf/CoreMediaSoftLink.cpp: Add new constant.
342         * platform/cf/CoreMediaSoftLink.h:
343
344         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
345         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
346         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForMediaData):
347           New, ask register for a callback when the sample buffer display layer is ready
348           for more media data.
349         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer): Don't change
350           the sample timestamps, assume the caller has configured the sample correctly.
351         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack): Don't
352           drop frames when the display layer isn't ready.
353         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Call stopRequestingMediaData.
354         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
355         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Deleted.
356
357         * platform/mediastream/mac/AVVideoCaptureSource.mm:
358         (WebCore::AVVideoCaptureSource::setupCaptureSession): Tell the video output to always discard
359           late video frames, we don't need them.
360         (WebCore::AVVideoCaptureSource::processNewFrame): Add a kCMSampleAttachmentKey_DisplayImmediately
361           attachment.
362
363 2016-11-09  Joanmarie Diggs  <jdiggs@igalia.com>
364
365         AX: [ATK] Wrong selected element at a given index in a list box (redux)
366         https://bugs.webkit.org/show_bug.cgi?id=164430
367
368         Reviewed by Darin Adler.
369
370         This essentially undoes the implementation change resulting from r164577.
371         As stated in the ATK documentation, atk_selection_ref_selection() takes
372         "a gint specifying the index in the selection set. (e.g. the ith selection
373         as opposed to the ith child)." r164577 deliberately modified that, causing
374         atk_selection_ref_selection() to treat the index as if it were the position
375         with respect to all of the children. There is different API in ATK, namely
376         atk_object_ref_accessible_child(), when the ith child from the set of all
377         children is sought.
378
379         Tests: accessibility/aria-listbox-no-selection.html
380                accessibility/native-listbox-no-selection.html
381
382         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
383         (optionFromSelection):
384
385 2016-11-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
386
387         [EFL] Use libgcrypt instead of GnuTLS for CryptoDigest
388         https://bugs.webkit.org/show_bug.cgi?id=164461
389
390         Reviewed by Michael Catanzaro.
391
392         As GTK port in r208297, EFL port starts to use libgcrypt instead of GnuTLS as well.
393
394         No new tests, no behavior change.
395
396         * PlatformEfl.cmake:
397
398 2016-11-09  Ryan Haddad  <ryanhaddad@apple.com>
399
400         Unreviewed, rolling out r208422.
401
402         Roll r208382 back in since it was not responsible for the API
403         test failures seen on macOS.
404
405         Reverted changeset:
406
407         "Unreviewed, rolling out r208382."
408         https://bugs.webkit.org/show_bug.cgi?id=164319
409         http://trac.webkit.org/changeset/208422
410
411 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
412
413         One more URTBF after r208361.
414
415         * PlatformMac.cmake:
416
417 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
418
419         Typo fix after r162782
420         https://bugs.webkit.org/show_bug.cgi?id=164473
421
422         Unreviewed trivial fix.
423
424         * platform/ThreadGlobalData.cpp:
425
426 2016-11-07  Ryan Haddad  <ryanhaddad@apple.com>
427
428         Unreviewed, rolling out r208382.
429
430         This change appears to have caused 3
431         SerializedCryptoKeyWrapTest API tests to fail on macOS.
432
433         Reverted changeset:
434
435         "[Readable Streams API] Implement ByteStreamController
436         error()"
437         https://bugs.webkit.org/show_bug.cgi?id=164319
438         http://trac.webkit.org/changeset/208382
439
440 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
441
442         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
443         https://bugs.webkit.org/show_bug.cgi?id=152045
444
445         Reviewed by Andy Estes.
446
447         No new layout tests because no new behavior. The new WTF time classes have some unit tests
448         in TestWebKitAPI.
449
450         * fileapi/ThreadableBlobRegistry.cpp:
451         (WebCore::ThreadableBlobRegistry::blobSize):
452         * platform/MainThreadSharedTimer.h:
453         * platform/SharedTimer.h:
454         * platform/ThreadTimers.cpp:
455         (WebCore::ThreadTimers::updateSharedTimer):
456         * platform/cf/MainThreadSharedTimerCF.cpp:
457         (WebCore::MainThreadSharedTimer::setFireInterval):
458         * platform/efl/MainThreadSharedTimerEfl.cpp:
459         (WebCore::MainThreadSharedTimer::setFireInterval):
460         * platform/glib/MainThreadSharedTimerGLib.cpp:
461         (WebCore::MainThreadSharedTimer::setFireInterval):
462         * platform/win/MainThreadSharedTimerWin.cpp:
463         (WebCore::MainThreadSharedTimer::setFireInterval):
464         * workers/WorkerRunLoop.cpp:
465         (WebCore::WorkerRunLoop::runInMode):
466
467 2016-11-04  Zalan Bujtas  <zalan@apple.com>
468
469         RenderFlowThread state reset cleanup.
470         https://bugs.webkit.org/show_bug.cgi?id=164426
471
472         Reviewed by Simon Fraser.
473
474         RenderFlowThread state reset is spread across several functions. This patch groups them
475         together in RenderObject::resetFlowThreadState().
476
477         No change in functionality.
478
479         * rendering/RenderBlock.cpp:
480         (WebCore::RenderBlock::removeLeftoverAnonymousBlock):
481         (WebCore::RenderBlock::dropAnonymousBoxChild): This is now part of resetFlowThreadState() since resetFlowThreadState
482         gets called even when NotifyChildren is false.
483         * rendering/RenderElement.cpp:
484         (WebCore::RenderElement::insertChildInternal): Initialize the thread state before we notify the child.
485         (WebCore::RenderElement::removeChildInternal): Reset the state even when NotifyChildren is false.
486         (WebCore::RenderElement::willBeRemovedFromTree): This code is moved to removeFromRenderFlowThread().
487         (WebCore::RenderElement::removeFromRenderFlowThread):
488         * rendering/RenderObject.cpp:
489         (WebCore::RenderObject::initializeFlowThreadState): This is in transition for webkit.org/b/164428 (RenderFlowThread state initialization cleanup.)
490         (WebCore::RenderObject::resetFlowThreadState):
491         (WebCore::RenderObject::setParent): This was seemingly a random place to put flow state initialization. 
492         (WebCore::RenderObject::willBeRemovedFromTree): resetFlowThreadState() takes care of it now.
493         * rendering/RenderObject.h:
494
495 2016-11-04  Yusuke Suzuki  <utatane.tea@gmail.com>
496
497         [DOMJIT] Add DOMJIT::Signature annotation to Document::getElementById
498         https://bugs.webkit.org/show_bug.cgi?id=164356
499
500         Reviewed by Filip Pizlo.
501
502         This patch implements DOMJIT::Signature annotation for getElementById.
503         Since getElementById is also implemented in DocumentFragment, we implement
504         the branchIfDocumentFragment/branchIfNotDocumentFragment for that.
505
506         In dromaeo, we have a test like this.
507
508         test( "getElementById", function(){
509             for ( var i = 0; i < num * 30; i++ ) {
510                 ret = document.getElementById("testA" + num).nodeType;
511                 ret = document.getElementById("testB" + num).nodeType;
512                 ret = document.getElementById("testC" + num).nodeType;
513                 ret = document.getElementById("testD" + num).nodeType;
514                 ret = document.getElementById("testE" + num).nodeType;
515                 ret = document.getElementById("testF" + num).nodeType;
516             }
517         });
518
519         In the above test, JSC already knows the following things.
520
521         1. Since nodeType is now handled as CallDOMGetter, we know that it is pure.
522         2. getElementById look up becomes PureGetById since document is impure object. But it is kept as PureGetById. So it does not write DOMState.
523         3. `"testA" + num` will be converted to constant string.
524         4. CallDOM for getElementById said it just reads(DOMState:DOM). And it saids that it returns the same value as long as DOMState is not clobbered.
525         5. CheckCell leading CallDOM ensures the inlined getElementById node. (CallDOM node).
526
527         The key thing is that no node clobbers DOMState during the loop. So CallDOM & CallDOMGetter can be hoisted.
528         This improves dom-query significantly. Dromaeo dom-query getElementById becomes 40x faster (247796 v.s. 6197).
529         Dromaeo dom-query getElementById (not in document) becomes 89x faster (630317.8 v.s. 7066.).
530
531         Tests: js/dom/domjit-function-get-element-by-id-changed.html
532                js/dom/domjit-function-get-element-by-id-licm.html
533                js/dom/domjit-function-get-element-by-id.html
534
535         * dom/NonElementParentNode.idl:
536         * domjit/DOMJITCheckDOM.h:
537         (WebCore::DOMJIT::TypeChecker<DocumentFragment>::branchIfFail):
538         * domjit/DOMJITHelpers.h:
539         (WebCore::DOMJIT::branchIfDocumentFragment):
540         (WebCore::DOMJIT::branchIfNotDocumentFragment):
541
542 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
543
544         Rename unscaledUnobscuredVisibleContentSize and unscaledVisibleContentSizeIncludingObscuredArea for attempted clarity
545         https://bugs.webkit.org/show_bug.cgi?id=164438
546
547         Reviewed by Tim Horton.
548
549         unscaledUnobscuredVisibleContentSize() and unscaledVisibleContentSizeIncludingObscuredArea() were an endless source
550         of confusion.
551         
552         Functions with "VisibleContent" in the name are usually expected to return document coordinates (affected by zooming),
553         so unscaledUnobscuredVisibleContentSize caused cognitive dissonance because of "unscaled" vs "visibleContent", and
554         "unobscured" vs "visible".
555         
556         So rename:
557             unscaledUnobscuredVisibleContentSize -> sizeForUnobscuredContent
558             unscaledVisibleContentSizeIncludingObscuredArea -> sizeForVisibleContent
559         
560         sizeForUnobscuredContent() can also be private to ScrollView.
561
562         * inspector/InspectorOverlay.cpp:
563         (WebCore::InspectorOverlay::update):
564         * platform/ScrollView.cpp:
565         (WebCore::ScrollView::unobscuredContentRectInternal):
566         (WebCore::ScrollView::sizeForVisibleContent):
567         (WebCore::ScrollView::sizeForUnobscuredContent): Don't compute unscaledVisibleContentSizeIncludingObscuredArea
568         before testing whether we have a platform widget.
569         (WebCore::ScrollView::layoutSize):
570         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Deleted.
571         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Deleted.
572         * platform/ScrollView.h:
573         * rendering/RenderBoxModelObject.cpp:
574         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
575         * rendering/RenderLayerCompositor.cpp:
576         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
577         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
578         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
579         (WebCore::RenderLayerCompositor::ensureRootLayer):
580
581 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
582
583         Layout viewport wrong with RTL documents
584         https://bugs.webkit.org/show_bug.cgi?id=164434
585
586         Reviewed by Tim Horton.
587
588         The layoutViewportRect was computed incorrectly in RTL documents, because 
589         FrameView::unscaledMaximumScrollPosition() was wrong; it erroneously mapped
590         what it thought was a scrollOffset to a scrollPosition.
591
592         Unscaled scroll positions are in the same coordinate space as unscaledDocumentRect,
593         so we should not call scrollPositionFromOffset() in FrameView::unscaledMaximumScrollPosition().
594
595         Changed FrameView::unscaledMinimumScrollPosition() to also just grab the location of
596         unscaledDocumentRect, for symmetry.
597
598         Finally fixed the tiled scrolling indicator's viewport rect for zoomed RTL documents
599         by using the unscaled scroll origin.
600
601         Tests: fast/visual-viewport/rtl-nonzoomed-rects.html
602                fast/visual-viewport/rtl-zoomed-rects.html
603
604         * page/FrameView.cpp:
605         (WebCore::FrameView::setLayoutViewportOrigin):
606         (WebCore::FrameView::unscaledScrollOrigin):
607         (WebCore::FrameView::unscaledMinimumScrollPosition):
608         (WebCore::FrameView::unscaledMaximumScrollPosition):
609         * page/FrameView.h:
610
611 2016-11-04  Sam Weinig  <sam@webkit.org>
612
613         [WebIDL] Add support for modern callback syntax
614         https://bugs.webkit.org/show_bug.cgi?id=164435
615
616         Reviewed by Chris Dumez.
617
618         Support new callback syntax:
619             callback Function = void (DOMString arg1, long arg2);
620
621         This replaces "callback interface" types with a Callback=FunctionOnly
622         extended attribute.
623
624         * Modules/geolocation/PositionCallback.idl:
625         * Modules/geolocation/PositionErrorCallback.idl:
626         * Modules/notifications/NotificationPermissionCallback.idl:
627         * Modules/quota/StorageErrorCallback.idl:
628         * Modules/quota/StorageQuotaCallback.idl:
629         * Modules/quota/StorageUsageCallback.idl:
630         * Modules/webaudio/AudioBufferCallback.idl:
631         * Modules/webdatabase/DatabaseCallback.idl:
632         * Modules/webdatabase/SQLStatementCallback.idl:
633         * Modules/webdatabase/SQLStatementErrorCallback.idl:
634         * Modules/webdatabase/SQLTransactionCallback.idl:
635         * Modules/webdatabase/SQLTransactionErrorCallback.idl:
636         * dom/RequestAnimationFrameCallback.idl:
637         * dom/StringCallback.idl:
638         * html/VoidCallback.idl:
639         * page/IntersectionObserverCallback.idl:
640         * css/MediaQueryListListener.idl:
641         Update to new syntax.
642
643         * css/MediaQueryListListener.h:
644         * css/MediaQueryMatcher.cpp:
645         (WebCore::MediaQueryMatcher::styleResolverChanged):
646         Switch to using the now required 'handleEvent' name. This is an implementation detail
647         that we should change.
648
649         * bindings/scripts/CodeGenerator.pm:
650         Update document processing to allow a callback only file. Update callback
651         type checks to look for a regex that matches in the new format.
652
653         * bindings/scripts/CodeGeneratorJS.pm:
654         (AddToImplIncludesForIDLType):
655         (AddToIncludesForIDLType):
656         (AddToImplIncludes):
657         (AddToIncludes):
658         Abstract includes functions to allow passing in an include hash.
659
660         (GenerateCallbackFunctionHeader):
661         (GenerateCallbackFunctionImplementation):
662         (GenerateCallbackInterfaceHeader):
663         (GenerateCallbackInterfaceImplementation):
664         (GenerateCallbackHeaderContent):
665         (GenerateCallbackImplementationContent):
666         Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
667         to allow using it for both the new callbacks as well as the old callback interfaces.
668
669         * bindings/scripts/IDLParser.pm:
670         (Parse):
671         (applyTypedefs):
672         (applyTypedefsToOperation):
673         (parseCallbackRest):
674         Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
675
676         * bindings/scripts/IDLAttributes.txt:
677         Remove support for Callback=FunctionOnly.
678
679         * bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
680         * bindings/scripts/test/JS/JSTestCallback.h: Removed.
681         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
682         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
683         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
684         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
685         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
686         * bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
687         * bindings/scripts/test/JS/JSTestObj.cpp:
688         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
689         * bindings/scripts/test/TestCallback.idl: Removed.
690         * bindings/scripts/test/TestCallbackFunction.idl:
691         * bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
692         * bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
693         * bindings/scripts/test/TestObj.idl:
694         * bindings/scripts/test/TestTypedefs.idl:
695         Update existing tests and add new ones to test callback functions specifically.
696
697 2016-11-04  Alex Christensen  <achristensen@webkit.org>
698
699         Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
700         https://bugs.webkit.org/show_bug.cgi?id=164439
701
702         Reviewed by Daniel Bates.
703
704         No change in behaviour.
705
706         * platform/URL.cpp:
707         (WebCore::defaultPortForProtocol):
708         (WebCore::isDefaultPortForProtocol):
709         * platform/URLParser.cpp:
710         (WebCore::URLParser::defaultPortForProtocol):
711         (WebCore::URLParser::parsePort):
712         (WebCore::defaultPortForProtocol): Deleted.
713         (WebCore::isDefaultPortForProtocol): Deleted.
714         * platform/URLParser.h:
715
716 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
717
718         Safari does not emit composition end if blurred for dead key / Japanese IME
719         https://bugs.webkit.org/show_bug.cgi?id=164369
720         <rdar://problem/29050439>
721
722         Reviewed by Ryosuke Niwa.
723
724         On Mac, _before_ changing selection, try to finalize the composition by calling Editor::cancelComposition early.
725         This is because the focused element may have changed after performing the selection change, so we would
726         otherwise be dispatching the `compositionend` to the new focused element (or no compositionend at all) instead
727         of the element with the composition.
728
729         Doing this allows us to match Chrome and Firefox behavior. After canceling the composition, we then need to also
730         clear the system IME state. We do this on Mac WK1/WK2 through the cancelComposition() codepath, which ends up
731         calling into -discardMarkedText, which resets the marked text state. Some minor refactoring was performed to
732         accomplish this -- currently, discardedComposition sends a CompositionWasCanceled message over to the UI process
733         that discards the marked text, and then updates the editor state. This patch splits this into two separate
734         steps -- see the WebKit2 ChangeLog for more details.
735
736         Test: fast/events/ime-compositionend-on-selection-change.html
737
738         * editing/Editor.cpp:
739         (WebCore::Editor::selectionWillChange):
740         * editing/Editor.h:
741         * editing/FrameSelection.cpp:
742         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
743         * editing/mac/EditorMac.mm:
744         (WebCore::Editor::selectionWillChange):
745         * loader/EmptyClients.h:
746         * page/EditorClient.h:
747
748 2016-11-04  Brady Eidson  <beidson@apple.com>
749
750         IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
751         https://bugs.webkit.org/show_bug.cgi?id=164424
752
753         Reviewed by Alex Christensen.
754
755         No new tests (Covered by existing tests).
756
757         This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
758         spec in flux/under discussion.
759
760         We'll update either source or the tests as things are resolved.
761
762         * Modules/indexeddb/IDBIndex.cpp:
763         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
764
765         * Modules/indexeddb/IDBObjectStore.cpp:
766         (WebCore::IDBObjectStore::get):
767         (WebCore::IDBObjectStore::putOrAdd):
768         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
769
770 2016-11-04  Ryosuke Niwa  <rniwa@webkit.org>
771
772         Load stylesheets in link elements inside a connected shadow tree
773         https://bugs.webkit.org/show_bug.cgi?id=160683
774         <rdar://problem/29040652>
775
776         Reviewed by Antti Koivisto.
777
778         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
779         when it's connected to a document instead of always talking to document's style scope.
780
781         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
782                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
783
784        * html/HTMLLinkElement.cpp:
785        (WebCore::HTMLLinkElement::HTMLLinkElement):
786        (WebCore::HTMLLinkElement::~HTMLLinkElement):
787        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
788        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
789        early when inDocument() is false.
790        (WebCore::HTMLLinkElement::parseAttribute):
791        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
792        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
793        a document instead of whenever its self-inclusive ancestor is inserted into a container.
794        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
795        calling removePendingSheet since the latter depends on m_styleScope being not null.
796        (WebCore::HTMLLinkElement::addPendingSheet):
797        (WebCore::HTMLLinkElement::removePendingSheet):
798        * html/HTMLLinkElement.h:
799        * html/HTMLStyleElement.cpp:
800        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
801        element has just become connected to a document.
802        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
803        * style/StyleScope.h:
804        * svg/SVGStyleElement.cpp:
805        (WebCore::SVGStyleElement::insertedInto): Ditto.
806        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
807
808 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
809
810         Add a setting and preferences to enable/disable async image decoding
811         https://bugs.webkit.org/show_bug.cgi?id=164417
812
813         Reviewed by Simon Fraser.
814
815         Add an asyncImageDecodingEnabled setting. This setting controls whether an
816         image "can" be asynchronously decoded on a separate thread or not. The
817         function ImageSource::isAsyncDecodingRequired() will be used in conjunction
818         with this setting to decide whether an image "should" be asynchronously
819         decoded or not.
820
821         * page/Settings.in:
822
823 2016-11-04  Tim Horton  <timothy_horton@apple.com>
824
825         Apply post-landing review comments for r208347
826
827         * dom/Element.cpp:
828         (WebCore::Element::findAnchorElementForLink):
829         Use attributeWithoutSynchronization.
830
831         * page/PrintContext.cpp:
832         (WebCore::PrintContext::spoolPage):
833         (WebCore::PrintContext::spoolRect):
834         (WebCore::PrintContext::collectLinkedDestinations):
835         (WebCore::PrintContext::outputLinkedDestinations):
836         * page/PrintContext.h:
837         Pass Document by reference instead of Node by pointer,
838         use ElementTraversal instead of NodeTraversal to avoid
839         having to locally check the type, and null-check renderers.
840
841 2016-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
842
843         Implement WebGL2RenderingContext::copyBufferSubData()
844         https://bugs.webkit.org/show_bug.cgi?id=164008
845
846         Reviewed by Dean Jackson.
847
848         Similar to previous work regarding WebGL 2 buffers, this method implements
849         the ability to copy from one buffer to another without the data leaving
850         the GPU.
851
852         Test: fast/canvas/webgl/copyBufferSubData.html
853
854         * html/canvas/WebGL2RenderingContext.cpp:
855         (WebCore::WebGL2RenderingContext::copyBufferSubData):
856         * html/canvas/WebGLBuffer.cpp:
857         (WebCore::WebGLBuffer::associateCopyBufferSubData):
858         * html/canvas/WebGLBuffer.h:
859         * platform/graphics/GraphicsContext3D.h:
860         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
861         (WebCore::GraphicsContext3D::copyBufferSubData):
862
863 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
864
865         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
866         https://bugs.webkit.org/show_bug.cgi?id=164420
867
868         Reviewed by Tim Horton.
869
870         Rename:
871             commitNewTreeState -> commitTreeState ("new" was redundant)
872             updateBeforeChildren -> commitStateBeforeChildren
873             updateAfterChildren -> commitStateAfterChildren
874
875         * page/scrolling/ScrollingTree.cpp:
876         (WebCore::ScrollingTree::commitTreeState):
877         (WebCore::ScrollingTree::updateTreeFromStateNode):
878         (WebCore::ScrollingTree::commitNewTreeState): Deleted.
879         * page/scrolling/ScrollingTree.h:
880         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
881         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
882         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren): Deleted.
883         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
884         * page/scrolling/ScrollingTreeNode.h:
885         (WebCore::ScrollingTreeNode::commitStateAfterChildren):
886         (WebCore::ScrollingTreeNode::updateAfterChildren): Deleted.
887         * page/scrolling/ScrollingTreeScrollingNode.cpp:
888         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
889         (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
890         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Deleted.
891         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren): Deleted.
892         * page/scrolling/ScrollingTreeScrollingNode.h:
893         * page/scrolling/ThreadedScrollingTree.cpp:
894         (WebCore::ThreadedScrollingTree::commitTreeState):
895         (WebCore::ThreadedScrollingTree::commitNewTreeState): Deleted.
896         * page/scrolling/ThreadedScrollingTree.h:
897         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
898         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
899         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
900         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren):
901         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren): Deleted.
902         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren): Deleted.
903         * page/scrolling/ios/ScrollingTreeIOS.cpp:
904         (WebCore::ScrollingTreeIOS::commitNewTreeState): Deleted.
905         * page/scrolling/ios/ScrollingTreeIOS.h:
906         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
907         (WebCore::ScrollingCoordinatorMac::commitTreeState):
908         * page/scrolling/mac/ScrollingTreeFixedNode.h:
909         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
910         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
911         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren): Deleted.
912         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
913         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
914         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
915         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
916         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Deleted.
917         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren): Deleted.
918         * page/scrolling/mac/ScrollingTreeStickyNode.h:
919         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
920         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
921         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren): Deleted.
922
923 2016-11-03  Anders Carlsson  <andersca@apple.com>
924
925         Add new 'other' Apple Pay button style
926         https://bugs.webkit.org/show_bug.cgi?id=164384
927         rdar://problem/28302528
928
929         Reviewed by Dean Jackson.
930
931         * DerivedSources.make:
932         * WebCorePrefix.h:
933         Add extension points.
934
935         * css/CSSPrimitiveValueMappings.h:
936         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
937         Add ApplePayButtonType::Other.
938
939         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
940         Add CSSValueOther.
941
942         * css/CSSValueKeywords.in:
943         Add other.
944
945         * css/parser/CSSParser.cpp:
946         (WebCore::isValidKeywordPropertyAndValue):
947         Add CSSValueOther.
948
949         * css/parser/CSSParserFastPaths.cpp:
950         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
951         Add CSSValueOther.
952
953         * rendering/RenderThemeCocoa.mm:
954         (WebCore::toPKPaymentButtonType):
955         Handle ApplePayButtonType::Other.
956
957         * rendering/style/RenderStyleConstants.h:
958         Add ApplePayButtonType::Other.
959
960 2016-11-04  Antti Koivisto  <antti@apple.com>
961
962         slotted() pseudo does not work with ID selector
963         https://bugs.webkit.org/show_bug.cgi?id=160538
964         <rdar://problem/28534529>
965
966         Reviewed by Andreas Kling.
967
968         When we saw an id selector while addin rules we immediately threw it into the m_idRules
969         optimization bucket and bailed out. However selectors containing ::slotted must always end
970         up in m_slottedPseudoElementRules list no matter what else is there.
971
972         Fix by treating id like other selectors and only choosing the bucket after analysing all
973         the selector components.
974
975         Test: fast/shadow-dom/css-scoping-slot-with-id.html
976
977         * css/RuleSet.cpp:
978         (WebCore::RuleSet::addRule): Also made this use switch instead of a series of ifs.
979
980 2016-11-04  Brady Eidson  <beidson@apple.com>
981
982         IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
983         https://bugs.webkit.org/show_bug.cgi?id=164416
984
985         Reviewed by Beth Dakin.
986
987         No new tests (Covered by existing tests).
988
989         * Modules/indexeddb/IDBObjectStore.cpp:
990         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
991
992 2016-11-04  Keith Rollin  <krollin@apple.com>
993
994         NetworkSession: Add NetworkDataTask implementation for blobs
995         https://bugs.webkit.org/show_bug.cgi?id=163939
996
997         Reviewed by Alex Christensen.
998
999         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
1000         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
1001         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
1002         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
1003         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
1004
1005 2016-11-04  Brady Eidson  <beidson@apple.com>
1006
1007         IndexedDB 2.0: Use IDB-specific exceptions in places where the generic exceptions are currently used.
1008         https://bugs.webkit.org/show_bug.cgi?id=164406
1009
1010         Reviewed by Alex Christensen.
1011
1012         No new tests (Covered by existing tests).
1013
1014         * Modules/indexeddb/IDBIndex.cpp:
1015         (WebCore::IDBIndex::setName):
1016
1017         * Modules/indexeddb/IDBObjectStore.cpp:
1018         (WebCore::IDBObjectStore::setName):
1019
1020 2016-11-04  Joanmarie Diggs  <jdiggs@igalia.com>
1021
1022         AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
1023         https://bugs.webkit.org/show_bug.cgi?id=164331
1024
1025         Reviewed by Chris Fleizach.
1026
1027         The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
1028         But is<AccessibilityListBox>() returns the value of isListBox() which returns
1029         true both for AccessibilityListBox instances as well as for AccessibilityObject
1030         instances which have an AccessibilityRole value of ListBoxRole. Because only
1031         native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
1032         that we can distinguish native and ARIA listboxes.
1033
1034         Tests: accessibility/aria-listbox-clear-selection-crash.html
1035                accessibility/listbox-clear-selection.html
1036
1037         * accessibility/AccessibilityListBox.h:
1038         * accessibility/AccessibilityObject.h:
1039         (WebCore::AccessibilityObject::isNativeListBox):
1040         (WebCore::AccessibilityObject::isListBox):
1041
1042 2016-11-04  Brady Eidson  <beidson@apple.com>
1043
1044         IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
1045         https://bugs.webkit.org/show_bug.cgi?id=164405
1046
1047         Reviewed by Alex Christensen.
1048
1049         No new tests (Covered by existing tests).
1050
1051         * Modules/indexeddb/IDBIndex.cpp:
1052         (WebCore::IDBIndex::setName):
1053
1054         * Modules/indexeddb/IDBObjectStore.cpp:
1055         (WebCore::IDBObjectStore::setName):
1056
1057 2016-11-04  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1058
1059         [Readable Streams API] Implement ByteStreamController error()
1060         https://bugs.webkit.org/show_bug.cgi?id=164319
1061
1062         Reviewed by Youenn Fablet.
1063
1064         Implemented error() method of ReadableByteStreamController.
1065
1066         Updated test expectations for error() and added IDL-related tests.
1067
1068         * Modules/streams/ReadableByteStreamController.js:
1069         (error): Implemented.
1070         * Modules/streams/ReadableByteStreamInternals.js:
1071         (privateInitializeReadableByteStreamController):
1072         (isReadableByteStreamController): Added.
1073         (readableByteStreamControllerError): Added.
1074         (readableByteStreamControllerClearPendingPullIntos): Added.
1075         * Modules/streams/ReadableStream.js:
1076         (initializeReadableStream): More detailed error message.
1077         * Modules/streams/ReadableStreamDefaultController.js:
1078         (error): Removed unnecessary variable declaration.
1079         * bindings/js/WebCoreBuiltinNames.h: Added totalQueuedBytes.
1080
1081 2016-11-03  Brady Eidson  <beidson@apple.com>
1082
1083         IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
1084         https://bugs.webkit.org/show_bug.cgi?id=164403
1085
1086         Reviewed by Alex Christensen.
1087
1088         No new tests (Covered by existing test).
1089
1090         * Modules/indexeddb/IDBIndex.cpp:
1091         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): Only rollback the info if this index
1092           already existed before this version change transaction.
1093
1094 2016-11-03  Youenn Fablet  <youenn@apple.com>
1095
1096         [WebRTC] Introduce asynchronous backend createOffer API
1097         https://bugs.webkit.org/show_bug.cgi?id=164365
1098
1099         Reviewed by Sam Weinig.
1100
1101         Covered by existing tests.
1102
1103         Removing PeerEndpointBackendClient as it is only RTCPeerConnection.
1104         This allows removing virtual for some functions.
1105
1106         Moving MediaEndpointPeerClient::m_client to PeerEndpointBackendClient::m_peerConnection and making it a reference.
1107
1108         Implementing createOffer at PeerConnectionBackend by splitting it in four sub-functions:
1109         - main createOffer, implemented at PeerConnectionBackend.
1110         - doCreateOffer implemented by subclasses (MediaEndpointPeerConnection).
1111         - createOfferSucceeded/createOfferFailed implemented by PeerConnectionBackend.
1112
1113         * CMakeLists.txt:
1114         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1115         (WebCore::createMediaEndpointPeerConnection):
1116         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
1117         (WebCore::MediaEndpointPeerConnection::doCreateOffer):
1118         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1119         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
1120         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1121         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1122         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
1123         (WebCore::MediaEndpointPeerConnection::createReceiver):
1124         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1125         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
1126         (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
1127         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
1128         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
1129         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1130         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
1131         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
1132         (WebCore::MediaEndpointPeerConnection::createOffer): Deleted.
1133         * Modules/mediastream/MediaEndpointPeerConnection.h:
1134         * Modules/mediastream/PeerConnectionBackend.cpp:
1135         (WebCore::PeerConnectionBackend::createOffer):
1136         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1137         (WebCore::PeerConnectionBackend::createOfferFailed):
1138         (WebCore::createPeerConnectionBackend): Deleted.
1139         * Modules/mediastream/PeerConnectionBackend.h:
1140         (WebCore::PeerConnectionBackend::PeerConnectionBackend):
1141         (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): Deleted.
1142         * Modules/mediastream/RTCPeerConnection.cpp:
1143         (WebCore::RTCPeerConnection::RTCPeerConnection):
1144         * Modules/mediastream/RTCPeerConnection.h:
1145         * WebCore.xcodeproj/project.pbxproj:
1146
1147 2016-11-03  Antti Koivisto  <antti@apple.com>
1148
1149         REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16
1150         https://bugs.webkit.org/show_bug.cgi?id=164397
1151         <rdar://problem/29100135>
1152
1153         Reviewed by Ryosuke Niwa.
1154
1155         The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when
1156         using fast-path document teardown.
1157
1158         (Patch and stories mostly by rniwa).
1159
1160         * dom/Document.cpp:
1161         (WebCore::Document::~Document):
1162         (WebCore::Document::didInsertInDocumentShadowRoot):
1163         (WebCore::Document::didRemoveInDocumentShadowRoot):
1164
1165             Improve asserts.
1166
1167         * dom/Element.cpp:
1168         (WebCore::Element::removeShadowRoot):
1169
1170             Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
1171             avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
1172             ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
1173             since the latter function tears down nodes via the deletion queue during a document destruction and use
1174             notifyChildNodeRemoved() on nodes that outlive the shadow root.
1175
1176         * dom/ShadowRoot.cpp:
1177         (WebCore::ShadowRoot::~ShadowRoot):
1178
1179             Take care to clean up inDocumentShadowRoots for fast-pathed destruction too.
1180
1181         (WebCore::ShadowRoot::insertedInto):
1182         (WebCore::ShadowRoot::removedFrom):
1183
1184             Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
1185             m_inDocumentShadowRoots when the connected-ness changes.
1186
1187 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
1188
1189         Give all the geometry classes a single-argument scale() function for consistency
1190         https://bugs.webkit.org/show_bug.cgi?id=164400
1191
1192         Reviewed by Zalan Bujtas.
1193
1194         Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
1195         as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
1196         to the new functions.
1197
1198         * dom/Document.cpp:
1199         (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
1200         * dom/MouseRelatedEvent.cpp:
1201         (WebCore::MouseRelatedEvent::init):
1202         (WebCore::MouseRelatedEvent::computeRelativePosition):
1203         * dom/TreeScope.cpp:
1204         (WebCore::TreeScope::nodeFromPoint):
1205         * page/PrintContext.cpp:
1206         (WebCore::PrintContext::spoolPage):
1207         * platform/cocoa/ThemeCocoa.mm:
1208         (WebCore::fitContextToBox):
1209         * platform/graphics/FloatPoint.h:
1210         (WebCore::FloatPoint::scale):
1211         * platform/graphics/FloatQuad.h:
1212         (WebCore::FloatQuad::scale):
1213         * platform/graphics/FloatSize.h:
1214         (WebCore::FloatSize::scale):
1215         * platform/graphics/GraphicsContext.cpp:
1216         (WebCore::GraphicsContext::applyDeviceScaleFactor):
1217         * platform/graphics/GraphicsContext.h:
1218         (WebCore::GraphicsContext::scale):
1219         * platform/graphics/LayoutPoint.h:
1220         (WebCore::LayoutPoint::scale):
1221         * platform/graphics/ca/TileCoverageMap.cpp:
1222         (WebCore::TileCoverageMap::update):
1223         * platform/graphics/ca/TileGrid.cpp:
1224         (WebCore::TileGrid::platformCALayerPaintContents):
1225         * platform/graphics/cg/ImageBufferCG.cpp:
1226         (WebCore::ImageBuffer::drawConsuming):
1227         (WebCore::ImageBuffer::draw):
1228         (WebCore::ImageBuffer::drawPattern):
1229         * platform/mac/ThemeMac.mm:
1230         (WebCore::paintToggleButton):
1231         (WebCore::paintButton):
1232         (WebCore::paintStepper):
1233         * rendering/RenderImage.cpp:
1234         (WebCore::RenderImage::nodeAtPoint):
1235         * rendering/RenderMediaControls.cpp:
1236         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
1237         * rendering/RenderThemeMac.mm:
1238         (WebCore::RenderThemeMac::paintMenuList):
1239         (WebCore::RenderThemeMac::paintSliderThumb):
1240         (WebCore::RenderThemeMac::paintSearchField):
1241         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1242         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1243         * rendering/svg/SVGInlineTextBox.cpp:
1244         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
1245         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
1246         (WebCore::SVGInlineTextBox::paintTextWithShadows):
1247         * svg/SVGPathBlender.cpp:
1248         (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
1249         (WebCore::SVGPathBlender::blendArcToSegment):
1250         * svg/SVGPathParser.cpp:
1251         (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
1252         (WebCore::SVGPathParser::parseCurveToQuadraticSegment):
1253         (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
1254         (WebCore::SVGPathParser::decomposeArcToCubic):
1255         * svg/SVGSVGElement.cpp:
1256         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
1257
1258 2016-11-03  Antti Koivisto  <antti@apple.com>
1259
1260         REGRESSION (r207669): Crash under media controls shadow root construction
1261         https://bugs.webkit.org/show_bug.cgi?id=164381
1262         <rdar://problem/28935401>
1263
1264         Reviewed by Simon Fraser.
1265
1266         The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
1267         It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
1268         callback should be used.
1269
1270         Test: media/media-controls-shadow-construction-crash.html
1271
1272         Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
1273
1274         * html/HTMLMediaElement.cpp:
1275         (WebCore::HTMLMediaElement::insertedInto):
1276         (WebCore::HTMLMediaElement::finishedInsertingSubtree):
1277
1278             Move configureMediaControls() to finishedInsertingSubtree().
1279
1280         * html/HTMLMediaElement.h:
1281         * style/StyleTreeResolver.cpp:
1282         (WebCore::Style::TreeResolver::resolveComposedTree):
1283
1284             Add an assert to make the bad state easier to hit in tests.
1285
1286 2016-11-03  Ryosuke Niwa  <rniwa@webkit.org>
1287
1288         Add an assertion to diagnose stress GC bots test failures
1289         https://bugs.webkit.org/show_bug.cgi?id=164396
1290
1291         Reviewed by Antti Koivisto.
1292
1293         Added an assertion for calling ElementQueue::add while ElementQueue::invokeAll is in progress.
1294         This should never happen as long as all DOM API has an appropriate CEReactions IDL attribute.
1295
1296         * dom/CustomElementReactionQueue.cpp:
1297         (WebCore::CustomElementReactionStack::ElementQueue::add):
1298         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
1299         * dom/CustomElementReactionQueue.h:
1300
1301 2016-11-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
1302
1303         Add the asynchronous image decoding mode
1304         https://bugs.webkit.org/show_bug.cgi?id=155546
1305
1306         Reviewed by Simon Fraser.
1307
1308         The asynchronous image decoding feature targets enhancing the rendering
1309         in two scenarios: the animated images and scrolling a page which large
1310         images. Enabling this feature for these two scenarios will be landed
1311         separately. 
1312
1313         The goal of the asynchronous image decoding is to have the decoded image
1314         frame ready before it has to be drawn. Drawing an image does not have to
1315         wait the image frame to be decoded.
1316
1317         * platform/graphics/BitmapImage.cpp:
1318         (WebCore::BitmapImage::frameImageAtIndex): Use the negation of frameHasValidNativeImageAtIndex().
1319         * platform/graphics/BitmapImage.h:
1320         (WebCore::BitmapImage::frameIsBeingDecodedAtIndex): Answers whether a frame is being decoded.
1321         (WebCore::BitmapImage::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
1322         (WebCore::BitmapImage::frameHasInvalidNativeImageAtIndex): Deleted.
1323         * platform/graphics/Image.h:
1324         (WebCore::Image::newFrameNativeImageAvailableAtIndex): Notifies the image with the availability of a frame NativeImage.
1325         * platform/graphics/ImageFrame.h:
1326         (WebCore::ImageFrame::isBeingDecoded): Answers whether the frame is being decoded.
1327         (WebCore::ImageFrame::hasValidNativeImage): Checks the validity of the frame.
1328         (WebCore::ImageFrame::hasInvalidNativeImage): Deleted.
1329         * platform/graphics/ImageFrameCache.cpp:
1330         (WebCore::ImageFrameCache::~ImageFrameCache): Asserts the decoding loop was ended before deleting the ImageFrameCache.
1331         (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Rename this function to matches the other which take the frame index.
1332         (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Ditto.
1333         (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): It setts the ImageFrame's members and updates the decoded size.
1334         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Replaces the frame NativeImage and notifies the Image with the new frame.
1335         (WebCore::ImageFrameCache::decodingQueue): Ensures the decoding WorkQueue is created and returns it.
1336         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Starts a decoding WorkQueue which loops until m_frameRequestQueue is closed.
1337         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Allows ImageSource to send a request to start asynchronous frame image decoding.
1338         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Stops the decoding WorkQueue by closing m_frameRequestQueue.
1339         (WebCore::ImageFrameCache::frameAtIndex): Call replaceFrameNativeImageAtIndex().
1340         (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Returns true if a request for the image frame is issued but not finished yet.
1341         (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
1342         (WebCore::ImageFrameCache::setFrameNativeImage): Deleted. Was renamed to be setFrameNativeImageAtIndex.
1343         (WebCore::ImageFrameCache::setFrameMetadata): Deleted. Was renamed to be setFrameMetadataAtIndex
1344         (WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
1345         * platform/graphics/ImageFrameCache.h:
1346         (WebCore::ImageFrameCache::create): The decoding queue needs to hold a reference to this class so it can stop decoding safely without blocking.
1347         (WebCore::ImageFrameCache::hasDecodingQueue): Returns true if a decoding queue has started.
1348         * platform/graphics/ImageSource.cpp:
1349         (WebCore::ImageSource::ImageSource): Call ImageFrameCache::create().
1350         (WebCore::ImageSource::clear): Deleting the decoder is unnecessary for asynchronous decoding because ImageFrameCache manages all the memory.
1351         
1352         (WebCore::ImageSource::destroyDecodedData):
1353         (WebCore::ImageSource::destroyDecodedDataIfNecessary):
1354         (WebCore::ImageSource::ensureDecoderAvailable):
1355         (WebCore::ImageSource::dataChanged):
1356         (WebCore::ImageSource::isAllDataReceived):
1357         (WebCore::ImageSource::isAsyncDecodingRequired): Answers the question whether the async image decoding is required for this ImageSource.
1358         (WebCore::ImageSource::frameImageAtIndex):
1359         * platform/graphics/ImageSource.h:
1360         (WebCore::ImageSource::decodedSize):
1361         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
1362         (WebCore::ImageSource::stopAsyncDecodingQueue):
1363         (WebCore::ImageSource::isSizeAvailable):
1364         (WebCore::ImageSource::frameCount):
1365         (WebCore::ImageSource::repetitionCount):
1366         (WebCore::ImageSource::filenameExtension):
1367         (WebCore::ImageSource::hotSpot):
1368         (WebCore::ImageSource::size):
1369         (WebCore::ImageSource::sizeRespectingOrientation):
1370         (WebCore::ImageSource::singlePixelSolidColor):
1371         (WebCore::ImageSource::frameIsBeingDecodedAtIndex):
1372         (WebCore::ImageSource::frameIsCompleteAtIndex):
1373         (WebCore::ImageSource::frameHasAlphaAtIndex):
1374         (WebCore::ImageSource::frameHasImageAtIndex):
1375         (WebCore::ImageSource::frameSubsamplingLevelAtIndex):
1376         (WebCore::ImageSource::frameSizeAtIndex):
1377         (WebCore::ImageSource::frameBytesAtIndex):
1378         (WebCore::ImageSource::frameDurationAtIndex):
1379         (WebCore::ImageSource::frameOrientationAtIndex):
1380          Make m_frameCache a type Ref<ImageFrameCache>. Use '->' instead of '.' when accessing its members.
1381
1382         (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
1383         (WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
1384
1385 2016-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
1386
1387         [WebGL2] Implement getBufferSubData()
1388         https://bugs.webkit.org/show_bug.cgi?id=164111
1389
1390         Reviewed by Dean Jackson.
1391
1392         The call exists in OpenGL 3.2 but in order to have parity with
1393         OpenGL ES 3 we back it with glMapBufferRange() instead.
1394
1395         This patch simply adds surface area to GraphicsContext3D
1396         until we can get an ANGLE implementation of it.
1397
1398         When testing this patch I discovered that r207649 incorrectly
1399         interpreted arguments to bufferData() and bufferSubData() as
1400         byte offsets. Instead, they should be element indices. This
1401         patch fixes those functions to work correctly so that
1402         getBufferSubData() can be tested correctly.
1403
1404         Tests: fast/canvas/webgl/webgl2-buffers.html
1405                fast/canvas/webgl/getBufferSubData-webgl1.html
1406
1407         * html/canvas/WebGL2RenderingContext.cpp:
1408         (WebCore::arrayBufferViewElementSize):
1409         (WebCore::WebGL2RenderingContext::bufferData):
1410         (WebCore::WebGL2RenderingContext::bufferSubData):
1411         (WebCore::WebGL2RenderingContext::getBufferSubData):
1412         * html/canvas/WebGL2RenderingContext.h:
1413         * html/canvas/WebGL2RenderingContext.idl:
1414         * platform/graphics/GraphicsContext3D.h:
1415         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1416         (WebCore::GraphicsContext3D::getBufferSubData):
1417         (WebCore::GraphicsContext3D::mapBufferRange):
1418         (WebCore::GraphicsContext3D::unmapBuffer):
1419
1420 2016-11-03  Chris Dumez  <cdumez@apple.com>
1421
1422         Unreviewed, mark support for the 'download' attribute as 'Done'.
1423
1424         * features.json:
1425
1426 2016-11-03  Chris Dumez  <cdumez@apple.com>
1427
1428         [WK2][Cocoa] Implement user interface for HTML form validation
1429         https://bugs.webkit.org/show_bug.cgi?id=164143
1430         <rdar://problem/28944652>
1431
1432         Reviewed by Simon Fraser.
1433
1434         Add ValidationBubble class to show HTML form validation messages
1435         using native dialogs. It currently has an implementation for both
1436         Mac and iOS. It is in WebCore under platform/ so that it can be
1437         used by both WebKit1 and WebKit2.
1438
1439         Update ownership of ValidationMessageClient so that is is owned
1440         by the Page using a unique_ptr<>, which seems to be the modern
1441         way of handling lifetime for page clients.
1442
1443         Test: fast/forms/validation-messages.html
1444
1445         * WebCore.xcodeproj/project.pbxproj:
1446         * html/HTMLFormControlElement.cpp:
1447         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
1448         * html/ValidationMessage.cpp:
1449         (WebCore::ValidationMessage::updateValidationMessage):
1450         * page/Page.cpp:
1451         (WebCore::Page::Page):
1452         (WebCore::Page::~Page):
1453         * page/Page.h:
1454         (WebCore::Page::validationMessageClient):
1455         * page/PageConfiguration.cpp:
1456         * page/PageConfiguration.h:
1457         * platform/ValidationBubble.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
1458         (WebCore::ValidationBubble::message):
1459         * platform/ios/ValidationBubbleIOS.mm: Added.
1460         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
1461         (WebCore::ValidationBubble::ValidationBubble):
1462         (WebCore::ValidationBubble::~ValidationBubble):
1463         (WebCore::ValidationBubble::show):
1464         (WebCore::ValidationBubble::setAnchorRect):
1465         * platform/mac/ValidationBubbleMac.mm: Added.
1466         (WebCore::ValidationBubble::ValidationBubble):
1467         (WebCore::ValidationBubble::~ValidationBubble):
1468         (WebCore::ValidationBubble::showRelativeTo):
1469
1470 2016-11-03  Brady Eidson  <beidson@apple.com>
1471
1472         IndexedDB 2.0: Rename IDBKeyRange.contains to IDBKeyRange.includes.
1473         https://bugs.webkit.org/show_bug.cgi?id=164383
1474
1475         Reviewed by Beth Dakin.
1476
1477         No new tests (Updated existing tests).
1478
1479         * Modules/indexeddb/IDBKeyRange.cpp:
1480         (WebCore::IDBKeyRange::includes):
1481         (WebCore::IDBKeyRange::contains): Deleted.
1482         * Modules/indexeddb/IDBKeyRange.h:
1483         * Modules/indexeddb/IDBKeyRange.idl:
1484
1485 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
1486
1487         Unreviewed, rolling out r208302.
1488
1489         This change causes LayoutTest crashes under GuardMalloc.
1490
1491         Reverted changeset:
1492
1493         "Load stylesheets in link elements inside a connected shadow
1494         tree"
1495         https://bugs.webkit.org/show_bug.cgi?id=160683
1496         http://trac.webkit.org/changeset/208302
1497
1498 2016-11-03  Chris Dumez  <cdumez@apple.com>
1499
1500         Unreviewed, add HTML5 specification for HTML Interactive Form Validation feature.
1501
1502         * features.json:
1503
1504 2016-11-03  Chris Dumez  <cdumez@apple.com>
1505
1506         Unreviewed, add HTML Interactive Form Validation to features.json
1507
1508         * features.json:
1509
1510 2016-11-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1511
1512         Unreviewed, rolling out due to crash in Amazon web site
1513         https://bugs.webkit.org/show_bug.cgi?id=164380
1514         <rdar://problem/29094221>
1515
1516         * dom/Node.idl:
1517         * domjit/JSNodeDOMJIT.cpp:
1518         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.
1519         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
1520
1521 2016-11-03  Brady Eidson  <beidson@apple.com>
1522
1523         IndexedDB 2.0: Support binary keys.
1524         <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
1525
1526         Reviewed by Alex Christensen.
1527
1528         Tests: storage/indexeddb/modern/binary-keys-1-private.html
1529                storage/indexeddb/modern/binary-keys-1.html
1530                Changes to other existing tests.
1531
1532         * Modules/indexeddb/IDBKey.cpp:
1533         (WebCore::IDBKey::createBinary):
1534         (WebCore::IDBKey::IDBKey):
1535         (WebCore::IDBKey::compare):
1536         * Modules/indexeddb/IDBKey.h:
1537         (WebCore::IDBKey::binary):
1538         (WebCore::compareBinaryKeyData):
1539
1540         * Modules/indexeddb/IDBKeyData.cpp:
1541         (WebCore::IDBKeyData::IDBKeyData):
1542         (WebCore::IDBKeyData::maybeCreateIDBKey):
1543         (WebCore::IDBKeyData::isolatedCopy):
1544         (WebCore::IDBKeyData::encode):
1545         (WebCore::IDBKeyData::decode):
1546         (WebCore::IDBKeyData::compare):
1547         (WebCore::IDBKeyData::loggingString):
1548         (WebCore::IDBKeyData::operator==):
1549         * Modules/indexeddb/IDBKeyData.h:
1550         (WebCore::IDBKeyData::hash):
1551         (WebCore::IDBKeyData::encode):
1552         (WebCore::IDBKeyData::decode):
1553
1554         * Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
1555
1556         * bindings/js/IDBBindingUtilities.cpp:
1557         (WebCore::toJS):
1558         (WebCore::createIDBKeyFromValue):
1559
1560         * platform/ThreadSafeDataBuffer.h:
1561         (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
1562         (WebCore::ThreadSafeDataBuffer::copyData):
1563         (WebCore::ThreadSafeDataBuffer::size):
1564         (WebCore::ThreadSafeDataBuffer::operator==):
1565         (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
1566
1567 2016-11-03  Tim Horton  <timothy_horton@apple.com>
1568
1569         Printing to PDF should produce internal links when HTML has internal links
1570         https://bugs.webkit.org/show_bug.cgi?id=112081
1571         <rdar://problem/5955705>
1572
1573         Reviewed by Simon Fraser.
1574         Patch originally by David Lattimore.
1575
1576         No new tests, as it's unclear how to test PDF output.
1577
1578         * dom/Element.cpp:
1579         (WebCore::Element::findAnchorElementForLink):
1580         * dom/Element.h:
1581         Add findAnchorElementForLink, which looks up the anchor element corresponding
1582         to the current element's href, and also returns the fragment name as an out parameter.
1583
1584         * page/PrintContext.cpp:
1585         (WebCore::PrintContext::PrintContext):
1586         (WebCore::PrintContext::spoolPage):
1587         (WebCore::PrintContext::spoolRect):
1588         (WebCore::PrintContext::end):
1589         (WebCore::PrintContext::collectLinkedDestinations):
1590         (WebCore::PrintContext::outputLinkedDestinations):
1591         * rendering/RenderObject.cpp:
1592         (WebCore::RenderObject::addPDFURLRect):
1593         Plumb internal links (fragment links) through to GraphicsContext, using
1594         the fragment name from the page.
1595
1596         * page/PrintContext.h:
1597         * platform/graphics/GraphicsContext.cpp:
1598         (WebCore::GraphicsContext::supportsInternalLinks):
1599         (WebCore::GraphicsContext::setDestinationForRect):
1600         (WebCore::GraphicsContext::addDestinationAtPoint):
1601         * platform/graphics/GraphicsContext.h:
1602         * platform/graphics/cg/GraphicsContextCG.cpp:
1603         (WebCore::GraphicsContext::supportsInternalLinks):
1604         (WebCore::GraphicsContext::setDestinationForRect):
1605         (WebCore::GraphicsContext::addDestinationAtPoint):
1606         Plumb internal links through to the CGContext. Apply the CTM, because
1607         these functions expect positions in global coordinates.
1608
1609         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1610         (WebCore::GraphicsContext::setURLForRect):
1611         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1612         (WebCore::GraphicsContext::setURLForRect):
1613         Adjust setURLForRect to take a FloatRect, like everything else, and
1614         stop rounding.
1615
1616 2016-11-03  Alex Christensen  <achristensen@webkit.org>
1617
1618         Unreviewed, rolling out r208298.
1619         https://bugs.webkit.org/show_bug.cgi?id=163939
1620
1621         caused asan crashes
1622
1623         Reverted changeset:
1624
1625         "NetworkSession: Add NetworkDataTask implementation for blobs"
1626         https://bugs.webkit.org/show_bug.cgi?id=163939
1627         http://trac.webkit.org/changeset/208298
1628
1629 2016-11-03  Brent Fulgham  <bfulgham@apple.com>
1630
1631         [Win][Direct2D] Native Windows widgets are drawn upside-down
1632         https://bugs.webkit.org/show_bug.cgi?id=164370
1633
1634         Reviewed by Alex Christensen.
1635
1636         When we return from drawing in GDI code, we need to flip the resulting
1637         bitmap so that it draws in the proper orientation in Direct2D.
1638
1639         Tested by existing widget tests.
1640
1641         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1642         (WebCore::GraphicsContext::releaseWindowsContext): Flip before drawing
1643         to our Direct2D context.
1644
1645 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
1646
1647         Remove PageThrottler & all related code
1648         https://bugs.webkit.org/show_bug.cgi?id=164302
1649
1650         Reviewed by Ryosuke Niwa.
1651
1652         All relevant information now available from the ActivityState.
1653
1654         * CMakeLists.txt:
1655         * WebCore.xcodeproj/project.pbxproj:
1656         * html/HTMLMediaElement.cpp:
1657         (WebCore::HTMLMediaElement::setMuted):
1658         (WebCore::HTMLMediaElement::updateVolume):
1659         (WebCore::HTMLMediaElement::updatePlayState):
1660         (WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
1661         * html/HTMLMediaElement.h:
1662         * loader/FrameLoader.cpp:
1663         (WebCore::FrameLoader::completed):
1664         (WebCore::FrameLoader::started):
1665         * loader/FrameLoader.h:
1666         * page/ChromeClient.h:
1667         * page/Page.cpp:
1668         (WebCore::Page::Page):
1669         * page/Page.h:
1670         (WebCore::Page::pageActivityStateChanged): Deleted.
1671         (WebCore::Page::pageThrottler): Deleted.
1672         * page/PageThrottler.cpp: Removed.
1673         * page/PageThrottler.h: Removed.
1674
1675 2016-11-03  Dan Bernstein  <mitz@apple.com>
1676
1677         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
1678         https://bugs.webkit.org/show_bug.cgi?id=164340
1679         <rdar://problem/29074344>
1680
1681         Reviewed by Tim Horton.
1682
1683         To give WebKit a chance to deliver the painting milestones to its client after the commit,
1684         we must tell it about them before or during the commit. To that end, we should not defer
1685         the call to firePaintRelatedMilestonesIfNeeded until after the commit.
1686
1687         * rendering/RenderLayerCompositor.cpp:
1688         (WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
1689           m_paintRelatedMilestonesTimer initializer.
1690         (WebCore::RenderLayerCompositor::didPaintBacking): Call
1691           FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
1692         (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
1693         * rendering/RenderLayerCompositor.h:
1694
1695 2016-11-03  Antti Koivisto  <antti@apple.com>
1696
1697         imported/mozilla/svg/paint-order-01.svg and imported/mozilla/svg/paint-order-02.svg are flaky failures
1698         https://bugs.webkit.org/show_bug.cgi?id=164355
1699
1700         Reviewed by Ryosuke Niwa.
1701
1702         Revert one change from https://trac.webkit.org/changeset/207669 to see if it is causing flakiness in
1703         some XML based tests.
1704
1705         * xml/parser/XMLDocumentParser.cpp:
1706         (WebCore::XMLDocumentParser::end):
1707
1708 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1709
1710         Unreviewed, fix CLoop build after r208320.
1711         https://bugs.webkit.org/show_bug.cgi?id=162980
1712
1713         Guard with ENABLE(JIT).
1714
1715         * bindings/scripts/CodeGeneratorJS.pm:
1716         (GenerateImplementation):
1717         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1718
1719 2016-11-02  Brady Eidson  <beidson@apple.com>
1720
1721         Expand upon IndexedDB status in features.json.
1722         
1723         * features.json:
1724
1725 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
1726
1727         CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false
1728         https://bugs.webkit.org/show_bug.cgi?id=164244
1729
1730         Reviewed by Michael Catanzaro.
1731
1732         Because we weren't passing a Document into CSSParserContext's constructor,
1733         there was no way for our parser to know whether the runtime switch was on
1734         or not. Instead, we can use the CallWith attribute in the IDL file to pass
1735         in a Document.
1736
1737         Test: fast/text/variations/css-supports-runtime-switch.html
1738
1739         * css/DOMCSSNamespace.cpp:
1740         (WebCore::DOMCSSNamespace::supports):
1741         * css/DOMCSSNamespace.h:
1742         * css/DOMCSSNamespace.idl:
1743
1744 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1745
1746         [DOMJIT] Add DOMJIT::Signature
1747         https://bugs.webkit.org/show_bug.cgi?id=162980
1748
1749         Reviewed by Saam Barati and Sam Weinig.
1750
1751         We introduce DOMJIT::Signature. This signature object is automatically generated by IDL code generator.
1752         It holds (1) types, (2) pointer to the unsafe function (the function without checks), and (3) the effect
1753         of the function. We use constexpr to initialize DOMJIT::Signature without invoking global constructors.
1754         Thus the content is embedded into the binary as the constant values.
1755
1756         We also clean up the IDL code generator related to DOMJIT part. Instead of switching things inside IDL
1757         code generator, we use C++ template to dispatch things at compile time. This template meta programming
1758         is highly utilized in IDL these days.
1759
1760         To make DOMJIT::Signature constexpr, we also need to define DOMJIT abstract heap things in the build time.
1761         To do so, we introduce a tiny Ruby script to calculate the range of abstract heaps. We can offer the abstract
1762         heap tree as YAML format and the script will produce a C++ header holding the calculated abstract heap ranges
1763
1764         * CMakeLists.txt:
1765         * DerivedSources.make:
1766         * ForwardingHeaders/bytecode/SpeculatedType.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
1767         * ForwardingHeaders/domjit/DOMJITSignature.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp.
1768         * WebCore.xcodeproj/project.pbxproj:
1769         * bindings/js/JSDOMGlobalObject.h:
1770         * bindings/scripts/CodeGeneratorJS.pm:
1771         (GenerateHeader):
1772         (GeneratePropertiesHashTable):
1773         (GetUnsafeArgumentType):
1774         (GetArgumentTypeFilter):
1775         (GetResultTypeFilter):
1776         (GenerateImplementation):
1777         (UnsafeToNative):
1778         (GenerateHashTableValueArray):
1779         (ComputeFunctionSpecial):
1780         * bindings/scripts/IDLAttributes.txt:
1781         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1782         (WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
1783         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
1784         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
1785         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
1786         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
1787         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
1788         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
1789         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
1790         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
1791         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
1792         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
1793         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
1794         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
1795         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
1796         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
1797         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
1798         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
1799         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
1800         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
1801         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
1802         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
1803         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
1804         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
1805         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
1806         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
1807         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
1808         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
1809         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
1810         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
1811         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
1812         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
1813         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
1814         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
1815         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
1816         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
1817         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
1818         (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
1819         (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeCaller):
1820         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
1821         (WebCore::jsTestDOMJITPrototypeFunctionItem):
1822         (WebCore::jsTestDOMJITPrototypeFunctionItemCaller):
1823         (WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
1824         (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
1825         (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeCaller):
1826         (WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
1827         (WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
1828         (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdCaller):
1829         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
1830         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
1831         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameCaller):
1832         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
1833         * bindings/scripts/test/TestDOMJIT.idl:
1834         * dom/Element.idl:
1835         * domjit/DOMJITAbstractHeapRepository.yaml: Added.
1836         * domjit/DOMJITIDLConvert.h: Added.
1837         (WebCore::DOMJIT::DirectConverter<IDLDOMString>::directConvert<StringConversionConfiguration::Normal>):
1838         * domjit/DOMJITIDLType.h: Added.
1839         * domjit/DOMJITIDLTypeFilter.h: Added.
1840         * domjit/JSDocumentDOMJIT.cpp:
1841         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
1842         * domjit/JSNodeDOMJIT.cpp:
1843         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
1844         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
1845         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
1846         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
1847         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
1848         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
1849         * domjit/generate-abstract-heap.rb: Added.
1850
1851 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
1852
1853         Followup after r208314.
1854
1855         The style created for reflections contains transforms and a mask, so needs to get explicit
1856         z-index on it. This doesn't change rendering, since this layer has no children.
1857
1858         Fixes assertions in various reflection tests.
1859
1860         * rendering/RenderLayer.cpp:
1861         (WebCore::RenderLayer::calculateClipRects):
1862
1863 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
1864
1865         REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
1866         https://bugs.webkit.org/show_bug.cgi?id=164350
1867         rdar://problem/29053414
1868
1869         Reviewed by Dean Jackson.
1870
1871         After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
1872         with a non-1 opacity, but without the explicit z-index that triggers stacking context.
1873         This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
1874         save/restores.
1875
1876         This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate()
1877         can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()"
1878         gave the wrong answser.
1879
1880         Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
1881         when it actually produced a new style, and when true, do the setZIndex(0).
1882
1883         Test: animations/stacking-during-opacity-animation.html
1884
1885         * page/animation/AnimationBase.h:
1886         * page/animation/CSSPropertyAnimation.cpp:
1887         (WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
1888         * page/animation/CompositeAnimation.cpp:
1889         (WebCore::CompositeAnimation::animate):
1890         * page/animation/ImplicitAnimation.cpp:
1891         (WebCore::ImplicitAnimation::animate):
1892         * page/animation/ImplicitAnimation.h:
1893         * page/animation/KeyframeAnimation.cpp:
1894         (WebCore::KeyframeAnimation::animate):
1895         * page/animation/KeyframeAnimation.h:
1896         * platform/graphics/GraphicsContext.cpp:
1897         (WebCore::GraphicsContext::restore):
1898         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1899         (PlatformCALayer::drawLayerContents): No functional change, but created scope for the
1900         GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
1901         * rendering/RenderLayer.cpp:
1902         (WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
1903
1904 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
1905
1906         [iOS] [WebGL] Multisample resolve step may operate on stale data
1907         https://bugs.webkit.org/show_bug.cgi?id=164347
1908
1909         Reviewed by Dean Jackson.
1910
1911         When antialiasing is enabled, WebKit internally creates a multisampled FBO
1912         and uses that as the target of all the drawing commands. Then, just before
1913         we actually put the image on the glass, we perform a “resolve” step which
1914         averages all the samples to create the final image. However, it appears
1915         that this resolve step only waits for commands to complete which were
1916         already submitted to the hardware. OpenGL is allowed (indeed, expected) to
1917         batch up drawing commands in main memory so it can submit them to the
1918         hardware in fewer batches, but this means that the hardware may not know
1919         about all the commands that the application submitted. Because of this,
1920         the data the resolve step saw is the result of only some of the previous
1921         draw calls - not all of them.
1922
1923         This doesn’t occur on macOS because we have a different code path there
1924         for performing the resolve step. On iOS 9 and below, WebKit didn’t
1925         implement multisampling in WebGL at all, which explains why this only
1926         occurs on iOS 10. 
1927
1928         Luckily, the OpenGL command glFlush() is exactly designed to submit any
1929         pending commands to the hardware.
1930
1931         Test: fast/canvas/webgl/multisample-resolve-consistency.html
1932
1933         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1934         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
1935
1936 2016-11-02  Brady Eidson  <beidson@apple.com>
1937
1938         Give IDBKey(Data) a WTF::Variant overhaul.
1939         https://bugs.webkit.org/show_bug.cgi?id=164332
1940
1941         Reviewed by Alex Christensen and Andy Estes.
1942
1943         No new tests (Refactor, no behavior change).
1944
1945         * Modules/indexeddb/IDBKey.cpp:
1946         (WebCore::IDBKey::IDBKey):
1947         (WebCore::IDBKey::isValid):
1948         (WebCore::IDBKey::compare):
1949         * Modules/indexeddb/IDBKey.h:
1950         (WebCore::IDBKey::array):
1951         (WebCore::IDBKey::string):
1952         (WebCore::IDBKey::date):
1953         (WebCore::IDBKey::number):
1954         (WebCore::IDBKey::IDBKey): Deleted.
1955
1956         * Modules/indexeddb/IDBKeyData.cpp:
1957         (WebCore::IDBKeyData::IDBKeyData):
1958         (WebCore::IDBKeyData::maybeCreateIDBKey):
1959         (WebCore::IDBKeyData::isolatedCopy):
1960         (WebCore::IDBKeyData::encode):
1961         (WebCore::IDBKeyData::decode):
1962         (WebCore::IDBKeyData::compare):
1963         (WebCore::IDBKeyData::loggingString):
1964         (WebCore::IDBKeyData::setArrayValue):
1965         (WebCore::IDBKeyData::setStringValue):
1966         (WebCore::IDBKeyData::setDateValue):
1967         (WebCore::IDBKeyData::setNumberValue):
1968         (WebCore::IDBKeyData::operator==):
1969         * Modules/indexeddb/IDBKeyData.h:
1970         (WebCore::IDBKeyData::hash):
1971         (WebCore::IDBKeyData::string):
1972         (WebCore::IDBKeyData::date):
1973         (WebCore::IDBKeyData::number):
1974         (WebCore::IDBKeyData::array):
1975         (WebCore::IDBKeyData::encode):
1976         (WebCore::IDBKeyData::decode):
1977
1978 2016-11-01  Sam Weinig  <sam@webkit.org>
1979
1980         [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
1981         https://bugs.webkit.org/show_bug.cgi?id=164256
1982
1983         Reviewed by Alex Christensen.
1984
1985         - Add the ability to pass an "exception thrower" functor to the convert functions.
1986           This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
1987           for now, but can be extended for more types as necessary to improve exception messages.
1988         - Add support for using toJSNewlyCreated in JSDOMConvert.
1989
1990         * bindings/generic/IDLTypes.h:
1991         (WebCore::IDLString::extractValueFromNullable):
1992         Use forwarding to simplify extraction function.
1993
1994         (WebCore::IDLInterface::nullValue):
1995         Update nullValue to work for both RefPtr<T> and T*.
1996
1997         (WebCore::IDLInterface::extractValueFromNullable):
1998         Use forwarding to simplify extraction function.
1999
2000         * bindings/js/JSDOMConvert.h:
2001         (WebCore::DefaultExceptionThrower::operator()):
2002         Add a default "exception thrower" which throws a normal type error.
2003
2004         (WebCore::convert):
2005         Add an overload of convert which takes an "exception thrower".
2006
2007         (WebCore::toJSNewlyCreated):
2008         Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
2009         which will return "newly created" values. This only works for types that implement
2010         a toJSNewlyCreated function for themselves.
2011
2012         (WebCore::Converter<IDLNullable<T>>::convert):
2013         Fix the return type of Converter<IDLNullable<T>> to be specialized when
2014         T is an IDLInterface. In that case, we want to match the return type of
2015         inner converter.
2016         
2017         Also add implementation of convert overload that takes an "exception thrower".
2018
2019         (WebCore::JSConverter<IDLNullable<T>>::convert):
2020         (WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
2021         Reimplement conversion to use forwarding of the value.
2022
2023         (WebCore::Converter<IDLInterface<T>>::convert):
2024         Add support for an "exception thrower".
2025
2026         (WebCore::Detail::getPtrOrRef):
2027         Add helper functions that extract either a pointer or reference, depending on the type,
2028         and const_casts it allowing the value to be used with toJS functions.
2029
2030         (WebCore::JSConverter<IDLInterface<T>>::convert):
2031         Re-implement to support more varied input values.
2032
2033         (WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
2034         Added. Forwards to overloaded toJSNewlyCreated functions.
2035
2036         * bindings/scripts/CodeGeneratorJS.pm:
2037         (AddToImplIncludesForIDLType):
2038         Add support for adding the right includes for SerializedScriptValue and Dictionary.
2039
2040         (GetArgumentExceptionThrower):
2041         (GetAttributeExceptionThrower):
2042         Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
2043         being passed to setters and functions.
2044
2045         (GenerateParametersCheck):
2046         Move around special cases so it is clear that it's not wrappers and typed arrays that
2047         need specialization here, it is now just EventListener and XPathNSResolver.
2048
2049         (GetIDLInterfaceName):
2050         Add helper to get the InterfaceName for use in IDLInterface template.
2051
2052         (GetBaseIDLType):
2053         Use new GetIDLInterfaceName helper.
2054
2055         (IsValidContextForJSValueToNative):
2056         Remove IDLOperation as a valid context. It is not.
2057
2058         (JSValueToNative):
2059         Move JSDOMConvert based conversion to the bottom, to show that everything above it
2060         is a special case that should be fixed. I have used explicit c-style if-statements
2061         to make it clear what the types of the exceptional cases are.
2062
2063         (NativeToJSValueDOMConvertNeedsState):
2064         (NativeToJSValueDOMConvertNeedsGlobalObject):
2065         Add wrapper types and typed arrays to the list needing state and globalObject.
2066
2067         (NativeToJSValue):
2068         Move JSDOMConvert based conversion to the bottom, to show that everything above it
2069         is a special case that should be fixed. I have used explicit c-style if-statements
2070         to make it clear what the types of the exceptional cases are.
2071
2072         (JSValueToNativeIsHandledByDOMConvert): Deleted.
2073         (NativeToJSValueIsHandledByDOMConvert): Deleted.
2074         Remove predicates protecting use of JSDOMConvert now that it is the default.
2075
2076         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2077         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2078         * bindings/scripts/test/JS/JSTestCallback.cpp:
2079         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2080         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2081         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2082         * bindings/scripts/test/JS/JSTestInterface.cpp:
2083         * bindings/scripts/test/JS/JSTestObj.cpp:
2084         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2085         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2086         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2087         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2088         Update test results.
2089
2090 2016-11-02  David Kilzer  <ddkilzer@apple.com>
2091
2092         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
2093         <https://webkit.org/b/164333>
2094         <rdar://problem/29072727>
2095
2096         Reviewed by Alex Christensen.
2097
2098         * page/DiagnosticLoggingKeys.cpp:
2099         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
2100         - Add implementation for new key method.
2101         * page/DiagnosticLoggingKeys.h:
2102         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
2103         - Add declaration for new key method.
2104
2105 2016-11-02  Filip Pizlo  <fpizlo@apple.com>
2106
2107         The GC should be in a thread
2108         https://bugs.webkit.org/show_bug.cgi?id=163562
2109
2110         Reviewed by Geoffrey Garen and Andreas Kling.
2111
2112         No new tests because existing tests cover this.
2113         
2114         We now need to be more careful about using JSLock. This fixes some places that were not
2115         holding it. New assertions in the GC are more likely to catch this than before.
2116
2117         * bindings/js/WorkerScriptController.cpp:
2118         (WebCore::WorkerScriptController::WorkerScriptController):
2119
2120 2016-11-02  Joseph Pecoraro  <pecoraro@apple.com>
2121
2122         Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
2123         https://bugs.webkit.org/show_bug.cgi?id=164136
2124         <rdar://problem/29028462>
2125
2126         Reviewed by Brian Burg.
2127
2128         Tests: inspector/worker/debugger-pause.html
2129                inspector/worker/debugger-scripts.html
2130
2131         * CMakeLists.txt:
2132         * WebCore.xcodeproj/project.pbxproj:
2133         * inspector/InspectorAllInOne.cpp:
2134         New file.
2135
2136         * inspector/PageDebuggerAgent.h:
2137         * inspector/WorkerDebuggerAgent.cpp: Added.
2138         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
2139         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
2140         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
2141         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2142         * inspector/WorkerDebuggerAgent.h: Added.
2143         DebuggerAgent customizations for Workers.
2144
2145         * inspector/WorkerInspectorController.cpp:
2146         (WebCore::WorkerInspectorController::WorkerInspectorController):
2147         Add the new agent.
2148
2149         * inspector/WorkerScriptDebugServer.cpp:
2150         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
2151         Implement the nested run loop for Workers.
2152
2153 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
2154
2155         Add Battery Status to features.json, marked as "Removed".
2156
2157         * features.json:
2158
2159 2016-11-02  Ryosuke Niwa  <rniwa@webkit.org>
2160
2161         Load stylesheets in link elements inside a connected shadow tree
2162         https://bugs.webkit.org/show_bug.cgi?id=160683
2163         <rdar://problem/29040652>
2164
2165         Reviewed by Antti Koivisto.
2166
2167         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
2168         when it's connected to a document instead of always talking to document's style scope.
2169
2170         Also improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
2171         m_inDocumentShadowRoots when the connected-ness changes.
2172
2173         This patch also removes the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
2174         avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
2175         ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
2176         since the latter function tears down nodes via the deletion queue during a document destruction and use
2177         notifyChildNodeRemoved() on nodes that outlive the shadow root.
2178
2179         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
2180                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
2181
2182        * dom/Document.cpp:
2183        (WebCore::Document::didInsertInDocumentShadowRoot): Assert that the shadow root is not in the set.
2184        (WebCore::Document::didRemoveInDocumentShadowRoot): Assert that the shadow root is not in the document as
2185        this function is now called after Node::removedFrom in ShadowRoot::removedFrom.
2186        * dom/Element.cpp:
2187        (WebCore::Element::removeShadowRoot): See the description above.
2188        * dom/ShadowRoot.cpp:
2189        (WebCore::ShadowRoot::insertedInto): Only call didInsertInDocumentShadowRoot when the this shadow root is
2190        newly connected to a document so we can add assertions in didInsertInDocumentShadowRoot.
2191        (WebCore::ShadowRoot::removedFrom): Ditto for the removal.
2192        * html/HTMLLinkElement.cpp:
2193        (WebCore::HTMLLinkElement::HTMLLinkElement):
2194        (WebCore::HTMLLinkElement::~HTMLLinkElement):
2195        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
2196        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
2197        early when inDocument() is false.
2198        (WebCore::HTMLLinkElement::parseAttribute):
2199        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
2200        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
2201        a document instead of whenever its self-inclusive ancestor is inserted into a container.
2202        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
2203        calling removePendingSheet since the latter depends on m_styleScope being not null.
2204        (WebCore::HTMLLinkElement::addPendingSheet):
2205        (WebCore::HTMLLinkElement::removePendingSheet):
2206        * html/HTMLLinkElement.h:
2207        * html/HTMLStyleElement.cpp:
2208        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
2209        element has just become connected to a document.
2210        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
2211        * style/StyleScope.h:
2212        * svg/SVGStyleElement.cpp:
2213        (WebCore::SVGStyleElement::insertedInto): Ditto.
2214        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2215
2216 2016-11-02  Dave Hyatt  <hyatt@apple.com>
2217
2218         [CSS Parser] Clean up new parser's grid layout ifdefs/runtime checking
2219         https://bugs.webkit.org/show_bug.cgi?id=164341
2220
2221         Reviewed by Dean Jackson.
2222
2223         * css/parser/CSSPropertyParser.cpp:
2224         (WebCore::consumeGridTrackRepeatFunction):
2225         (WebCore::consumeGridTrackList):
2226         (WebCore::CSSPropertyParser::parseSingleValue):
2227
2228 2016-11-02  Alex Christensen  <achristensen@webkit.org>
2229
2230         Remove Battery Status API from the tree
2231         https://bugs.webkit.org/show_bug.cgi?id=164213
2232
2233         Reviewed by Sam Weinig.
2234
2235         * CMakeLists.txt:
2236         * DerivedSources.cpp:
2237         * Modules/battery: Removed.
2238         * Modules/battery/BatteryClient.h: Removed.
2239         * Modules/battery/BatteryController.cpp: Removed.
2240         * Modules/battery/BatteryController.h: Removed.
2241         * Modules/battery/BatteryManager.cpp: Removed.
2242         * Modules/battery/BatteryManager.h: Removed.
2243         * Modules/battery/BatteryManager.idl: Removed.
2244         * Modules/battery/BatteryStatus.cpp: Removed.
2245         * Modules/battery/BatteryStatus.h: Removed.
2246         * Modules/battery/NavigatorBattery.cpp: Removed.
2247         * Modules/battery/NavigatorBattery.h: Removed.
2248         * Modules/battery/NavigatorBattery.idl: Removed.
2249         * PlatformEfl.cmake:
2250         * dom/EventTargetFactory.in:
2251         * platform/efl/BatteryProviderEfl.cpp: Removed.
2252         * platform/efl/BatteryProviderEfl.h: Removed.
2253         * platform/efl/BatteryProviderEflClient.h: Removed.
2254         * platform/glib/BatteryProviderUPower.cpp: Removed.
2255         * platform/glib/BatteryProviderUPower.h: Removed.
2256         * platform/glib/BatteryProviderUPowerClient.h: Removed.
2257         * testing/Internals.cpp:
2258         (WebCore::Internals::setBatteryStatus): Deleted.
2259         * testing/Internals.h:
2260         * testing/Internals.idl:
2261
2262 2016-11-02  Keith Rollin  <krollin@apple.com>
2263
2264         NetworkSession: Add NetworkDataTask implementation for blobs
2265         https://bugs.webkit.org/show_bug.cgi?id=163939
2266
2267         Reviewed by Alex Christensen.
2268
2269         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
2270         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
2271         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
2272         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
2273         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2274
2275 2016-11-02  Olivier Blin  <olivier.blin@softathome.com>
2276
2277         [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation
2278         https://bugs.webkit.org/show_bug.cgi?id=163125
2279
2280         Reviewed by Michael Catanzaro.
2281
2282         No new tests, already covered by existing SubtleCrypto tests.
2283
2284         * PlatformGTK.cmake: Use libgcrypt instead of gnutls.
2285         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: Added. Adapted from the GnuTLS backend.
2286         (WebCore::getGCryptDigestAlgorithm):
2287         (WebCore::calculateSignature):
2288         (WebCore::CryptoAlgorithmHMAC::platformSign):
2289         (WebCore::CryptoAlgorithmHMAC::platformVerify):
2290         * platform/crypto/gcrypt/CryptoDigestGCrypt.cpp: Added. Adapted from the GnuTLS backend.
2291         (WebCore::CryptoDigest::CryptoDigest):
2292         (WebCore::CryptoDigest::~CryptoDigest):
2293         (WebCore::CryptoDigest::create):
2294         (WebCore::CryptoDigest::addBytes):
2295         (WebCore::CryptoDigest::computeHash):
2296
2297 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
2298
2299         REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
2300         https://bugs.webkit.org/show_bug.cgi?id=162933
2301         <rdar://problem/28570590>
2302
2303         Reviewed by Dean Jackson.
2304
2305         A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.
2306
2307         We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
2308         helper function (isStretchy) to encapsulate the fact that only non-empty elements with
2309         the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.
2310
2311         Test: mathml/empty-mo.html
2312
2313         * rendering/mathml/RenderMathMLOperator.cpp:
2314         (WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
2315         * rendering/mathml/RenderMathMLOperator.h:
2316         (WebCore::RenderMathMLOperator::isStretchy): Added.
2317         * rendering/mathml/RenderMathMLRow.cpp:
2318         (WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
2319         (WebCore::RenderMathMLRow::layoutRowItems): Ditto.
2320         * rendering/mathml/RenderMathMLUnderOver.cpp:
2321         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
2322         (WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.
2323
2324 2016-11-01  Dean Jackson  <dino@apple.com>
2325
2326         Filter functions grayscale/invert/opacity/sepia should clamp values over 100%, not fail
2327         https://bugs.webkit.org/show_bug.cgi?id=164310
2328
2329         Reviewed by Sam Weinig.
2330
2331         When bringing up the new CSS parser, I discovered that our old parser was
2332         not conforming to the specification.
2333
2334         Covered by existing tests.
2335
2336         * css/parser/CSSParser.cpp:
2337         (WebCore::CSSParser::parseBuiltinFilterArguments): For these functions, clamp to
2338         100% rather than fail.
2339
2340 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
2341
2342         WebKit nullptr dereference Archive Subframe
2343         https://bugs.webkit.org/show_bug.cgi?id=164281
2344         <rdar://problem/28943006>
2345
2346         Reviewed by Andy Estes.
2347
2348         If the page is torn down during a load, we can attempt to use a deallocated
2349         (and nulled) document loader. Most places that use the "active document loader"
2350         null-check it before using, but there was one place that did not. This patch
2351         fixes that oversight.
2352
2353         Test: fast/dom/crash-with-bad-url.html
2354
2355         * loader/FrameLoader.cpp:
2356         (WebCore::FrameLoader::loadURLIntoChildFrame): Check that the active document
2357         loader is non-null before using.
2358
2359 2016-11-02  Dave Hyatt  <hyatt@apple.com>
2360
2361         [CSS Parser] Support scroll-snap-* properties
2362         https://bugs.webkit.org/show_bug.cgi?id=164321
2363
2364         Reviewed by Simon Fraser.
2365
2366         * css/CSSPrimitiveValue.h:
2367         * css/StyleBuilderConverter.h:
2368         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
2369         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
2370         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
2371         * css/parser/CSSPropertyParser.cpp:
2372         (WebCore::consumePositionLonghand):
2373         (WebCore::consumePositionX):
2374         (WebCore::consumePositionY):
2375         (WebCore::consumePositionList):
2376         (WebCore::consumeScrollSnapDestination):
2377         (WebCore::consumeScrollSnapPoints):
2378         (WebCore::CSSPropertyParser::parseSingleValue):
2379
2380 2016-11-02  David Kilzer  <ddkilzer@apple.com>
2381
2382         Add logging for "WebKit encountered an internal error" messages
2383         <https://webkit.org/b/164272>
2384         <rdar://problem/28546064>
2385
2386         Reviewed by Alex Christensen.
2387
2388         * page/DiagnosticLoggingKeys.cpp:
2389         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
2390         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
2391         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
2392         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
2393         - Add implementations for new key methods.
2394
2395         * page/DiagnosticLoggingKeys.h:
2396         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
2397         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
2398         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
2399         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
2400         - Add declarations for new key methods.
2401
2402 2016-11-02  Zalan Bujtas  <zalan@apple.com>
2403
2404         [Tables] Simplified layout skips captions.
2405         https://bugs.webkit.org/show_bug.cgi?id=164284
2406
2407         Reviewed by David Hyatt.
2408
2409         This patch ensures that we take care of simplified normalflow captions during layout.    
2410
2411         Covered by fast/regions/table-caption-as-region.html
2412
2413         * rendering/RenderTable.cpp:
2414         (WebCore::RenderTable::layoutCaption):
2415         (WebCore::RenderTable::layoutCaptions): _caption_side is 2bits, can't use bitmask. 
2416         (WebCore::RenderTable::simplifiedNormalFlowLayout):
2417         (WebCore::RenderTable::layout):
2418         * rendering/RenderTable.h:
2419
2420 2016-11-02  Youenn Fablet  <youenn@apple.com>
2421
2422         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
2423         https://bugs.webkit.org/show_bug.cgi?id=163905
2424
2425         Reviewed by Antti Koivisto.
2426
2427         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
2428
2429         Small refactoring to do more member fields initialization in StyleSheetContents header.
2430         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
2431         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
2432
2433         * css/StyleSheetContents.cpp:
2434         (WebCore::StyleSheetContents::StyleSheetContents):
2435         (WebCore::StyleSheetContents::addedToMemoryCache):
2436         (WebCore::StyleSheetContents::removedFromMemoryCache):
2437         * css/StyleSheetContents.h:
2438         * loader/cache/CachedCSSStyleSheet.cpp:
2439         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
2440
2441 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2442
2443         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
2444         https://bugs.webkit.org/show_bug.cgi?id=164315
2445
2446         Reviewed by Michael Catanzaro.
2447
2448         * platform/FileSystem.h:
2449         * platform/glib/FileSystemGlib.cpp:
2450         (WebCore::stringFromFileSystemRepresentation):
2451         (WebCore::homeDirectoryPath):
2452         (WebCore::listDirectory):
2453         (WebCore::filenameToString): Deleted.
2454
2455 2016-11-02  Manuel Rego Casasnovas  <rego@igalia.com>
2456
2457         [css-grid] mimax(auto, <flex>) should be serialized as <flex>
2458         https://bugs.webkit.org/show_bug.cgi?id=164316
2459
2460         Reviewed by Sergio Villar Senin.
2461
2462         * css/CSSComputedStyleDeclaration.cpp:
2463         (WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
2464         properly this case.
2465         * rendering/style/GridLength.h:
2466         (WebCore::GridLength::isAuto): Add new function to check if GridLength
2467         is or not "auto".
2468
2469 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2470
2471         [Readable Streams API] Enable creation of ReadableByteStreamController
2472         https://bugs.webkit.org/show_bug.cgi?id=164014
2473
2474         Reviewed by Youenn Fablet.
2475
2476         Added support for creating ReadableByteStreamController. IDL is mostly
2477         implemented but methods return TypeError. Tests have been added to ensure
2478         behaviour. This part of Readable Streams API is associated to
2479         a flag (READABLE_BYTE_STREAM_API).
2480
2481         Test: streams/readable-byte-stream-controller.html
2482
2483         * CMakeLists.txt:
2484         * Configurations/FeatureDefines.xcconfig:
2485         * DerivedSources.cpp:
2486         * DerivedSources.make:
2487         * Modules/streams/ReadableByteStreamController.idl: Added.
2488         * Modules/streams/ReadableByteStreamController.js: Added.
2489         (enqueue): Empty method for the moment, throws TypeError.
2490         (error): Empty method for the moment, throws TypeError.
2491         (close): Empty method for the moment, throws TypeError.
2492         (byobRequest): Empty method for the moment, throws TypeError.
2493         (desiredSize): Empty method for the moment, throws TypeError.
2494         * Modules/streams/ReadableByteStreamInternals.js: Added.
2495         (privateInitializeReadableByteStreamController):
2496         * Modules/streams/ReadableStream.js:
2497         (initializeReadableStream):
2498         * WebCore.xcodeproj/project.pbxproj:
2499         * bindings/js/JSDOMGlobalObject.cpp:
2500         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2501         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2502         (WebCore::constructJSReadableByteStreamController):
2503         (WebCore::constructJSReadableStreamDefaultReader):
2504         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
2505         (WebCore::createReadableByteStreamControllerPrivateConstructor):
2506         * bindings/js/JSReadableStreamPrivateConstructors.h:
2507         * bindings/js/WebCoreBuiltinNames.h:
2508
2509 2016-11-02  Antoine Quint  <graouts@apple.com>
2510
2511         [Modern Media Controls] Media Controller: fullscreen toggle support
2512         https://bugs.webkit.org/show_bug.cgi?id=163728
2513         <rdar://problem/27989486>
2514
2515         Reviewed by Darin Adler.
2516
2517         We introduce the FullscreenSupport class which brings support for entering and
2518         exiting fullscreen by clicking on the fullscreen button in the media controls
2519         and correctly reflecting the media's fullscreen state should it be changed
2520         via the media API.
2521
2522         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
2523                media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
2524
2525         * Modules/modern-media-controls/js-files:
2526         * Modules/modern-media-controls/media/fullscreen-support.js: Added.
2527         (FullscreenSupport):
2528         (FullscreenSupport.prototype.get control):
2529         (FullscreenSupport.prototype.get mediaEvents):
2530         (FullscreenSupport.prototype.buttonWasClicked):
2531         (FullscreenSupport.prototype.syncControl):
2532         * Modules/modern-media-controls/media/media-controller.js:
2533         (MediaController):
2534         * WebCore.xcodeproj/project.pbxproj:
2535
2536 2016-11-02  Antoine Quint  <graouts@apple.com>
2537
2538         [Modern Media Controls] Media Controller: PiP support
2539         https://bugs.webkit.org/show_bug.cgi?id=163730
2540         <rdar://problem/27989485>
2541
2542         Reviewed by Dean Jackson.
2543
2544         We introduce the PiPSupport class which brings support for entering picture-in-picture
2545         by clicking on the PiP button in the media controls and enabling the button only when
2546         picture-in-picture mode is available.
2547
2548         Tests: media/modern-media-controls/pip-support/pip-support-click.html
2549                media/modern-media-controls/pip-support/pip-support-enabled.html
2550
2551         * Modules/modern-media-controls/js-files:
2552         * Modules/modern-media-controls/media/media-controller.js:
2553         (MediaController):
2554         * Modules/modern-media-controls/media/pip-support.js: Added.
2555         (PiPSupport.prototype.get control):
2556         (PiPSupport.prototype.get mediaEvents):
2557         (PiPSupport.prototype.buttonWasClicked):
2558         (PiPSupport.prototype.syncControl):
2559         (PiPSupport):
2560         * WebCore.xcodeproj/project.pbxproj:
2561
2562 2016-11-01  Dave Hyatt  <hyatt@apple.com>
2563
2564         [CSS Parser] Support the shadow DOM
2565         https://bugs.webkit.org/show_bug.cgi?id=164240
2566
2567         Reviewed by Dean Jackson.
2568
2569         * css/CSSSelector.cpp:
2570         (WebCore::CSSSelector::selectorText):
2571         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
2572         ShadowDescendant combinator.
2573
2574         * css/CSSSelector.h:
2575         * css/SelectorChecker.cpp:
2576         (WebCore::SelectorChecker::matchRecursively):
2577         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
2578         ShadowDescendant combinator.
2579
2580         * css/SelectorFilter.cpp:
2581         (WebCore::SelectorFilter::collectIdentifierHashes):
2582         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
2583         ShadowDescendant combinator.
2584
2585         * css/SelectorPseudoElementTypeMap.in:
2586         Add support for slotted.
2587
2588         * css/parser/CSSParserValues.cpp:
2589         (WebCore::CSSParserSelector::appendTagHistory):
2590         * css/parser/CSSParserValues.h:
2591         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2592         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
2593         ShadowDescendant combinator. Take :slotted out of
2594         needsImplicitShadowCombinatorForMatching(), since our code doesn't do
2595         this for :slotted.
2596
2597         * css/parser/CSSSelectorParser.cpp:
2598         (WebCore::isPseudoClassFunction):
2599         :host can be both an id and a function, so don't restrict it.
2600
2601         (WebCore::CSSSelectorParser::consumePseudo):
2602         Put in a hack for :host (inside the hack we already plan on removing
2603         once we turn on).
2604
2605         (WebCore::CSSSelectorParser::consumeCombinator):
2606         Remove deep shadow combinator support, as we don't support matching
2607         on it.
2608
2609         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
2610         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
2611         Make the split use our combinator, ShadowDescendant, and no longer do anything
2612         special with :slotted.
2613
2614         * cssjit/SelectorCompiler.cpp:
2615         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2616         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
2617         ShadowDescendant combinator.
2618
2619 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2620
2621         Turn the Input Events runtime flag on by default
2622         https://bugs.webkit.org/show_bug.cgi?id=164297
2623
2624         Reviewed by Ryosuke Niwa.
2625
2626         Set the initial value of inputEventsEnabled in Settings to true.
2627
2628         * page/Settings.in:
2629
2630 2016-11-01  Brady Eidson  <beidson@apple.com>
2631
2632         IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.
2633         <rdar://problem/28806933> and https://bugs.webkit.org/show_bug.cgi?id=164294
2634
2635         Reviewed by Alex Christensen.
2636
2637         Tests: storage/indexeddb/modern/idbindex-getall-1-private.html
2638                storage/indexeddb/modern/idbindex-getall-1.html
2639                storage/indexeddb/modern/idbindex-getallkeys-1-private.html
2640                storage/indexeddb/modern/idbindex-getallkeys-1.html
2641                Existing imported W3C tests.
2642
2643         * Modules/indexeddb/IDBIndex.cpp:
2644         (WebCore::IDBIndex::getAll):
2645         (WebCore::IDBIndex::getAllKeys):
2646         * Modules/indexeddb/IDBIndex.h:
2647         * Modules/indexeddb/IDBIndex.idl:
2648
2649         * Modules/indexeddb/IDBRequest.cpp:
2650         (WebCore::IDBRequest::create):
2651         (WebCore::IDBRequest::createIndexGet):
2652         (WebCore::IDBRequest::createCount): Deleted.
2653         (WebCore::IDBRequest::createGet): Deleted.
2654         * Modules/indexeddb/IDBRequest.h:
2655
2656         * Modules/indexeddb/IDBTransaction.cpp:
2657         (WebCore::IDBTransaction::requestGetAllIndexRecords):
2658         (WebCore::IDBTransaction::requestIndexRecord):
2659         (WebCore::IDBTransaction::requestCount):
2660         * Modules/indexeddb/IDBTransaction.h:
2661
2662         * Modules/indexeddb/server/IndexValueStore.cpp:
2663         (WebCore::IDBServer::IndexValueStore::allValuesForKey):
2664         * Modules/indexeddb/server/IndexValueStore.h:
2665
2666         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2667         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
2668
2669         * Modules/indexeddb/server/MemoryIndex.cpp:
2670         (WebCore::IDBServer::MemoryIndex::getAllRecords):
2671         * Modules/indexeddb/server/MemoryIndex.h:
2672
2673         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2674         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
2675         (WebCore::IDBServer::queryForGetAllObjectStoreRecords):
2676         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2677         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2678         (WebCore::IDBServer::queryForGetAllRecords): Deleted.
2679         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2680
2681 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
2682
2683         Remove CUSTOM_ELEMENTS build flag
2684         https://bugs.webkit.org/show_bug.cgi?id=164267
2685
2686         Reviewed by Antti Koivisto.
2687
2688         Removed the build flag. Also rebaselined the bindings tests.
2689
2690         * Configurations/FeatureDefines.xcconfig:
2691         * DerivedSources.cpp:
2692         * bindings/generic/RuntimeEnabledFeatures.h:
2693         (WebCore::RuntimeEnabledFeatures::customElementsEnabled):
2694         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2695         (WebCore::JSCSSStyleDeclaration::putDelegate):
2696         * bindings/js/JSCustomElementInterface.cpp:
2697         * bindings/js/JSCustomElementInterface.h:
2698         * bindings/js/JSCustomElementRegistryCustom.cpp:
2699         * bindings/js/JSDOMStringMapCustom.cpp:
2700         (WebCore::JSDOMStringMap::deleteProperty):
2701         (WebCore::JSDOMStringMap::putDelegate):
2702         * bindings/js/JSElementCustom.cpp:
2703         (WebCore::toJSNewlyCreated):
2704         * bindings/js/JSHTMLElementCustom.cpp:
2705         (WebCore::constructJSHTMLElement):
2706         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2707         (WebCore::JSHTMLOptionsCollection::setLength):
2708         (WebCore::JSHTMLOptionsCollection::indexSetter):
2709         * bindings/js/JSHTMLSelectElementCustom.cpp:
2710         (WebCore::JSHTMLSelectElement::indexSetter):
2711         * bindings/js/JSMainThreadExecState.h:
2712         * bindings/scripts/CodeGeneratorJS.pm:
2713         (GenerateImplementation):
2714         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2715         (WebCore::setJSTestCEReactionsAttributeWithCEReactionsFunction):
2716         (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsFunction):
2717         (WebCore::setJSTestCEReactionsStringifierAttributeFunction):
2718         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
2719         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2720         (WebCore::setJSTestCEReactionsStringifierValueFunction):
2721         * css/CSSSelector.cpp:
2722         (WebCore::CSSSelector::selectorText):
2723         * css/CSSSelector.h:
2724         * css/PropertySetCSSStyleDeclaration.cpp:
2725         * css/SelectorChecker.cpp:
2726         (WebCore::SelectorChecker::checkOne):
2727         * css/SelectorCheckerTestFunctions.h:
2728         (WebCore::isDefinedElement):
2729         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2730         * cssjit/SelectorCompiler.cpp:
2731         (WebCore::SelectorCompiler::addPseudoClassType):
2732         * dom/CustomElementReactionQueue.cpp:
2733         * dom/CustomElementReactionQueue.h:
2734         * dom/CustomElementRegistry.cpp:
2735         * dom/CustomElementRegistry.h:
2736         * dom/CustomElementRegistry.idl:
2737         * dom/Document.cpp:
2738         (WebCore::createHTMLElementWithNameValidation):
2739         (WebCore::createFallbackHTMLElement):
2740         * dom/Element.cpp:
2741         (WebCore::Element::attributeChanged):
2742         (WebCore::Element::didMoveToNewDocument):
2743         (WebCore::Element::insertedInto):
2744         (WebCore::Element::removedFrom):
2745         * dom/Element.h:
2746         * dom/ElementRareData.cpp:
2747         * dom/ElementRareData.h:
2748         (WebCore::ElementRareData::setCustomElementReactionQueue):
2749         * dom/Node.h:
2750         (WebCore::Node::isFailedCustomElement):
2751         * dom/make_names.pl:
2752         (printWrapperFactoryCppFile):
2753         * html/HTMLElement.idl:
2754         * html/parser/HTMLConstructionSite.cpp:
2755         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2756         * html/parser/HTMLConstructionSite.h:
2757         * html/parser/HTMLDocumentParser.cpp:
2758         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
2759         * html/parser/HTMLTreeBuilder.cpp:
2760         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
2761         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
2762         * html/parser/HTMLTreeBuilder.h:
2763         (WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork):
2764         * page/DOMWindow.cpp:
2765         * page/DOMWindow.h:
2766         * page/DOMWindow.idl:
2767
2768 2016-11-01  Antoine Quint  <graouts@apple.com>
2769
2770         [Modern Media Controls] Media Controller: Airplay support
2771         https://bugs.webkit.org/show_bug.cgi?id=163729
2772         <rdar://problem/27989484>
2773
2774         Reviewed by Dean Jackson.
2775
2776         We introduce the AirplaySupport class which brings support for playing the media
2777         via Airplay by clicking on the Airplay button in the media controls and correctly
2778         reflecting when the media is played through Airplay via the media API. The enabled
2779         state of the Airplay button is also tied to Airplay sources being available.
2780
2781         Test: media/modern-media-controls/airplay-support/airplay-support.html
2782
2783         * Modules/modern-media-controls/controls/airplay-button.js:
2784         (AirplayButton.prototype.get on):
2785         * Modules/modern-media-controls/js-files:
2786         * Modules/modern-media-controls/media/airplay-support.js: Added.
2787         (AirplaySupport.prototype.get control):
2788         (AirplaySupport.prototype.get mediaEvents):
2789         (AirplaySupport.prototype.buttonWasClicked):
2790         (AirplaySupport.prototype.handleEvent):
2791         (AirplaySupport.prototype.syncControl):
2792         (AirplaySupport):
2793         * Modules/modern-media-controls/media/media-controller.js:
2794         (MediaController):
2795         * WebCore.xcodeproj/project.pbxproj:
2796
2797 2016-11-01  Dean Jackson  <dino@apple.com>
2798
2799         Remove WebKitCSSFilterValue to make Hyatt happy
2800         https://bugs.webkit.org/show_bug.cgi?id=164289
2801         <rdar://problems/29050973>
2802
2803         Reviewed by Simon Fraser.
2804
2805         The new CSS parser should not use WebKitCSSFilterValue. It's non-standard,
2806         very likely only used in our tests, doesn't provide much benefit, and will be
2807         covered by the new CSSOM function interface.
2808
2809         Covered by modifying existing tests.
2810
2811         * DerivedSources.make: Remove WebKitCSSFilterValue.idl.
2812
2813         * WebCore.xcodeproj/project.pbxproj: Make CSSFunctionValue.h private so API testing
2814         can see it.
2815
2816         * bindings/js/JSCSSValueCustom.cpp:
2817         (WebCore::toJSNewlyCreated): No WebKitCSSFilterValue.
2818
2819         * css/CSSComputedStyleDeclaration.cpp: Use CSSFunctionValue or CSSPrimitiveValue to
2820         build up the computed style.
2821         (WebCore::ComputedStyleExtractor::valueForFilter):
2822
2823         * css/CSSValue.cpp: No WebKitCSSFilterValue.
2824         (WebCore::CSSValue::equals):
2825         (WebCore::CSSValue::cssText):
2826         (WebCore::CSSValue::destroy):
2827         (WebCore::CSSValue::cloneForCSSOM):
2828         * css/CSSValue.h:
2829         (WebCore::CSSValue::isFilterImageValue):
2830         (WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
2831
2832         * css/StyleResolver.cpp: Resolve against CSSFunctionValues with
2833         CSSValueIDs as name, rather than WebKitCSSFilterValue.
2834         (WebCore::filterOperationForType):
2835         (WebCore::StyleResolver::createFilterOperations):
2836         * css/StyleResolver.h:
2837
2838         * css/WebKitCSSFilterValue.cpp: Removed.
2839         * css/WebKitCSSFilterValue.h: Removed.
2840         * css/WebKitCSSFilterValue.idl: Removed.
2841
2842         * css/parser/CSSParser.cpp: Parse into CSSPrimitiveValue and CSSFunctionValue.
2843         (WebCore::isValidPrimitiveFilterFunction):
2844         (WebCore::CSSParser::parseBuiltinFilterArguments):
2845         (WebCore::cssValueKeywordIDForFunctionName):
2846         (WebCore::CSSParser::parseFilter):
2847         (WebCore::filterInfoForName): Deleted.
2848         * css/parser/CSSParser.h:
2849         * css/parser/CSSPropertyParser.cpp:
2850         (WebCore::consumeFilterFunction):
2851
2852 2016-11-01  Simon Fraser  <simon.fraser@apple.com>
2853
2854         Add ViewportAPI to features.json
2855
2856         * features.json:
2857
2858 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
2859
2860         Unreviewed build fix for r208240.
2861
2862         * inspector/InspectorInstrumentation.h:
2863         Don't export an inlined function.
2864
2865 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
2866
2867         [MediaStream] restrict media capture secure connections
2868         https://bugs.webkit.org/show_bug.cgi?id=164234
2869         <rdar://problem/28944906>
2870
2871         Reviewed by Alex Christensen.
2872
2873         Tests: http/tests/ssl/media-stream/get-user-media-different-host.html
2874                http/tests/ssl/media-stream/get-user-media-nested.html
2875                http/tests/ssl/media-stream/get-user-media-secure-connection.html
2876
2877         * Modules/mediastream/UserMediaRequest.cpp:
2878         (WebCore::isSecure): New.
2879         (WebCore::canCallGetUserMedia): New.
2880         (WebCore::UserMediaRequest::start): When the setting says the require secure a secure connection, 
2881           fail immediately if the page or one of its ancestors is not secure.
2882
2883         * page/Settings.cpp:
2884         (WebCore::Settings::mediaCaptureRequiresSecureConnection): New.
2885         (WebCore::Settings::setMediaCaptureRequiresSecureConnection): New.
2886         * page/Settings.h:
2887
2888         * testing/InternalSettings.cpp:
2889         (WebCore::InternalSettings::InternalSettings): Do not require a secure connection for media 
2890           capture during tests.
2891         (WebCore::InternalSettings::resetToConsistentState):
2892         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
2893         * testing/InternalSettings.h:
2894         * testing/InternalSettings.idl:
2895         * testing/Internals.cpp:
2896         (WebCore::Internals::Internals):
2897
2898 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2899
2900         Port Page timer throttling to use ActivityState instead of PageThrottler
2901         https://bugs.webkit.org/show_bug.cgi?id=164291
2902
2903         Reviewed by Geoff Garen & Antti Koivisto.
2904
2905         ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.
2906
2907         * page/Page.cpp:
2908         (WebCore::Page::updateTimerThrottlingState):
2909             - determine page throttling mode based on IsAudible/IsLoading in ActivityState.
2910         (WebCore::Page::setActivityState):
2911             - call updateTimerThrottlingState if IsAudible/IsLoading change.
2912         * page/Page.h:
2913         (WebCore::Page::pageActivityStateChanged):
2914             - no need to listen for PageActivityState changes from the PageThrottler.
2915
2916 2016-11-01  Antoine Quint  <graouts@apple.com>
2917
2918         [Modern Media Controls] Media Controller: Placard support
2919         https://bugs.webkit.org/show_bug.cgi?id=163731
2920         <rdar://problem/28869598>
2921
2922         Reviewed by Dean Jackson.
2923
2924         We introduce the PlacardSupport class which brings support for showing the
2925         appropriate placard when the media is played via AirPlay or in picture-in-picture.
2926
2927         Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
2928                media/modern-media-controls/placard-support/placard-support-pip.html
2929
2930         * Modules/modern-media-controls/js-files:
2931         * Modules/modern-media-controls/media/media-controller.js:
2932         (MediaController):
2933         * Modules/modern-media-controls/media/placard-support.js: Added.
2934         (PlacardSupport):
2935         (PlacardSupport.prototype.get mediaEvents):
2936         (PlacardSupport.prototype.handleEvent):
2937         (PlacardSupport.prototype._updatePlacard):
2938         * WebCore.xcodeproj/project.pbxproj:
2939
2940 2016-11-01  Zalan Bujtas  <zalan@apple.com>
2941
2942         ShowRenderTree: Add information about the type of the needsLayout bit.
2943         https://bugs.webkit.org/show_bug.cgi?id=164287
2944
2945         Reviewed by Simon Fraser.
2946
2947         Currently showRenderTree only tells you whether a renderer's "needs layout bit" is set or not.
2948         With certain type of layout bugs, it's essential to know the kind of layout a particular
2949         renderer needs.
2950         This patch extends the renderer output by listing all the layout bits set.
2951
2952         B------- -+ BODY RenderBody  (0.00, 0.00) (0.00, 0.00) renderer->(0x) node->(0x) layout->[self][normal child]
2953
2954         Not testable.
2955
2956         * rendering/RenderObject.cpp:
2957         (WebCore::RenderObject::showRenderObject):
2958
2959 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
2960
2961         Web Inspector: Use more references in inspector code
2962         https://bugs.webkit.org/show_bug.cgi?id=164283
2963
2964         Reviewed by Timothy Hatcher.
2965
2966         (WebCore::frameForScriptExecutionContext):
2967         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2968         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
2969         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2970         (WebCore::InspectorInstrumentation::didLayoutImpl):
2971         (WebCore::InspectorInstrumentation::willPaintImpl):
2972         (WebCore::InspectorInstrumentation::didPaintImpl):
2973         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2974         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2975         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
2976         (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
2977         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
2978         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
2979         * inspector/InspectorInstrumentation.h:
2980         (WebCore::InspectorInstrumentation::frameWindowDiscarded):
2981         (WebCore::InspectorInstrumentation::didInstallTimer):
2982         (WebCore::InspectorInstrumentation::didRemoveTimer):
2983         (WebCore::InspectorInstrumentation::willFireTimer):
2984         (WebCore::InspectorInstrumentation::didLayout):
2985         (WebCore::InspectorInstrumentation::willComposite):
2986         (WebCore::InspectorInstrumentation::didComposite):
2987         (WebCore::InspectorInstrumentation::willPaint):
2988         (WebCore::InspectorInstrumentation::didPaint):
2989         (WebCore::InspectorInstrumentation::continueAfterPingLoader):
2990         (WebCore::InspectorInstrumentation::scriptImported):
2991         (WebCore::InspectorInstrumentation::didCommitLoad):
2992         (WebCore::InspectorInstrumentation::frameDocumentUpdated):
2993         (WebCore::InspectorInstrumentation::frameStartedLoading):
2994         (WebCore::InspectorInstrumentation::frameStoppedLoading):
2995         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
2996         (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
2997         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
2998         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
2999         (WebCore::InspectorInstrumentation::workerStarted):
3000         (WebCore::InspectorInstrumentation::workerTerminated):
3001         (WebCore::InspectorInstrumentation::didHandleMemoryPressure):
3002         (WebCore::InspectorInstrumentation::networkStateChanged):
3003         (WebCore::InspectorInstrumentation::addMessageToConsole):
3004         (WebCore::InspectorInstrumentation::consoleCount):
3005         (WebCore::InspectorInstrumentation::startConsoleTiming):
3006         (WebCore::InspectorInstrumentation::stopConsoleTiming):
3007         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
3008         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
3009         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
3010         Convert to references where possible.
3011
3012         * inspector/InspectorCSSAgent.cpp:
3013         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3014         (WebCore::InspectorCSSAgent::buildObjectForRule):
3015         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
3016         * inspector/InspectorCSSAgent.h:
3017         * inspector/InspectorDOMAgent.cpp:
3018         (WebCore::InspectorDOMAgent::frameDocumentUpdated):
3019         * inspector/InspectorDOMAgent.h:
3020         * inspector/InspectorDOMStorageAgent.cpp:
3021         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
3022         * inspector/InspectorDOMStorageAgent.h:
3023         * inspector/InspectorInstrumentation.cpp:
3024         * inspector/InspectorPageAgent.cpp:
3025         (WebCore::InspectorPageAgent::frameNavigated):
3026         (WebCore::InspectorPageAgent::didPaint):
3027         * inspector/InspectorPageAgent.h:
3028         * inspector/InspectorReplayAgent.cpp:
3029         (WebCore::InspectorReplayAgent::frameNavigated):
3030         * inspector/InspectorReplayAgent.h:
3031         * inspector/InspectorTimelineAgent.cpp:
3032         (WebCore::InspectorTimelineAgent::didLayout):
3033         (WebCore::InspectorTimelineAgent::didPaint):
3034         * inspector/InspectorTimelineAgent.h:
3035         Pass references through InspectorInstrumentation to the Agents.
3036
3037         * loader/FrameLoader.cpp:
3038         (WebCore::FrameLoader::clear):
3039         * page/DOMTimer.cpp:
3040         (WebCore::DOMTimer::install):
3041         (WebCore::DOMTimer::removeById):
3042         (WebCore::DOMTimer::fired):
3043         * page/DOMWindow.cpp:
3044         (WebCore::DOMWindow::willDetachPage):
3045         * page/Frame.cpp:
3046         (WebCore::Frame::setDocument):
3047         * page/FrameView.cpp:
3048         (WebCore::FrameView::layout):
3049         (WebCore::FrameView::willPaintContents):
3050         (WebCore::FrameView::didPaintContents):
3051         * page/Page.cpp:
3052         (WebCore::networkStateChanged):
3053         * rendering/RenderLayerBacking.cpp:
3054         (WebCore::RenderLayerBacking::paintContents):
3055         * replay/ReplayController.cpp:
3056         (WebCore::ReplayController::frameNavigated):
3057         * replay/ReplayController.h:
3058         * storage/StorageEventDispatcher.cpp:
3059         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
3060         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
3061         * workers/Worker.cpp:
3062         (WebCore::Worker::notifyFinished):
3063         * workers/WorkerGlobalScope.cpp:
3064         (WebCore::WorkerGlobalScope::importScripts):
3065         (WebCore::WorkerGlobalScope::addConsoleMessage):
3066         (WebCore::WorkerGlobalScope::addMessage):
3067         * workers/WorkerInspectorProxy.cpp:
3068         (WebCore::WorkerInspectorProxy::workerStartMode):
3069         (WebCore::WorkerInspectorProxy::workerStarted):
3070         (WebCore::WorkerInspectorProxy::workerTerminated):
3071         * workers/WorkerInspectorProxy.h:
3072         * workers/WorkerMessagingProxy.cpp:
3073         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3074         Pass references to InspectorInstrumentation.
3075
3076 2016-11-01  Alex Christensen  <achristensen@webkit.org>
3077
3078         Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
3079         https://bugs.webkit.org/show_bug.cgi?id=164290
3080
3081         Reviewed by Tim Horton.
3082
3083         NSURL fails to parse these URLs, WebKit used to punycode encode them, but now we match Chrome and Firefox,
3084         as well as what will likely become the standard once https://github.com/whatwg/url/issues/148 is resolved.
3085         We continue to parse IPv6 address hosts because otherwise we wouldn't be able to tell where a port
3086         starts in a URL with colons in the IPv6 address and before the port like "a://[b::c]:4"
3087
3088         Covered by new API tests and updated LayoutTests.
3089
3090         * platform/URLParser.cpp:
3091         (WebCore::URLParser::domainToASCII):
3092         (WebCore::URLParser::parseHostAndPort):
3093
3094 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
3095
3096         Add IsAudible, IsLoading to ActivityState
3097         https://bugs.webkit.org/show_bug.cgi?id=164286
3098
3099         Reviewed by Geoff Garen.
3100
3101         By computing these values in the UIProcess and passing them to WebContent we can
3102         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
3103
3104         * page/ActivityState.h:
3105             - added IsAudible, IsLoading
3106
3107 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
3108
3109         Rename ViewState to ActivityState
3110         https://bugs.webkit.org/show_bug.cgi?id=164254
3111
3112         Reviewed by Andreas Kling.
3113
3114         We plan to add a couple more flags to ViewState that aren't directly related to the view
3115         itself - whether there is an ongoing page load, and whether whether there is audio playback.
3116         This will allow viewState (now activityState) to fully drive throttling decisions.
3117
3118         Renaming this bitfield accordingly.
3119         * Modules/geolocation/GeolocationController.cpp:
3120         (WebCore::GeolocationController::GeolocationController):
3121         (WebCore::GeolocationController::~GeolocationController):
3122         (WebCore::GeolocationController::activityStateDidChange):
3123         (WebCore::GeolocationController::viewStateDidChange): Deleted.
3124         * Modules/geolocation/GeolocationController.h:
3125         * WebCore.xcodeproj/project.pbxproj:
3126         * page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
3127         * page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
3128         (WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
3129         (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
3130         * page/FocusController.cpp:
3131         (WebCore::FocusController::FocusController):
3132         (WebCore::FocusController::setFocused):
3133         (WebCore::FocusController::setActivityState):
3134         (WebCore::FocusController::setActive):
3135         (WebCore::FocusController::setViewState): Deleted.
3136         * page/FocusController.h:
3137         (WebCore::FocusController::isActive):
3138         (WebCore::FocusController::isFocused):
3139         (WebCore::FocusController::contentIsVisible):
3140         * page/Page.cpp:
3141         (WebCore::Page::Page):
3142         (WebCore::Page::setIsInWindow):
3143         (WebCore::Page::addActivityStateChangeObserver):
3144         (WebCore::Page::removeActivityStateChangeObserver):
3145         (WebCore::Page::updateTimerThrottlingState):
3146         (WebCore::Page::setActivityState):
3147         (WebCore::Page::isVisibleAndActive):
3148         (WebCore::Page::setIsVisible):
3149         (WebCore::Page::addViewStateChangeObserver): Deleted.
3150         (WebCore::Page::removeViewStateChangeObserver): Deleted.
3151         (WebCore::Page::setViewState): Deleted.
3152         * page/Page.h:
3153         (WebCore::Page::isVisible):
3154         (WebCore::Page::isInWindow):
3155         * page/PageThrottler.h:
3156         * page/ViewState.h: Removed.
3157         * page/ViewStateChangeObserver.h: Removed.
3158
3159 2016-11-01  Ryan Haddad  <ryanhaddad@apple.com>
3160
3161         Unreviewed, rolling out r208100.
3162
3163         This change caused LayoutTest crashes under GuardMalloc.
3164
3165         Reverted changeset:
3166
3167         "MediaEndpoint::generateDtlsInfo is not needed"
3168         https://bugs.webkit.org/show_bug.cgi?id=164130
3169         http://trac.webkit.org/changeset/208100
3170
3171 2016-11-01  Claudio Saavedra  <csaavedra@igalia.com>
3172
3173         Add missing inline include to JSDeviceMotionEventCustom
3174         https://bugs.webkit.org/show_bug.cgi?id=164269
3175
3176         Reviewed by Michael Catanzaro.
3177
3178         Inlined JSObject functions are used through JSObject::get() get here,
3179         so this fixes the build with -fvisibility-inlines-hidden.
3180
3181         * bindings/js/JSDeviceMotionEventCustom.cpp: Include JSObjectInlines.h
3182
3183 2016-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
3184
3185         [CMake] generate-bindings-all.pl uses USES_TERMINAL which leaves a noisy line in interactive Ninja build
3186         https://bugs.webkit.org/show_bug.cgi?id=163868
3187
3188         Reviewed by Michael Catanzaro.
3189
3190         It takes long time for generate-bindings-all.pl to generate all
3191         bindings.  So, it shows the progress while running and
3192         USES_TERMINAL option of add_custom_target have been used to invoke
3193         the command.  However, USES_TERMINAL leaves a noisy line in
3194         Ninja's neat build log of interactive build.
3195
3196         A new CMake option SHOW_BINDINGS_GENERATION_PROGRESS is added to
3197         stop using USES_TERMINAL only in case of interactive Ninja build.
3198
3199         * bindings/scripts/generate-bindings-all.pl: Added a new switch
3200         --showProgress.  Removed $terminalWidth and getTerminalWidth which
3201         are mainly for interactive Ninja build.  Added printProgress.
3202
3203 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
3204
3205         Web Inspector: Add the support for custom elements
3206         https://bugs.webkit.org/show_bug.cgi?id=164266
3207         <rdar://problem/29038883>
3208
3209         Reviewed by Joseph Pecoraro.
3210
3211         Set "customElementState" property on each DOMNode object when building a protocol object for the node.
3212         Also added InspectorInstrumentation::didChangeCustomElementState to track the changes to custom element states.
3213
3214         Tests: inspector/dom/customElementState.html
3215
3216         * dom/Element.cpp:
3217         (WebCore::Element::setIsDefinedCustomElement): Invoke didChangeCustomElementState to update the state.
3218         (WebCore::Element::setIsFailedCustomElement): Ditto.
3219         (WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.
3220         (WebCore::Element::enqueueToUpgrade): Ditto.
3221         * inspector/InspectorDOMAgent.cpp:
3222         (WebCore::customElementState): Added.
3223         (WebCore::InspectorDOMAgent::buildObjectForNode): Set the custom element state.
3224         (WebCore::InspectorDOMAgent::didChangeCustomElementState): Invoke customElementStateChanged.
3225         * inspector/InspectorDOMAgent.h:
3226         * inspector/InspectorInstrumentation.cpp:
3227         (WebCore::InspectorInstrumentation::didChangeCustomElementStateImpl): Added.
3228         * inspector/InspectorInstrumentation.h:
3229         (WebCore::InspectorInstrumentation::didChangeCustomElementState): Added.
3230
3231 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
3232
3233         Add StaticPasteboard.cpp to the cmake after r207841.
3234
3235         * CMakeLists.txt:
3236
3237 2016-10-31  Zalan Bujtas  <zalan@apple.com>
3238
3239         Simple line layout: Clear needs layout flag even when only overflow is getting recomputed.
3240         https://bugs.webkit.org/show_bug.cgi?id=164253
3241
3242         Reviewed by Antti Koivisto.
3243
3244         When a style change triggers visual overflow re-computation, we set StyleDifferenceLayout style diff
3245         but in practice we don't actually make changes to the simple line structure. We just re-compute the visual overflow later.
3246         This patch moves the 'clean the renderes' logic back to RenderBlockFlow::layoutSimpleLines so that
3247         we set the needs layout bit to false regardless of whether we preformed layout.
3248
3249         Covered by fast/events/tabindex-focus-blur-all.html
3250
3251         * rendering/RenderBlockFlow.cpp:
3252         (WebCore::RenderBlockFlow::layoutSimpleLines):
3253         * rendering/SimpleLineLayout.cpp:
3254         (WebCore::SimpleLineLayout::create):
3255
3256 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3257
3258         Add basic visual/layout viewport support for fixed position layout
3259         https://bugs.webkit.org/show_bug.cgi?id=164261
3260
3261         Reviewed by Dean Jackson.
3262
3263         This patch adds a new behavior for position:fixed objects on zooming. Instead of
3264         interpolating between two implicit viewports as we do now, have explicit and distinct
3265         layout and visual viewports.
3266
3267         The layout viewport is always the size of the initial containing block (i.e. the RenderView).
3268         Position:fixed and sticky elements are laid out relative to the layout viewport.
3269
3270         The visual viewport is the visible part of the view, in content coordinates.
3271
3272         When the user pans and zooms, the visual viewport changes. If it hits the edge of the
3273         layout viepwort, it pushes the layout viewport in that direction; it's as if the user
3274         is dragging the layout viewport around.
3275
3276         The layout viewport is maintained on FrameView, and has to be recomputed when the
3277         scroll position changes, when the view size changes, and when the content size (which
3278         affets min/max scroll position) changes. Layout viewport size and position are computed
3279         in unzoomed coordinates, requiring some new functions on FrameView to return these.
3280
3281         Updated the TileCoverageMap to show the layout viewport visually.
3282
3283         Subsequent patches will plumb the layout and visual viewports through the scrolling tree.
3284
3285         Tests: fast/visual-viewport/nonzoomed-rects.html
3286                fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html
3287                fast/visual-viewport/zoomed-fixed.html
3288                fast/visual-viewport/zoomed-rects.html
3289
3290         * page/FrameView.cpp:
3291         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
3292         (WebCore::FrameView::scrollPositionRespectingCustomFixedPosition):
3293         (WebCore::FrameView::computeLayoutViewportOrigin):
3294         (WebCore::FrameView::setLayoutViewportOrigin):
3295         (WebCore::FrameView::updateLayoutViewport):
3296         (WebCore::FrameView::minStableLayoutViewportOrigin):
3297         (WebCore::FrameView::maxStableLayoutViewportOrigin):
3298         (WebCore::FrameView::layoutViewportRect):
3299         (WebCore::FrameView::visualViewportRect):
3300         (WebCore::FrameView::viewportConstrainedVisibleContentRect):
3301         (WebCore::FrameView::rectForFixedPositionLayout):
3302         (WebCore::FrameView::scrollPositionForFixedPosition):
3303         (WebCore::FrameView::unscaledMinimumScrollPosition):
3304         (WebCore::FrameView::unscaledMaximumScrollPosition):
3305         (WebCore::FrameView::scrollPositionChanged):
3306         (WebCore::FrameView::availableContentSizeChanged):
3307         (WebCore::FrameView::performPostLayoutTasks):
3308         (WebCore::FrameView::scrollTo):
3309         (WebCore::FrameView::useCustomFixedPositionLayoutRect):
3310         * page/FrameView.h:
3311         * page/Settings.in:
3312         * page/scrolling/AsyncScrollingCoordinator.cpp:
3313         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3314         * platform/graphics/TiledBacking.h:
3315         * platform/graphics/ca/TileController.cpp:
3316         (WebCore::TileController::setLayoutViewportRect):
3317         * platform/graphics/ca/TileController.h:
3318         * platform/graphics/ca/TileCoverageMap.cpp:
3319         (WebCore::TileCoverageMap::TileCoverageMap):
3320         (WebCore::TileCoverageMap::update):
3321         * platform/graphics/ca/TileCoverageMap.h:
3322         * rendering/RenderBoxModelObject.cpp:
3323         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
3324         * rendering/RenderLayerBacking.cpp:
3325         (WebCore::RenderLayerBacking::updateCompositedBounds):
3326         * rendering/RenderLayerCompositor.cpp:
3327         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
3328         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
3329         * rendering/RenderTreeAsText.cpp:
3330         (WebCore::externalRepresentation): Logging here is useful when debugging tests.
3331         * testing/Internals.cpp:
3332         (WebCore::Internals::layoutViewportRect): Expose these rects so tests can dump them.
3333         (WebCore::Internals::visualViewportRect):
3334         * testing/Internals.h:
3335         * testing/Internals.idl:
3336
3337 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3338
3339         Fix bindings tests after r208209.
3340
3341         * bindings/scripts/test/JS/JSTestObj.cpp:
3342         (WebCore::setJSTestObjTypedArrayAttrFunction):
3343         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3344         (WebCore::constructJSTestOverloadedConstructors1):
3345         (WebCore::constructJSTestOverloadedConstructors2):
3346
3347 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3348
3349         Warning: Multiple build commands for output file RenderThemeCocoa.h
3350         https://bugs.webkit.org/show_bug.cgi?id=164265
3351
3352         Reviewed by Ryosuke Niwa.
3353
3354         * WebCore.xcodeproj/project.pbxproj:
3355
3356 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
3357
3358         JSC should support SharedArrayBuffer
3359         https://bugs.webkit.org/show_bug.cgi?id=163986
3360
3361         Reviewed by Keith Miller.
3362
3363         New tests added in the LayoutTests/workers/sab directory.
3364         
3365         This teaches WebCore that a typed array could be shared or not. By default, WebCore will
3366         reject shared typed arrays as if they were not typed arrays. This ensures that we don't get
3367         race conditions in code that can't handle it.
3368         
3369         If you postMessage a SharedArrayBuffer or something that wraps it, you will send the shared
3370         memory to the other worker.
3371
3372         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
3373         (WebCore::CDMSessionClearKey::cachedKeyForKeyID):
3374         * Modules/fetch/FetchBody.cpp:
3375         (WebCore::FetchBody::extract):
3376         * Modules/mediastream/RTCDataChannel.cpp:
3377         (WebCore::RTCDataChannel::send):
3378         * Modules/webaudio/AudioBuffer.cpp:
3379         (WebCore::AudioBuffer::getChannelData):
3380         * Modules/websockets/WebSocket.cpp:
3381         (WebCore::WebSocket::send):
3382         * bindings/js/JSBlobCustom.cpp:
3383         (WebCore::constructJSBlob):
3384         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3385         (WebCore::createRsaKeyGenParams):
3386         * bindings/js/JSCryptoCustom.cpp:
3387         (WebCore::JSCrypto::getRandomValues):
3388         * bindings/js/JSCryptoOperationData.cpp:
3389         (WebCore::cryptoOperationDataFromJSValue):
3390         * bindings/js/JSDOMBinding.h:
3391         (WebCore::toJS):
3392         (WebCore::toPossiblySharedArrayBufferView):
3393         (WebCore::toUnsharedArrayBufferView):
3394         (WebCore::toPossiblySharedInt8Array):
3395         (WebCore::toPossiblySharedInt16Array):
3396         (WebCore::toPossiblySharedInt32Array):
3397         (WebCore::toPossiblySharedUint8Array):
3398         (WebCore::toPossiblySharedUint8ClampedArray):
3399         (WebCore::toPossiblySharedUint16Array):
3400         (WebCore::toPossiblySharedUint32Array):
3401         (WebCore::toPossiblySharedFloat32Array):
3402         (WebCore::toPossiblySharedFloat64Array):
3403         (WebCore::toUnsharedInt8Array):
3404         (WebCore::toUnsharedInt16Array):
3405         (WebCore::toUnsharedInt32Array):
3406         (WebCore::toUnsharedUint8Array):
3407         (WebCore::toUnsharedUint8ClampedArray):
3408         (WebCore::toUnsharedUint16Array):
3409         (WebCore::toUnsharedUint32Array):
3410         (WebCore::toUnsharedFloat32Array):
3411         (WebCore::toUnsharedFloat64Array):
3412         (WebCore::toArrayBufferView): Deleted.
3413         (WebCore::toInt8Array): Deleted.
3414         (WebCore::toInt16Array): Deleted.
3415         (WebCore::toInt32Array): Deleted.
3416         (WebCore::toUint8Array): Deleted.
3417         (WebCore::toUint8ClampedArray): Deleted.
3418         (WebCore::toUint16Array): Deleted.
3419         (WebCore::toUint32Array): Deleted.
3420         (WebCore::toFloat32Array): Deleted.
3421         (WebCore::toFloat64Array): Deleted.
3422         * bindings/js/JSDataCueCustom.cpp:
3423         (WebCore::constructJSDataCue):
3424         * bindings/js/JSDictionary.cpp:
3425         (WebCore::JSDictionary::convertValue):
3426         * bindings/js/JSFileCustom.cpp:
3427         (WebCore::constructJSFile):
3428         * bindings/js/JSMessagePortCustom.cpp:
3429         (WebCore::extractTransferables):
3430         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
3431         (WebCore::dataFunctionf):
3432         (WebCore::dataFunctioni):
3433         (WebCore::dataFunctionMatrix):