cdba5a4fc6be9adabe578d0fa5c0bbff404bd9d4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-09  Alex Christensen  <achristensen@webkit.org>
2
3         Unreviewed, rolling out r208438.
4
5         crashes
6
7         Reverted changeset:
8
9         "[WK2][NETWORK_SESSION] Add support for downloading file
10         backed blobs"
11         https://bugs.webkit.org/show_bug.cgi?id=164458
12         http://trac.webkit.org/changeset/208438
13
14 2016-11-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
15
16         Change the decoding for some animated images to be asynchronous
17         https://bugs.webkit.org/show_bug.cgi?id=161566
18
19         Reviewed by Simon Fraser.
20
21         Tests: fast/images/slower-animation-than-decoding-image.html
22                fast/images/slower-decoding-than-animation-image.html
23                fast/images/stopped-animation-deleted-image.html
24                
25         Request the next frame before firing the animation timer. The asynchronous
26         image decoding work queue notifies the BitmapImage when the frame finishes
27         decoding. If the timer fires before the frame is decoded, no repaint will
28         be requested. Only when the image frame is ready, the animation will be
29         advanced and the image will be repainted.
30
31         * loader/cache/CachedImage.cpp:
32         (WebCore::CachedImage::load): Cache the image settings in CachedImage.
33         (WebCore::CachedImage::createImage): No need to pass allowSubsampling to BitmapImage. It can be retrieved through Image::imageObserver().
34         (WebCore::CachedImage::changedInRect): Change the parameter to notifyObservers() to be a pointer.
35         * loader/cache/CachedImage.h: Cache the settings: allowSubsampling, allowAsyncImageDecoding and showDebugBackground through m_loader.
36         * platform/graphics/BitmapImage.cpp:
37         (WebCore::BitmapImage::dataChanged): Fix a logging message.
38         (WebCore::BitmapImage::draw): Store the current SubsamplingLevel to be used when requesting decoding the image of the next frame.
39         Draw a debug rectangle if the next frame is missed because it is being decoded and the setting showDebugBackground is on.
40         (WebCore::BitmapImage::startAnimation): Deleted. Moved to the header file.
41         (WebCore::BitmapImage::internalStartAnimation): Added. Request asynchronous image decoding for the next frame if required. Return the
42         result of starting the animation.
43         (WebCore::BitmapImage::advanceAnimation): Call internalAdvanceAnimation() if the frame image is not being decoded. If it is being decoded
44         and the setting showDebugBackground is on, force repaint so the debug rectangle is drawn.
45         (WebCore::BitmapImage::internalAdvanceAnimation): This is the old body of advanceAnimation().
46         (WebCore::BitmapImage::stopAnimation): Stop the asynchronous image decoding if it is started.
47         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): This function is called from the async image decoding work queue when finishing decoding a native image frame.
48         * platform/graphics/BitmapImage.h:
49         (WebCore::BitmapImage::startAnimation): Added. It is now calls internalStartAnimation().
50         * platform/graphics/Color.h: Define a constant for the yellow color.
51         * platform/graphics/ImageFrameCache.cpp:
52         (WebCore::ImageFrameCache::clearMetadata): Delete unreferenced member.
53         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Return true if the frame is requested for async decoding.
54         * platform/graphics/ImageFrameCache.h:
55         * platform/graphics/ImageObserver.h:  Add virtual functions for allowSubsampling, allowAsyncImageDecoding and showDebugBackground.
56         * platform/graphics/ImageSource.cpp:
57         (WebCore::ImageSource::maximumSubsamplingLevel): Move checking allowSubsampling() to the caller BitmapImage::draw().
58         * platform/graphics/ImageSource.h: Remove the setting allowSubsampling(); it can be retrieved from imageObserver().
59         (WebCore::ImageSource::setAllowSubsampling): Deleted.
60         * rendering/RenderImageResource.cpp:
61         (WebCore::RenderImageResource::shutdown): Stop the animation of an image when shutting down the resource.
62         * rendering/RenderImageResourceStyleImage.cpp:
63         (WebCore::RenderImageResourceStyleImage::shutdown): Ditto.
64         svg/graphics/SVGImageClients.h: Change the parameter to ImageObserver::changedInRect() to be a pointer.
65         (WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
66         * testing/Internals.cpp:
67         (WebCore::Internals::setImageFrameDecodingDuration): Sets a fixed frame decoding duration for testing.
68         * testing/Internals.h:
69         * testing/Internals.idl: Adds an internal option for ImageFrameDecodingDuration.
70
71 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
72
73         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
74         https://bugs.webkit.org/show_bug.cgi?id=155185
75         <rdar://problem/11101440>
76
77         Reviewed by Brady Eidson.
78
79         Add a new quirk for localStorage that defaults to 'on'. When active, this quirk says that
80         localStorage access should be granted, without needing to grant universal file access.
81
82         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
83         grants universal file access.
84
85         Tests: storage/domstorage/localstorage/blocked-file-access-permitted-by-quirk.html
86                storage/domstorage/localstorage/blocked-file-access.html
87
88         * dom/Document.cpp:
89         (WebCore::Document::initSecurityContext): Set localStorage quirk mode based on settings.
90         * page/SecurityOrigin.cpp:
91         (WebCore::SecurityOrigin::SecurityOrigin): Use more C++11 initializers.
92         (WebCore::SecurityOrigin::canAccessStorage): If the origin is a local file, and we are NOT in
93         localStorage quirks mode, and we have not been granted universal file access, prevent access
94         to DOM localStorage.
95         (WebCore::SecurityOrigin::setNeedsLocalStorageQuirk): Added.
96         * page/SecurityOrigin.h:
97         (WebCore::SecurityOrigin::needsLocalStorageQuirk): Added.
98         * page/Settings.in:
99         * workers/WorkerGlobalScope.cpp:
100         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Make sure Workers know what the
101         localStorage quirks mode is set to.
102
103 2016-11-09  Alex Christensen  <achristensen@webkit.org>
104
105         URLParser should not consider path of URLs with no host to start at the first slash after the colon
106         https://bugs.webkit.org/show_bug.cgi?id=164555
107
108         Reviewed by Tim Horton.
109
110         When we see a url that is only scheme:// we treated the // as the path.  Firefox did this with unrecognized schemes,
111         but based on https://github.com/whatwg/url/issues/148 they seem willing to change.  We had added similar behavior to
112         URL::parse, and I added this to URLParser in r206783 which this effectively reverts.
113
114         Covered by API and layout tests.
115
116         * platform/URLParser.cpp:
117         (WebCore::URLParser::parse):
118         Don't move m_userStart to m_pathStart back by two when we see an empty host.
119
120 2016-11-09  Alex Christensen  <achristensen@webkit.org>
121
122         Simplify logic of SecurityOrigin::databaseIdentifier
123         https://bugs.webkit.org/show_bug.cgi?id=164565
124
125         Reviewed by Brady Eidson.
126
127         No change in behavior.
128
129         SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
130         Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
131         making the database identifier, just determine whether we need this quirk when making the database identifier.
132         I'm planning to move this logic to SecurityOriginData in another patch.
133
134         * page/SecurityOrigin.cpp:
135         (WebCore::SecurityOrigin::SecurityOrigin):
136         (WebCore::SecurityOrigin::create):
137         (WebCore::SecurityOrigin::databaseIdentifier):
138         * page/SecurityOrigin.h:
139
140 2016-11-09  Jaehun Lim  <ljaehun.lim@samsung.com>
141
142         Unreviewed, build fix after r208460
143
144         isValidColorString() was renamed isValidSimpleColorString().
145
146         * html/ColorInputType.cpp:
147         (WebCore::ColorInputType::suggestions):
148
149 2016-11-09  Anders Carlsson  <andersca@apple.com>
150
151         Fix STP build.
152
153         * WebCorePrefix.h:
154
155 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
156
157         Implement visual-viewport based position:fixed handling for Mac async scrolling
158         https://bugs.webkit.org/show_bug.cgi?id=164495
159
160         Reviewed by Tim Horton.
161
162         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
163         so we push the enable flag to via the root state node, then push the layout viewport,
164         and the min/max scroll position that contstrain it, through frame state nodes.
165
166         When a scroll happens, we compute a new layout viewport when the visual viewport hits
167         an edge, and push that down through setScrollLayerPosition() since it's used to position
168         fixed and sticky layers.
169
170         When the main thread gets notified about an async scroll, we set the new layout viewport
171         on the FrameView, but do so in such a way that does not trigger layout. This is OK because
172         we do a RenderLayer update which udpates all the layoutViewport-dependent state, and is
173         necessary to avoid repaints every main thread update.
174
175         The iOS code is made to compile, but not work yet.
176
177         Tests: compositing/tiling/visiblerect-accumulated-offset.html
178                fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html
179                fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html
180                fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
181
182         * page/FrameView.cpp:
183         (WebCore::FrameView::setLayoutViewportOrigin):
184         (WebCore::FrameView::updateLayoutViewport):
185         (WebCore::FrameView::visualViewportRect):
186         (WebCore::FrameView::unscaledMinimumScrollPosition):
187         (WebCore::FrameView::scrollPositionChanged):
188         * page/FrameView.h:
189         * page/scrolling/AsyncScrollingCoordinator.cpp:
190         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
191         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
192         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
193         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
194         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
195         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled):
196         * page/scrolling/AsyncScrollingCoordinator.h:
197         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
198         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
199         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
200         (WebCore::ScrollingStateFrameScrollingNode::setLayoutViewport):
201         (WebCore::ScrollingStateFrameScrollingNode::setMinLayoutViewportOrigin):
202         (WebCore::ScrollingStateFrameScrollingNode::setMaxLayoutViewportOrigin):
203         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled):
204         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
205         * page/scrolling/ScrollingStateFrameScrollingNode.h:
206         * page/scrolling/ScrollingTree.cpp:
207         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
208         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
209         (WebCore::ScrollingTree::commitTreeState):
210         * page/scrolling/ScrollingTree.h:
211         (WebCore::ScrollingTree::visualViewportEnabled):
212         (WebCore::ScrollingTree::setVisualViewportEnabled):
213         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
214         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
215         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
216         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
217         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport):
218         (WebCore::ScrollingTreeFrameScrollingNode::minLayoutViewportOrigin):
219         (WebCore::ScrollingTreeFrameScrollingNode::maxLayoutViewportOrigin):
220         * page/scrolling/ScrollingTreeScrollingNode.cpp:
221         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
222         * page/scrolling/ScrollingTreeScrollingNode.h:
223         * page/scrolling/ThreadedScrollingTree.cpp:
224         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
225         * page/scrolling/ThreadedScrollingTree.h:
226         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
227         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
228         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
229         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
230         * page/scrolling/ios/ScrollingTreeIOS.cpp:
231         (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
232         * page/scrolling/ios/ScrollingTreeIOS.h:
233         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
234         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
235         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
236         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
237
238 2016-11-09  Brady Eidson  <beidson@apple.com>
239
240         IndexedDB 2.0: W3C test IndexedDB/idbtransaction_objectStoreNames.html fails.
241         https://bugs.webkit.org/show_bug.cgi?id=164528
242
243         Reviewed by Alex Christensen.
244
245         No new tests (Covered by existing test).
246
247         * Modules/indexeddb/IDBDatabase.cpp:
248         (WebCore::IDBDatabase::transaction): De-dupe the input names.
249
250 2016-11-09  Brady Eidson  <beidson@apple.com>
251
252         IndexedDB 2.0: Implement new IDBCursor.continuePrimaryKey function.
253         https://bugs.webkit.org/show_bug.cgi?id=164404
254
255         Reviewed by Alex Christensen.
256
257         Tests: storage/indexeddb/modern/idbcursor-continue-primary-key-1-private.html
258                storage/indexeddb/modern/idbcursor-continue-primary-key-1.html
259                Also covered by existing tests.
260
261         * Modules/indexeddb/IDBCursor.cpp:
262         (WebCore::IDBCursor::continuePrimaryKey):
263         (WebCore::IDBCursor::uncheckedIterateCursor):
264         * Modules/indexeddb/IDBCursor.h:
265         * Modules/indexeddb/IDBCursor.idl:
266
267         * Modules/indexeddb/IDBKeyData.h:
268         (WebCore::IDBKeyData::operator>):
269         (WebCore::IDBKeyData::operator<=):
270         (WebCore::IDBKeyData::operator>=):
271
272         * Modules/indexeddb/server/MemoryCursor.h:
273
274         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
275         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
276
277         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
278         (WebCore::IDBServer::MemoryIndexCursor::iterate):
279         * Modules/indexeddb/server/MemoryIndexCursor.h:
280
281         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
282         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
283         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
284
285         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
286         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
287
288         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
289         (WebCore::IDBServer::SQLiteIDBCursor::iterate):
290         * Modules/indexeddb/server/SQLiteIDBCursor.h:
291
292         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
293         (WebCore::IDBIterateCursorData::isolatedCopy):
294         * Modules/indexeddb/shared/IDBIterateCursorData.h:
295         (WebCore::IDBIterateCursorData::encode):
296         (WebCore::IDBIterateCursorData::decode):
297
298 2016-11-09  Antoine Quint  <graouts@apple.com>
299
300         [Modern Media Controls] Media Controller: set status label according to media state
301         https://bugs.webkit.org/show_bug.cgi?id=164557
302         <rdar://problem/29184097>
303
304         Reviewed by Dean Jackson.
305
306         Correctly set the StatusLabel text based on the media loading and network state.
307
308         Tests: http/tests/media/modern-media-controls/status-support/status-support-live-broadcast.html
309                http/tests/media/modern-media-controls/status-support/status-support-loading.html
310                media/modern-media-controls/status-support/status-support-error.html
311
312         * Modules/modern-media-controls/js-files:
313         * Modules/modern-media-controls/media/media-controller.js:
314         (MediaController):
315         * Modules/modern-media-controls/media/status-support.js: Added.
316         (StatusSupport.prototype.get control):
317         (StatusSupport.prototype.get mediaEvents):
318         (StatusSupport.prototype.syncControl):
319         (StatusSupport):
320         * WebCore.xcodeproj/project.pbxproj:
321
322 2016-11-09  Zalan Bujtas  <zalan@apple.com>
323
324         No need to set setFlowThreadState on RenderText in createTextRenderer.
325         https://bugs.webkit.org/show_bug.cgi?id=164559
326
327         Reviewed by Antti Koivisto.
328
329        setFlowThreadState in create*Renderer ensures that by the time we issue the initial call to
330        styleWillChange/styleDidChange through initializeStyle, the state is already set.
331        However since RenderText does not have its own style, it's sufficient to have the flow state set
332        through the normal RenderElement::insertChildInternal code path.
333
334         No change in functionality.
335
336         * style/RenderTreeUpdater.cpp:
337         (WebCore::createTextRenderer):
338
339 2016-11-09  Brady Eidson  <beidson@apple.com>
340
341         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
342         https://bugs.webkit.org/show_bug.cgi?id=164504
343
344         Reviewed by Darin Adler.
345
346         No new tests (Refactor, no behavior change).
347
348         This patch literally just takes the "key" and "count" arguments and encapsulates them in a struct.
349         That struct will then be easily expandable in the future (e.g. bug 164404).
350
351         * Modules/indexeddb/IDBCursor.cpp:
352         (WebCore::IDBCursor::uncheckedIterateCursor):
353         
354         * Modules/indexeddb/IDBTransaction.cpp:
355         (WebCore::IDBTransaction::iterateCursor):
356         (WebCore::IDBTransaction::iterateCursorOnServer):
357         * Modules/indexeddb/IDBTransaction.h:
358         
359         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
360         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
361         * Modules/indexeddb/client/IDBConnectionProxy.h:
362         
363         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
364         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
365         * Modules/indexeddb/client/IDBConnectionToServer.h:
366         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
367         
368         * Modules/indexeddb/server/IDBBackingStore.h:
369         
370         * Modules/indexeddb/server/IDBServer.cpp:
371         (WebCore::IDBServer::IDBServer::iterateCursor):
372         * Modules/indexeddb/server/IDBServer.h:
373         
374         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
375         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
376         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
377         
378         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
379         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
380         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
381         
382         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
383         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
384         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
385         * Modules/indexeddb/server/UniqueIDBDatabase.h:
386         
387         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
388         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
389         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
390         
391         * Modules/indexeddb/shared/IDBIterateCursorData.cpp: Added.
392         (WebCore::IDBIterateCursorData::isolatedCopy):
393         * Modules/indexeddb/shared/IDBIterateCursorData.h: Added.
394         (WebCore::IDBIterateCursorData::encode):
395         (WebCore::IDBIterateCursorData::decode):
396
397         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
398         (WebCore::InProcessIDBServer::iterateCursor):
399         * Modules/indexeddb/shared/InProcessIDBServer.h:
400
401         * CMakeLists.txt:
402         * WebCore.xcodeproj/project.pbxproj:
403
404 2016-11-09  Ryosuke Niwa  <rniwa@webkit.org>
405
406         StyledElement::attributeChanged shouldn't do any work when the attribute value didn't change
407         https://bugs.webkit.org/show_bug.cgi?id=129476
408
409         Reviewed by Andreas Kling.
410
411         Avoid calling styleAttributeChanged and setPresentationAttributeStyleIsDirty
412         when the attribute value didn't change as in r164856.
413
414         * dom/StyledElement.cpp:
415         (WebCore::StyledElement::attributeChanged):
416
417 2016-11-09  Yusuke Suzuki  <utatane.tea@gmail.com>
418
419         [DOMJIT] Implement Node::ownerDocument
420         https://bugs.webkit.org/show_bug.cgi?id=164004
421
422         Reviewed by Darin Adler.
423
424         Test: js/dom/domjit-accessor-owner-document.html
425
426         Still I cannot reproduce this crash in x64 environment, according to the crash log, it accesses 0x8 address.
427         This can happen if document() accidentally returns nullptr. In the C++ ownerDocument implementation,
428         if document() returns nullptr, it just returns nullptr. But in the DOMJIT implementation, we assume that
429         document() won't return nullptr and access the member of it.
430
431         This patch aligns the DOMJIT implementation strictly to the C++ one.
432
433         * dom/Node.idl:
434         * domjit/JSNodeDOMJIT.cpp:
435         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
436         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
437
438 2016-11-09  Sam Weinig  <sam@webkit.org>
439
440         [SVG] Start moving special casing of SVG out of the bindings - SVGAngle
441         https://bugs.webkit.org/show_bug.cgi?id=164496
442
443         Reviewed by Darin Adler.
444
445         There is quite a bit of special casing of SVG types in the bindings that adds
446         a lot of complexity and is relatively fragile, as it is based on type naming.
447
448         Instead of keeping the complexity in the bindings, I am going to move it into
449         the implementation, where it has also longed to be. 
450
451         Starting small, with just SVGAngle. It has been split in two, with the existing
452         SVGAngle being renamed SVGAngleValue, and the bound instance, which used to be name
453         SVGPropertyTearOff<SVGAngle>, taking the name SVGAngle (and inheriting from 
454         SVGPropertyTearOff<SVGAngleValue>).
455
456         * CMakeLists.txt:
457         * WebCore.xcodeproj/project.pbxproj:
458         Add SVGAngleValue.cpp
459
460         * bindings/scripts/CodeGenerator.pm:
461         Remove SVGAngle as a special case.
462
463         * svg/SVGAngle.cpp: Removed.
464         * svg/SVGAngle.h:
465         Added. Implements the SVGAngle interface explicitly, getting to
466         the SVGAngleValue through propertyReference().
467
468         * svg/SVGAngle.idl:
469         * svg/SVGAngleValue.cpp: Copied from Source/WebCore/svg/SVGAngle.cpp.
470         * svg/SVGAngleValue.h: Copied from Source/WebCore/svg/SVGAngle.h.
471         Move old SVGAngle implementation to SVGAngleValue.
472
473         * svg/SVGAnimatedAngle.cpp:
474         Replace SVGAngle usage with SVGAngleValue.
475
476         * svg/SVGAnimatedAngle.h:
477         Switch SVGAnimatedAngle to be a type alias. This remains SVGAnimatedPropertyTearOff<SVGAngle>
478         as SVGAnimatedPropertyTearOff has been changed to take the TearOff type as its parameter.
479
480         * svg/SVGAnimatedLength.h:
481         * svg/SVGAnimatedPreserveAspectRatio.h:
482         * svg/SVGAnimatedRect.h:
483         Switch to using type aliases and pass the TearOff to SVGAnimatedPropertyTearOff.
484
485         * svg/SVGAnimatedType.cpp:
486         (WebCore::SVGAnimatedType::createAngleAndEnumeration):
487         * svg/SVGAnimatedType.h:
488         (WebCore::SVGAnimatedType::angleAndEnumeration):
489         Use SVGAngleValue.
490
491         * svg/SVGComponentTransferFunctionElement.h:
492         Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
493
494         * svg/SVGMarkerElement.cpp:
495         (WebCore::SVGMarkerElement::parseAttribute):
496         (WebCore::SVGMarkerElement::setOrient):
497         Switch to take an SVGAngleValue.
498
499         (WebCore::SVGMarkerElement::setOrientToAngle):
500         Update to pull the value out via propertyReference().
501
502         * svg/SVGMarkerElement.h:
503         Switch to take an SVGAngleValue.
504
505         * svg/SVGLengthList.h:
506         * svg/SVGNumberList.h:
507         * svg/SVGPathSegList.h:
508         * svg/SVGPointList.h:
509         * svg/SVGStringList.h:
510         * svg/SVGTransformList.h:
511         Switch to using type aliases in SVGPropertyTraits and add an alias for
512         ListItemTearOff.
513
514         * svg/SVGSVGElement.cpp:
515         (WebCore::SVGSVGElement::createSVGAngle):
516         * svg/SVGSVGElement.h:
517         Change createSVGAngle to return a Ref<SVGAngle> and create one.
518
519         * svg/SVGSVGElement.idl:
520         Annotate IDL to indicate that a new value is being returned.
521
522         * svg/SVGTransform.cpp:
523         Remove unnecessary include of SVGAngle.h.
524
525         * svg/SVGViewSpec.cpp:
526         Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
527
528         * svg/properties/SVGAnimatedPropertyTearOff.h:
529         Change to be parameterized on the TearOffType, rather than the PropertyType itself. Get the
530         Property type from the TearOffType.
531
532         * svg/properties/SVGListProperty.h:
533         * svg/properties/SVGListPropertyTearOff.h:
534         Fix assumption that all TearOffTypes are just a SVGPropertyTearOff templatized on a property
535         type. This is no longer true for SVGAngle. Instead, get the TearOffType for lists via SVGPropertyTraits.
536
537         * svg/properties/SVGPropertyTearOff.h:
538         Make the PropertyType available by exposing it as a type alias.
539
540 2016-11-09  Darin Adler  <darin@apple.com>
541
542         Move Range from ExceptionCode to ExceptionOr
543         https://bugs.webkit.org/show_bug.cgi?id=164457
544
545         Reviewed by Alex Christensen.
546
547         * accessibility/AXObjectCache.cpp:
548         (WebCore::AXObjectCache::rangeForNodeContents): Update to use ExceptionOr,
549         keeping behavior the same.
550         (WebCore::characterOffsetsInOrder): Ditto.
551         (WebCore::setRangeStartOrEndWithCharacterOffset): Changed argument to a
552         reference instead of a pointer. Use a boolean return value to indicate
553         success rather than an exception, since the callers don't need to know
554         which exception it is.
555         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Updated for
556         the above.
557         (WebCore::AXObjectCache::nextBoundary): Ditto.
558         (WebCore::AXObjectCache::previousBoundary): Ditto.
559
560         * accessibility/AccessibilityObject.cpp:
561         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
562         Update to use ExceptionOr, keeping behavior the same.
563         * accessibility/AccessibilityRenderObject.cpp:
564         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange): Ditto.
565         * accessibility/atk/WebKitAccessibleUtil.cpp:
566         (selectionBelongsToObject): Ditto.
567         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
568         (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Ditto.
569         * dom/Node.cpp:
570         (WebCore::Node::textRects): Ditto.
571
572         * dom/Range.cpp:
573         (WebCore::Range::~Range): Remove old comment that no longer makes sense now
574         that the detach function no longer does anything.
575         (WebCore::checkForDifferentRootContainer): Updated to use ExceptionOr,
576         keeping behavior the same.
577         (WebCore::Range::setStart): Ditto.
578         (WebCore::Range::setEnd): Ditto.
579         (WebCore::Range::isPointInRange): Ditto.
580         (WebCore::Range::comparePoint): Ditto.
581         (WebCore::Range::compareNode): Ditto.
582         (WebCore::top): Added helper function so that compareBoundaryPoints doesn't
583         need to have two identical loops in it.
584         (WebCore::Range::compareBoundaryPoints): Updated to use ExceptionOr,
585         keeping behavior the same.
586         (WebCore::Range::compareBoundaryPointsForBindings): Ditto. Also use a switch
587         instead of relying on the order of the values to check for unsupported values.
588         (WebCore::Range::boundaryPointsValid): Ditto.
589         (WebCore::Range::deleteContents): Ditto.
590         (WebCore::Range::intersectsNode): Ditto.
591         (WebCore::Range::processContents): Ditto.
592         (WebCore::deleteCharacterData): Ditto.
593         (WebCore::processContentsBetweenOffsets): Ditto. Also changed to be a
594         non-member function and private to this file instead of in the class.
595         (WebCore::processNodes): Ditto. Also changed one argument to be a RefPtr
596         since the code relies on using it after mutating the DOM.
597         (WebCore::processAncestorsAndTheirSiblings): Ditto. Changed one argument type
598         to use ExceptionOr so the caller doesn't have to check the exception first.
599         (WebCore::Range::extractContents): Ditto.
600         (WebCore::Range::cloneContents): Ditto.
601         (WebCore::Range::insertNode): Ditto. Also fixed to only call nodeType once
602         instead of three times.
603         (WebCore::Range::toString): Ditto. Also fixed to call nodeType only once
604         per node instead of twice, to use downcast instead of static_cast, and to
605         use the word "node" instead of "n" for the local variable name.
606         (WebCore::Range::createContextualFragment): Ditto.
607         (WebCore::Range::checkNodeWOffset): Ditto.
608         (WebCore::Range::setStartAfter): Ditto.
609         (WebCore::Range::setEndBefore): Ditto.
610         (WebCore::Range::setEndAfter): Ditto.
611         (WebCore::Range::selectNode): Ditto.
612         (WebCore::Range::selectNodeContents): Ditto.
613         (WebCore::Range::surroundContents): Ditto.
614         (WebCore::Range::setStartBefore): Ditto.
615         (WebCore::Range::contains): Ditto. Except added code to handle exception
616         case to return false without asserting because I saw at least one crash
617         that seemed to imply this behavior was needed.
618         (WebCore::rangesOverlap): Ditto.
619         (WebCore::rangeOfContents): Ditto.
620         (WebCore::Range::expand): Ditto.
621         (WebCore::Range::getClientRects): Ditto.
622         (WebCore::Range::getBoundingClientRect): Ditto.
623         (WebCore::Range::borderAndTextQuads): Changed to use return value
624         instead of out argument, since it's a private function used only
625         within this class so it was easy to update all call sites.
626         (WebCore::Range::boundingRect): Updated for above. Also renamed since
627         there was no need for the name "internal" in this.
628         (WebCore::Range::absoluteBoundingRect): Ditto.
629         * dom/Range.h: Updated for above.
630         * dom/Range.idl: Use non-legacy exceptions. Also changed the default value
631         of the string argument to the expand function to the empty string rather
632         than "undefined", because the function silently does nothing when passed
633         any unrecognized string, and so this leaves behavior unchanged. I removed
634         the comment saying that the "undefined" default is wrong.
635
636         * editing/AlternativeTextController.cpp:
637         (WebCore::AlternativeTextController::applyAlternativeTextToRange): Updated
638         to use ExceptionOr but behave the same.
639         * editing/Editor.cpp:
640         (WebCore::Editor::advanceToNextMisspelling): Ditto.
641         (WebCore::Editor::markAndReplaceFor): Ditto.
642         (WebCore::isFrameInRange): Ditto. Also made a few style tweaks.
643         (WebCore::Editor::countMatchesForText): Ditto.
644         * editing/EditorCommand.cpp:
645         (WebCore::unionDOMRanges): Ditto.
646         * editing/FrameSelection.cpp:
647         (WebCore::FrameSelection::respondToNodeModification): Ditto.
648         * editing/InsertListCommand.cpp:
649         (WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
650         * editing/TextCheckingHelper.cpp:
651         (WebCore::TextCheckingParagraph::offsetTo): Ditto.
652         * editing/TextCheckingHelper.h: Updated for above and also deleted
653         unneeded private function checkingRange, which just churned the
654         reference count unnecessarily; instead use m_checkingRange directly.
655         * editing/TextIterator.cpp:
656         (WebCore::TextIterator::getLocationAndLengthFromRange): Ditto.
657         * editing/VisiblePosition.cpp:
658         (WebCore::setStart): Ditto.
659         (WebCore::setEnd): Ditto.
660         * editing/VisibleSelection.cpp:
661         (WebCore::makeSearchRange): Ditto.
662
663         * editing/VisibleUnits.cpp:
664         (WebCore::suffixLengthForRange): Changed argument from RefPtr to
665         a reference.
666         (WebCore::prefixLengthForRange): Ditto.
667         (WebCore::previousBoundary): Updated for ExceptionOr and the change
668         above.
669         (WebCore::nextBoundary): Ditto.
670         * editing/VisibleUnits.h: Updated for above.
671
672         * editing/htmlediting.cpp:
673         (WebCore::comparePositions): Updated to use ExceptionOr but behave
674         the same.
675         (WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
676         (WebCore::isNodeVisiblyContainedWithin): Ditto.
677         * editing/ios/EditorIOS.mm:
678         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
679         (WebCore::Editor::setTextAsChildOfElement): Ditto.
680         * editing/mac/EditorMac.mm:
681         (WebCore::Editor::adjustedSelectionRange): Ditto.
682         * editing/markup.cpp:
683         (WebCore::createMarkupInternal): Ditto.
684         * page/ContextMenuController.cpp:
685         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
686         * page/DOMSelection.cpp:
687         (WebCore::DOMSelection::addRange): Ditto.
688         (WebCore::DOMSelection::deleteFromDocument): Ditto.
689         (WebCore::DOMSelection::containsNode): Ditto.
690
691         * page/EventHandler.cpp:
692         (WebCore::EventHandler::dispatchMouseEvent): Updated for change to
693         use ExceptionOr in Ragne::compareNode. Also refactored the function
694         to make the logic a little mroe straightforward and nest less of it
695         inside a loop.
696
697         * page/Page.cpp:
698         (WebCore::Page::findStringMatchingRanges): Updated for ExceptionOr
699         without changing behavior.
700         * page/TextIndicator.cpp:
701         (WebCore::hasNonInlineOrReplacedElements): Ditto.
702         * rendering/RenderNamedFlowThread.cpp:
703         (WebCore::RenderNamedFlowThread::getRanges): Ditto.
704
705 2016-11-09  Dave Hyatt  <hyatt@apple.com>
706
707         [CSS Parser] Fix grid layout parsing
708         https://bugs.webkit.org/show_bug.cgi?id=164489
709
710         Reviewed by Dean Jackson.
711
712         * css/CSSValueKeywords.in:
713         * css/parser/CSSPropertyParser.cpp:
714         (WebCore::consumeFitContent):
715         (WebCore::isGridTrackFixedSized):
716         (WebCore::consumeGridTrackSize):
717         (WebCore::consumeGridTrackRepeatFunction):
718         (WebCore::consumeGridTrackList):
719         (WebCore::isCustomIdentValue):
720         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
721         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
722         (WebCore::consumeImplicitGridAutoFlow):
723         (WebCore::CSSPropertyParser::consumeGridShorthand):
724
725 2016-11-09  Darin Adler  <darin@apple.com>
726
727         Move EventTarget from ExceptionCode to ExceptionOr
728         https://bugs.webkit.org/show_bug.cgi?id=164465
729
730         Reviewed by Youenn Fablet.
731
732         * Modules/indexeddb/IDBRequest.h: Added now-needed forward
733         class declarations.
734         * Modules/webaudio/AudioContext.h: Ditto.
735
736         * bindings/js/JSEventListener.cpp:
737         (WebCore::eventHandlerAttribute): Updated for name change of the
738         attributeEventListener function.
739         (WebCore::documentEventHandlerAttribute): Ditto.
740         * dom/Document.cpp:
741         (WebCore::Document::getWindowAttributeEventListener): Ditto.
742
743         * dom/EventTarget.cpp:
744         (WebCore::EventTarget::setAttributeEventListener): Updated for
745         name change.
746         (WebCore::EventTarget::attributeEventListener): Ditto.
747         (WebCore::EventTarget::dispatchEventForBindings): Use ExceptionOr.
748         (WebCore::legacyType): Use null instead of empty for no type, since
749         it's more efficient to check for null.
750         (WebCore::EventTarget::fireEventListeners): Check for null.
751         Also streamlined logic a little bit and removed a very old comment.
752         (WebCore::EventTarget::eventListeners): Renamed from getEventListeners.
753         * dom/EventTarget.h: Removed lots of unneeded declarations. Renamed
754         some functions to remove get prefix. Updated for above changes.
755         Moved one inline function out of the class header. Made the destructor
756         for EventTarget be inline to make the destructors for derived classes
757         slightly more efficient.
758         * dom/EventTarget.idl: Use non-legacy exception.
759
760         * dom/Node.cpp:
761         (WebCore::Node::didMoveToNewDocument): Updated for name change.
762         * editing/ReplaceSelectionCommand.cpp:
763         (WebCore::ReplacementFragment::ReplacementFragment): Ditto.
764
765         * inspector/InspectorCSSAgent.h: Added now-needed forward declaration.
766
767         * inspector/InspectorDOMAgent.cpp:
768         (WebCore::InspectorDOMAgent::getEventListeners): Updated for name change.
769
770         * inspector/InspectorInstrumentation.h: Added now-needed forward declaration.
771         * page/DOMWindow.h: Ditto.
772         * xml/XMLHttpRequest.h: Ditto.
773
774 2016-11-09  Daniel Bates  <dabates@apple.com>
775
776         Add test infrastructure and tests for existing HTTP 0.9 sandbox machinery
777         https://bugs.webkit.org/show_bug.cgi?id=164389
778         <rdar://problem/29101072>
779
780         Reviewed by Alex Christensen.
781
782         Add test infrastructure to support registering an arbitrary port as the default port
783         for a protocol. The behavior of various machinery, including the HTTP 0.9 machinery,
784         can be effected by whether the resource request was made using the default port for
785         the protocol. We expose window.internals.registerDefaultPortForProtocol() to allow
786         a test to override the default port associated with a protocol so as to support
787         testing these code paths using the existing port 8000 server started by run-webkit-httpd.
788         Without window.internals.registerDefaultPortForProtocol() we would need to teach
789         run-webkit-httpd to run a web server on port 80, which requires superuser privileges
790         (since it is a privileged port number) and is more likely to interfere with an
791         existing web server setup.
792
793         Tests: http/tests/security/http-0.9/default-port-plugin-blocked.html
794                http/tests/security/http-0.9/default-port-script-blocked.html
795                http/tests/security/http-0.9/iframe-blocked.html
796                http/tests/security/http-0.9/image-blocked.html
797                http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
798                http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
799                http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
800                http/tests/security/http-0.9/worker-connect-src-blocked.html
801                http/tests/security/http-0.9/worker-importScripts-blocked.html
802                http/tests/security/http-0.9/xhr-asynchronous-blocked.html
803
804         * platform/URL.cpp:
805         (WebCore::defaultPortForProtocolMapForTesting): Added.
806         (WebCore::registerDefaultPortForProtocolForTesting): Adds the specified (protocol, port) to the
807         mapping used for testing.
808         (WebCore::clearDefaultPortForProtocolMapForTesting): Clears the protocol to default port testing map.
809         We call this function from Internals::resetToConsistentState() so that the mapping is cleared between
810         test runs.
811         (WebCore::defaultPortForProtocol): Modified to check the protocol to default port map for testing
812         before consulting URLParser::defaultPortForProtocol().
813         * platform/URL.h:
814         * testing/Internals.cpp:
815         (WebCore::Internals::resetToConsistentState): Clear the default port mapping used for testing.
816         (WebCore::Internals::registerDefaultPortForProtocol): Added.
817         * testing/Internals.h:
818         * testing/Internals.idl: Added declaration for registerDefaultPortForProtocol().
819
820 2016-11-09  Sam Weinig  <sam@webkit.org>
821
822         [WebIDL] Add proper parsing for Promises
823         https://bugs.webkit.org/show_bug.cgi?id=164497
824
825         Reviewed by Tim Horton.
826
827         * bindings/scripts/IDLParser.pm:
828         (parseNonAnyType):
829         (parseStringType):
830         Require Promise types to declare the type they resolve to.
831         
832         * bindings/js/JSDOMPromise.h:
833         Allow DOMPromise to be be parameterized on void. Add an SFINAE guarded
834         overload of resolve that takes no arguments when in a DOMPromise<void>.
835
836         * Modules/applepay/ApplePaySession.idl:
837         * Modules/fetch/DOMWindowFetch.idl:
838         * Modules/fetch/FetchBody.idl:
839         * Modules/fetch/FetchResponse.idl:
840         * Modules/fetch/WorkerGlobalScopeFetch.idl:
841         * Modules/mediastream/MediaDevices.idl:
842         * Modules/mediastream/MediaStreamTrack.idl:
843         * Modules/mediastream/RTCPeerConnection.idl:
844         * Modules/mediastream/RTCRtpSender.idl:
845         * Modules/mediastream/RTCStatsReport.idl:
846         * Modules/streams/ReadableStream.idl:
847         * Modules/streams/ReadableStreamDefaultReader.idl:
848         * Modules/streams/ReadableStreamSource.idl:
849         * Modules/streams/WritableStream.idl:
850         * Modules/webaudio/AudioContext.idl:
851         * bindings/scripts/test/TestNode.idl:
852         * bindings/scripts/test/TestObj.idl:
853         * crypto/SubtleCrypto.idl:
854         * crypto/WebKitSubtleCrypto.idl:
855         * css/FontFace.idl:
856         * css/FontFaceSet.idl:
857         * dom/CustomElementRegistry.idl:
858         * html/HTMLMediaElement.idl:
859         Update IDLs to specify the resolve type of promise types.
860
861         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
862         (WebCore::MediaEndpointPeerConnection::replaceTrack):
863         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
864         * Modules/mediastream/MediaStreamTrack.cpp:
865         (WebCore::MediaStreamTrack::applyConstraints):
866         * Modules/mediastream/MediaStreamTrack.h:
867         * Modules/mediastream/PeerConnectionBackend.cpp:
868         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
869         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
870         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
871         * Modules/mediastream/PeerConnectionBackend.h:
872         * Modules/streams/ReadableStreamSource.h:
873         (WebCore::ReadableStreamSource::start):
874         (WebCore::ReadableStreamSource::pull):
875         (WebCore::ReadableStreamSource::startFinished):
876         (WebCore::ReadableStreamSource::pullFinished):
877         * Modules/webaudio/AudioContext.cpp:
878         (WebCore::AudioContext::addReaction):
879         (WebCore::AudioContext::setState):
880         (WebCore::AudioContext::suspend):
881         (WebCore::AudioContext::resume):
882         (WebCore::AudioContext::close):
883         * Modules/webaudio/AudioContext.h:
884         * html/HTMLMediaElement.cpp:
885         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
886         (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
887         (WebCore::HTMLMediaElement::play):
888         * html/HTMLMediaElement.h:
889         Update implementations to use DOMPromise<void> rather than DOMPromise<nullptr_t>
890         and use the new resolve() overload.
891
892 2016-11-07  Brady Eidson  <beidson@apple.com>
893
894         Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&
895
896         Rubberstamped by Alex Christensen.
897
898         No new tests (No behavior change).
899
900         * Modules/indexeddb/IDBObjectStore.cpp:
901         (WebCore::IDBObjectStore::IDBObjectStore):
902         (WebCore::IDBObjectStore::~IDBObjectStore):
903         (WebCore::IDBObjectStore::hasPendingActivity):
904         (WebCore::IDBObjectStore::name):
905         (WebCore::IDBObjectStore::setName):
906         (WebCore::IDBObjectStore::keyPath):
907         (WebCore::IDBObjectStore::indexNames):
908         (WebCore::IDBObjectStore::transaction):
909         (WebCore::IDBObjectStore::autoIncrement):
910         (WebCore::IDBObjectStore::openCursor):
911         (WebCore::IDBObjectStore::openKeyCursor):
912         (WebCore::IDBObjectStore::get):
913         (WebCore::IDBObjectStore::putOrAdd):
914         (WebCore::IDBObjectStore::doDelete):
915         (WebCore::IDBObjectStore::clear):
916         (WebCore::IDBObjectStore::createIndex):
917         (WebCore::IDBObjectStore::index):
918         (WebCore::IDBObjectStore::deleteIndex):
919         (WebCore::IDBObjectStore::doCount):
920         (WebCore::IDBObjectStore::getAll):
921         (WebCore::IDBObjectStore::getAllKeys):
922         (WebCore::IDBObjectStore::markAsDeleted):
923         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
924         (WebCore::IDBObjectStore::ref):
925         (WebCore::IDBObjectStore::deref):
926         * Modules/indexeddb/IDBObjectStore.h:
927
928 2016-11-09  Zalan Bujtas  <zalan@apple.com>
929
930         Move RenderNamedFlowThread nextRendererForElement logic to RenderTreeUpdater.
931         https://bugs.webkit.org/show_bug.cgi?id=164503
932
933         Reviewed by Antti Koivisto.
934
935         When we insert a renderer into the render tree, we need to know both its parent
936         and its next sibling. Normally the parent and the sibling are based on the DOM, but
937         when this renderer is part of a flow thread, its insertion sibling is not necessarily the DOM sibling.
938         To find the correct sibling, we call RenderNamedFlowThread's nextRendererForElement().
939         RenderNamedFlowThread keeps track of its children so that it can compute the next sibling
940         for the insertion point.
941
942         This patch eliminates the need for keeping track of the child renderers of each
943         flow by moving the 'next sibling' logic to RenderTreePosition.
944
945         No change in functionality.
946
947         * rendering/RenderElement.cpp:
948         (WebCore::RenderElement::insertedIntoTree):
949         (WebCore::RenderElement::willBeDestroyed):
950         (WebCore::RenderElement::removeFromRenderFlowThread):
951         (WebCore::RenderElement::renderNamedFlowThreadWrapper): Deleted.
952         * rendering/RenderElement.h:
953         * rendering/RenderNamedFlowThread.cpp:
954         (WebCore::RenderNamedFlowThread::nextRendererForElement): Deleted.
955         (WebCore::RenderNamedFlowThread::addFlowChild): Deleted.
956         (WebCore::RenderNamedFlowThread::removeFlowChild): Deleted.
957         * rendering/RenderNamedFlowThread.h:
958         * style/RenderTreePosition.cpp:
959         (WebCore::RenderTreePosition::previousSiblingRenderer):
960         (WebCore::RenderTreePosition::flowThreadInsertionContext):
961         * style/RenderTreePosition.h:
962         (WebCore::RenderTreePosition::RenderTreePosition):
963         (WebCore::RenderTreePosition::parent):
964         * style/RenderTreeUpdater.cpp:
965         (WebCore::registerElementForFlowThreadIfNeeded): We need to registed the element even when it does not create renderer (display: none).
966         (WebCore::RenderTreeUpdater::createRenderer):
967         (WebCore::moveToFlowThreadIfNeeded): Deleted.
968
969 2016-11-09  Per Arne Vollan  <pvollan@apple.com>
970
971         [Win][Direct2D] Incomplete image decoding.
972         https://bugs.webkit.org/show_bug.cgi?id=164511
973
974         Reviewed by Darin Adler.
975
976         Create native decoder when all image data has been received.
977
978         * platform/graphics/win/ImageDecoderDirect2D.cpp:
979         (WebCore::ImageDecoder::setData):
980
981 2016-11-09  Beth Dakin  <bdakin@apple.com>
982
983         Attempted build fix.
984
985         * platform/spi/cocoa/AVKitSPI.h:
986
987 2016-11-09  Brady Eidson  <beidson@apple.com>
988
989         IndexedDB 2.0: Clean up more transaction abort behavior, including tweaks to Index/ObjectStore lifetime.
990         https://bugs.webkit.org/show_bug.cgi?id=164466
991
992         Reviewed by Alex Christensen.
993
994         No new tests (Covered by existing tests that now pass).
995         
996         Previously, IDBIndex ref/deref didn't track a traditional ref count but instead kept the owning object store alive.
997         Now, IDBObjectStore ref/deref do the same thing for the owning transaction.
998         
999         Now when a version change transaction is rolled back, some object stores and indexes get pulled out of the "deleted"
1000         set and get promoted back up into the "referenced" set.
1001         
1002         Now deleted object stores/indexes are considered opaque roots, as live objects in the deleted state *can* get back
1003         to the owning objects.
1004
1005         * CMakeLists.txt:
1006         * WebCore.xcodeproj/project.pbxproj:
1007
1008         * Modules/indexeddb/IDBIndex.cpp:
1009         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
1010
1011         * Modules/indexeddb/IDBObjectStore.cpp:
1012         (WebCore::IDBObjectStore::IDBObjectStore):
1013         (WebCore::IDBObjectStore::indexNames):
1014         (WebCore::IDBObjectStore::transaction):
1015         (WebCore::IDBObjectStore::openCursor):
1016         (WebCore::IDBObjectStore::openKeyCursor):
1017         (WebCore::IDBObjectStore::deleteIndex):
1018         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
1019         (WebCore::IDBObjectStore::visitReferencedIndexes):
1020         (WebCore::IDBObjectStore::ref):
1021         (WebCore::IDBObjectStore::deref):
1022         (WebCore::IDBObjectStore::create): Deleted.
1023         * Modules/indexeddb/IDBObjectStore.h:
1024
1025         * Modules/indexeddb/IDBTransaction.cpp:
1026         (WebCore::IDBTransaction::objectStore):
1027         (WebCore::IDBTransaction::transitionedToFinishing):
1028         (WebCore::IDBTransaction::internalAbort):
1029         (WebCore::IDBTransaction::createObjectStore):
1030         (WebCore::IDBTransaction::deleteObjectStore):
1031         (WebCore::IDBTransaction::visitReferencedObjectStores):
1032         * Modules/indexeddb/IDBTransaction.h:
1033         * Modules/indexeddb/IDBTransaction.idl:
1034
1035         * bindings/js/JSIDBTransactionCustom.cpp: Added.
1036         (WebCore::JSIDBTransaction::visitAdditionalChildren):
1037
1038 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
1039
1040         Allow customization of TextStream-based logging for geometry types
1041         https://bugs.webkit.org/show_bug.cgi?id=164460
1042
1043         Reviewed by Zalan Bujtas.
1044
1045         TextStream-based logging was constrained by the requirement to maintain compatibility
1046         with DRT-style output, which includes cumbersome rect logging ("at (5,0) size 40x40")
1047         and dumping LayoutRects as IntRects.
1048         
1049         Add some formatting flags so that other TextStream clients (e.g. logging) can have
1050         more readable output, and opt into automatic FormatNumberRespectingIntegers behavior.
1051         
1052         TextStreams whose output appears in test results are given flags to avoid behavior
1053         changes, but in the longer term test results should be updated.
1054
1055         * html/canvas/CanvasRenderingContext2D.cpp:
1056         (WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
1057         * page/scrolling/ScrollingStateNode.cpp:
1058         (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
1059         * platform/graphics/FloatPoint.cpp:
1060         (WebCore::operator<<):
1061         * platform/graphics/FloatRect.cpp:
1062         (WebCore::operator<<):
1063         * platform/graphics/GraphicsLayer.cpp:
1064         (WebCore::GraphicsLayer::layerTreeAsText):
1065         * platform/graphics/IntRect.cpp:
1066         (WebCore::operator<<):
1067         * platform/graphics/LayoutPoint.cpp:
1068         (WebCore::operator<<):
1069         * platform/graphics/LayoutRect.cpp:
1070         (WebCore::operator<<):
1071         * platform/graphics/ca/GraphicsLayerCA.cpp:
1072         (WebCore::GraphicsLayerCA::replayDisplayListAsText):
1073         * platform/graphics/displaylists/DisplayList.cpp:
1074         (WebCore::DisplayList::DisplayList::asText):
1075         * platform/text/TextStream.cpp:
1076         (WebCore::TextStream::operator<<):
1077         * platform/text/TextStream.h:
1078         (WebCore::TextStream::TextStream):
1079         (WebCore::TextStream::formattingFlags):
1080         (WebCore::TextStream::setFormattingFlags):
1081         (WebCore::TextStream::hasFormattingFlag):
1082         (WebCore::TextStream::increaseIndent):
1083         (WebCore::TextStream::decreaseIndent):
1084         * rendering/RenderTreeAsText.cpp:
1085         (WebCore::externalRepresentation):
1086         (WebCore::counterValueForElement):
1087
1088 2016-11-09  Zalan Bujtas  <zalan@apple.com>
1089
1090         RenderFlowThread::flowThreadRelativeWillBeRemoved should take RenderObject& instead of RenderObject*
1091         https://bugs.webkit.org/show_bug.cgi?id=164543
1092
1093         Reviewed by Simon Fraser.
1094
1095         No change in functionality.
1096
1097         * rendering/RenderBlockFlow.cpp:
1098         (WebCore::RenderBlockFlow::removeChild):
1099         * rendering/RenderFlowThread.h:
1100         * rendering/RenderMultiColumnFlowThread.cpp:
1101         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
1102         (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
1103         * rendering/RenderMultiColumnFlowThread.h:
1104
1105 2016-11-09  Jer Noble  <jer.noble@apple.com>
1106
1107         REGRESSION (r208149): Media scrubber is not displayed in media controls
1108         https://bugs.webkit.org/show_bug.cgi?id=164514
1109
1110         Reviewed by Darin Adler.
1111
1112         Fixes broken Media Controls API tests.
1113
1114         Added a new PlatformMediaSessionType; need to add that same type to the TYPE_TRAITS section of 
1115         MediaElementSession.h so that is<> and downcast<> work correctly.
1116
1117         * html/MediaElementSession.h:
1118         (isType):
1119
1120 2016-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1121
1122         When editing IME, `compositionend` events should fire after input events
1123         https://bugs.webkit.org/show_bug.cgi?id=164324
1124         <rdar://problem/29050438>
1125
1126         Reviewed by Darin Adler.
1127
1128         Moves where we dispatch `compositionend` events to after applying editing commands that fire `beforeinput` or
1129         `input` events. Also augments existing layout tests to verify the change.
1130
1131         * editing/Editor.cpp:
1132         (WebCore::Editor::setComposition):
1133
1134 2016-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1135
1136         Setting foreground color when text is selected should fire an input event with color data
1137         https://bugs.webkit.org/show_bug.cgi?id=164241
1138         <rdar://problem/29032759>
1139
1140         Reviewed by Darin Adler.
1141
1142         Refactors Editor::applyStyle and Editor::applyParagraphStyle to handle beforeinput and input event dispatch.
1143         Instead of going through the ApplyStyleCommand to dispatch input events, override shouldDispatchInputEvents to
1144         return false. This strategy also has the effect of unifying the way input events are dispatched in applyStyle,
1145         in both codepaths where we computeAndSetTypingStyle and where we create and then apply a style command.
1146
1147         Test: fast/events/input-events-selection-forecolor-data.html
1148
1149         * editing/ApplyStyleCommand.h:
1150         * editing/Editor.cpp:
1151         (WebCore::inputEventDataForEditingStyleAndAction):
1152         (WebCore::Editor::applyStyle):
1153         (WebCore::Editor::applyParagraphStyle):
1154         (WebCore::Editor::computeAndSetTypingStyle):
1155
1156 2016-11-08  Dean Jackson  <dino@apple.com>
1157
1158         Rendering support for ExtendedColors
1159         https://bugs.webkit.org/show_bug.cgi?id=164443
1160         <rdar://problems/29123243>
1161
1162         Reviewed by Simon Fraser and Darin Adler.
1163
1164         Add support for rendering the new color() syntax, which
1165         ends up as an ExtendedColor.
1166
1167         In order to make rendering code a little more readable, I
1168         changed Color::hasAlpha to Color::isOpaque (since an alpha
1169         of 100% is still an alpha), and added a Color::isVisible
1170         helper (the color isn't completely transparent). These new
1171         helpers support ExtendedColor forms.
1172
1173         Support for painting gradients and blending between colors
1174         is still to come. I also added some FIXME comments
1175         to show other places that don't handle ExtendedColors yet.
1176
1177         Tests: css3/color/backgrounds-and-borders.html
1178                css3/color/box-shadows.html
1179                css3/color/canvas.html
1180                css3/color/composited-solid-backgrounds.html
1181                css3/color/text.html
1182
1183         * css/CSSGradientValue.cpp: Add some notes that this is broken.
1184         (WebCore::interpolate):
1185         (WebCore::CSSGradientValue::knownToBeOpaque):
1186
1187         * editing/EditingStyle.cpp: Use new Color helpers.
1188         (WebCore::isTransparentColorValue):
1189
1190         * editing/mac/EditorMac.mm: Use new Color helpers.
1191         (WebCore::Editor::fontAttributesForSelectionStart):
1192
1193         * html/ColorInputType.cpp: No need to use the Color class at all here.
1194         (WebCore::isValidSimpleColorString): Renamed from isValidColorString.
1195         (WebCore::ColorInputType::sanitizeValue):
1196         (WebCore::ColorInputType::typeMismatchFor):
1197         (WebCore::isValidColorString): Deleted.
1198
1199         * html/canvas/CanvasRenderingContext2D.cpp: New helpers.
1200         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
1201         (WebCore::CanvasRenderingContext2D::didDraw):
1202
1203         * page/FrameView.cpp: Ditto.
1204         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
1205         (WebCore::FrameView::hasOpaqueBackground):
1206         (WebCore::FrameView::setBaseBackgroundColor):
1207
1208         * platform/graphics/Color.cpp:
1209         (WebCore::differenceSquared): Support ExtendedColor, but also
1210         add a note to indicate that this method and its call sites
1211         should use floats.
1212         (WebCore::Color::serialized): New helper.
1213         (WebCore::Color::cssText): Ditto.
1214         (WebCore::Color::blend): Ditto.
1215         (WebCore::Color::blendWithWhite):
1216         (WebCore::Color::colorWithAlphaMultipliedBy): Implementation of new function.
1217         (WebCore::Color::colorWithAlpha): Ditto.
1218         (WebCore::Color::opaqueColor): New method to return an opaque version of the given color.
1219         (WebCore::blend):
1220         * platform/graphics/Color.h:
1221         (WebCore::Color::isOpaque): New helper that is !hasAlpha().
1222         (WebCore::Color::isVisible): New helper.
1223         (WebCore::Color::alphaAsFloat): Gets the alpha value as a float. This replaces
1224         a bunch of places that were calculating it manually each time. Meanwhile, we
1225         might consider always exposing the primaries as floats... or at least
1226         have that option.
1227         (WebCore::isBlackColor): New helper - it was used in a couple of places.
1228         (WebCore::isWhiteColor): Ditto.
1229         (WebCore::Color::hasAlpha): Deleted.
1230
1231         * platform/graphics/Gradient.cpp: Add FIXME.
1232         (WebCore::Gradient::addColorStop):
1233         * platform/graphics/Gradient.h:
1234
1235         * platform/graphics/GraphicsContext.cpp: Use new helpers.
1236         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
1237         * platform/graphics/GraphicsContext.h:
1238         (WebCore::GraphicsContext::hasVisibleShadow):
1239
1240         * platform/graphics/Image.cpp: Ditto.
1241         (WebCore::Image::fillWithSolidColor):
1242
1243         * platform/graphics/ShadowBlur.cpp: Ditto.
1244         (WebCore::ShadowBlur::updateShadowBlurValues):
1245
1246         * platform/graphics/ca/GraphicsLayerCA.cpp: Ditto.
1247         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
1248
1249         * platform/graphics/cg/GradientCG.cpp:
1250         (WebCore::Gradient::platformGradient): Add a FIXME to note that we can
1251         add ExtendedColor support simply by using CGColors, rather than fetching
1252         the components ourselves.
1253
1254         * platform/graphics/cg/GraphicsContextCG.cpp: New helpers.
1255         (WebCore::calculateDrawingMode):
1256
1257         * platform/graphics/cocoa/FontCascadeCocoa.mm: New helpers.
1258         (WebCore::FontCascade::drawGlyphs):
1259
1260         * platform/graphics/mac/ColorMac.mm: Use the new helpers and Color::hash().
1261         (WebCore::nsColor):
1262
1263         * platform/graphics/texmap/TextureMapperGL.cpp: New helpers.
1264         (WebCore::TextureMapperGL::drawBorder):
1265
1266         * rendering/BorderEdge.cpp: Ditto.
1267         (WebCore::BorderEdge::obscuresBackgroundEdge):
1268         (WebCore::BorderEdge::obscuresBackground):
1269
1270         * rendering/RenderBox.cpp: Ditto.
1271         (WebCore::RenderBox::getBackgroundPaintedExtent):
1272         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
1273         (WebCore::RenderBox::backgroundHasOpaqueTopLayer):
1274
1275         * rendering/RenderBoxModelObject.cpp: Ditto.
1276         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1277         (WebCore::colorNeedsAntiAliasAtCorner):
1278         (WebCore::willBeOverdrawn):
1279         (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
1280         (WebCore::RenderBoxModelObject::paintBorder):
1281         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
1282         (WebCore::RenderBoxModelObject::paintBoxShadow):
1283         * rendering/RenderElement.cpp:
1284         (WebCore::RenderElement::paintOutline):
1285         * rendering/RenderInline.cpp:
1286         (WebCore::RenderInline::paintOutline):
1287         * rendering/RenderLayerBacking.cpp:
1288         (WebCore::canCreateTiledImage):
1289         * rendering/RenderLayerCompositor.cpp:
1290         (WebCore::RenderLayerCompositor::viewHasTransparentBackground):
1291         * rendering/RenderMenuList.cpp:
1292         (RenderMenuList::getItemBackgroundColor):
1293         * rendering/RenderTheme.cpp:
1294         (WebCore::RenderTheme::disabledTextColor):
1295         * rendering/RenderView.cpp:
1296         (WebCore::RenderView::paintBoxDecorations):
1297         * rendering/TextDecorationPainter.cpp:
1298         (WebCore::TextDecorationPainter::paintTextDecoration):
1299         * rendering/TextPainter.cpp:
1300         (WebCore::TextPainter::paintTextWithShadows):
1301         * rendering/style/BorderValue.h:
1302         (WebCore::BorderValue::isTransparent):
1303         * rendering/style/RenderStyle.cpp:
1304         (WebCore::RenderStyle::visitedDependentColor):
1305         * rendering/style/RenderStyle.h:
1306         (WebCore::RenderStyle::hasBackground):
1307         * rendering/svg/RenderSVGResource.cpp:
1308         (WebCore::requestPaintingResource):
1309         * rendering/svg/SVGInlineTextBox.cpp:
1310         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1311
1312         * svg/SVGAnimatedColor.cpp: Add a FIXME to note this is broken.
1313         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
1314
1315 2016-11-09  Antoine Quint  <graouts@apple.com>
1316
1317         [Modern Media Controls] UI Library: StatusLabel
1318         https://bugs.webkit.org/show_bug.cgi?id=164544
1319         <rdar://problem/29179541>
1320
1321         Reviewed by Dean Jackson.
1322
1323         We add a new StatusLabel class to display a string of text in place of the TimeControl.
1324         A followup patch will add the logic to display "Error", "Loading" and "Live Broadcast"
1325         test under the right media state.
1326
1327         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html
1328                media/modern-media-controls/status-label/status-label.html
1329
1330         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
1331         (.media-controls.mac.inline .time-label,):
1332         (.media-controls.mac.inline .time-label): Deleted.
1333         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1334         (MacOSInlineMediaControls.prototype.layout):
1335         * Modules/modern-media-controls/controls/media-controls.js:
1336         (MediaControls.):
1337         * Modules/modern-media-controls/controls/status-label.css: Added.
1338         (.status-label):
1339         * Modules/modern-media-controls/controls/status-label.js: Added.
1340         (StatusLabel.prototype.get text):
1341         (StatusLabel.prototype.set text):
1342         (StatusLabel.prototype.commitProperty):
1343         * Modules/modern-media-controls/js-files:
1344         * WebCore.xcodeproj/project.pbxproj:
1345
1346 2016-11-09  Chris Dumez  <cdumez@apple.com>
1347
1348         [Mac] Stop using deprecated AppKit enumeration values
1349         https://bugs.webkit.org/show_bug.cgi?id=164494
1350
1351         Reviewed by Darin Adler.
1352
1353         Stop using deprecated AppKit enumeration values.
1354
1355         * editing/cocoa/HTMLConverter.mm:
1356         (HTMLConverter::computedAttributesForElement):
1357         (HTMLConverter::_processElement):
1358         (HTMLConverter::_addMarkersToList):
1359         * page/mac/EventHandlerMac.mm:
1360         (WebCore::EventHandler::keyEvent):
1361         (WebCore::lastEventIsMouseUp):
1362         (WebCore::EventHandler::passSubframeEventToSubframe):
1363         (WebCore::EventHandler::widgetDidHandleWheelEvent):
1364         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1365         * page/mac/TextIndicatorWindow.mm:
1366         (WebCore::TextIndicatorWindow::setTextIndicator):
1367         * platform/graphics/mac/IconMac.mm:
1368         (WebCore::Icon::paint):
1369         * platform/mac/CursorMac.mm:
1370         (WebCore::createCustomCursor):
1371         * platform/mac/DragImageMac.mm:
1372         (WebCore::dissolveDragImageToFraction):
1373         (WebCore::createDragImageFromImage):
1374         * platform/mac/EventLoopMac.mm:
1375         (WebCore::EventLoop::cycle):
1376         * platform/mac/PasteboardMac.mm:
1377         (WebCore::Pasteboard::setDragImage):
1378         * platform/mac/PlatformEventFactoryMac.mm:
1379         (WebCore::globalPointForEvent):
1380         (WebCore::pointForEvent):
1381         (WebCore::mouseButtonForEvent):
1382         (WebCore::mouseEventTypeForEvent):
1383         (WebCore::clickCountForEvent):
1384         (WebCore::isKeypadEvent):
1385         (WebCore::windowsKeyCodeForKeyEvent):
1386         (WebCore::isKeyUpEvent):
1387         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1388         * platform/mac/ScrollbarThemeMac.mm:
1389         (WebCore::scrollbarControlSizeToNSControlSize):
1390         * platform/mac/ThemeMac.mm:
1391         (-[WebCoreThemeView window]):
1392         (WebCore::controlSizeForFont):
1393         (WebCore::controlSizeFromPixelSize):
1394         (WebCore::setUpButtonCell):
1395         (WebCore::stepperControlSizeForFont):
1396         (WebCore::paintStepper):
1397         (WebCore::ThemeMac::minimumControlSize):
1398         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1399         (-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
1400         (-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
1401         (-[WebVideoFullscreenHUDWindowController init]):
1402         (-[WebVideoFullscreenHUDWindowController keyDown:]):
1403         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
1404         * platform/mac/WebWindowAnimation.mm:
1405         (WebWindowAnimationDurationFromDuration):
1406         * rendering/RenderThemeMac.mm:
1407         (WebCore::RenderThemeMac::updateCachedSystemFontDescription):
1408         (WebCore::RenderThemeMac::controlSizeForFont):
1409         (WebCore::RenderThemeMac::controlSizeForCell):
1410         (WebCore::RenderThemeMac::controlSizeForSystemFont):
1411         (WebCore::RenderThemeMac::paintProgressBar):
1412         (WebCore::RenderThemeMac::popupMenuSize):
1413         (WebCore::RenderThemeMac::sliderThumbHorizontal):
1414         (WebCore::RenderThemeMac::sliderThumbVertical):
1415
1416 2016-11-08  Antoine Quint  <graouts@apple.com>
1417
1418         [Modern Media Controls] UI Library: iOS inline controls
1419         https://bugs.webkit.org/show_bug.cgi?id=164513
1420         <rdar://problem/27989475>
1421
1422         Reviewed by Dean Jackson.
1423
1424         We introduce a new IOSInlineMediaControls class which can be used to instantiate media controls
1425         for inline playback on iOS.
1426
1427         Tests: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html
1428                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor.html
1429                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles.html
1430                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html
1431                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles.html
1432                media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls.html
1433
1434         * Modules/modern-media-controls/controls/ios-inline-media-controls.css: Added.
1435         (.media-controls.ios.inline > .controls-bar):
1436         (.media-controls.ios.inline .time-control):
1437         (.media-controls.ios.inline button):
1438         (.media-controls.ios.inline button:active):
1439         (.media-controls.ios.inline > .controls-bar button):
1440         (.media-controls.ios.inline .buttons-container.right):
1441         (.media-controls.ios.inline button.play-pause):
1442         (.media-controls.ios.inline button.skip-back):
1443         (.media-controls.ios.inline .scrubber.slider):
1444         (.media-controls.ios.inline button.airplay):
1445         (.media-controls.ios.inline button.pip):
1446         (.media-controls.ios.inline button.fullscreen):
1447         (.media-controls.ios.inline .time-label):
1448         (.media-controls.ios.inline .scrubber.slider > .fill):
1449         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
1450         * Modules/modern-media-controls/controls/ios-inline-media-controls.js: Added.
1451         (IOSInlineMediaControls.prototype.layout):
1452         (IOSInlineMediaControls):
1453         * Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Added.
1454         * Modules/modern-media-controls/js-files:
1455         * WebCore.xcodeproj/project.pbxproj:
1456
1457 2016-11-09  Beth Dakin  <bdakin@apple.com>
1458
1459         Support TouchBar in WebKit
1460         https://bugs.webkit.org/show_bug.cgi?id=164437
1461         -and corresponding-
1462         rdar://problem/28876524
1463
1464         Reviewed by Darin Adler.
1465
1466         * WebCore.xcodeproj/project.pbxproj:
1467         * platform/spi/cocoa/AVKitSPI.h:
1468         * platform/spi/cocoa/NSTouchBarSPI.h: Added.
1469         * platform/spi/mac/NSSpellCheckerSPI.h:
1470
1471 2016-11-09  Chris Dumez  <cdumez@apple.com>
1472
1473         Use Blob URL instead of webkit-fake-url when pasting an image
1474         https://bugs.webkit.org/show_bug.cgi?id=49141
1475
1476         Reviewed by Darin Adler.
1477
1478         Use Blob URL instead of webkit-fake-url when pasting an image.
1479
1480         Tests: editing/pasteboard/paste-image-as-blob-url.html
1481                editing/pasteboard/paste-image-using-image-data.html
1482
1483         * editing/Editor.h:
1484         * editing/mac/EditorMac.mm:
1485         (WebCore::Editor::WebContentReader::readImage):
1486         (WebCore::Editor::createFragmentForImageAndURL):
1487
1488 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1489
1490         Fix error message when SQLite initialization fails
1491         https://bugs.webkit.org/show_bug.cgi?id=164462
1492
1493         Reviewed by Darin Adler.
1494
1495         * platform/sql/SQLiteDatabase.cpp:
1496         (WebCore::initializeSQLiteIfNecessary):
1497
1498 2016-11-08  Antoine Quint  <graouts@apple.com>
1499
1500         [Modern Media Controls] UI Library: macOS fullscreen controls
1501         https://bugs.webkit.org/show_bug.cgi?id=164414
1502         <rdar://problem/27989474>
1503
1504         Reviewed by Dean Jackson.
1505
1506         We introduce a new MacOSFullscreenMediaControls class which can be used to instantiate media controls
1507         for fullscreen playback on macOS. These controls can be dragged by the user.
1508
1509         Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html
1510                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
1511                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html
1512                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html
1513                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-right-container-margin.html
1514                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html
1515                media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html
1516
1517         * Modules/modern-media-controls/controls/button.js:
1518         (Button.prototype.set enabled):
1519
1520             Correctly notify the layoutDelegate when the enabled property changes, regardless of whether
1521             the flag is on.
1522
1523         * Modules/modern-media-controls/controls/icon-button.js:
1524         (IconButton.prototype._updateImage):
1525         (IconButton):
1526
1527             Correctly notify the layout delegate when the image metrics have changed so that it may perform
1528             a layout. This issues became apparent with the new tests on Yosemite and caused some flakyness.
1529
1530         * Modules/modern-media-controls/controls/icon-service.js:
1531         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
1532         (const.iconService.new.IconService):
1533
1534             Fix a typo.
1535
1536         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: Added.
1537         (.media-controls.mac.fullscreen > .controls-bar):
1538         (.media-controls.mac.fullscreen .volume.slider):
1539         (.media-controls.mac.fullscreen .buttons-container):
1540         (.media-controls.mac.fullscreen .buttons-container.center):
1541         (.media-controls.mac.fullscreen > .controls-bar button):
1542         (.media-controls.mac.fullscreen button.rewind):
1543         (.media-controls.mac.fullscreen button.play-pause):
1544         (.media-controls.mac.fullscreen button.forward):
1545         (.media-controls.mac.fullscreen .buttons-container.right):
1546         (.media-controls.mac.fullscreen button.airplay):
1547         (.media-controls.mac.fullscreen button.aspect-ratio):
1548         (.media-controls.mac.fullscreen button.pip):
1549         (.media-controls.mac.fullscreen button.tracks):
1550         (.media-controls.mac.fullscreen button.fullscreen):
1551         (.media-controls.mac.fullscreen .time-control):
1552         (.media-controls.mac.fullscreen .time-label):
1553         (.media-controls.mac.fullscreen .scrubber):
1554         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: Added.
1555         (MacOSFullscreenMediaControls.prototype.layout):
1556         (MacOSFullscreenMediaControls):
1557         * Modules/modern-media-controls/controls/macos-media-controls.js:
1558         (MacOSMediaControls):
1559         
1560             Allow the layoutTraits property to be set to something other than just LayoutTraits.macOS
1561             so that MacOSFullscreenMediaControls may set the LayoutTraits.Fullscreen bit.
1562         
1563         * Modules/modern-media-controls/js-files:
1564         
1565             Add a reference to the new macos-fullscreen-media-controls.js file.
1566         
1567         * WebCore.xcodeproj/project.pbxproj:
1568
1569             Add references to the new macos-fullscreen-media-controls.js and
1570             macos-fullscreen-media-controls.css files.
1571
1572 2016-11-09  Chris Dumez  <cdumez@apple.com>
1573
1574         Shave 16 bytes off HTMLInputElement
1575         https://bugs.webkit.org/show_bug.cgi?id=164488
1576
1577         Reviewed by Sam Weinig.
1578
1579         Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
1580         better.
1581
1582         * html/HTMLFormControlElement.h:
1583         * html/HTMLTextFormControlElement.cpp:
1584         (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
1585         * html/HTMLTextFormControlElement.h:
1586
1587 2016-11-09  Youenn Fablet  <youenn@apple.com>
1588
1589         [WebRTC] Introduce asynchronous backend for other RTCPeerConnection API
1590         https://bugs.webkit.org/show_bug.cgi?id=164409
1591
1592         Reviewed by Eric Carlson.
1593
1594         Covered by existing tests.
1595
1596         Following on createOffer changes, applying the same changes to createAnswer, setLocalDescription, setRemoteDescription and addIceCandidate.
1597         Also refactored ICE candidate event generation (done at PeerConnectionBackend).
1598         Updated stop implementation to clean any promise that may be stored in PeerConnectionBackend.
1599
1600         The goal of this is to be more aligned with https://www.w3.org/TR/webrtc/.
1601         Implementation of the various functions such as //www.w3.org/TR/webrtc/#set-description would be done in PeerConnectionBackend.
1602         This will require additional code moved from MediaEndpointPeerConnection up to PeerConnectionBackend.
1603
1604         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1605         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1606         (WebCore::MediaEndpointPeerConnection::doCreateAnswer):
1607         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
1608         (WebCore::MediaEndpointPeerConnection::doSetLocalDescription):
1609         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1610         (WebCore::MediaEndpointPeerConnection::doSetRemoteDescription):
1611         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1612         (WebCore::MediaEndpointPeerConnection::doAddIceCandidate):
1613         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
1614         (WebCore::MediaEndpointPeerConnection::doStop):
1615         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1616         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
1617         (WebCore::MediaEndpointPeerConnection::createAnswer): Deleted.
1618         (WebCore::MediaEndpointPeerConnection::setLocalDescription): Deleted.
1619         (WebCore::MediaEndpointPeerConnection::setRemoteDescription): Deleted.
1620         (WebCore::MediaEndpointPeerConnection::addIceCandidate): Deleted.
1621         (WebCore::MediaEndpointPeerConnection::stop): Deleted.
1622         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState): Deleted.
1623         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState): Deleted.
1624         * Modules/mediastream/MediaEndpointPeerConnection.h:
1625         * Modules/mediastream/PeerConnectionBackend.cpp:
1626         (WebCore::PeerConnectionBackend::createOffer):
1627         (WebCore::PeerConnectionBackend::createOfferFailed):
1628         (WebCore::PeerConnectionBackend::createAnswer):
1629         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1630         (WebCore::PeerConnectionBackend::createAnswerFailed):
1631         (WebCore::isLocalDescriptionTypeValidForState):
1632         (WebCore::PeerConnectionBackend::setLocalDescription):
1633         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1634         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1635         (WebCore::isRemoteDescriptionTypeValidForState):
1636         (WebCore::PeerConnectionBackend::setRemoteDescription):
1637         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1638         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1639         (WebCore::PeerConnectionBackend::addIceCandidate):
1640         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1641         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1642         (WebCore::PeerConnectionBackend::fireICECandidateEvent):
1643         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
1644         (WebCore::PeerConnectionBackend::stop):
1645         * Modules/mediastream/PeerConnectionBackend.h:
1646
1647 2016-11-09  Eric Carlson  <eric.carlson@apple.com>
1648
1649         [MediaStream][Mac] Mark captured video frames as ready for display immediately
1650         https://bugs.webkit.org/show_bug.cgi?id=164482
1651         <rdar://problem/29139073>
1652
1653         Reviewed by Jer Noble.
1654
1655         * platform/cf/CoreMediaSoftLink.cpp: Add new constant.
1656         * platform/cf/CoreMediaSoftLink.h:
1657
1658         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1659         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1660         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForMediaData):
1661           New, ask register for a callback when the sample buffer display layer is ready
1662           for more media data.
1663         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer): Don't change
1664           the sample timestamps, assume the caller has configured the sample correctly.
1665         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack): Don't
1666           drop frames when the display layer isn't ready.
1667         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Call stopRequestingMediaData.
1668         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
1669         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Deleted.
1670
1671         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1672         (WebCore::AVVideoCaptureSource::setupCaptureSession): Tell the video output to always discard
1673           late video frames, we don't need them.
1674         (WebCore::AVVideoCaptureSource::processNewFrame): Add a kCMSampleAttachmentKey_DisplayImmediately
1675           attachment.
1676
1677 2016-11-09  Joanmarie Diggs  <jdiggs@igalia.com>
1678
1679         AX: [ATK] Wrong selected element at a given index in a list box (redux)
1680         https://bugs.webkit.org/show_bug.cgi?id=164430
1681
1682         Reviewed by Darin Adler.
1683
1684         This essentially undoes the implementation change resulting from r164577.
1685         As stated in the ATK documentation, atk_selection_ref_selection() takes
1686         "a gint specifying the index in the selection set. (e.g. the ith selection
1687         as opposed to the ith child)." r164577 deliberately modified that, causing
1688         atk_selection_ref_selection() to treat the index as if it were the position
1689         with respect to all of the children. There is different API in ATK, namely
1690         atk_object_ref_accessible_child(), when the ith child from the set of all
1691         children is sought.
1692
1693         Tests: accessibility/aria-listbox-no-selection.html
1694                accessibility/native-listbox-no-selection.html
1695
1696         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1697         (optionFromSelection):
1698
1699 2016-11-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1700
1701         [EFL] Use libgcrypt instead of GnuTLS for CryptoDigest
1702         https://bugs.webkit.org/show_bug.cgi?id=164461
1703
1704         Reviewed by Michael Catanzaro.
1705
1706         As GTK port in r208297, EFL port starts to use libgcrypt instead of GnuTLS as well.
1707
1708         No new tests, no behavior change.
1709
1710         * PlatformEfl.cmake:
1711
1712 2016-11-09  Ryan Haddad  <ryanhaddad@apple.com>
1713
1714         Unreviewed, rolling out r208422.
1715
1716         Roll r208382 back in since it was not responsible for the API
1717         test failures seen on macOS.
1718
1719         Reverted changeset:
1720
1721         "Unreviewed, rolling out r208382."
1722         https://bugs.webkit.org/show_bug.cgi?id=164319
1723         http://trac.webkit.org/changeset/208422
1724
1725 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
1726
1727         One more URTBF after r208361.
1728
1729         * PlatformMac.cmake:
1730
1731 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
1732
1733         Typo fix after r162782
1734         https://bugs.webkit.org/show_bug.cgi?id=164473
1735
1736         Unreviewed trivial fix.
1737
1738         * platform/ThreadGlobalData.cpp:
1739
1740 2016-11-07  Ryan Haddad  <ryanhaddad@apple.com>
1741
1742         Unreviewed, rolling out r208382.
1743
1744         This change appears to have caused 3
1745         SerializedCryptoKeyWrapTest API tests to fail on macOS.
1746
1747         Reverted changeset:
1748
1749         "[Readable Streams API] Implement ByteStreamController
1750         error()"
1751         https://bugs.webkit.org/show_bug.cgi?id=164319
1752         http://trac.webkit.org/changeset/208382
1753
1754 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
1755
1756         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
1757         https://bugs.webkit.org/show_bug.cgi?id=152045
1758
1759         Reviewed by Andy Estes.
1760
1761         No new layout tests because no new behavior. The new WTF time classes have some unit tests
1762         in TestWebKitAPI.
1763
1764         * fileapi/ThreadableBlobRegistry.cpp:
1765         (WebCore::ThreadableBlobRegistry::blobSize):
1766         * platform/MainThreadSharedTimer.h:
1767         * platform/SharedTimer.h:
1768         * platform/ThreadTimers.cpp:
1769         (WebCore::ThreadTimers::updateSharedTimer):
1770         * platform/cf/MainThreadSharedTimerCF.cpp:
1771         (WebCore::MainThreadSharedTimer::setFireInterval):
1772         * platform/efl/MainThreadSharedTimerEfl.cpp:
1773         (WebCore::MainThreadSharedTimer::setFireInterval):
1774         * platform/glib/MainThreadSharedTimerGLib.cpp:
1775         (WebCore::MainThreadSharedTimer::setFireInterval):
1776         * platform/win/MainThreadSharedTimerWin.cpp:
1777         (WebCore::MainThreadSharedTimer::setFireInterval):
1778         * workers/WorkerRunLoop.cpp:
1779         (WebCore::WorkerRunLoop::runInMode):
1780
1781 2016-11-04  Zalan Bujtas  <zalan@apple.com>
1782
1783         RenderFlowThread state reset cleanup.
1784         https://bugs.webkit.org/show_bug.cgi?id=164426
1785
1786         Reviewed by Simon Fraser.
1787
1788         RenderFlowThread state reset is spread across several functions. This patch groups them
1789         together in RenderObject::resetFlowThreadState().
1790
1791         No change in functionality.
1792
1793         * rendering/RenderBlock.cpp:
1794         (WebCore::RenderBlock::removeLeftoverAnonymousBlock):
1795         (WebCore::RenderBlock::dropAnonymousBoxChild): This is now part of resetFlowThreadState() since resetFlowThreadState
1796         gets called even when NotifyChildren is false.
1797         * rendering/RenderElement.cpp:
1798         (WebCore::RenderElement::insertChildInternal): Initialize the thread state before we notify the child.
1799         (WebCore::RenderElement::removeChildInternal): Reset the state even when NotifyChildren is false.
1800         (WebCore::RenderElement::willBeRemovedFromTree): This code is moved to removeFromRenderFlowThread().
1801         (WebCore::RenderElement::removeFromRenderFlowThread):
1802         * rendering/RenderObject.cpp:
1803         (WebCore::RenderObject::initializeFlowThreadState): This is in transition for webkit.org/b/164428 (RenderFlowThread state initialization cleanup.)
1804         (WebCore::RenderObject::resetFlowThreadState):
1805         (WebCore::RenderObject::setParent): This was seemingly a random place to put flow state initialization. 
1806         (WebCore::RenderObject::willBeRemovedFromTree): resetFlowThreadState() takes care of it now.
1807         * rendering/RenderObject.h:
1808
1809 2016-11-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1810
1811         [DOMJIT] Add DOMJIT::Signature annotation to Document::getElementById
1812         https://bugs.webkit.org/show_bug.cgi?id=164356
1813
1814         Reviewed by Filip Pizlo.
1815
1816         This patch implements DOMJIT::Signature annotation for getElementById.
1817         Since getElementById is also implemented in DocumentFragment, we implement
1818         the branchIfDocumentFragment/branchIfNotDocumentFragment for that.
1819
1820         In dromaeo, we have a test like this.
1821
1822         test( "getElementById", function(){
1823             for ( var i = 0; i < num * 30; i++ ) {
1824                 ret = document.getElementById("testA" + num).nodeType;
1825                 ret = document.getElementById("testB" + num).nodeType;
1826                 ret = document.getElementById("testC" + num).nodeType;
1827                 ret = document.getElementById("testD" + num).nodeType;
1828                 ret = document.getElementById("testE" + num).nodeType;
1829                 ret = document.getElementById("testF" + num).nodeType;
1830             }
1831         });
1832
1833         In the above test, JSC already knows the following things.
1834
1835         1. Since nodeType is now handled as CallDOMGetter, we know that it is pure.
1836         2. getElementById look up becomes PureGetById since document is impure object. But it is kept as PureGetById. So it does not write DOMState.
1837         3. `"testA" + num` will be converted to constant string.
1838         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.
1839         5. CheckCell leading CallDOM ensures the inlined getElementById node. (CallDOM node).
1840
1841         The key thing is that no node clobbers DOMState during the loop. So CallDOM & CallDOMGetter can be hoisted.
1842         This improves dom-query significantly. Dromaeo dom-query getElementById becomes 40x faster (247796 v.s. 6197).
1843         Dromaeo dom-query getElementById (not in document) becomes 89x faster (630317.8 v.s. 7066.).
1844
1845         Tests: js/dom/domjit-function-get-element-by-id-changed.html
1846                js/dom/domjit-function-get-element-by-id-licm.html
1847                js/dom/domjit-function-get-element-by-id.html
1848
1849         * dom/NonElementParentNode.idl:
1850         * domjit/DOMJITCheckDOM.h:
1851         (WebCore::DOMJIT::TypeChecker<DocumentFragment>::branchIfFail):
1852         * domjit/DOMJITHelpers.h:
1853         (WebCore::DOMJIT::branchIfDocumentFragment):
1854         (WebCore::DOMJIT::branchIfNotDocumentFragment):
1855
1856 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
1857
1858         Rename unscaledUnobscuredVisibleContentSize and unscaledVisibleContentSizeIncludingObscuredArea for attempted clarity
1859         https://bugs.webkit.org/show_bug.cgi?id=164438
1860
1861         Reviewed by Tim Horton.
1862
1863         unscaledUnobscuredVisibleContentSize() and unscaledVisibleContentSizeIncludingObscuredArea() were an endless source
1864         of confusion.
1865         
1866         Functions with "VisibleContent" in the name are usually expected to return document coordinates (affected by zooming),
1867         so unscaledUnobscuredVisibleContentSize caused cognitive dissonance because of "unscaled" vs "visibleContent", and
1868         "unobscured" vs "visible".
1869         
1870         So rename:
1871             unscaledUnobscuredVisibleContentSize -> sizeForUnobscuredContent
1872             unscaledVisibleContentSizeIncludingObscuredArea -> sizeForVisibleContent
1873         
1874         sizeForUnobscuredContent() can also be private to ScrollView.
1875
1876         * inspector/InspectorOverlay.cpp:
1877         (WebCore::InspectorOverlay::update):
1878         * platform/ScrollView.cpp:
1879         (WebCore::ScrollView::unobscuredContentRectInternal):
1880         (WebCore::ScrollView::sizeForVisibleContent):
1881         (WebCore::ScrollView::sizeForUnobscuredContent): Don't compute unscaledVisibleContentSizeIncludingObscuredArea
1882         before testing whether we have a platform widget.
1883         (WebCore::ScrollView::layoutSize):
1884         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Deleted.
1885         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Deleted.
1886         * platform/ScrollView.h:
1887         * rendering/RenderBoxModelObject.cpp:
1888         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1889         * rendering/RenderLayerCompositor.cpp:
1890         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1891         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1892         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1893         (WebCore::RenderLayerCompositor::ensureRootLayer):
1894
1895 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
1896
1897         Layout viewport wrong with RTL documents
1898         https://bugs.webkit.org/show_bug.cgi?id=164434
1899
1900         Reviewed by Tim Horton.
1901
1902         The layoutViewportRect was computed incorrectly in RTL documents, because 
1903         FrameView::unscaledMaximumScrollPosition() was wrong; it erroneously mapped
1904         what it thought was a scrollOffset to a scrollPosition.
1905
1906         Unscaled scroll positions are in the same coordinate space as unscaledDocumentRect,
1907         so we should not call scrollPositionFromOffset() in FrameView::unscaledMaximumScrollPosition().
1908
1909         Changed FrameView::unscaledMinimumScrollPosition() to also just grab the location of
1910         unscaledDocumentRect, for symmetry.
1911
1912         Finally fixed the tiled scrolling indicator's viewport rect for zoomed RTL documents
1913         by using the unscaled scroll origin.
1914
1915         Tests: fast/visual-viewport/rtl-nonzoomed-rects.html
1916                fast/visual-viewport/rtl-zoomed-rects.html
1917
1918         * page/FrameView.cpp:
1919         (WebCore::FrameView::setLayoutViewportOrigin):
1920         (WebCore::FrameView::unscaledScrollOrigin):
1921         (WebCore::FrameView::unscaledMinimumScrollPosition):
1922         (WebCore::FrameView::unscaledMaximumScrollPosition):
1923         * page/FrameView.h:
1924
1925 2016-11-04  Sam Weinig  <sam@webkit.org>
1926
1927         [WebIDL] Add support for modern callback syntax
1928         https://bugs.webkit.org/show_bug.cgi?id=164435
1929
1930         Reviewed by Chris Dumez.
1931
1932         Support new callback syntax:
1933             callback Function = void (DOMString arg1, long arg2);
1934
1935         This replaces "callback interface" types with a Callback=FunctionOnly
1936         extended attribute.
1937
1938         * Modules/geolocation/PositionCallback.idl:
1939         * Modules/geolocation/PositionErrorCallback.idl:
1940         * Modules/notifications/NotificationPermissionCallback.idl:
1941         * Modules/quota/StorageErrorCallback.idl:
1942         * Modules/quota/StorageQuotaCallback.idl:
1943         * Modules/quota/StorageUsageCallback.idl:
1944         * Modules/webaudio/AudioBufferCallback.idl:
1945         * Modules/webdatabase/DatabaseCallback.idl:
1946         * Modules/webdatabase/SQLStatementCallback.idl:
1947         * Modules/webdatabase/SQLStatementErrorCallback.idl:
1948         * Modules/webdatabase/SQLTransactionCallback.idl:
1949         * Modules/webdatabase/SQLTransactionErrorCallback.idl:
1950         * dom/RequestAnimationFrameCallback.idl:
1951         * dom/StringCallback.idl:
1952         * html/VoidCallback.idl:
1953         * page/IntersectionObserverCallback.idl:
1954         * css/MediaQueryListListener.idl:
1955         Update to new syntax.
1956
1957         * css/MediaQueryListListener.h:
1958         * css/MediaQueryMatcher.cpp:
1959         (WebCore::MediaQueryMatcher::styleResolverChanged):
1960         Switch to using the now required 'handleEvent' name. This is an implementation detail
1961         that we should change.
1962
1963         * bindings/scripts/CodeGenerator.pm:
1964         Update document processing to allow a callback only file. Update callback
1965         type checks to look for a regex that matches in the new format.
1966
1967         * bindings/scripts/CodeGeneratorJS.pm:
1968         (AddToImplIncludesForIDLType):
1969         (AddToIncludesForIDLType):
1970         (AddToImplIncludes):
1971         (AddToIncludes):
1972         Abstract includes functions to allow passing in an include hash.
1973
1974         (GenerateCallbackFunctionHeader):
1975         (GenerateCallbackFunctionImplementation):
1976         (GenerateCallbackInterfaceHeader):
1977         (GenerateCallbackInterfaceImplementation):
1978         (GenerateCallbackHeaderContent):
1979         (GenerateCallbackImplementationContent):
1980         Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
1981         to allow using it for both the new callbacks as well as the old callback interfaces.
1982
1983         * bindings/scripts/IDLParser.pm:
1984         (Parse):
1985         (applyTypedefs):
1986         (applyTypedefsToOperation):
1987         (parseCallbackRest):
1988         Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
1989
1990         * bindings/scripts/IDLAttributes.txt:
1991         Remove support for Callback=FunctionOnly.
1992
1993         * bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
1994         * bindings/scripts/test/JS/JSTestCallback.h: Removed.
1995         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1996         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
1997         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
1998         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
1999         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
2000         * bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
2001         * bindings/scripts/test/JS/JSTestObj.cpp:
2002         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2003         * bindings/scripts/test/TestCallback.idl: Removed.
2004         * bindings/scripts/test/TestCallbackFunction.idl:
2005         * bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
2006         * bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
2007         * bindings/scripts/test/TestObj.idl:
2008         * bindings/scripts/test/TestTypedefs.idl:
2009         Update existing tests and add new ones to test callback functions specifically.
2010
2011 2016-11-04  Alex Christensen  <achristensen@webkit.org>
2012
2013         Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
2014         https://bugs.webkit.org/show_bug.cgi?id=164439
2015
2016         Reviewed by Daniel Bates.
2017
2018         No change in behaviour.
2019
2020         * platform/URL.cpp:
2021         (WebCore::defaultPortForProtocol):
2022         (WebCore::isDefaultPortForProtocol):
2023         * platform/URLParser.cpp:
2024         (WebCore::URLParser::defaultPortForProtocol):
2025         (WebCore::URLParser::parsePort):
2026         (WebCore::defaultPortForProtocol): Deleted.
2027         (WebCore::isDefaultPortForProtocol): Deleted.
2028         * platform/URLParser.h:
2029
2030 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2031
2032         Safari does not emit composition end if blurred for dead key / Japanese IME
2033         https://bugs.webkit.org/show_bug.cgi?id=164369
2034         <rdar://problem/29050439>
2035
2036         Reviewed by Ryosuke Niwa.
2037
2038         On Mac, _before_ changing selection, try to finalize the composition by calling Editor::cancelComposition early.
2039         This is because the focused element may have changed after performing the selection change, so we would
2040         otherwise be dispatching the `compositionend` to the new focused element (or no compositionend at all) instead
2041         of the element with the composition.
2042
2043         Doing this allows us to match Chrome and Firefox behavior. After canceling the composition, we then need to also
2044         clear the system IME state. We do this on Mac WK1/WK2 through the cancelComposition() codepath, which ends up
2045         calling into -discardMarkedText, which resets the marked text state. Some minor refactoring was performed to
2046         accomplish this -- currently, discardedComposition sends a CompositionWasCanceled message over to the UI process
2047         that discards the marked text, and then updates the editor state. This patch splits this into two separate
2048         steps -- see the WebKit2 ChangeLog for more details.
2049
2050         Test: fast/events/ime-compositionend-on-selection-change.html
2051
2052         * editing/Editor.cpp:
2053         (WebCore::Editor::selectionWillChange):
2054         * editing/Editor.h:
2055         * editing/FrameSelection.cpp:
2056         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2057         * editing/mac/EditorMac.mm:
2058         (WebCore::Editor::selectionWillChange):
2059         * loader/EmptyClients.h:
2060         * page/EditorClient.h:
2061
2062 2016-11-04  Brady Eidson  <beidson@apple.com>
2063
2064         IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
2065         https://bugs.webkit.org/show_bug.cgi?id=164424
2066
2067         Reviewed by Alex Christensen.
2068
2069         No new tests (Covered by existing tests).
2070
2071         This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
2072         spec in flux/under discussion.
2073
2074         We'll update either source or the tests as things are resolved.
2075
2076         * Modules/indexeddb/IDBIndex.cpp:
2077         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
2078
2079         * Modules/indexeddb/IDBObjectStore.cpp:
2080         (WebCore::IDBObjectStore::get):
2081         (WebCore::IDBObjectStore::putOrAdd):
2082         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2083
2084 2016-11-04  Ryosuke Niwa  <rniwa@webkit.org>
2085
2086         Load stylesheets in link elements inside a connected shadow tree
2087         https://bugs.webkit.org/show_bug.cgi?id=160683
2088         <rdar://problem/29040652>
2089
2090         Reviewed by Antti Koivisto.
2091
2092         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
2093         when it's connected to a document instead of always talking to document's style scope.
2094
2095         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
2096                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
2097
2098        * html/HTMLLinkElement.cpp:
2099        (WebCore::HTMLLinkElement::HTMLLinkElement):
2100        (WebCore::HTMLLinkElement::~HTMLLinkElement):
2101        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
2102        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
2103        early when inDocument() is false.
2104        (WebCore::HTMLLinkElement::parseAttribute):
2105        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
2106        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
2107        a document instead of whenever its self-inclusive ancestor is inserted into a container.
2108        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
2109        calling removePendingSheet since the latter depends on m_styleScope being not null.
2110        (WebCore::HTMLLinkElement::addPendingSheet):
2111        (WebCore::HTMLLinkElement::removePendingSheet):
2112        * html/HTMLLinkElement.h:
2113        * html/HTMLStyleElement.cpp:
2114        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
2115        element has just become connected to a document.
2116        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
2117        * style/StyleScope.h:
2118        * svg/SVGStyleElement.cpp:
2119        (WebCore::SVGStyleElement::insertedInto): Ditto.
2120        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2121
2122 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2123
2124         Add a setting and preferences to enable/disable async image decoding
2125         https://bugs.webkit.org/show_bug.cgi?id=164417
2126
2127         Reviewed by Simon Fraser.
2128
2129         Add an asyncImageDecodingEnabled setting. This setting controls whether an
2130         image "can" be asynchronously decoded on a separate thread or not. The
2131         function ImageSource::isAsyncDecodingRequired() will be used in conjunction
2132         with this setting to decide whether an image "should" be asynchronously
2133         decoded or not.
2134
2135         * page/Settings.in:
2136
2137 2016-11-04  Tim Horton  <timothy_horton@apple.com>
2138
2139         Apply post-landing review comments for r208347
2140
2141         * dom/Element.cpp:
2142         (WebCore::Element::findAnchorElementForLink):
2143         Use attributeWithoutSynchronization.
2144
2145         * page/PrintContext.cpp:
2146         (WebCore::PrintContext::spoolPage):
2147         (WebCore::PrintContext::spoolRect):
2148         (WebCore::PrintContext::collectLinkedDestinations):
2149         (WebCore::PrintContext::outputLinkedDestinations):
2150         * page/PrintContext.h:
2151         Pass Document by reference instead of Node by pointer,
2152         use ElementTraversal instead of NodeTraversal to avoid
2153         having to locally check the type, and null-check renderers.
2154
2155 2016-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
2156
2157         Implement WebGL2RenderingContext::copyBufferSubData()
2158         https://bugs.webkit.org/show_bug.cgi?id=164008
2159
2160         Reviewed by Dean Jackson.
2161
2162         Similar to previous work regarding WebGL 2 buffers, this method implements
2163         the ability to copy from one buffer to another without the data leaving
2164         the GPU.
2165
2166         Test: fast/canvas/webgl/copyBufferSubData.html
2167
2168         * html/canvas/WebGL2RenderingContext.cpp:
2169         (WebCore::WebGL2RenderingContext::copyBufferSubData):
2170         * html/canvas/WebGLBuffer.cpp:
2171         (WebCore::WebGLBuffer::associateCopyBufferSubData):
2172         * html/canvas/WebGLBuffer.h:
2173         * platform/graphics/GraphicsContext3D.h:
2174         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2175         (WebCore::GraphicsContext3D::copyBufferSubData):
2176
2177 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
2178
2179         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
2180         https://bugs.webkit.org/show_bug.cgi?id=164420
2181
2182         Reviewed by Tim Horton.
2183
2184         Rename:
2185             commitNewTreeState -> commitTreeState ("new" was redundant)
2186             updateBeforeChildren -> commitStateBeforeChildren
2187             updateAfterChildren -> commitStateAfterChildren
2188
2189         * page/scrolling/ScrollingTree.cpp:
2190         (WebCore::ScrollingTree::commitTreeState):
2191         (WebCore::ScrollingTree::updateTreeFromStateNode):
2192         (WebCore::ScrollingTree::commitNewTreeState): Deleted.
2193         * page/scrolling/ScrollingTree.h:
2194         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2195         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
2196         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren): Deleted.
2197         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2198         * page/scrolling/ScrollingTreeNode.h:
2199         (WebCore::ScrollingTreeNode::commitStateAfterChildren):
2200         (WebCore::ScrollingTreeNode::updateAfterChildren): Deleted.
2201         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2202         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2203         (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
2204         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Deleted.
2205         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren): Deleted.
2206         * page/scrolling/ScrollingTreeScrollingNode.h:
2207         * page/scrolling/ThreadedScrollingTree.cpp:
2208         (WebCore::ThreadedScrollingTree::commitTreeState):
2209         (WebCore::ThreadedScrollingTree::commitNewTreeState): Deleted.
2210         * page/scrolling/ThreadedScrollingTree.h:
2211         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2212         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2213         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
2214         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren):
2215         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren): Deleted.
2216         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren): Deleted.
2217         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2218         (WebCore::ScrollingTreeIOS::commitNewTreeState): Deleted.
2219         * page/scrolling/ios/ScrollingTreeIOS.h:
2220         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2221         (WebCore::ScrollingCoordinatorMac::commitTreeState):
2222         * page/scrolling/mac/ScrollingTreeFixedNode.h:
2223         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2224         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2225         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren): Deleted.
2226         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2227         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2228         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2229         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2230         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Deleted.
2231         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren): Deleted.
2232         * page/scrolling/mac/ScrollingTreeStickyNode.h:
2233         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2234         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2235         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren): Deleted.
2236
2237 2016-11-03  Anders Carlsson  <andersca@apple.com>
2238
2239         Add new 'other' Apple Pay button style
2240         https://bugs.webkit.org/show_bug.cgi?id=164384
2241         rdar://problem/28302528
2242
2243         Reviewed by Dean Jackson.
2244
2245         * DerivedSources.make:
2246         * WebCorePrefix.h:
2247         Add extension points.
2248
2249         * css/CSSPrimitiveValueMappings.h:
2250         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2251         Add ApplePayButtonType::Other.
2252
2253         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
2254         Add CSSValueOther.
2255
2256         * css/CSSValueKeywords.in:
2257         Add other.
2258
2259         * css/parser/CSSParser.cpp:
2260         (WebCore::isValidKeywordPropertyAndValue):
2261         Add CSSValueOther.
2262
2263         * css/parser/CSSParserFastPaths.cpp:
2264         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2265         Add CSSValueOther.
2266
2267         * rendering/RenderThemeCocoa.mm:
2268         (WebCore::toPKPaymentButtonType):
2269         Handle ApplePayButtonType::Other.
2270
2271         * rendering/style/RenderStyleConstants.h:
2272         Add ApplePayButtonType::Other.
2273
2274 2016-11-04  Antti Koivisto  <antti@apple.com>
2275
2276         slotted() pseudo does not work with ID selector
2277         https://bugs.webkit.org/show_bug.cgi?id=160538
2278         <rdar://problem/28534529>
2279
2280         Reviewed by Andreas Kling.
2281
2282         When we saw an id selector while addin rules we immediately threw it into the m_idRules
2283         optimization bucket and bailed out. However selectors containing ::slotted must always end
2284         up in m_slottedPseudoElementRules list no matter what else is there.
2285
2286         Fix by treating id like other selectors and only choosing the bucket after analysing all
2287         the selector components.
2288
2289         Test: fast/shadow-dom/css-scoping-slot-with-id.html
2290
2291         * css/RuleSet.cpp:
2292         (WebCore::RuleSet::addRule): Also made this use switch instead of a series of ifs.
2293
2294 2016-11-04  Brady Eidson  <beidson@apple.com>
2295
2296         IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
2297         https://bugs.webkit.org/show_bug.cgi?id=164416
2298
2299         Reviewed by Beth Dakin.
2300
2301         No new tests (Covered by existing tests).
2302
2303         * Modules/indexeddb/IDBObjectStore.cpp:
2304         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2305
2306 2016-11-04  Keith Rollin  <krollin@apple.com>
2307
2308         NetworkSession: Add NetworkDataTask implementation for blobs
2309         https://bugs.webkit.org/show_bug.cgi?id=163939
2310
2311         Reviewed by Alex Christensen.
2312
2313         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
2314         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
2315         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
2316         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
2317         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2318
2319 2016-11-04  Brady Eidson  <beidson@apple.com>
2320
2321         IndexedDB 2.0: Use IDB-specific exceptions in places where the generic exceptions are currently used.
2322         https://bugs.webkit.org/show_bug.cgi?id=164406
2323
2324         Reviewed by Alex Christensen.
2325
2326         No new tests (Covered by existing tests).
2327
2328         * Modules/indexeddb/IDBIndex.cpp:
2329         (WebCore::IDBIndex::setName):
2330
2331         * Modules/indexeddb/IDBObjectStore.cpp:
2332         (WebCore::IDBObjectStore::setName):
2333
2334 2016-11-04  Joanmarie Diggs  <jdiggs@igalia.com>
2335
2336         AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
2337         https://bugs.webkit.org/show_bug.cgi?id=164331
2338
2339         Reviewed by Chris Fleizach.
2340
2341         The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
2342         But is<AccessibilityListBox>() returns the value of isListBox() which returns
2343         true both for AccessibilityListBox instances as well as for AccessibilityObject
2344         instances which have an AccessibilityRole value of ListBoxRole. Because only
2345         native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
2346         that we can distinguish native and ARIA listboxes.
2347
2348         Tests: accessibility/aria-listbox-clear-selection-crash.html
2349                accessibility/listbox-clear-selection.html
2350
2351         * accessibility/AccessibilityListBox.h:
2352         * accessibility/AccessibilityObject.h:
2353         (WebCore::AccessibilityObject::isNativeListBox):
2354         (WebCore::AccessibilityObject::isListBox):
2355
2356 2016-11-04  Brady Eidson  <beidson@apple.com>
2357
2358         IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
2359         https://bugs.webkit.org/show_bug.cgi?id=164405
2360
2361         Reviewed by Alex Christensen.
2362
2363         No new tests (Covered by existing tests).
2364
2365         * Modules/indexeddb/IDBIndex.cpp:
2366         (WebCore::IDBIndex::setName):
2367
2368         * Modules/indexeddb/IDBObjectStore.cpp:
2369         (WebCore::IDBObjectStore::setName):
2370
2371 2016-11-04  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2372
2373         [Readable Streams API] Implement ByteStreamController error()
2374         https://bugs.webkit.org/show_bug.cgi?id=164319
2375
2376         Reviewed by Youenn Fablet.
2377
2378         Implemented error() method of ReadableByteStreamController.
2379
2380         Updated test expectations for error() and added IDL-related tests.
2381
2382         * Modules/streams/ReadableByteStreamController.js:
2383         (error): Implemented.
2384         * Modules/streams/ReadableByteStreamInternals.js:
2385         (privateInitializeReadableByteStreamController):
2386         (isReadableByteStreamController): Added.
2387         (readableByteStreamControllerError): Added.
2388         (readableByteStreamControllerClearPendingPullIntos): Added.
2389         * Modules/streams/ReadableStream.js:
2390         (initializeReadableStream): More detailed error message.
2391         * Modules/streams/ReadableStreamDefaultController.js:
2392         (error): Removed unnecessary variable declaration.
2393         * bindings/js/WebCoreBuiltinNames.h: Added totalQueuedBytes.
2394
2395 2016-11-03  Brady Eidson  <beidson@apple.com>
2396
2397         IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
2398         https://bugs.webkit.org/show_bug.cgi?id=164403
2399
2400         Reviewed by Alex Christensen.
2401
2402         No new tests (Covered by existing test).
2403
2404         * Modules/indexeddb/IDBIndex.cpp:
2405         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): Only rollback the info if this index
2406           already existed before this version change transaction.
2407
2408 2016-11-03  Youenn Fablet  <youenn@apple.com>
2409
2410         [WebRTC] Introduce asynchronous backend createOffer API
2411         https://bugs.webkit.org/show_bug.cgi?id=164365
2412
2413         Reviewed by Sam Weinig.
2414
2415         Covered by existing tests.
2416
2417         Removing PeerEndpointBackendClient as it is only RTCPeerConnection.
2418         This allows removing virtual for some functions.
2419
2420         Moving MediaEndpointPeerClient::m_client to PeerEndpointBackendClient::m_peerConnection and making it a reference.
2421
2422         Implementing createOffer at PeerConnectionBackend by splitting it in four sub-functions:
2423         - main createOffer, implemented at PeerConnectionBackend.
2424         - doCreateOffer implemented by subclasses (MediaEndpointPeerConnection).
2425         - createOfferSucceeded/createOfferFailed implemented by PeerConnectionBackend.
2426
2427         * CMakeLists.txt:
2428         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2429         (WebCore::createMediaEndpointPeerConnection):
2430         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
2431         (WebCore::MediaEndpointPeerConnection::doCreateOffer):
2432         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2433         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
2434         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
2435         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2436         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
2437         (WebCore::MediaEndpointPeerConnection::createReceiver):
2438         (WebCore::MediaEndpointPeerConnection::replaceTrack):
2439         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
2440         (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
2441         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
2442         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
2443         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
2444         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
2445         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
2446         (WebCore::MediaEndpointPeerConnection::createOffer): Deleted.
2447         * Modules/mediastream/MediaEndpointPeerConnection.h:
2448         * Modules/mediastream/PeerConnectionBackend.cpp:
2449         (WebCore::PeerConnectionBackend::createOffer):
2450         (WebCore::PeerConnectionBackend::createOfferSucceeded):
2451         (WebCore::PeerConnectionBackend::createOfferFailed):
2452         (WebCore::createPeerConnectionBackend): Deleted.
2453         * Modules/mediastream/PeerConnectionBackend.h:
2454         (WebCore::PeerConnectionBackend::PeerConnectionBackend):
2455         (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): Deleted.
2456         * Modules/mediastream/RTCPeerConnection.cpp:
2457         (WebCore::RTCPeerConnection::RTCPeerConnection):
2458         * Modules/mediastream/RTCPeerConnection.h:
2459         * WebCore.xcodeproj/project.pbxproj:
2460
2461 2016-11-03  Antti Koivisto  <antti@apple.com>
2462
2463         REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16
2464         https://bugs.webkit.org/show_bug.cgi?id=164397
2465         <rdar://problem/29100135>
2466
2467         Reviewed by Ryosuke Niwa.
2468
2469         The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when
2470         using fast-path document teardown.
2471
2472         (Patch and stories mostly by rniwa).
2473
2474         * dom/Document.cpp:
2475         (WebCore::Document::~Document):
2476         (WebCore::Document::didInsertInDocumentShadowRoot):
2477         (WebCore::Document::didRemoveInDocumentShadowRoot):
2478
2479             Improve asserts.
2480
2481         * dom/Element.cpp:
2482         (WebCore::Element::removeShadowRoot):
2483
2484             Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
2485             avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
2486             ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
2487             since the latter function tears down nodes via the deletion queue during a document destruction and use
2488             notifyChildNodeRemoved() on nodes that outlive the shadow root.
2489
2490         * dom/ShadowRoot.cpp:
2491         (WebCore::ShadowRoot::~ShadowRoot):
2492
2493             Take care to clean up inDocumentShadowRoots for fast-pathed destruction too.
2494
2495         (WebCore::ShadowRoot::insertedInto):
2496         (WebCore::ShadowRoot::removedFrom):
2497
2498             Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
2499             m_inDocumentShadowRoots when the connected-ness changes.
2500
2501 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
2502
2503         Give all the geometry classes a single-argument scale() function for consistency
2504         https://bugs.webkit.org/show_bug.cgi?id=164400
2505
2506         Reviewed by Zalan Bujtas.
2507
2508         Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
2509         as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
2510         to the new functions.
2511
2512         * dom/Document.cpp:
2513         (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
2514         * dom/MouseRelatedEvent.cpp:
2515         (WebCore::MouseRelatedEvent::init):
2516         (WebCore::MouseRelatedEvent::computeRelativePosition):
2517         * dom/TreeScope.cpp:
2518         (WebCore::TreeScope::nodeFromPoint):
2519         * page/PrintContext.cpp:
2520         (WebCore::PrintContext::spoolPage):
2521         * platform/cocoa/ThemeCocoa.mm:
2522         (WebCore::fitContextToBox):
2523         * platform/graphics/FloatPoint.h:
2524         (WebCore::FloatPoint::scale):
2525         * platform/graphics/FloatQuad.h:
2526         (WebCore::FloatQuad::scale):
2527         * platform/graphics/FloatSize.h:
2528         (WebCore::FloatSize::scale):
2529         * platform/graphics/GraphicsContext.cpp:
2530         (WebCore::GraphicsContext::applyDeviceScaleFactor):
2531         * platform/graphics/GraphicsContext.h:
2532         (WebCore::GraphicsContext::scale):
2533         * platform/graphics/LayoutPoint.h:
2534         (WebCore::LayoutPoint::scale):
2535         * platform/graphics/ca/TileCoverageMap.cpp:
2536         (WebCore::TileCoverageMap::update):
2537         * platform/graphics/ca/TileGrid.cpp:
2538         (WebCore::TileGrid::platformCALayerPaintContents):
2539         * platform/graphics/cg/ImageBufferCG.cpp:
2540         (WebCore::ImageBuffer::drawConsuming):
2541         (WebCore::ImageBuffer::draw):
2542         (WebCore::ImageBuffer::drawPattern):
2543         * platform/mac/ThemeMac.mm:
2544         (WebCore::paintToggleButton):
2545         (WebCore::paintButton):
2546         (WebCore::paintStepper):
2547         * rendering/RenderImage.cpp:
2548         (WebCore::RenderImage::nodeAtPoint):
2549         * rendering/RenderMediaControls.cpp:
2550         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
2551         * rendering/RenderThemeMac.mm:
2552         (WebCore::RenderThemeMac::paintMenuList):
2553         (WebCore::RenderThemeMac::paintSliderThumb):
2554         (WebCore::RenderThemeMac::paintSearchField):
2555         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2556         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
2557         * rendering/svg/SVGInlineTextBox.cpp:
2558         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
2559         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2560         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2561         * svg/SVGPathBlender.cpp:
2562         (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
2563         (WebCore::SVGPathBlender::blendArcToSegment):
2564         * svg/SVGPathParser.cpp:
2565         (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
2566         (WebCore::SVGPathParser::parseCurveToQuadraticSegment):
2567         (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
2568         (WebCore::SVGPathParser::decomposeArcToCubic):
2569         * svg/SVGSVGElement.cpp:
2570         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
2571
2572 2016-11-03  Antti Koivisto  <antti@apple.com>
2573
2574         REGRESSION (r207669): Crash under media controls shadow root construction
2575         https://bugs.webkit.org/show_bug.cgi?id=164381
2576         <rdar://problem/28935401>
2577
2578         Reviewed by Simon Fraser.
2579
2580         The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
2581         It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
2582         callback should be used.
2583
2584         Test: media/media-controls-shadow-construction-crash.html
2585
2586         Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
2587
2588         * html/HTMLMediaElement.cpp:
2589         (WebCore::HTMLMediaElement::insertedInto):
2590         (WebCore::HTMLMediaElement::finishedInsertingSubtree):
2591
2592             Move configureMediaControls() to finishedInsertingSubtree().
2593
2594         * html/HTMLMediaElement.h:
2595         * style/StyleTreeResolver.cpp:
2596         (WebCore::Style::TreeResolver::resolveComposedTree):
2597
2598             Add an assert to make the bad state easier to hit in tests.
2599
2600 2016-11-03  Ryosuke Niwa  <rniwa@webkit.org>
2601
2602         Add an assertion to diagnose stress GC bots test failures
2603         https://bugs.webkit.org/show_bug.cgi?id=164396
2604
2605         Reviewed by Antti Koivisto.
2606
2607         Added an assertion for calling ElementQueue::add while ElementQueue::invokeAll is in progress.
2608         This should never happen as long as all DOM API has an appropriate CEReactions IDL attribute.
2609
2610         * dom/CustomElementReactionQueue.cpp:
2611         (WebCore::CustomElementReactionStack::ElementQueue::add):
2612         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
2613         * dom/CustomElementReactionQueue.h:
2614
2615 2016-11-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2616
2617         Add the asynchronous image decoding mode
2618         https://bugs.webkit.org/show_bug.cgi?id=155546
2619
2620         Reviewed by Simon Fraser.
2621
2622         The asynchronous image decoding feature targets enhancing the rendering
2623         in two scenarios: the animated images and scrolling a page which large
2624         images. Enabling this feature for these two scenarios will be landed
2625         separately. 
2626
2627         The goal of the asynchronous image decoding is to have the decoded image
2628         frame ready before it has to be drawn. Drawing an image does not have to
2629         wait the image frame to be decoded.
2630
2631         * platform/graphics/BitmapImage.cpp:
2632         (WebCore::BitmapImage::frameImageAtIndex): Use the negation of frameHasValidNativeImageAtIndex().
2633         * platform/graphics/BitmapImage.h:
2634         (WebCore::BitmapImage::frameIsBeingDecodedAtIndex): Answers whether a frame is being decoded.
2635         (WebCore::BitmapImage::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
2636         (WebCore::BitmapImage::frameHasInvalidNativeImageAtIndex): Deleted.
2637         * platform/graphics/Image.h:
2638         (WebCore::Image::newFrameNativeImageAvailableAtIndex): Notifies the image with the availability of a frame NativeImage.
2639         * platform/graphics/ImageFrame.h:
2640         (WebCore::ImageFrame::isBeingDecoded): Answers whether the frame is being decoded.
2641         (WebCore::ImageFrame::hasValidNativeImage): Checks the validity of the frame.
2642         (WebCore::ImageFrame::hasInvalidNativeImage): Deleted.
2643         * platform/graphics/ImageFrameCache.cpp:
2644         (WebCore::ImageFrameCache::~ImageFrameCache): Asserts the decoding loop was ended before deleting the ImageFrameCache.
2645         (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Rename this function to matches the other which take the frame index.
2646         (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Ditto.
2647         (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): It setts the ImageFrame's members and updates the decoded size.
2648         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Replaces the frame NativeImage and notifies the Image with the new frame.
2649         (WebCore::ImageFrameCache::decodingQueue): Ensures the decoding WorkQueue is created and returns it.
2650         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Starts a decoding WorkQueue which loops until m_frameRequestQueue is closed.
2651         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Allows ImageSource to send a request to start asynchronous frame image decoding.
2652         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Stops the decoding WorkQueue by closing m_frameRequestQueue.
2653         (WebCore::ImageFrameCache::frameAtIndex): Call replaceFrameNativeImageAtIndex().
2654         (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Returns true if a request for the image frame is issued but not finished yet.
2655         (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
2656         (WebCore::ImageFrameCache::setFrameNativeImage): Deleted. Was renamed to be setFrameNativeImageAtIndex.
2657         (WebCore::ImageFrameCache::setFrameMetadata): Deleted. Was renamed to be setFrameMetadataAtIndex
2658         (WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
2659         * platform/graphics/ImageFrameCache.h:
2660         (WebCore::ImageFrameCache::create): The decoding queue needs to hold a reference to this class so it can stop decoding safely without blocking.
2661         (WebCore::ImageFrameCache::hasDecodingQueue): Returns true if a decoding queue has started.
2662         * platform/graphics/ImageSource.cpp:
2663         (WebCore::ImageSource::ImageSource): Call ImageFrameCache::create().
2664         (WebCore::ImageSource::clear): Deleting the decoder is unnecessary for asynchronous decoding because ImageFrameCache manages all the memory.
2665         
2666         (WebCore::ImageSource::destroyDecodedData):
2667         (WebCore::ImageSource::destroyDecodedDataIfNecessary):
2668         (WebCore::ImageSource::ensureDecoderAvailable):
2669         (WebCore::ImageSource::dataChanged):
2670         (WebCore::ImageSource::isAllDataReceived):
2671         (WebCore::ImageSource::isAsyncDecodingRequired): Answers the question whether the async image decoding is required for this ImageSource.
2672         (WebCore::ImageSource::frameImageAtIndex):
2673         * platform/graphics/ImageSource.h:
2674         (WebCore::ImageSource::decodedSize):
2675         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
2676         (WebCore::ImageSource::stopAsyncDecodingQueue):
2677         (WebCore::ImageSource::isSizeAvailable):
2678         (WebCore::ImageSource::frameCount):
2679         (WebCore::ImageSource::repetitionCount):
2680         (WebCore::ImageSource::filenameExtension):
2681         (WebCore::ImageSource::hotSpot):
2682         (WebCore::ImageSource::size):
2683         (WebCore::ImageSource::sizeRespectingOrientation):
2684         (WebCore::ImageSource::singlePixelSolidColor):
2685         (WebCore::ImageSource::frameIsBeingDecodedAtIndex):
2686         (WebCore::ImageSource::frameIsCompleteAtIndex):
2687         (WebCore::ImageSource::frameHasAlphaAtIndex):
2688         (WebCore::ImageSource::frameHasImageAtIndex):
2689         (WebCore::ImageSource::frameSubsamplingLevelAtIndex):
2690         (WebCore::ImageSource::frameSizeAtIndex):
2691         (WebCore::ImageSource::frameBytesAtIndex):
2692         (WebCore::ImageSource::frameDurationAtIndex):
2693         (WebCore::ImageSource::frameOrientationAtIndex):
2694          Make m_frameCache a type Ref<ImageFrameCache>. Use '->' instead of '.' when accessing its members.
2695
2696         (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
2697         (WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
2698
2699 2016-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
2700
2701         [WebGL2] Implement getBufferSubData()
2702         https://bugs.webkit.org/show_bug.cgi?id=164111
2703
2704         Reviewed by Dean Jackson.
2705
2706         The call exists in OpenGL 3.2 but in order to have parity with
2707         OpenGL ES 3 we back it with glMapBufferRange() instead.
2708
2709         This patch simply adds surface area to GraphicsContext3D
2710         until we can get an ANGLE implementation of it.
2711
2712         When testing this patch I discovered that r207649 incorrectly
2713         interpreted arguments to bufferData() and bufferSubData() as
2714         byte offsets. Instead, they should be element indices. This
2715         patch fixes those functions to work correctly so that
2716         getBufferSubData() can be tested correctly.
2717
2718         Tests: fast/canvas/webgl/webgl2-buffers.html
2719                fast/canvas/webgl/getBufferSubData-webgl1.html
2720
2721         * html/canvas/WebGL2RenderingContext.cpp:
2722         (WebCore::arrayBufferViewElementSize):
2723         (WebCore::WebGL2RenderingContext::bufferData):
2724         (WebCore::WebGL2RenderingContext::bufferSubData):
2725         (WebCore::WebGL2RenderingContext::getBufferSubData):
2726         * html/canvas/WebGL2RenderingContext.h:
2727         * html/canvas/WebGL2RenderingContext.idl:
2728         * platform/graphics/GraphicsContext3D.h:
2729         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2730         (WebCore::GraphicsContext3D::getBufferSubData):
2731         (WebCore::GraphicsContext3D::mapBufferRange):
2732         (WebCore::GraphicsContext3D::unmapBuffer):
2733
2734 2016-11-03  Chris Dumez  <cdumez@apple.com>
2735
2736         Unreviewed, mark support for the 'download' attribute as 'Done'.
2737
2738         * features.json:
2739
2740 2016-11-03  Chris Dumez  <cdumez@apple.com>
2741
2742         [WK2][Cocoa] Implement user interface for HTML form validation
2743         https://bugs.webkit.org/show_bug.cgi?id=164143
2744         <rdar://problem/28944652>
2745
2746         Reviewed by Simon Fraser.
2747
2748         Add ValidationBubble class to show HTML form validation messages
2749         using native dialogs. It currently has an implementation for both
2750         Mac and iOS. It is in WebCore under platform/ so that it can be
2751         used by both WebKit1 and WebKit2.
2752
2753         Update ownership of ValidationMessageClient so that is is owned
2754         by the Page using a unique_ptr<>, which seems to be the modern
2755         way of handling lifetime for page clients.
2756
2757         Test: fast/forms/validation-messages.html
2758
2759         * WebCore.xcodeproj/project.pbxproj:
2760         * html/HTMLFormControlElement.cpp:
2761         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2762         * html/ValidationMessage.cpp:
2763         (WebCore::ValidationMessage::updateValidationMessage):
2764         * page/Page.cpp:
2765         (WebCore::Page::Page):
2766         (WebCore::Page::~Page):
2767         * page/Page.h:
2768         (WebCore::Page::validationMessageClient):
2769         * page/PageConfiguration.cpp:
2770         * page/PageConfiguration.h:
2771         * platform/ValidationBubble.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2772         (WebCore::ValidationBubble::message):
2773         * platform/ios/ValidationBubbleIOS.mm: Added.
2774         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
2775         (WebCore::ValidationBubble::ValidationBubble):
2776         (WebCore::ValidationBubble::~ValidationBubble):
2777         (WebCore::ValidationBubble::show):
2778         (WebCore::ValidationBubble::setAnchorRect):
2779         * platform/mac/ValidationBubbleMac.mm: Added.
2780         (WebCore::ValidationBubble::ValidationBubble):
2781         (WebCore::ValidationBubble::~ValidationBubble):
2782         (WebCore::ValidationBubble::showRelativeTo):
2783
2784 2016-11-03  Brady Eidson  <beidson@apple.com>
2785
2786         IndexedDB 2.0: Rename IDBKeyRange.contains to IDBKeyRange.includes.
2787         https://bugs.webkit.org/show_bug.cgi?id=164383
2788
2789         Reviewed by Beth Dakin.
2790
2791         No new tests (Updated existing tests).
2792
2793         * Modules/indexeddb/IDBKeyRange.cpp:
2794         (WebCore::IDBKeyRange::includes):
2795         (WebCore::IDBKeyRange::contains): Deleted.
2796         * Modules/indexeddb/IDBKeyRange.h:
2797         * Modules/indexeddb/IDBKeyRange.idl:
2798
2799 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
2800
2801         Unreviewed, rolling out r208302.
2802
2803         This change causes LayoutTest crashes under GuardMalloc.
2804
2805         Reverted changeset:
2806
2807         "Load stylesheets in link elements inside a connected shadow
2808         tree"
2809         https://bugs.webkit.org/show_bug.cgi?id=160683
2810         http://trac.webkit.org/changeset/208302
2811
2812 2016-11-03  Chris Dumez  <cdumez@apple.com>
2813
2814         Unreviewed, add HTML5 specification for HTML Interactive Form Validation feature.
2815
2816         * features.json:
2817
2818 2016-11-03  Chris Dumez  <cdumez@apple.com>
2819
2820         Unreviewed, add HTML Interactive Form Validation to features.json
2821
2822         * features.json:
2823
2824 2016-11-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2825
2826         Unreviewed, rolling out due to crash in Amazon web site
2827         https://bugs.webkit.org/show_bug.cgi?id=164380
2828         <rdar://problem/29094221>
2829
2830         * dom/Node.idl:
2831         * domjit/JSNodeDOMJIT.cpp:
2832         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.
2833         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
2834
2835 2016-11-03  Brady Eidson  <beidson@apple.com>
2836
2837         IndexedDB 2.0: Support binary keys.
2838         <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
2839
2840         Reviewed by Alex Christensen.
2841
2842         Tests: storage/indexeddb/modern/binary-keys-1-private.html
2843                storage/indexeddb/modern/binary-keys-1.html
2844                Changes to other existing tests.
2845
2846         * Modules/indexeddb/IDBKey.cpp:
2847         (WebCore::IDBKey::createBinary):
2848         (WebCore::IDBKey::IDBKey):
2849         (WebCore::IDBKey::compare):
2850         * Modules/indexeddb/IDBKey.h:
2851         (WebCore::IDBKey::binary):
2852         (WebCore::compareBinaryKeyData):
2853
2854         * Modules/indexeddb/IDBKeyData.cpp:
2855         (WebCore::IDBKeyData::IDBKeyData):
2856         (WebCore::IDBKeyData::maybeCreateIDBKey):
2857         (WebCore::IDBKeyData::isolatedCopy):
2858         (WebCore::IDBKeyData::encode):
2859         (WebCore::IDBKeyData::decode):
2860         (WebCore::IDBKeyData::compare):
2861         (WebCore::IDBKeyData::loggingString):
2862         (WebCore::IDBKeyData::operator==):
2863         * Modules/indexeddb/IDBKeyData.h:
2864         (WebCore::IDBKeyData::hash):
2865         (WebCore::IDBKeyData::encode):
2866         (WebCore::IDBKeyData::decode):
2867
2868         * Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
2869
2870         * bindings/js/IDBBindingUtilities.cpp:
2871         (WebCore::toJS):
2872         (WebCore::createIDBKeyFromValue):
2873
2874         * platform/ThreadSafeDataBuffer.h:
2875         (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
2876         (WebCore::ThreadSafeDataBuffer::copyData):
2877         (WebCore::ThreadSafeDataBuffer::size):
2878         (WebCore::ThreadSafeDataBuffer::operator==):
2879         (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
2880
2881 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2882
2883         Printing to PDF should produce internal links when HTML has internal links
2884         https://bugs.webkit.org/show_bug.cgi?id=112081
2885         <rdar://problem/5955705>
2886
2887         Reviewed by Simon Fraser.
2888         Patch originally by David Lattimore.
2889
2890         No new tests, as it's unclear how to test PDF output.
2891
2892         * dom/Element.cpp:
2893         (WebCore::Element::findAnchorElementForLink):
2894         * dom/Element.h:
2895         Add findAnchorElementForLink, which looks up the anchor element corresponding
2896         to the current element's href, and also returns the fragment name as an out parameter.
2897
2898         * page/PrintContext.cpp:
2899         (WebCore::PrintContext::PrintContext):
2900         (WebCore::PrintContext::spoolPage):
2901         (WebCore::PrintContext::spoolRect):
2902         (WebCore::PrintContext::end):
2903         (WebCore::PrintContext::collectLinkedDestinations):
2904         (WebCore::PrintContext::outputLinkedDestinations):
2905         * rendering/RenderObject.cpp:
2906         (WebCore::RenderObject::addPDFURLRect):
2907         Plumb internal links (fragment links) through to GraphicsContext, using
2908         the fragment name from the page.
2909
2910         * page/PrintContext.h:
2911         * platform/graphics/GraphicsContext.cpp:
2912         (WebCore::GraphicsContext::supportsInternalLinks):
2913         (WebCore::GraphicsContext::setDestinationForRect):
2914         (WebCore::GraphicsContext::addDestinationAtPoint):
2915         * platform/graphics/GraphicsContext.h:
2916         * platform/graphics/cg/GraphicsContextCG.cpp:
2917         (WebCore::GraphicsContext::supportsInternalLinks):
2918         (WebCore::GraphicsContext::setDestinationForRect):
2919         (WebCore::GraphicsContext::addDestinationAtPoint):
2920         Plumb internal links through to the CGContext. Apply the CTM, because
2921         these functions expect positions in global coordinates.
2922
2923         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2924         (WebCore::GraphicsContext::setURLForRect):
2925         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2926         (WebCore::GraphicsContext::setURLForRect):
2927         Adjust setURLForRect to take a FloatRect, like everything else, and
2928         stop rounding.
2929
2930 2016-11-03  Alex Christensen  <achristensen@webkit.org>
2931
2932         Unreviewed, rolling out r208298.
2933         https://bugs.webkit.org/show_bug.cgi?id=163939
2934
2935         caused asan crashes
2936
2937         Reverted changeset:
2938
2939         "NetworkSession: Add NetworkDataTask implementation for blobs"
2940         https://bugs.webkit.org/show_bug.cgi?id=163939
2941         http://trac.webkit.org/changeset/208298
2942
2943 2016-11-03  Brent Fulgham  <bfulgham@apple.com>
2944
2945         [Win][Direct2D] Native Windows widgets are drawn upside-down
2946         https://bugs.webkit.org/show_bug.cgi?id=164370
2947
2948         Reviewed by Alex Christensen.
2949
2950         When we return from drawing in GDI code, we need to flip the resulting
2951         bitmap so that it draws in the proper orientation in Direct2D.
2952
2953         Tested by existing widget tests.
2954
2955         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2956         (WebCore::GraphicsContext::releaseWindowsContext): Flip before drawing
2957         to our Direct2D context.
2958
2959 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2960
2961         Remove PageThrottler & all related code
2962         https://bugs.webkit.org/show_bug.cgi?id=164302
2963
2964         Reviewed by Ryosuke Niwa.
2965
2966         All relevant information now available from the ActivityState.
2967
2968         * CMakeLists.txt:
2969         * WebCore.xcodeproj/project.pbxproj:
2970         * html/HTMLMediaElement.cpp:
2971         (WebCore::HTMLMediaElement::setMuted):
2972         (WebCore::HTMLMediaElement::updateVolume):
2973         (WebCore::HTMLMediaElement::updatePlayState):
2974         (WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
2975         * html/HTMLMediaElement.h:
2976         * loader/FrameLoader.cpp:
2977         (WebCore::FrameLoader::completed):
2978         (WebCore::FrameLoader::started):
2979         * loader/FrameLoader.h:
2980         * page/ChromeClient.h:
2981         * page/Page.cpp:
2982         (WebCore::Page::Page):
2983         * page/Page.h:
2984         (WebCore::Page::pageActivityStateChanged): Deleted.
2985         (WebCore::Page::pageThrottler): Deleted.
2986         * page/PageThrottler.cpp: Removed.
2987         * page/PageThrottler.h: Removed.
2988
2989 2016-11-03  Dan Bernstein  <mitz@apple.com>
2990
2991         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
2992         https://bugs.webkit.org/show_bug.cgi?id=164340
2993         <rdar://problem/29074344>
2994
2995         Reviewed by Tim Horton.
2996
2997         To give WebKit a chance to deliver the painting milestones to its client after the commit,
2998         we must tell it about them before or during the commit. To that end, we should not defer
2999         the call to firePaintRelatedMilestonesIfNeeded until after the commit.
3000
3001         * rendering/RenderLayerCompositor.cpp:
3002         (WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
3003           m_paintRelatedMilestonesTimer initializer.
3004         (WebCore::RenderLayerCompositor::didPaintBacking): Call
3005           FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
3006         (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
3007         * rendering/RenderLayerCompositor.h:
3008
3009 2016-11-03  Antti Koivisto  <antti@apple.com>
3010
3011         imported/mozilla/svg/paint-order-01.svg and imported/mozilla/svg/paint-order-02.svg are flaky failures
3012         https://bugs.webkit.org/show_bug.cgi?id=164355
3013
3014         Reviewed by Ryosuke Niwa.
3015
3016         Revert one change from https://trac.webkit.org/changeset/207669 to see if it is causing flakiness in
3017         some XML based tests.
3018
3019         * xml/parser/XMLDocumentParser.cpp:
3020         (WebCore::XMLDocumentParser::end):
3021
3022 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3023
3024         Unreviewed, fix CLoop build after r208320.
3025         https://bugs.webkit.org/show_bug.cgi?id=162980
3026
3027         Guard with ENABLE(JIT).
3028
3029         * bindings/scripts/CodeGeneratorJS.pm:
3030         (GenerateImplementation):
3031         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3032
3033 2016-11-02  Brady Eidson  <beidson@apple.com>
3034
3035         Expand upon IndexedDB status in features.json.
3036         
3037         * features.json:
3038
3039 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
3040
3041         CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false
3042         https://bugs.webkit.org/show_bug.cgi?id=164244
3043
3044         Reviewed by Michael Catanzaro.
3045
3046         Because we weren't passing a Document into CSSParserContext's constructor,
3047         there was no way for our parser to know whether the runtime switch was on
3048         or not. Instead, we can use the CallWith attribute in the IDL file to pass
3049         in a Document.
3050
3051         Test: fast/text/variations/css-supports-runtime-switch.html
3052
3053         * css/DOMCSSNamespace.cpp:
3054         (WebCore::DOMCSSNamespace::supports):
3055         * css/DOMCSSNamespace.h:
3056         * css/DOMCSSNamespace.idl:
3057
3058 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3059
3060         [DOMJIT] Add DOMJIT::Signature
3061         https://bugs.webkit.org/show_bug.cgi?id=162980
3062
3063         Reviewed by Saam Barati and Sam Weinig.
3064
3065         We introduce DOMJIT::Signature. This signature object is automatically generated by IDL code generator.
3066         It holds (1) types, (2) pointer to the unsafe function (the function without checks), and (3) the effect
3067         of the function. We use constexpr to initialize DOMJIT::Signature without invoking global constructors.
3068         Thus the content is embedded into the binary as the constant values.
3069
3070         We also clean up the IDL code generator related to DOMJIT part. Instead of switching things inside IDL
3071         code generator, we use C++ template to dispatch things at compile time. This template meta programming
3072         is highly utilized in IDL these days.
3073
3074         To make DOMJIT::Signature constexpr, we also need to define DOMJIT abstract heap things in the build time.
3075         To do so, we introduce a tiny Ruby script to calculate the range of abstract heaps. We can offer the abstract
3076         heap tree as YAML format and the script will produce a C++ header holding the calculated abstract heap ranges
3077
3078         * CMakeLists.txt:
3079         * DerivedSources.make:
3080         * ForwardingHeaders/bytecode/SpeculatedType.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
3081         * ForwardingHeaders/domjit/DOMJITSignature.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp.
3082         * WebCore.xcodeproj/project.pbxproj:
3083         * bindings/js/JSDOMGlobalObject.h:
3084         * bindings/scripts/CodeGeneratorJS.pm:
3085         (GenerateHeader):
3086         (GeneratePropertiesHashTable):
3087         (GetUnsafeArgumentType):
3088         (GetArgumentTypeFilter):
3089         (GetResultTypeFilter):
3090         (GenerateImplementation):
3091         (UnsafeToNative):
3092         (GenerateHashTableValueArray):
3093         (ComputeFunctionSpecial):
3094         * bindings/scripts/IDLAttributes.txt:
3095         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3096         (WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
3097         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
3098         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
3099         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
3100         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
3101         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
3102         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
3103         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
3104         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
3105         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
3106         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
3107         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
3108         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
3109         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
3110         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
3111         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
3112         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
3113         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
3114         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
3115         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
3116         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
3117         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
3118         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
3119         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
3120         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
3121         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
3122         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
3123         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
3124         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
3125         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
3126         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
3127         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
3128         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
3129         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
3130         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
3131         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
3132         (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
3133         (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeCaller):
3134         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
3135         (WebCore::jsTestDOMJITPrototypeFunctionItem):
3136         (WebCore::jsTestDOMJITPrototypeFunctionItemCaller):
3137         (WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
3138         (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
3139         (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeCaller):
3140         (WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
3141         (WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
3142         (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdCaller):
3143         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
3144         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
3145         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameCaller):
3146         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
3147         * bindings/scripts/test/TestDOMJIT.idl:
3148         * dom/Element.idl:
3149         * domjit/DOMJITAbstractHeapRepository.yaml: Added.
3150         * domjit/DOMJITIDLConvert.h: Added.
3151         (WebCore::DOMJIT::DirectConverter<IDLDOMString>::directConvert<StringConversionConfiguration::Normal>):
3152         * domjit/DOMJITIDLType.h: Added.
3153         * domjit/DOMJITIDLTypeFilter.h: Added.
3154         * domjit/JSDocumentDOMJIT.cpp:
3155         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
3156         * domjit/JSNodeDOMJIT.cpp:
3157         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
3158         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
3159         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
3160         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
3161         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
3162         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
3163         * domjit/generate-abstract-heap.rb: Added.
3164
3165 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
3166
3167         Followup after r208314.
3168
3169         The style created for reflections contains transforms and a mask, so needs to get explicit
3170         z-index on it. This doesn't change rendering, since this layer has no children.
3171
3172         Fixes assertions in various reflection tests.
3173
3174         * rendering/RenderLayer.cpp:
3175         (WebCore::RenderLayer::calculateClipRects):
3176
3177 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
3178
3179         REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
3180         https://bugs.webkit.org/show_bug.cgi?id=164350
3181         rdar://problem/29053414
3182
3183         Reviewed by Dean Jackson.
3184
3185         After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
3186         with a non-1 opacity, but without the explicit z-index that triggers stacking context.
3187         This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
3188         save/restores.
3189
3190         This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate()
3191         can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()"
3192         gave the wrong answser.
3193
3194         Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
3195         when it actually produced a new style, and when true, do the setZIndex(0).
3196
3197         Test: animations/stacking-during-opacity-animation.html
3198
3199         * page/animation/AnimationBase.h:
3200         * page/animation/CSSPropertyAnimation.cpp:
3201         (WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
3202         * page/animation/CompositeAnimation.cpp:
3203         (WebCore::CompositeAnimation::animate):
3204         * page/animation/ImplicitAnimation.cpp:
3205         (WebCore::ImplicitAnimation::animate):
3206         * page/animation/ImplicitAnimation.h:
3207         * page/animation/KeyframeAnimation.cpp:
3208         (WebCore::KeyframeAnimation::animate):
3209         * page/animation/KeyframeAnimation.h:
3210         * platform/graphics/GraphicsContext.cpp:
3211         (WebCore::GraphicsContext::restore):
3212         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3213         (PlatformCALayer::drawLayerContents): No functional change, but created scope for the
3214         GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
3215         * rendering/RenderLayer.cpp:
3216         (WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
3217
3218 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
3219
3220         [iOS] [WebGL] Multisample resolve step may operate on stale data
3221         https://bugs.webkit.org/show_bug.cgi?id=164347
3222
3223         Reviewed by Dean Jackson.
3224
3225         When antialiasing is enabled, WebKit internally creates a multisampled FBO
3226         and uses that as the target of all the drawing commands. Then, just before
3227         we actually put the image on the glass, we perform a “resolve” step which
3228         averages all the samples to create the final image. However, it appears
3229         that this resolve step only waits for commands to complete which were
3230         already submitted to the hardware. OpenGL is allowed (indeed, expected) to
3231         batch up drawing commands in main memory so it can submit them to the
3232         hardware in fewer batches, but this means that the hardware may not know
3233         about all the commands that the application submitted. Because of this,
3234         the data the resolve step saw is the result of only some of the previous
3235         draw calls - not all of them.
3236
3237         This doesn’t occur on macOS because we have a different code path there
3238         for performing the resolve step. On iOS 9 and below, WebKit didn’t
3239         implement multisampling in WebGL at all, which explains why this only
3240         occurs on iOS 10. 
3241
3242         Luckily, the OpenGL command glFlush() is exactly designed to submit any
3243         pending commands to the hardware.
3244
3245         Test: fast/canvas/webgl/multisample-resolve-consistency.html
3246
3247         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3248         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
3249
3250 2016-11-02  Brady Eidson  <beidson@apple.com>
3251
3252         Give IDBKey(Data) a WTF::Variant overhaul.
3253         https://bugs.webkit.org/show_bug.cgi?id=164332
3254
3255         Reviewed by Alex Christensen and Andy Estes.
3256
3257         No new tests (Refactor, no behavior change).
3258
3259         * Modules/indexeddb/IDBKey.cpp:
3260         (WebCore::IDBKey::IDBKey):
3261         (WebCore::IDBKey::isValid):
3262         (WebCore::IDBKey::compare):
3263         * Modules/indexeddb/IDBKey.h:
3264         (WebCore::IDBKey::array):
3265         (WebCore::IDBKey::string):
3266         (WebCore::IDBKey::date):
3267         (WebCore::IDBKey::number):
3268         (WebCore::IDBKey::IDBKey): Deleted.
3269
3270         * Modules/indexeddb/IDBKeyData.cpp:
3271         (WebCore::IDBKeyData::IDBKeyData):
3272         (WebCore::IDBKeyData::maybeCreateIDBKey):
3273         (WebCore::IDBKeyData::isolatedCopy):
3274         (WebCore::IDBKeyData::encode):
3275         (WebCore::IDBKeyData::decode):
3276         (WebCore::IDBKeyData::compare):
3277         (WebCore::IDBKeyData::loggingString):
3278         (WebCore::IDBKeyData::setArrayValue):
3279         (WebCore::IDBKeyData::setStringValue):
3280         (WebCore::IDBKeyData::setDateValue):
3281         (WebCore::IDBKeyData::setNumberValue):
3282         (WebCore::IDBKeyData::operator==):
3283         * Modules/indexeddb/IDBKeyData.h:
3284         (WebCore::IDBKeyData::hash):
3285         (WebCore::IDBKeyData::string):
3286         (WebCore::IDBKeyData::date):
3287         (WebCore::IDBKeyData::number):
3288         (WebCore::IDBKeyData::array):
3289         (WebCore::IDBKeyData::encode):
3290         (WebCore::IDBKeyData::decode):
3291
3292 2016-11-01  Sam Weinig  <sam@webkit.org>
3293
3294         [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
3295         https://bugs.webkit.org/show_bug.cgi?id=164256
3296
3297         Reviewed by Alex Christensen.
3298
3299         - Add the ability to pass an "exception thrower" functor to the convert functions.
3300           This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
3301           for now, but can be extended for more types as necessary to improve exception messages.
3302         - Add support for using toJSNewlyCreated in JSDOMConvert.
3303
3304         * bindings/generic/IDLTypes.h:
3305         (WebCore::IDLString::extractValueFromNullable):
3306         Use forwarding to simplify extraction function.
3307
3308         (WebCore::IDLInterface::nullValue):
3309         Update nullValue to work for both RefPtr<T> and T*.
3310
3311         (WebCore::IDLInterface::extractValueFromNullable):
3312         Use forwarding to simplify extraction function.
3313
3314         * bindings/js/JSDOMConvert.h:
3315         (WebCore::DefaultExceptionThrower::operator()):
3316         Add a default "exception thrower" which throws a normal type error.
3317
3318         (WebCore::convert):
3319         Add an overload of convert which takes an "exception thrower".
3320
3321         (WebCore::toJSNewlyCreated):
3322         Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
3323         which will return "newly created" values. This only works for types that implement
3324         a toJSNewlyCreated function for themselves.
3325
3326         (WebCore::Converter<IDLNullable<T>>::convert):
3327         Fix the return type of Converter<IDLNullable<T>> to be specialized when
3328         T is an IDLInterface. In that case, we want to match the return type of
3329         inner converter.
3330         
3331         Also add implementation of convert overload that takes an "exception thrower".
3332
3333         (WebCore::JSConverter<IDLNullable<T>>::convert):
3334         (WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
3335         Reimplement conversion to use forwarding of the value.
3336
3337         (WebCore::Converter<IDLInterface<T>>::convert):
3338         Add support for an "exception thrower".
3339
3340         (WebCore::Detail::getPtrOrRef):
3341         Add helper functions that extract either a pointer or reference, depending on the type,
3342         and const_casts it allowing the value to be used with toJS functions.
3343
3344         (WebCore::JSConverter<IDLInterface<T>>::convert):
3345         Re-implement to support more varied input values.
3346
3347         (WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
3348         Added. Forwards to overloaded toJSNewlyCreated functions.
3349
3350         * bindings/scripts/CodeGeneratorJS.pm:
3351         (AddToImplIncludesForIDLType):
3352         Add support for adding the right includes for SerializedScriptValue and Dictionary.
3353
3354         (GetArgumentExceptionThrower):
3355         (GetAttributeExceptionThrower):
3356         Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
3357         being passed to setters and functions.
3358
3359         (GenerateParametersCheck):
3360         Move around special cases so it is clear that it's not wrappers and typed arrays that
3361         need specialization here, it is now just EventListener and XPathNSResolver.
3362
3363         (GetIDLInterfaceName):
3364         Add helper to get the InterfaceName for use in IDLInterface template.
3365
3366         (GetBaseIDLType):
3367         Use new GetIDLInterfaceName helper.
3368
3369         (IsValidContextForJSValueToNative):
3370         Remove IDLOperation as a valid context. It is not.
3371
3372         (JSValueToNative):
3373         Move JSDOMConvert based conversion to the bottom, to show that everything above it
3374         is a special case that should be fixed. I have used explicit c-style if-statements
3375         to make it clear what the types of the exceptional cases are.
3376
3377         (NativeToJSValueDOMConvertNeedsState):
3378         (NativeToJSValueDOMConvertNeedsGlobalObject):
3379         Add wrapper types and typed arrays to the list needing state and globalObject.
3380
3381         (NativeToJSValue):
3382         Move JSDOMConvert based conversion to the bottom, to show that everything above it
3383         is a special case that should be fixed. I have used explicit c-style if-statements
3384         to make it clear what the types of the exceptional cases are.
3385
3386         (JSValueToNativeIsHandledByDOMConvert): Deleted.
3387         (NativeToJSValueIsHandledByDOMConvert): Deleted.
3388         Remove predicates protecting use of JSDOMConvert now that it is the default.
3389
3390         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3391         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3392         * bindings/scripts/test/JS/JSTestCallback.cpp:
3393         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3394         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3395         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3396         * bindings/scripts/test/JS/JSTestInterface.cpp:
3397         * bindings/scripts/test/JS/JSTestObj.cpp:
3398         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3399         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3400         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3401         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3402         Update test results.
3403
3404 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3405
3406         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
3407         <https://webkit.org/b/164333>
3408         <rdar://problem/29072727>
3409
3410         Reviewed by Alex Christensen.
3411
3412         * page/DiagnosticLoggingKeys.cpp:
3413         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
3414         - Add implementation for new key method.
3415         * page/DiagnosticLoggingKeys.h:
3416         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
3417         - Add declaration for new key method.
3418
3419 2016-11-02  Filip Pizlo  <fpizlo@apple.com>
3420
3421         The GC should be in a thread
3422         https://bugs.webkit.org/show_bug.cgi?id=163562
3423
3424         Reviewed by Geoffrey Garen and Andreas Kling.
3425
3426         No new tests because existing tests cover this.
3427         
3428         We now need to be more careful about using JSLock. This fixes some places that were not
3429         holding it. New assertions in the GC are more likely to catch this than before.
3430
3431         * bindings/js/WorkerScriptController.cpp:
3432         (WebCore::WorkerScriptController::WorkerScriptController):
3433
3434 2016-11-02  Joseph Pecoraro  <pecoraro@apple.com>
3435
3436         Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
3437         https://bugs.webkit.org/show_bug.cgi?id=164136
3438         <rdar://problem/29028462>
3439
3440         Reviewed by Brian Burg.
3441
3442         Tests: inspector/worker/debugger-pause.html
3443                inspector/worker/debugger-scripts.html
3444
3445         * CMakeLists.txt:
3446         * WebCore.xcodeproj/project.pbxproj:
3447         * inspector/InspectorAllInOne.cpp:
3448         New file.
3449
3450         * inspector/PageDebuggerAgent.h:
3451         * inspector/WorkerDebuggerAgent.cpp: Added.
3452         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
3453         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
3454         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
3455         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
3456         * inspector/WorkerDebuggerAgent.h: Added.
3457         DebuggerAgent customizations for Workers.
3458
3459         * inspector/WorkerInspectorController.cpp:
3460         (WebCore::WorkerInspectorController::WorkerInspectorController):
3461         Add the new agent.
3462
3463         * inspector/WorkerScriptDebugServer.cpp:
3464         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3465         Implement the nested run loop for Workers.
3466
3467 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
3468
3469         Add Battery Status to features.json, marked as "Removed".
3470
3471         * features.json:
3472
3473 2016-11-02  Ryosuke Niwa  <rniwa@webkit.org>
3474
3475         Load stylesheets in link elements inside a connected shadow tree
3476         https://bugs.webkit.org/show_bug.cgi?id=160683
3477         <rdar://problem/29040652>
3478
3479         Reviewed by Antti Koivisto.
3480
3481         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
3482         when it's connected to a document instead of always talking to document's style scope.
3483
3484         Also improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
3485         m_inDocumentShadowRoots when the connected-ness changes.
3486
3487         This patch also removes the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
3488         avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
3489         ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
3490         since the latter function tears down nodes via the deletion queue during a document destruction and use
3491         notifyChildNodeRemoved() on nodes that outlive the shadow root.
3492
3493         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
3494                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
3495
3496        * dom/Document.cpp:
3497        (WebCore::Document::didInsertInDocumentShadowRoot): Assert that the shadow root is not in the set.
3498        (WebCore::Document::didRemoveInDocumentShadowRoot): Assert that the shadow root is not in the document as
3499        this function is now called after Node::removedFrom in ShadowRoot::removedFrom.
3500        * dom/Element.cpp:
3501        (WebCore::Element::removeShadowRoot): See the description above.
3502        * dom/ShadowRoot.cpp:
3503        (WebCore::ShadowRoot::insertedInto): Only call didInsertInDocumentShadowRoot when the this shadow root is
3504        newly connected to a document so we can add assertions in didInsertInDocumentShadowRoot.
3505        (WebCore::ShadowRoot::removedFrom): Ditto for the removal.
3506        * html/HTMLLinkElement.cpp:
3507        (WebCore::HTMLLinkElement::HTMLLinkElement):
3508        (WebCore::HTMLLinkElement::~HTMLLinkElement):
3509        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
3510        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
3511        early when inDocument() is false.
3512        (WebCore::HTMLLinkElement::parseAttribute):
3513        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
3514        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
3515        a document instead of whenever its self-inclusive ancestor is inserted into a container.
3516        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
3517        calling removePendingSheet since the latter depends on m_styleScope being not null.
3518        (WebCore::HTMLLinkElement::addPendingSheet):
3519        (WebCore::HTMLLinkElement::removePendingSheet):
3520        * html/HTMLLinkElement.h:
3521        * html/HTMLStyleElement.cpp:
3522        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
3523        element has just become connected to a document.
3524        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
3525        * style/StyleScope.h:
3526        * svg/SVGStyleElement.cpp:
3527        (WebCore::SVGStyleElement::insertedInto): Ditto.
3528        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
3529
3530 2016-11-02  Dave Hyatt  <hyatt@apple.com>
3531
3532         [CSS Parser] Clean up new parser's grid layout ifdefs/runtime checking
3533         https://bugs.webkit.org/show_bug.cgi?id=164341
3534
3535         Reviewed by Dean Jackson.
3536
3537         * css/parser/CSSPropertyParser.cpp:
3538         (WebCore::consumeGridTrackRepeatFunction):
3539         (WebCore::consumeGridTrackList):
3540         (WebCore::CSSPropertyParser::parseSingleValue):
3541
3542 2016-11-02  Alex Christensen  <achristensen@webkit.org>
3543
3544         Remove Battery Status API from the tree
3545         https://bugs.webkit.org/show_bug.cgi?id=164213
3546
3547         Reviewed by Sam Weinig.
3548
3549         * CMakeLists.txt:
3550         * DerivedSources.cpp:
3551         * Modules/battery: Removed.
3552         * Modules/battery/BatteryClient.h: Removed.
3553         * Modules/battery/BatteryController.cpp: Removed.
3554         * Modules/battery/BatteryController.h: Removed.
3555         * Modules/battery/BatteryManager.cpp: Removed.
3556         * Modules/battery/BatteryManager.h: Removed.
3557         * Modules/battery/BatteryManager.idl: Removed.
3558         * Modules/battery/BatteryStatus.cpp: Removed.
3559         * Modules/battery/BatteryStatus.h: Removed.
3560         * Modules/battery/NavigatorBattery.cpp: Removed.
3561         * Modules/battery/NavigatorBattery.h: Removed.
3562         * Modules/battery/NavigatorBattery.idl: Removed.
3563         * PlatformEfl.cmake:
3564         * dom/EventTargetFactory.in:
3565         * platform/efl/BatteryProviderEfl.cpp: Removed.
3566         * platform/efl/BatteryProviderEfl.h: Removed.
3567         * platform/efl/BatteryProviderEflClient.h: Removed.
3568         * platform/glib/BatteryProviderUPower.cpp: Removed.
3569         * platform/glib/BatteryProviderUPower.h: Removed.
3570         * platform/glib/BatteryProviderUPowerClient.h: Removed.
3571         * testing/Internals.cpp:
3572         (WebCore::Internals::setBatteryStatus): Deleted.
3573         * testing/Internals.h:
3574         * testing/Internals.idl:
3575
3576 2016-11-02  Keith Rollin  <krollin@apple.com>
3577
3578         NetworkSession: Add NetworkDataTask implementation for blobs
3579         https://bugs.webkit.org/show_bug.cgi?id=163939
3580
3581         Reviewed by Alex Christensen.
3582
3583         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
3584         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
3585         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
3586         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
3587         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
3588
3589 2016-11-02  Olivier Blin  <olivier.blin@softathome.com>
3590
3591         [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation
3592         https://bugs.webkit.org/show_bug.cgi?id=163125
3593
3594         Reviewed by Michael Catanzaro.
3595
3596         No new tests, already covered by existing SubtleCrypto tests.
3597
3598         * PlatformGTK.cmake: Use libgcrypt instead of gnutls.
3599         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: Added. Adapted from the GnuTLS backend.
3600         (WebCore::getGCryptDigestAlgorithm):
3601         (WebCore::calculateSignature):
3602         (WebCore::CryptoAlgorithmHMAC::platformSign):
3603         (WebCore::CryptoAlgorithmHMAC::platformVerify):
3604         * platform/crypto/gcrypt/CryptoDigestGCrypt.cpp: Added. Adapted from the GnuTLS backend.
3605         (WebCore::CryptoDigest::CryptoDigest):
3606         (WebCore::CryptoDigest::~CryptoDigest):
3607         (WebCore::CryptoDigest::create):
3608         (WebCore::CryptoDigest::addBytes):
3609         (WebCore::CryptoDigest::computeHash):
3610
3611 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
3612
3613         REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
3614         https://bugs.webkit.org/show_bug.cgi?id=162933
3615         <rdar://problem/28570590>
3616
3617         Reviewed by Dean Jackson.
3618
3619         A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.
3620
3621         We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
3622         helper function (isStretchy) to encapsulate the fact that only non-empty elements with
3623         the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.
3624
3625         Test: mathml/empty-mo.html
3626
3627         * rendering/mathml/RenderMathMLOperator.cpp:
3628         (WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
3629         * rendering/mathml/RenderMathMLOperator.h:
3630         (WebCore::RenderMathMLOperator::isStretchy): Added.
3631         * rendering/mathml/RenderMathMLRow.cpp:
3632         (WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
3633         (WebCore::RenderMathMLRow::layoutRowItems): Ditto.
3634         * rendering/mathml/RenderMathMLUnderOver.cpp:
3635         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
3636         (WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.
3637
3638 2016-11-01  Dean Jackson  <dino@apple.com>
3639
3640         Filter functions grayscale/invert/opacity/sepia should clamp values over 100%, not fail
3641         https://bugs.webkit.org/show_bug.cgi?id=164310
3642
3643         Reviewed by Sam Weinig.
3644
3645         When bringing up the new CSS parser, I discovered that our old parser was
3646         not conforming to the specification.
3647
3648         Covered by existing tests.
3649
3650         * css/parser/CSSParser.cpp:
3651         (WebCore::CSSParser::parseBuiltinFilterArguments): For these functions, clamp to
3652         100% rather than fail.
3653
3654 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
3655
3656         WebKit nullptr dereference Archive Subframe
3657         https://bugs.webkit.org/show_bug.cgi?id=164281
3658         <rdar://problem/28943006>
3659
3660         Reviewed by Andy Estes.
3661
3662         If the page is torn down during a load, we can attempt to use a deallocated
3663         (and nulled) document loader. Most places that use the "active document loader"
3664         null-check it before using, but there was one place that did not. This patch
3665         fixes that oversight.
3666
3667         Test: fast/dom/crash-with-bad-url.html
3668
3669         * loader/FrameLoader.cpp:
3670         (WebCore::FrameLoader::loadURLIntoChildFrame): Check that the active document
3671         loader is non-null before using.
3672
3673 2016-11-02  Dave Hyatt  <hyatt@apple.com>
3674
3675         [CSS Parser] Support scroll-snap-* properties
3676         https://bugs.webkit.org/show_bug.cgi?id=164321
3677
3678         Reviewed by Simon Fraser.
3679
3680         * css/CSSPrimitiveValue.h:
3681         * css/StyleBuilderConverter.h:
3682         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
3683         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
3684         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
3685         * css/parser/CSSPropertyParser.cpp:
3686         (WebCore::consumePositionLonghand):
3687         (WebCore::consumePositionX):
3688         (WebCore::consumePositionY):
3689         (WebCore::consumePositionList):
3690         (WebCore::consumeScrollSnapDestination):
3691         (WebCore::consumeScrollSnapPoints):
3692         (WebCore::CSSPropertyParser::parseSingleValue):
3693
3694 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3695
3696         Add logging for "WebKit encountered an internal error" messages
3697         <https://webkit.org/b/164272>
3698         <rdar://problem/28546064>
3699
3700         Reviewed by Alex Christensen.
3701
3702         * page/DiagnosticLoggingKeys.cpp:
3703         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
3704         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
3705         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
3706         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
3707         - Add implementations for new key methods.
3708
3709         * page/DiagnosticLoggingKeys.h:
3710         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
3711         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
3712         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
3713         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
3714         - Add declarations for new key methods.
3715
3716 2016-11-02  Zalan Bujtas  <zalan@apple.com>
3717
3718         [Tables] Simplified layout skips captions.
3719         https://bugs.webkit.org/show_bug.cgi?id=164284
3720
3721         Reviewed by David Hyatt.
3722
3723         This patch ensures that we take care of simplified normalflow captions during layout.    
3724
3725         Covered by fast/regions/table-caption-as-region.html
3726
3727         * rendering/RenderTable.cpp:
3728         (WebCore::RenderTable::layoutCaption):
3729         (WebCore::RenderTable::layoutCaptions): _caption_side is 2bits, can't use bitmask. 
3730         (WebCore::RenderTable::simplifiedNormalFlowLayout):
3731         (WebCore::RenderTable::layout):
3732         * rendering/RenderTable.h:
3733
3734 2016-11-02  Youenn Fablet  <youenn@apple.com>
3735
3736         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
3737         https://bugs.webkit.org/show_bug.cgi?id=163905
3738
3739         Reviewed by Antti Koivisto.
3740
3741         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
3742
3743         Small refactoring to do more member fields initialization in StyleSheetContents header.
3744         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
3745         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
3746
3747         * css/StyleSheetContents.cpp:
3748         (WebCore::StyleSheetContents::StyleSheetContents):
3749         (WebCore::StyleSheetContents::addedToMemoryCache):
3750         (WebCore::StyleSheetContents::removedFromMemoryCache):
3751         * css/StyleSheetContents.h:
3752         * loader/cache/CachedCSSStyleSheet.cpp:
3753         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
3754
3755 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3756
3757         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
3758         https://bugs.webkit.org/show_bug.cgi?id=164315
3759
3760         Reviewed by Michael Catanzaro.
3761
3762         * platform/FileSystem.h:
3763         * platform/glib/FileSystemGlib.cpp:
3764         (WebCore::stringFromFileSystemRepresentation):
3765         (WebCore::homeDirectoryPath):
3766         (WebCore::listDirectory):
3767         (WebCore::filenameToString): Deleted.
3768
3769 2016-11-02  Manuel Rego Casasnovas  <rego@igalia.com>
3770
3771         [css-grid] mimax(auto, <flex>) should be serialized as <flex>
3772         https://bugs.webkit.org/show_bug.cgi?id=164316
3773
3774         Reviewed by Sergio Villar Senin.
3775
3776         * css/CSSComputedStyleDeclaration.cpp:
3777         (WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
3778         properly this case.
3779         * rendering/style/GridLength.h:
3780         (WebCore::GridLength::isAuto): Add new function to check if GridLength
3781         is or not "auto".
3782
3783 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3784
3785         [Readable Streams API] Enable creation of ReadableByteStreamController
3786         https://bugs.webkit.org/show_bug.cgi?id=164014
3787
3788         Reviewed by Youenn Fablet.
3789
3790         Added support for creating ReadableByteStreamController. IDL is mostly
3791         implemented but methods return TypeError. Tests have been added to ensure
3792         behaviour. This part of Readable Streams API is associated to
3793         a flag (READABLE_BYTE_STREAM_API).
3794
3795         Test: streams/readable-byte-stream-controller.html
3796
3797         * CMakeLists.txt:
3798         * Configurations/FeatureDefines.xcconfig:
3799         * DerivedSources.cpp:
3800         * DerivedSources.make:
3801         * Modules/streams/ReadableByteStreamController.idl: Added.
3802         * Modules/streams/ReadableByteStreamController.js: Added.
3803         (enqueue): Empty method for the moment, throws TypeError.
3804         (error): Empty method for the moment, throws TypeError.
3805         (close): Empty method for the moment, throws TypeError.
3806         (byobRequest): Empty method for the moment, throws TypeError.
3807         (desiredSize): Empty method for the moment, throws TypeError.
3808         * Modules/streams/ReadableByteStreamInternals.js: Added.
3809         (privateInitializeReadableByteStreamController):
3810         * Modules/streams/ReadableStream.js:
3811         (initializeReadableStream):
3812         * WebCore.xcodeproj/project.pbxproj:
3813         * bindings/js/JSDOMGlobalObject.cpp:
3814         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3815         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3816         (WebCore::constructJSReadableByteStreamController):
3817         (WebCore::constructJSReadableStreamDefaultReader):
3818         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
3819         (WebCore::createReadableByteStreamControllerPrivateConstructor):
3820         * bindings/js/JSReadableStreamPrivateConstructors.h:
3821         * bindings/js/WebCoreBuiltinNames.h:
3822
3823 2016-11-02  Antoine Quint  <graouts@apple.com>
3824
3825         [Modern Media Controls] Media Controller: fullscreen toggle support
3826         https://bugs.webkit.org/show_bug.cgi?id=163728
3827         <rdar://problem/27989486>
3828
3829         Reviewed by Darin Adler.
3830
3831         We introduce the FullscreenSupport class which brings support for entering and
3832         exiting fullscreen by clicking on the fullscreen button in the media controls
3833         and correctly reflecting the media's fullscreen state should it be changed
3834         via the media API.
3835
3836         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
3837                media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
3838
3839         * Modules/modern-media-controls/js-files:
3840         * Modules/modern-media-controls/media/fullscreen-support.js: Added.
3841         (FullscreenSupport):
3842         (FullscreenSupport.prototype.get control):
3843         (FullscreenSupport.prototype.get mediaEvents):
3844         (FullscreenSupport.prototype.buttonWasClicked):
3845         (FullscreenSupport.prototype.syncControl):
3846         * Modules/modern-media-controls/media/media-controller.js:
3847         (MediaController):
3848         * WebCore.xcodeproj/project.pbxproj:
3849
3850 2016-11-02  Antoine Quint  <graouts@apple.com>
3851
3852         [Modern Media Controls] Media Controller: PiP support
3853         https://bugs.webkit.org/show_bug.cgi?id=163730
3854         <rdar://problem/27989485>
3855
3856         Reviewed by Dean Jackson.
3857
3858         We introduce the PiPSupport class which brings support for entering picture-in-picture
3859         by clicking on the PiP button in the media controls and enabling the button only when
3860         picture-in-picture mode is available.
3861
3862         Tests: media/modern-media-controls/pip-support/pip-support-click.html
3863                media/modern-media-controls/pip-support/pip-support-enabled.html
3864
3865         * Modules/modern-media-controls/js-files:
3866         * Modules/modern-media-controls/media/media-controller.js:
3867         (MediaController):
3868         * Modules/modern-media-controls/media/pip-support.js: Added.
3869         (PiPSupport.prototype.get control):
3870         (PiPSupport.prototype.get mediaEvents):
3871         (PiPSupport.prototype.buttonWasClicked):
3872         (PiPSupport.prototype.syncControl):
3873         (PiPSupport):
3874         * WebCore.xcodeproj/project.pbxproj:
3875
3876 2016-11-01  Dave Hyatt  <hyatt@apple.com>
3877
3878         [CSS Parser] Support the shadow DOM
3879         https://bugs.webkit.org/show_bug.cgi?id=164240
3880
3881         Reviewed by Dean Jackson.
3882
3883         * css/CSSSelector.cpp:
3884         (WebCore::CSSSelector::selectorText):
3885         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3886         ShadowDescendant combinator.
3887
3888         * css/CSSSelector.h:
3889         * css/SelectorChecker.cpp:
3890         (WebCore::SelectorChecker::matchRecursively):
3891         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3892         ShadowDescendant combinator.
3893
3894         * css/SelectorFilter.cpp:
3895         (WebCore::SelectorFilter::collectIdentifierHashes):
3896         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3897         ShadowDescendant combinator.
3898
3899         * css/SelectorPseudoElementTypeMap.in:
3900         Add support for slotted.
3901
3902         * css/parser/CSSParserValues.cpp:
3903         (WebCore::CSSParserSelector::appendTagHistory):
3904         * css/parser/CSSParserValues.h:
3905         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
3906         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3907         ShadowDescendant combinator. Take :slotted out of
3908         needsImplicitShadowCombinatorForMatching(), since our code doesn't do
3909         this for :slotted.
3910
3911         * css/parser/CSSSelectorParser.cpp:
3912         (WebCore::isPseudoClassFunction):
3913         :host can be both an id and a function, so don't restrict it.
3914
3915         (WebCore::CSSSelectorParser::consumePseudo):
3916         Put in a hack for :host (inside the hack we already plan on removing
3917         once we turn on).
3918
3919         (WebCore::CSSSelectorParser::consumeCombinator):
3920         Remove deep shadow combinator support, as we don't support matching
3921         on it.
3922
3923         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3924         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
3925         Make the split use our combinator, ShadowDescendant, and no longer do anything
3926         special with :slotted.
3927
3928         * cssjit/SelectorCompiler.cpp:
3929         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
3930         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3931         ShadowDescendant combinator.
3932
3933 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3934
3935         Turn the Input Events runtime flag on by default
3936         https://bugs.webkit.org/show_bug.cgi?id=164297
3937
3938         Reviewed by Ryosuke Niwa.
3939
3940         Set the initial value of inputEventsEnabled in Settings to true.
3941
3942         * page/Settings.in:
3943
3944 2016-11-01  Brady Eidson  <beidson@apple.com>
3945
3946         IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.
3947         <rdar://problem/28806933> and https://bugs.webkit.org/show_bug.cgi?id=164294
3948
3949         Reviewed by Alex Christensen.
3950
3951         Tests: storage/indexeddb/modern/idbindex-getall-1-private.html
3952                storage/indexeddb/modern/idbindex-getall-1.html
3953                storage/indexeddb/modern/idbindex-getallkeys-1-private.html
3954                storage/indexeddb/modern/idbindex-getallkeys-1.html
3955                Existing imported W3C tests.
3956
3957         * Modules/indexeddb/IDBIndex.cpp:
3958         (WebCore::IDBIndex::getAll):
3959         (WebCore::IDBIndex::getAllKeys):
3960         * Modules/indexeddb/IDBIndex.h:
3961         * Modules/indexeddb/IDBIndex.idl:
3962
3963         * Modules/indexeddb/IDBRequest.cpp:
3964         (WebCore::IDBRequest::create):
3965         (WebCore::IDBRequest::createIndexGet):
3966         (WebCore::IDBRequest::createCount): Deleted.
3967         (WebCore::IDBRequest::createGet): Deleted.
3968         * Modules/indexeddb/IDBRequest.h:
3969
3970         * Modules/indexeddb/IDBTransaction.cpp:
3971         (WebCore::IDBTransaction::requestGetAllIndexRecords):
3972         (WebCore::IDBTransaction::requestIndexRecord):
3973         (WebCore::IDBTransaction::requestCount):
3974         * Modules/indexeddb/IDBTransaction.h:
3975
3976         * Modules/indexeddb/server/IndexValueStore.cpp:
3977         (WebCore::IDBServer::IndexValueStore::allValuesForKey):
3978         * Modules/indexeddb/server/IndexValueStore.h:
3979
3980         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3981         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
3982
3983         * Modules/indexeddb/server/MemoryIndex.cpp:
3984         (WebCore::IDBServer::MemoryIndex::getAllRecords):
3985         * Modules/indexeddb/server/MemoryIndex.h:
3986
3987         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3988         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
3989         (WebCore::IDBServer::queryForGetAllObjectStoreRecords):
3990         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
3991         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
3992         (WebCore::IDBServer::queryForGetAllRecords): Deleted.
3993         *&n