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