99e4f27a907ad7be5494ea581dfb5e580f0659df
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
2
3         [css-grid] Unprefix CSS Grid Layout properties
4         https://bugs.webkit.org/show_bug.cgi?id=157137
5
6         Reviewed by Simon Fraser.
7
8         Remove "-webkit" prefix from all the grid layout properties,
9         including the display value.
10         Update the source code to remove the prefix where it was used too.
11
12         * css/CSSComputedStyleDeclaration.cpp:
13         (WebCore::isLayoutDependent):
14         (WebCore::ComputedStyleExtractor::propertyValue):
15         * css/CSSParser.cpp:
16         (WebCore::isSimpleLengthPropertyID):
17         (WebCore::isValidKeywordPropertyAndValue):
18         (WebCore::CSSParser::parseValue):
19         (WebCore::CSSParser::parseGridGapShorthand):
20         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
21         (WebCore::CSSParser::parseGridTemplateShorthand):
22         (WebCore::CSSParser::parseGridShorthand):
23         (WebCore::CSSParser::parseGridAreaShorthand):
24         * css/CSSPrimitiveValueMappings.h:
25         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
26         * css/CSSPropertyNames.in:
27         * css/CSSValueKeywords.in:
28         * css/StyleBuilderCustom.h:
29         (WebCore::StyleBuilderCustom::applyInitialGridTemplateAreas):
30         (WebCore::StyleBuilderCustom::applyInheritGridTemplateAreas):
31         (WebCore::StyleBuilderCustom::applyValueGridTemplateAreas):
32         (WebCore::StyleBuilderCustom::applyInitialGridTemplateColumns):
33         (WebCore::StyleBuilderCustom::applyInheritGridTemplateColumns):
34         (WebCore::StyleBuilderCustom::applyValueGridTemplateColumns):
35         (WebCore::StyleBuilderCustom::applyInitialGridTemplateRows):
36         (WebCore::StyleBuilderCustom::applyInheritGridTemplateRows):
37         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
38         * css/StyleProperties.cpp:
39         (WebCore::StyleProperties::getPropertyValue):
40
41 2016-05-06  Nan Wang  <n_wang@apple.com>
42
43         AX: <attachment> element should have a replacement character
44         https://bugs.webkit.org/show_bug.cgi?id=157406
45
46         Reviewed by Chris Fleizach.
47
48         Make sure attachment element is considered as a replaced node.
49
50         Test: accessibility/mac/attachment-element-replacement-character.html
51
52         * editing/TextIterator.cpp:
53         (WebCore::isRendererReplacedElement):
54
55 2016-05-06  Nan Wang  <n_wang@apple.com>
56
57         AX: String for document range is empty if end visible position anchors to a ignored replaced node
58         https://bugs.webkit.org/show_bug.cgi?id=157403
59
60         Reviewed by Chris Fleizach.
61
62         The CharacterOffset that is converted from VisiblePositon is wrong when the VisiblePostion anchors
63         to an ignored replaced node. Fixed it by adjusting the offset of the CharacterOffset correctly in 
64         such case.
65
66         Test: accessibility/mac/text-marker-string-for-document-end-replaced-node.html
67
68         * accessibility/AXObjectCache.cpp:
69         (WebCore::characterOffsetsInOrder):
70         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
71         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
72
73 2016-05-05  David Kilzer  <ddkilzer@apple.com>
74
75         [iOS] WebCore does not need to link to CoreAudio, GraphicsServices, SystemConfiguration frameworks
76         <https://webkit.org/b/157413>
77         <rdar://problem/26104189>
78
79         Reviewed by Gavin Barraclough.
80
81         * Configurations/WebCore.xcconfig:
82         (OTHER_LDFLAGS_BASE_ios): Remove "-framework GraphicsServices".
83         (OTHER_LDFLAGS_PLATFORM[sdk=macosx*]): Add "-framework CoreAudio"
84         and "-framework SystemConfiguration".
85         * WebCore.xcodeproj/project.pbxproj: Remove CoreAudio.framework
86         and SystemConfiguration.framework from the project file.
87
88 2016-05-05  Brady Eidson  <beidson@apple.com>
89
90         Modern IDB (Workers): Get everything to the right threads.
91         https://bugs.webkit.org/show_bug.cgi?id=157398
92
93         Reviewed by Alex Christensen.
94
95         No new tests (No current change in behavior, will be tested as bug 149953 is resolved, enabling IDB in workers).
96
97         * dom/ScriptExecutionContext.h:
98         (WebCore::ScriptExecutionContext::postCrossThreadTask): Add a helper to post a CrossThreadTask to a context.
99                 
100         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
101         (WebCore::IDBClient::performCallbackOnCorrectThread): Helper to perform an IDB callback on either the main thread
102           or Worker thread as necessary.
103         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
104         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
105         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
106         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
107         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
108         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
109         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
110         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
111         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
112         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
113         (WebCore::IDBClient::IDBConnectionProxy::getCount):
114         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
115         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
116         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
117         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
118         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
119         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
120         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
121         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
122         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
123         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
124         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
125         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
126         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
127         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
128         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
129         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
130         (WebCore::IDBClient::IDBConnectionProxy::scheduleMainThreadTasks):
131         (WebCore::IDBClient::IDBConnectionProxy::handleMainThreadTasks):
132         * Modules/indexeddb/client/IDBConnectionProxy.h:
133         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread): Helper to marshall IDB operations from the
134           Worker thread to the main thread.
135         (WebCore::IDBClient::IDBConnectionProxy::postMainThreadTask):
136
137         * Modules/indexeddb/IDBTransaction.cpp:
138         (WebCore::IDBTransaction::originThreadID):
139         * Modules/indexeddb/IDBTransaction.h:
140         
141         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
142         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
143         * Modules/indexeddb/client/IDBConnectionToServer.h:
144
145         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
146
147         * Modules/indexeddb/client/TransactionOperation.cpp:
148         (WebCore::IDBClient::TransactionOperation::scriptExecutionContext):
149         * Modules/indexeddb/client/TransactionOperation.h:
150
151         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
152         (WebCore::nextClientResourceNumber):
153
154         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
155         (WebCore::InProcessIDBServer::putOrAdd):
156         * Modules/indexeddb/shared/InProcessIDBServer.h:
157
158 2016-05-05  Dean Jackson  <dino@apple.com>
159
160         4 and 8 digit color attributes should use the crazypants algorithm, not the CSS one.
161         https://bugs.webkit.org/show_bug.cgi?id=157402
162         <rdar://problem/26131142>
163
164         Reviewed by Simon Fraser.
165
166         Noel and Tab from Google alerted me to the fact I broke some legacy
167         HTML color attributes when I added support for 4 and 8 digit hex colors
168         in CSS. The fix is to favor the "crazy" parsing unless we know it is a 3 or 6
169         digit hex value (in which case we try the CSS algorithm first).
170
171         Covered by reverting an existing test.
172
173         * html/HTMLElement.cpp:
174         (WebCore::HTMLElement::addHTMLColorToStyle):
175
176 2016-05-05  Brady Eidson  <beidson@apple.com>
177
178         Modern IDB (Workers): Remove the need for IDBConnectionProxy to expose its IDBConnectionToServer.
179         https://bugs.webkit.org/show_bug.cgi?id=157394
180
181         Reviewed by Alex Christensen.
182
183         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
184
185         * Modules/indexeddb/IDBDatabase.cpp:
186         (WebCore::IDBDatabase::transaction):
187         (WebCore::IDBDatabase::fireVersionChangeEvent):
188         (WebCore::IDBDatabase::dispatchEvent):
189         * Modules/indexeddb/IDBDatabase.h:
190         (WebCore::IDBDatabase::serverConnection): Deleted.
191
192         * Modules/indexeddb/IDBOpenDBRequest.cpp:
193         (WebCore::IDBOpenDBRequest::requestCompleted):
194
195         * Modules/indexeddb/IDBRequest.cpp:
196         (WebCore::IDBRequest::IDBRequest):
197
198         * Modules/indexeddb/IDBTransaction.cpp:
199         (WebCore::IDBTransaction::connectionProxy):
200         (WebCore::IDBTransaction::serverConnection): Deleted.
201         * Modules/indexeddb/IDBTransaction.h:
202
203         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
204         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
205         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer): Deleted.
206         * Modules/indexeddb/client/IDBConnectionProxy.h:
207
208         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
209         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
210
211         * Modules/indexeddb/client/TransactionOperation.h:
212         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
213
214         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
215         (WebCore::IDBCursorInfo::IDBCursorInfo):
216
217         * Modules/indexeddb/shared/IDBRequestData.cpp:
218         (WebCore::IDBRequestData::IDBRequestData):
219
220         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
221         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
222         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
223
224         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
225         (WebCore::IDBTransactionInfo::clientTransaction):
226         * Modules/indexeddb/shared/IDBTransactionInfo.h:
227
228 2016-05-05  Commit Queue  <commit-queue@webkit.org>
229
230         Unreviewed, rolling out r200479.
231         https://bugs.webkit.org/show_bug.cgi?id=157397
232
233         A LayoutTest added with this change is crashing on Mac WK1
234         test runs. (Requested by ryanhaddad on #webkit).
235
236         Reverted changeset:
237
238         "For keyboard users, activating a fragment URL should transfer
239         focus and caret to the destination"
240         https://bugs.webkit.org/show_bug.cgi?id=116046
241         http://trac.webkit.org/changeset/200479
242
243 2016-05-05  Chris Dumez  <cdumez@apple.com>
244
245         CORS check is sometimes incorrectly failing for media loads
246         https://bugs.webkit.org/show_bug.cgi?id=157370
247         <rdar://problem/26071607>
248
249         Reviewed by Alex Christensen.
250
251         When the media library is issuing a conditional request for a media
252         element that had the 'crossorigin' attribute, we would fail the CORS
253         check and log an error if the server were to respond with a "304 Not
254         Modified" response because the 304 response usually does not have
255         the necessary "Access-Control-Allow-Origin: *" header (At least for
256         Apache) and we cannot use the cached headers either since WebKit
257         does not have them.
258
259         To work around the problem in the short term, we now drop the
260         conditional headers from the request that the media library is
261         giving us when the media element has the 'crossorigin' attribute
262         set. As a result, the server will never respond with a 304 and we
263         will be able to do a CORS check on the full (e.g. 206) response.
264
265         In the long term, we need to deal with this better as this means
266         we may sometimes fail to reuse cached data. For now, this is only
267         potentially inefficient in the cases that were broken (i.e. no
268         video would play and we would log an error in the console).
269
270         Test: http/tests/security/video-cross-origin-caching.html
271
272         * loader/MediaResourceLoader.cpp:
273         (WebCore::MediaResourceLoader::requestResource):
274         Make the request unconditional if the media element has the
275         'crossorigin' attribute set.
276
277         * platform/network/ResourceRequestBase.cpp:
278         (WebCore::ResourceRequestBase::isConditional):
279         (WebCore::ResourceRequestBase::makeUnconditional):
280         When fixing the bug above, I noticed that those method do not do
281         the right thing if the m_httpHeaderFields data member has not
282         been populated yet. m_httpHeaderFields is lazily initialized so
283         we need to call updateResourceRequest() before using it.
284
285 2016-05-05  Zalan Bujtas  <zalan@apple.com>
286
287         Stop traversing at the container block when computing RTL inline static distance.
288         https://bugs.webkit.org/show_bug.cgi?id=157349
289         <rdar://problem/25994087>
290
291         Reviewed by David Hyatt.
292
293         When computing the inline static distance for a child renderer, we start at its enclosing box
294         and traverse up all the way to the container block.
295         However when the enclosing box is the ancestor of the container block, we
296         should just bail out right away since there's no container to use to adjust the position.
297
298         Test: fast/multicol/positioned-rtl-column-crash.html
299
300         * rendering/RenderBox.cpp:
301         (WebCore::computeInlineStaticDistance):
302
303 2016-05-05  Ada Chan  <adachan@apple.com>
304
305         Add WebKitAdditions extension points in media controls related code in RenderThemeMac
306         https://bugs.webkit.org/show_bug.cgi?id=157390
307
308         Reviewed by Anders Carlsson.
309
310         * rendering/RenderThemeMac.mm:
311         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
312         (WebCore::RenderThemeMac::mediaControlsScript):
313
314 2016-05-05  Jer Noble  <jer.noble@apple.com>
315
316         [WK2] Media controls don't update if controller is created after the interface is created
317         https://bugs.webkit.org/show_bug.cgi?id=157376
318
319         Reviewed by Beth Dakin.
320
321         Add getter methods to WebPlaybackSessionModel so that the model's values can be retrieved
322         if those values were missed before the equivalent WebPlaybackSessionInterface methods were
323         called. This necessatates a bunch of changes in HTMLMediaElement and related classes to
324         change PassRefPtr<TimeRanges> types to Ref<TimeRanges> (and one change in TimeRanges itself).
325         WebPlaybackSessionModelMediaElement can implement these new getter methods by querying the
326         values from the HTMLMediaElement, something it was doing already, so most of those changes
327         are simple refactoring.
328
329         There's no reason any longer for WebVideoFullscreenModel to inherit from WebPlaybackSessionModel,
330         so remove that superclass.
331
332         In WebPlaybackSessionInterfaceMac, when a new WebPlaybackControlsManager is set, use the new
333         getter methods on WebPlaybackSessionModel to update the values in the manager.
334
335         * html/HTMLMediaElement.cpp:
336         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
337         (WebCore::HTMLMediaElement::maxBufferedTime):
338         (WebCore::HTMLMediaElement::played):
339         (WebCore::HTMLMediaElement::buffered): Deleted.
340         (WebCore::HTMLMediaElement::seekable): Deleted.
341         * html/HTMLMediaElement.h:
342         * html/MediaController.cpp:
343         (MediaController::buffered):
344         (MediaController::seekable):
345         (MediaController::played):
346         * html/MediaController.h:
347         * html/MediaControllerInterface.h:
348         * html/TimeRanges.cpp:
349         (WebCore::TimeRanges::copy):
350         * html/TimeRanges.h:
351         * platform/cocoa/WebPlaybackSessionModel.h:
352         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
353         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
354         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
355         (WebPlaybackSessionModelMediaElement::updateForEventName):
356         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
357         (WebPlaybackSessionModelMediaElement::observedEventNames):
358         (WebPlaybackSessionModelMediaElement::eventNameAll):
359         (WebPlaybackSessionModelMediaElement::duration):
360         (WebPlaybackSessionModelMediaElement::currentTime):
361         (WebPlaybackSessionModelMediaElement::bufferedTime):
362         (WebPlaybackSessionModelMediaElement::isPlaying):
363         (WebPlaybackSessionModelMediaElement::playbackRate):
364         (WebPlaybackSessionModelMediaElement::seekableRanges):
365         (WebPlaybackSessionModelMediaElement::canPlayFastReverse):
366         (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
367         (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex):
368         (WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
369         (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex):
370         (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled):
371         (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled):
372         * platform/cocoa/WebVideoFullscreenModel.h:
373         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
374         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
375         (WebVideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
376         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
377         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
378         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
379         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
380         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
381         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
382         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
383         (WebVideoFullscreenControllerContext::play): Deleted.
384         (WebVideoFullscreenControllerContext::pause): Deleted.
385         (WebVideoFullscreenControllerContext::togglePlayState): Deleted.
386         (WebVideoFullscreenControllerContext::beginScrubbing): Deleted.
387         (WebVideoFullscreenControllerContext::endScrubbing): Deleted.
388         (WebVideoFullscreenControllerContext::seekToTime): Deleted.
389         (WebVideoFullscreenControllerContext::fastSeek): Deleted.
390         (WebVideoFullscreenControllerContext::beginScanningForward): Deleted.
391         (WebVideoFullscreenControllerContext::beginScanningBackward): Deleted.
392         (WebVideoFullscreenControllerContext::endScanning): Deleted.
393         (WebVideoFullscreenControllerContext::selectAudioMediaOption): Deleted.
394         (WebVideoFullscreenControllerContext::selectLegibleMediaOption): Deleted.
395         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
396         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
397         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
398         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
399         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
400         (WebCore::timeRangesToArray):
401         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
402         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
403         * platform/mac/WebVideoFullscreenInterfaceMac.h:
404
405 2016-05-05  Brady Eidson  <beidson@apple.com>
406
407         Modern IDB (Workers): Move TransactionOperation management from IDBConnectionToServer to IDBConnectionProxy.
408         https://bugs.webkit.org/show_bug.cgi?id=157392
409
410         Reviewed by Alex Christensen.
411
412         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
413
414         Set up TransactionOperations on the IDBConnectionProxy instead of the IDBConnectionToServer:
415         * Modules/indexeddb/IDBTransaction.cpp:
416         (WebCore::IDBTransaction::createObjectStoreOnServer):
417         (WebCore::IDBTransaction::createIndexOnServer):
418         (WebCore::IDBTransaction::openCursorOnServer):
419         (WebCore::IDBTransaction::iterateCursorOnServer):
420         (WebCore::IDBTransaction::getRecordOnServer):
421         (WebCore::IDBTransaction::getCountOnServer):
422         (WebCore::IDBTransaction::deleteRecordOnServer):
423         (WebCore::IDBTransaction::clearObjectStoreOnServer):
424         (WebCore::IDBTransaction::putOrAddOnServer):
425         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
426         (WebCore::IDBTransaction::deleteIndexOnServer):
427         
428         IDBConnectionProxy is now the owner of dispatched TransactionOperations:
429         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
430         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
431         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
432         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
433         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
434         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
435         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
436         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
437         (WebCore::IDBClient::IDBConnectionProxy::getCount):
438         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
439         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
440         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
441         (WebCore::IDBClient::IDBConnectionProxy::saveOperation):
442         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
443         * Modules/indexeddb/client/IDBConnectionProxy.h:
444         
445         Proxy this in-and-out calls to the ConnectionProxy:
446         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
447         (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
448         (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore):
449         (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
450         (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
451         (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
452         (WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore):
453         (WebCore::IDBClient::IDBConnectionToServer::createIndex):
454         (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
455         (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
456         (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
457         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
458         (WebCore::IDBClient::IDBConnectionToServer::didPutOrAdd):
459         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
460         (WebCore::IDBClient::IDBConnectionToServer::didGetRecord):
461         (WebCore::IDBClient::IDBConnectionToServer::getCount):
462         (WebCore::IDBClient::IDBConnectionToServer::didGetCount):
463         (WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
464         (WebCore::IDBClient::IDBConnectionToServer::didDeleteRecord):
465         (WebCore::IDBClient::IDBConnectionToServer::openCursor):
466         (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
467         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
468         (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
469         (WebCore::IDBClient::IDBConnectionToServer::saveOperation): Deleted.
470         (WebCore::IDBClient::IDBConnectionToServer::completeOperation): Deleted.
471         * Modules/indexeddb/client/IDBConnectionToServer.h:
472
473         - Give TransactionOperation a ThreadIdentifier member
474         - Privatize most public methods from TransactionOperation
475         - Make IDBRequestData a friend so it can get at the private methods
476         * Modules/indexeddb/client/TransactionOperation.h:
477         (WebCore::IDBClient::TransactionOperation::~TransactionOperation):
478         (WebCore::IDBClient::TransactionOperation::perform):
479         (WebCore::IDBClient::TransactionOperation::completed):
480         (WebCore::IDBClient::TransactionOperation::originThreadID):
481         (WebCore::IDBClient::TransactionOperation::transactionIdentifier):
482         (WebCore::IDBClient::TransactionOperation::objectStoreIdentifier):
483         (WebCore::IDBClient::TransactionOperation::indexIdentifier):
484         (WebCore::IDBClient::TransactionOperation::cursorIdentifier):
485         (WebCore::IDBClient::TransactionOperation::transaction):
486         (WebCore::IDBClient::TransactionOperation::indexRecordType):
487
488 2016-05-05  Zalan Bujtas  <zalan@apple.com>
489
490         Do not attempt to compute min/max width.
491         https://bugs.webkit.org/show_bug.cgi?id=157320
492
493         Reviewed by David Hyatt.
494
495         Replaced elements with no intrinsic size (only with ratio) should not call the containing
496         block to compute the min/max width when the containing block's min/max width
497         depends on the children's intrinsic size. It could lead to infinite recursion.
498
499         Test: fast/replaced/before-content-intrinsic-crash.html
500
501         * rendering/RenderBox.cpp:
502         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth): Unrelated code change.
503         * rendering/RenderImage.cpp: Unrelated code change.
504         (WebCore::RenderImage::RenderImage): Deleted.
505         * rendering/RenderImage.h:
506         * rendering/RenderReplaced.cpp:
507         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
508
509 2016-05-04  Brady Eidson  <beidson@apple.com>
510
511         Modern IDB: Move all IDB DOM object management from IDBConnectionToServer to IDBConnectionProxy.
512         https://bugs.webkit.org/show_bug.cgi?id=157348
513
514         Reviewed by Alex Christensen.
515
516         No new tests (Refactor, no change in behavior yet).
517
518         This is in-progress IDB-in-Workers code that is isolated enough to land right now.
519         
520         The goal is to have IDBConnectionToServer be a main-thread-only object, leaving IDBConnectionProxy
521         as the threading bridge between the worker thread and the main thread.
522         
523         As such, IDBConnectionToServer no longer maintains maps of IDB DOM objects, but instead the proxy
524         does and guards that access with locks.
525         
526         No threading changes takes place in this patch but it does scatter some isMainThread() checks and FIXMEs 
527         accurately representing where threading changes will take place once I can return to this.
528         
529         * Modules/indexeddb/IDBDatabase.cpp:
530         (WebCore::IDBDatabase::IDBDatabase):
531         (WebCore::IDBDatabase::~IDBDatabase):
532         (WebCore::IDBDatabase::maybeCloseInServer):
533
534         * Modules/indexeddb/IDBOpenDBRequest.cpp:
535         (WebCore::IDBOpenDBRequest::dispatchEvent):
536
537         * Modules/indexeddb/IDBTransaction.cpp:
538         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
539         (WebCore::IDBTransaction::commitOnServer):
540         (WebCore::IDBTransaction::establishOnServer):
541
542         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
543         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
544         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
545         (WebCore::IDBClient::IDBConnectionProxy::didOpenDatabase):
546         (WebCore::IDBClient::IDBConnectionProxy::didDeleteDatabase):
547         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
548         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
549         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
550         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
551         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
552         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
553         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
554         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
555         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
556         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
557         (WebCore::IDBClient::IDBConnectionProxy::hasRecordOfTransaction):
558         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
559         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
560         (WebCore::IDBClient::IDBConnectionProxy::registerDatabaseConnection):
561         (WebCore::IDBClient::IDBConnectionProxy::unregisterDatabaseConnection):
562         * Modules/indexeddb/client/IDBConnectionProxy.h:
563         
564         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
565         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
566         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
567         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
568         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
569         (WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
570         (WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
571         (WebCore::IDBClient::IDBConnectionToServer::didCommitTransaction):
572         (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
573         (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
574         (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
575         (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
576         (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
577         (WebCore::IDBClient::IDBConnectionToServer::didStartTransaction):
578         (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked):
579         (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
580         (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection): Deleted.
581         (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection): Deleted.
582         (WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction): Deleted.
583         * Modules/indexeddb/client/IDBConnectionToServer.h:
584         
585         * Modules/indexeddb/shared/IDBRequestData.cpp:
586         (WebCore::IDBRequestData::IDBRequestData):
587         * Modules/indexeddb/shared/IDBRequestData.h:
588         
589         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
590         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
591         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
592
593 2016-05-04  Brady Eidson  <beidson@apple.com>
594
595         Modern IDB: Add isolatedCopy to a few more objects.
596         https://bugs.webkit.org/show_bug.cgi?id=157330
597
598         Reviewed by Alex Christensen.
599
600         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
601
602         * Modules/indexeddb/shared/IDBRequestData.cpp:
603         (WebCore::IDBRequestData::IDBRequestData):
604         (WebCore::IDBRequestData::isolatedCopy):
605         * Modules/indexeddb/shared/IDBRequestData.h:
606
607         * Modules/indexeddb/shared/IDBResultData.cpp:
608         (WebCore::IDBResultData::IDBResultData):
609         (WebCore::IDBResultData::isolatedCopy):
610         * Modules/indexeddb/shared/IDBResultData.h:
611
612 2016-05-04  Brady Eidson  <beidson@apple.com>
613
614         Modern IDB: Add thread identifiers and assertions to IDB DOM objects.
615         https://bugs.webkit.org/show_bug.cgi?id=157329
616
617         Reviewed by Alex Christensen.
618
619         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
620
621         * Modules/indexeddb/IDBCursor.cpp:
622         (WebCore::IDBCursor::IDBCursor):
623         (WebCore::IDBCursor::~IDBCursor):
624         (WebCore::IDBCursor::sourcesDeleted):
625         (WebCore::IDBCursor::transaction):
626         (WebCore::IDBCursor::direction):
627         (WebCore::IDBCursor::update):
628         (WebCore::IDBCursor::advance):
629         (WebCore::IDBCursor::continueFunction):
630         (WebCore::IDBCursor::uncheckedIterateCursor):
631         (WebCore::IDBCursor::deleteFunction):
632         (WebCore::IDBCursor::setGetResult):
633         
634         * Modules/indexeddb/IDBDatabase.cpp:
635         (WebCore::IDBDatabase::~IDBDatabase):
636         (WebCore::IDBDatabase::hasPendingActivity):
637         (WebCore::IDBDatabase::name):
638         (WebCore::IDBDatabase::version):
639         (WebCore::IDBDatabase::objectStoreNames):
640         (WebCore::IDBDatabase::createObjectStore):
641         (WebCore::IDBDatabase::transaction):
642         (WebCore::IDBDatabase::deleteObjectStore):
643         (WebCore::IDBDatabase::close):
644         (WebCore::IDBDatabase::maybeCloseInServer):
645         (WebCore::IDBDatabase::activeDOMObjectName):
646         (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
647         (WebCore::IDBDatabase::stop):
648         (WebCore::IDBDatabase::startVersionChangeTransaction):
649         (WebCore::IDBDatabase::didStartTransaction):
650         (WebCore::IDBDatabase::willCommitTransaction):
651         (WebCore::IDBDatabase::didCommitTransaction):
652         (WebCore::IDBDatabase::willAbortTransaction):
653         (WebCore::IDBDatabase::didAbortTransaction):
654         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
655         (WebCore::IDBDatabase::fireVersionChangeEvent):
656         (WebCore::IDBDatabase::dispatchEvent):
657         (WebCore::IDBDatabase::didCreateIndexInfo):
658         (WebCore::IDBDatabase::didDeleteIndexInfo):
659         * Modules/indexeddb/IDBDatabase.h:
660         (WebCore::IDBDatabase::originThreadID):
661         
662         * Modules/indexeddb/IDBIndex.cpp:
663         (WebCore::IDBIndex::IDBIndex):
664         (WebCore::IDBIndex::~IDBIndex):
665         (WebCore::IDBIndex::name):
666         (WebCore::IDBIndex::objectStore):
667         (WebCore::IDBIndex::keyPath):
668         (WebCore::IDBIndex::unique):
669         (WebCore::IDBIndex::multiEntry):
670         (WebCore::IDBIndex::openCursor):
671         (WebCore::IDBIndex::doCount):
672         (WebCore::IDBIndex::openKeyCursor):
673         (WebCore::IDBIndex::doGet):
674         (WebCore::IDBIndex::doGetKey):
675         (WebCore::IDBIndex::markAsDeleted):
676         
677         * Modules/indexeddb/IDBObjectStore.cpp:
678         (WebCore::IDBObjectStore::IDBObjectStore):
679         (WebCore::IDBObjectStore::~IDBObjectStore):
680         (WebCore::IDBObjectStore::name):
681         (WebCore::IDBObjectStore::keyPath):
682         (WebCore::IDBObjectStore::indexNames):
683         (WebCore::IDBObjectStore::transaction):
684         (WebCore::IDBObjectStore::autoIncrement):
685         (WebCore::IDBObjectStore::openCursor):
686         (WebCore::IDBObjectStore::get):
687         (WebCore::IDBObjectStore::putOrAdd):
688         (WebCore::IDBObjectStore::doDelete):
689         (WebCore::IDBObjectStore::clear):
690         (WebCore::IDBObjectStore::createIndex):
691         (WebCore::IDBObjectStore::index):
692         (WebCore::IDBObjectStore::deleteIndex):
693         (WebCore::IDBObjectStore::doCount):
694         (WebCore::IDBObjectStore::markAsDeleted):
695         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
696         
697         * Modules/indexeddb/IDBOpenDBRequest.cpp:
698         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
699         (WebCore::IDBOpenDBRequest::onError):
700         (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
701         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
702         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
703         (WebCore::IDBOpenDBRequest::dispatchEvent):
704         (WebCore::IDBOpenDBRequest::onSuccess):
705         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
706         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
707         (WebCore::IDBOpenDBRequest::requestCompleted):
708         (WebCore::IDBOpenDBRequest::requestBlocked):
709         
710         * Modules/indexeddb/IDBRequest.cpp:
711         (WebCore::IDBRequest::~IDBRequest):
712         (WebCore::IDBRequest::errorCode):
713         (WebCore::IDBRequest::error):
714         (WebCore::IDBRequest::setSource):
715         (WebCore::IDBRequest::setVersionChangeTransaction):
716         (WebCore::IDBRequest::transaction):
717         (WebCore::IDBRequest::readyState):
718         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
719         (WebCore::IDBRequest::sourceIndexIdentifier):
720         (WebCore::IDBRequest::requestedIndexRecordType):
721         (WebCore::IDBRequest::eventTargetInterface):
722         (WebCore::IDBRequest::activeDOMObjectName):
723         (WebCore::IDBRequest::canSuspendForDocumentSuspension):
724         (WebCore::IDBRequest::hasPendingActivity):
725         (WebCore::IDBRequest::stop):
726         (WebCore::IDBRequest::enqueueEvent):
727         (WebCore::IDBRequest::dispatchEvent):
728         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
729         (WebCore::IDBRequest::setResult):
730         (WebCore::IDBRequest::setResultToStructuredClone):
731         (WebCore::IDBRequest::clearResult):
732         (WebCore::IDBRequest::setResultToUndefined):
733         (WebCore::IDBRequest::resultCursor):
734         (WebCore::IDBRequest::willIterateCursor):
735         (WebCore::IDBRequest::didOpenOrIterateCursor):
736         (WebCore::IDBRequest::requestCompleted):
737         (WebCore::IDBRequest::onError):
738         (WebCore::IDBRequest::onSuccess):
739         * Modules/indexeddb/IDBRequest.h:
740         (WebCore::IDBRequest::originThreadID):
741         
742         * Modules/indexeddb/IDBTransaction.cpp:
743         (WebCore::IDBTransaction::IDBTransaction):
744         (WebCore::IDBTransaction::~IDBTransaction):
745         (WebCore::IDBTransaction::mode):
746         (WebCore::IDBTransaction::db):
747         (WebCore::IDBTransaction::serverConnection):
748         (WebCore::IDBTransaction::error):
749         (WebCore::IDBTransaction::objectStore):
750         (WebCore::IDBTransaction::abortDueToFailedRequest):
751         (WebCore::IDBTransaction::transitionedToFinishing):
752         (WebCore::IDBTransaction::abort):
753         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
754         (WebCore::IDBTransaction::activeDOMObjectName):
755         (WebCore::IDBTransaction::canSuspendForDocumentSuspension):
756         (WebCore::IDBTransaction::hasPendingActivity):
757         (WebCore::IDBTransaction::stop):
758         (WebCore::IDBTransaction::isActive):
759         (WebCore::IDBTransaction::isFinishedOrFinishing):
760         (WebCore::IDBTransaction::addRequest):
761         (WebCore::IDBTransaction::removeRequest):
762         (WebCore::IDBTransaction::scheduleOperation):
763         (WebCore::IDBTransaction::scheduleOperationTimer):
764         (WebCore::IDBTransaction::operationTimerFired):
765         (WebCore::IDBTransaction::commit):
766         (WebCore::IDBTransaction::commitOnServer):
767         (WebCore::IDBTransaction::finishAbortOrCommit):
768         (WebCore::IDBTransaction::didStart):
769         (WebCore::IDBTransaction::notifyDidAbort):
770         (WebCore::IDBTransaction::didAbort):
771         (WebCore::IDBTransaction::didCommit):
772         (WebCore::IDBTransaction::fireOnComplete):
773         (WebCore::IDBTransaction::fireOnAbort):
774         (WebCore::IDBTransaction::enqueueEvent):
775         (WebCore::IDBTransaction::dispatchEvent):
776         (WebCore::IDBTransaction::createObjectStore):
777         (WebCore::IDBTransaction::createObjectStoreOnServer):
778         (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
779         (WebCore::IDBTransaction::createIndex):
780         (WebCore::IDBTransaction::createIndexOnServer):
781         (WebCore::IDBTransaction::didCreateIndexOnServer):
782         (WebCore::IDBTransaction::requestOpenCursor):
783         (WebCore::IDBTransaction::doRequestOpenCursor):
784         (WebCore::IDBTransaction::openCursorOnServer):
785         (WebCore::IDBTransaction::didOpenCursorOnServer):
786         (WebCore::IDBTransaction::iterateCursor):
787         (WebCore::IDBTransaction::iterateCursorOnServer):
788         (WebCore::IDBTransaction::didIterateCursorOnServer):
789         (WebCore::IDBTransaction::requestGetRecord):
790         (WebCore::IDBTransaction::requestGetValue):
791         (WebCore::IDBTransaction::requestGetKey):
792         (WebCore::IDBTransaction::requestIndexRecord):
793         (WebCore::IDBTransaction::getRecordOnServer):
794         (WebCore::IDBTransaction::didGetRecordOnServer):
795         (WebCore::IDBTransaction::requestCount):
796         (WebCore::IDBTransaction::getCountOnServer):
797         (WebCore::IDBTransaction::didGetCountOnServer):
798         (WebCore::IDBTransaction::requestDeleteRecord):
799         (WebCore::IDBTransaction::deleteRecordOnServer):
800         (WebCore::IDBTransaction::didDeleteRecordOnServer):
801         (WebCore::IDBTransaction::requestClearObjectStore):
802         (WebCore::IDBTransaction::clearObjectStoreOnServer):
803         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
804         (WebCore::IDBTransaction::requestPutOrAdd):
805         (WebCore::IDBTransaction::putOrAddOnServer):
806         (WebCore::IDBTransaction::didPutOrAddOnServer):
807         (WebCore::IDBTransaction::deleteObjectStore):
808         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
809         (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
810         (WebCore::IDBTransaction::deleteIndex):
811         (WebCore::IDBTransaction::deleteIndexOnServer):
812         (WebCore::IDBTransaction::didDeleteIndexOnServer):
813         (WebCore::IDBTransaction::operationDidComplete):
814         (WebCore::IDBTransaction::establishOnServer):
815         (WebCore::IDBTransaction::activate):
816         (WebCore::IDBTransaction::deactivate):
817
818 2016-05-05  Nan Wang  <n_wang@apple.com>
819
820         For keyboard users, activating a fragment URL should transfer focus and caret to the destination
821         https://bugs.webkit.org/show_bug.cgi?id=116046
822
823         Reviewed by Ryosuke Niwa.
824
825         Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
826         and there is no focused element, we start searching for next focus candidates at the sequential
827         focus navigation node.
828
829         Test: fast/events/sequential-focus-navigation-starting-point.html
830
831         * dom/Document.cpp:
832         (WebCore::Document::removedLastRef):
833         (WebCore::Document::destroyRenderTree):
834         (WebCore::Document::removeFocusedNodeOfSubtree):
835         (WebCore::Document::hoveredElementDidDetach):
836         (WebCore::Document::setFocusedElement):
837         (WebCore::isNodeFrameOrDocument):
838         (WebCore::Document::setFocusNavigationStartingNode):
839         (WebCore::Document::focusNavigationStartingNode):
840         (WebCore::Document::setCSSTarget):
841         (WebCore::Document::nodeChildrenWillBeRemoved):
842         (WebCore::Document::nodeWillBeRemoved):
843         (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
844         (WebCore::Document::updateFocusNavigationStartingNodeWithNodeRemoval):
845         (WebCore::Document::textInserted):
846         * dom/Document.h:
847         (WebCore::Document::userActionElements):
848         * page/EventHandler.cpp:
849         (WebCore::EventHandler::handleMousePressEvent):
850         * page/FocusController.cpp:
851         (WebCore::FocusController::advanceFocusInDocumentOrder):
852         * page/FrameView.cpp:
853         (WebCore::FrameView::scrollToAnchor):
854
855 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
856
857         Another iOS debug build fix after r200464.
858
859         * dom/EventContext.h:
860         (WebCore::EventContext::isUnreachableNode):
861
862 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
863
864         iOS debug build fix after r200464.
865
866         * dom/EventContext.cpp:
867         (WebCore::TouchEventContext::checkReachability):
868
869 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
870
871         Revert r200390, thus putting r199259 and r200161 and back.
872
873         * loader/HistoryController.cpp:
874         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
875         * page/FrameView.cpp:
876         (WebCore::FrameView::adjustTiledBackingScrollability):
877         * page/Page.h:
878         (WebCore::Page::obscuredInset):
879         (WebCore::Page::setObscuredInset):
880         (WebCore::Page::enclosedInScrollableAncestorView):
881         (WebCore::Page::setEnclosedInScrollableAncestorView):
882         * platform/ScrollView.h:
883         (WebCore::ScrollView::platformObscuredInset): Deleted.
884         (WebCore::ScrollView::platformSetObscuredInset): Deleted.
885
886 2016-05-05  Sam Weinig  <sam@webkit.org>
887
888         Fix the build.
889
890         * platform/network/cf/CertificateInfo.h:
891
892 2016-05-05  Eric Carlson  <eric.carlson@apple.com>
893
894         [iOS] Media information is sometimes not shown in Control Center
895         https://bugs.webkit.org/show_bug.cgi?id=157377
896
897         Reviewed by Jer Noble.
898
899         * platform/audio/ios/MediaSessionManagerIOS.h:
900         * platform/audio/ios/MediaSessionManagerIOS.mm:
901         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Store values passed to MPNowPlayingInfoCenter
902           individually instead of in a dictionary.
903
904 2016-05-04  Simon Fraser  <simon.fraser@apple.com>
905
906         Comments on wired.com are blurry
907         https://bugs.webkit.org/show_bug.cgi?id=148630
908         rdar://problem/22499655
909
910         Reviewed by Tim Horton.
911
912         Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers
913         with some configurations of transforms, perspective and clipping.
914
915         Test: compositing/contents-scale/rasterization-scale.html
916
917         * platform/graphics/ca/TileController.cpp:
918         (WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid,
919         because TileGrid's constructor needs to read the device scale.
920         * platform/graphics/ca/TileController.h:
921         * platform/graphics/ca/TileGrid.cpp:
922         (WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto 
923         the tile grid container layer on constructions, and in setScale().
924         (WebCore::TileGrid::setScale):
925
926 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
927
928         event.target shouldn't be retargeted as the event bubbles into a slot
929         https://bugs.webkit.org/show_bug.cgi?id=157369
930
931         Reviewed by Antti Koivisto.
932
933         When an event bubbles up from an assigned node to its assigned slot, we shouldn't be adjusting
934         event.target to point to the slot. Since a shadow tree should have access to nodes outside
935         the shadow tree, event.target is accessible inside the shadow tree of such a slot.
936
937         New behavior matches the behavior of Google Chrome Canary as well as the shadow DOM specification:
938         http://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm
939
940         Test: fast/shadow-dom/event-inside-slotted-node.html
941
942         * dom/Event.cpp:
943         (WebCore::Event::deepPath):
944         * dom/EventContext.h:
945         (WebCore::EventContext::isUnreachableNode): Use Node::isUnclosedNode instead of isReachable.
946         (WebCore::EventContext::isReachable): Deleted.
947         * dom/EventPath.cpp:
948         (WebCore::EventPath::EventPath): Don't set the target to the slot when entering a slot. Also moved
949         the code to adjust the target as we exit a shadow tree to the end of the outer loop for clarity.
950         (WebCore::isUnclosedNodeOf): Deleted. Renamed to Node::isUnclosedNode.
951         (WebCore::EventPath::setRelatedTarget):
952         (WebCore::EventPath::computePathUnclosedToTarget): Renamed from computePathDisclosedToTarget.
953         (WebCore::moveOutOfAllShadowRoots): Extracted from RelatedNodeRetargeter::RelatedNodeRetargeter.
954         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Fixed a bug that we were exiting early
955         without setting m_hasDifferentTreeRoot true when target and relatedNode are disconnected from
956         a document.
957         (WebCore::RelatedNodeRetargeter::currentNode):
958         (WebCore::RelatedNodeRetargeter::checkConsistency): Updated to match the spec with one exception.
959         We don't use null as the adjusted related target when the (original) related target and the target
960         are in two distinct disconnected trees since such a behavior is not Web compatible. This spec bug is
961         tracked by https://github.com/w3c/webcomponents/issues/494
962         * dom/EventPath.h:
963         (WebCore::EventPath::eventTargetRespectingTargetRules): Returns Node* instead of EventTarget* since
964         we need a Node in RelatedNodeRetargeter::checkConsistency.
965         * dom/Node.cpp:
966         (WebCore::Node::isUnclosedNode): Moved from RelatedNodeRetargeter.cpp
967         * dom/Node.h:
968
969 2016-05-02  Sam Weinig  <sam@webkit.org>
970
971         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
972         https://bugs.webkit.org/show_bug.cgi?id=157220
973
974         Reviewed by Darin Adler.
975
976         * platform/network/cf/CertificateInfo.h:
977         (WebCore::CertificateInfo::CertificateInfo):
978         (WebCore::CertificateInfo::trust):
979         (WebCore::CertificateInfo::isEmpty):
980         (WebCore::CertificateInfo::setCertificateChain): Deleted.
981         (WebCore::CertificateInfo::certificateChain): Deleted.
982         * platform/network/mac/CertificateInfoMac.mm:
983         (WebCore::CertificateInfo::type):
984         (WebCore::CertificateInfo::certificateChain):
985         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
986         (WebCore::CertificateInfo::dump):
987         When supported, allow CertificateInfo to contain a SecTrustRef instead of a certificate chain. We keep
988         support for holding on to a certificate chain as well, since there is API that depends on this.
989
990         * platform/network/cocoa/ResourceResponseCocoa.mm:
991         (WebCore::ResourceResponse::platformCertificateInfo):
992         When supported, use the SecTrustRef from the error instead of extracting it's certificate chain.
993
994 2016-05-04  Ada Chan  <adachan@apple.com>
995
996         When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away
997         https://bugs.webkit.org/show_bug.cgi?id=157359
998
999         Reviewed by Eric Carlson.
1000
1001         No new tests as this is done to just mitigate a visual glitch.
1002
1003         * html/HTMLMediaElement.cpp:
1004         (WebCore::HTMLMediaElement::exitFullscreen):
1005         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
1006         * html/HTMLMediaElement.h:
1007
1008 2016-05-04  Alex Christensen  <achristensen@webkit.org>
1009
1010         Blocked redirected main resource requests need descriptive errors
1011         https://bugs.webkit.org/show_bug.cgi?id=156828
1012         rdar://problem/25711316
1013
1014         Reviewed by Daniel Bates.
1015
1016         Test: http/tests/contentextensions/main-resource-redirect-error.html
1017
1018         * loader/DocumentLoader.cpp:
1019         (WebCore::DocumentLoader::startLoadingMainResource):
1020         Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame()
1021         is called to be consistent with blocked redirected main resource requests.
1022         * loader/ResourceLoader.cpp:
1023         (WebCore::ResourceLoader::willSendRequestInternal):
1024         (WebCore::ResourceLoader::blockedError):
1025         (WebCore::ResourceLoader::blockedByContentBlockerError):
1026         (WebCore::ResourceLoader::cannotShowURLError):
1027         * loader/ResourceLoader.h:
1028         Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load.
1029
1030 2016-05-05  Zan Dobersek  <zdobersek@igalia.com>
1031
1032         Fix assertions in debug builds for the GTK+ port.
1033
1034         Rubber-stamped by Carlos Garcia Campos.
1035
1036         * platform/graphics/texmap/TextureMapperGL.cpp:
1037         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
1038         Switch back to the find() + add() combo for retrieving the pointer
1039         to the SharedGLData object stored for the specific GraphicsContext3D.
1040         add() + isNewEntry is causing assertions in debug builds when adding
1041         the first entry.
1042
1043 2016-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1044
1045         [GStreamer] Adaptive streaming issues
1046         https://bugs.webkit.org/show_bug.cgi?id=144040
1047
1048         Reviewed by Philippe Normand.
1049
1050         In the case of adaptive streaming, the GST URI downloader object is creating the source object, in our case
1051         WebKitWebSrc, without taking its ownership. This is breaking the lifetime of the WebKitWebSrc element. We are
1052         using GRefPtr in WebKitWebSrc to ref/unref the object when sending notifications to the main thread, ensuring
1053         that the object is not destroyed before the main thread dispatches the message. But our smart pointers are so
1054         smart that in case of receiving a floating reference, it's converted to a full reference, so that the first time
1055         we try to take a ref of a WebKitWebSrc having a floating reference we are actually taking the ownership
1056         instead. When we try to release the reference, we are actuallty destroying the object, something that the actual
1057         owner is not expecting and causing runtime critical warnings and very often web process crashes.
1058
1059             (WebKitWebProcess:6863): GStreamer-CRITICAL **:
1060             Trying to dispose element appsrc1, but it is in READY instead of the NULL state.
1061             You need to explicitly set elements to the NULL state before
1062             dropping the final reference, to allow them to clean up.
1063             This problem may also be caused by a refcounting bug in the
1064             application or some element.
1065
1066             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_handler_get_uri: assertion 'GST_IS_URI_HANDLER(handler)' failed
1067
1068             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_get_protocol: assertion 'uri != NULL' failed
1069
1070         This should be fixed in GST, but we can workaround it in WebKit while it's fixed in GST or to prevent this from
1071         happening if other users make the same mistake. The idea is to add a ensureGRef() only available for GRefPtr
1072         when using WebKitWebSrc objects that consumes the floating reference if needed before taking the actual reference.
1073
1074         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1075         (WTF::ensureGRef): Consume the floating ref if needed.
1076         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1077         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1078         (webKitWebSrcChangeState): Use ensureGRef().
1079
1080 2016-05-05  Csaba Osztrogonác  <ossy@webkit.org>
1081
1082         [Mac][cmake] Unreviewed speculative buildfix after r200433, just for fun.
1083
1084         * PlatformMac.cmake:
1085
1086 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
1087
1088         [TexMap] Clean up TextureMapperShaderProgram
1089         https://bugs.webkit.org/show_bug.cgi?id=157302
1090
1091         Reviewed by Carlos Garcia Campos.
1092
1093         Clean up the header and the implementation file of the
1094         TextureMapperShaderProgram class. Reference the GraphicsContext3D
1095         object through a Ref<>, and have the context() return a reference,
1096         not a pointer.
1097
1098         Sort the parts of the implementation file into something more
1099         sensible. StringBuilder usage in create() is improved. getLocation()
1100         only needs to do one lookup in the m_variables map by using ensure().
1101
1102         No new tests -- no change in behavior.
1103
1104         * platform/graphics/surfaces/GLTransportSurface.cpp:
1105         (WebCore::GLTransportSurface::initializeShaderProgram):
1106         * platform/graphics/texmap/TextureMapperGL.cpp:
1107         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram):
1108         (WebCore::prepareFilterProgram):
1109         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1110         (WebCore::TextureMapperShaderProgram::create):
1111         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
1112         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
1113         (WebCore::TextureMapperShaderProgram::setMatrix):
1114         (WebCore::TextureMapperShaderProgram::getLocation):
1115         * platform/graphics/texmap/TextureMapperShaderProgram.h:
1116         (WebCore::TextureMapperShaderProgram::context):
1117
1118 2016-05-03  Darin Adler  <darin@apple.com>
1119
1120         Start on dictionary support for IDL, getting enough to work for one dictionary
1121         https://bugs.webkit.org/show_bug.cgi?id=157336
1122
1123         Reviewed by Alex Christensen.
1124
1125         * bindings/js/JSDOMBinding.h: Return RefPtr instead of PassRefPtr for the return
1126         value of toArrayBufferView. Not only is this the correct modern idiom, it also
1127         works properly with auto, and PassRefPtr does not.
1128
1129         * bindings/js/JSDOMBuild.h: Added. This has the build function template in it.
1130         It's used to build values like dictionaries. We specialize and call the tempate
1131         in generated code. This is only the initial simplistic version; will be refining
1132         for exception handling, optional handling, default value handling, and lots of
1133         other things not yet needed for this first dictionary.
1134
1135         * bindings/scripts/CodeGenerator.pm:
1136         (ProcessDocument): Handle dictionaries much like how we handle enumerations.
1137         (SkipIncludeHeader): Moved small list of special types here from CodeGeneratorJS.
1138         (IsDictionaryType): Added.
1139         (IsRefPtrType): Make this return 0 for dictionary types.
1140
1141         * bindings/scripts/CodeGeneratorJS.pm:
1142         (GenerateInterface): Added handling for dictionaries.
1143         (SkipIncludeHeader): Deleted.
1144         (AddIncludesForType): Call the the SkipIncludeHeader from CodeGenerator.pm directly.
1145         (GetNestedClassName): Factored out the work that was previously in
1146         GetEnumerationClassName so we could reuse it for dictionaries too.
1147         (GetEnumerationClassName): Changed to call GetNestedClassName.
1148         (GetEnumerationClassIdentifier): Deleted. Instead of using this, we now use templates
1149         so we can use the actual class name.
1150         (GenerateEnumerationImplementationContent): Changed parse and expectedEnumerationValues
1151         to use function template specialization instead of functions. This cleans up the code
1152         a bit and makes it eaiser to use from other templates. Later we may want to merge the
1153         parse function template build function template from JSDOMBuild.h. Added specialization
1154         of the build function template.
1155         (GetDictionaryClassName): Added. Calls GetNestedClassName.
1156         (GenerateDictionaryImplementationContent): Added. Generates the build function for each
1157         dictionary type. Initial simplistic version to be refined.
1158         (GenerateImplementation): Added dictionaries argument and called the
1159         GenerateDictionaryImplementationContent function. Also changed many functions to take
1160         interface arguments and also removed redundant interfaceName arguments from functions
1161         that formerly took both.
1162         (GenerateParametersCheck): Updated for changes above. That includes calling the new
1163         parse function template. Also changed to use auto and WTFMove, which makes the code
1164         both more generic and potentially more efficient and obviates the need for a special
1165         case for dictionary types.
1166         (GenerateCallbackHeader): Updated for changes above.
1167         (GenerateCallbackImplementation): Ditto.
1168         (GenerateImplementationFunctionCall): Ditto.
1169         (GetNativeTypeFromSignature): Ditto.
1170         (GetNativeType): Changed this function to take the interface because that's needed to
1171         get the type name right for enumeration types rather than returning "auto". Made that
1172         change as well. Moved one type, DOMStringList, into the nativeType hash instead of
1173         having explicit code here for it. Didn't add a dictionary type case here yet, but
1174         probably will need to do that in the next patch.
1175         (ShouldPassWrapperByReference): Pass interface in to GetNativeType.
1176         (GetNativeVectorInnerType): Removed unneeded special case for DOMString.
1177         (GetNativeTypeForCallbacks): Changed to take the interface.
1178         (GetNativeTypeForMemoization): Ditto.
1179         (JSValueToNative): Changed expression for Dictionary (the thing I am working to make
1180         obsolete) to name the type so it will work with auto. Added a case for dictionary
1181         types and updated the case for enumeration types.
1182         (NativeToJSValue): Updated to take an interface rather than an interface name, and to
1183         pass that along as needed.
1184
1185         * bindings/scripts/IDLParser.pm:
1186         (Parse): Add dictionaries to a list.
1187         (parseDictionary): Put name, extended attributes, and members into the dictionary.
1188         (parseDictionaryMembers): Build up a members array.
1189         (parseDictionaryMember): Put isOptional, type, name, and default value into the
1190         dictionary member.
1191
1192         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1193         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1194         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1195         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1196         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1197         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1198         * bindings/scripts/test/JS/JSTestInterface.cpp:
1199         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1200         * bindings/scripts/test/JS/JSTestNode.cpp:
1201         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1202         * bindings/scripts/test/JS/JSTestObj.cpp:
1203         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1204         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1205         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1206         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1207         * bindings/scripts/test/ObjC/DOMTestObj.h:
1208         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1209         Regenerated.
1210
1211         * bindings/scripts/test/TestObj.idl: Added some test cases that I was using to
1212         get the bindings script to work. Right now this is basically identical to the
1213         actual use of this in Element.idl, but over time I will modify it to cover more
1214         features of dictionaries. Also fixed some incorrect test cases trying to use
1215         the type "bool", which doesn't exist in IDL.
1216
1217         * dom/Element.cpp:
1218         (WebCore::Element::canHaveUserAgentShadowRoot): Added. The existing code used a
1219         combination of a virtual function on HTMLElement and type checking. It's better
1220         to just use a virtual function on Element.
1221         (WebCore::Element::attachShadow): Updated to take a ShadowRootInit struct instead
1222         of a Dictionary. Also tweaked the code in a couple other minor ways.
1223
1224         * dom/Element.h: Added the ShadowRootMode enum class and the ShadowRootInit struct,
1225         and changed attachShadow to take ShadowRootInit instead of Dictionary. Also added
1226         the private canHaveUserAgentShadowRoot virtual function.
1227
1228         * dom/Element.idl: Added ShadowRootMode, ShadowRootInit, and used them in as the
1229         arguemnt type for attachShadow.
1230
1231         * html/HTMLElement.h: Made canHaveUserAgentShadowRoot a private override instead
1232         of a public virtual function.
1233
1234 2016-05-04  Eric Carlson  <eric.carlson@apple.com>
1235
1236         [iOS] Playback does not pause when locking screen after playing to AirPlay.
1237         https://bugs.webkit.org/show_bug.cgi?id=157366
1238         <rdar://problem/22100651>
1239
1240         Reviewed by Dean Jackson.
1241
1242         * platform/audio/PlatformMediaSession.cpp:
1243         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Save and restore
1244           m_interruptionCount around calling sessionIsPlayingToWirelessPlaybackTargetChanged because
1245           it will call beginInterruption if we are already in the background and the counter will
1246           get out of sync.
1247
1248 2016-05-04  Daniel Bates  <dabates@apple.com>
1249
1250         CSP: Perform case sensitive match against path portion of source expression URL that ends in '/'
1251         https://bugs.webkit.org/show_bug.cgi?id=157275
1252
1253         Reviewed by Darin Adler.
1254
1255         Merged from Blink:
1256         <https://chromium.googlesource.com/chromium/src/+/7bd0a75e3f71a10e71ded31ea5905d5ee3d992eb>
1257
1258         Perform a case-sensitive prefix match of the path portion a source expression that ends in '/'
1259         against the path portion of a request URL as per step 8.5.4 of section Does url match expression
1260         in origin with redirect count of the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp>
1261         (Editor's Draft, 27 April 2016).
1262
1263         * page/csp/ContentSecurityPolicySource.cpp:
1264         (WebCore::ContentSecurityPolicySource::pathMatches):
1265
1266 2016-05-04  Aaron Chu  <aaron_chu@apple.com>
1267
1268         AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver
1269         https://bugs.webkit.org/show_bug.cgi?id=153089
1270         <rdar://problem/24050668>
1271
1272         Reviewed by Dean Jackson.
1273
1274         Test: media/video-controls-show-on-kb-or-ax-event.html
1275
1276         * Modules/mediacontrols/mediaControlsApple.js:
1277         (Controller):
1278         (Controller.prototype.createControls):
1279         (Controller.prototype.updateControls):
1280         (Controller.prototype.handlePlayButtonClicked):
1281         (Controller.prototype.setPlaying):
1282         (Controller.prototype.showShowControlsButton):
1283         (Controller.prototype.showControls):
1284         (Controller.prototype.hideControls):
1285         * Modules/mediacontrols/mediaControlsiOS.js:
1286         (ControllerIOS.prototype.addStartPlaybackControls):
1287         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd):
1288         (ControllerIOS.prototype.showControls):
1289
1290         Fix to make sure the showControls button in a media player behaves correctly.
1291
1292 2016-05-04  Dean Jackson  <dino@apple.com>
1293
1294         Disabling WebGL2 should mean no context is created
1295         https://bugs.webkit.org/show_bug.cgi?id=157352
1296         <rdar://problem/26096346>
1297
1298         Reviewed by Eric Carlson.
1299
1300         If WebGL2 is disabled by the runtime flag, we should
1301         not create a context.
1302
1303         Test: fast/canvas/webgl/webgl2-runtime-flag.html
1304
1305         * html/canvas/WebGLRenderingContextBase.cpp:
1306         (WebCore::WebGLRenderingContextBase::create):
1307         * testing/Internals.cpp: Added some helpers to toggle the runtime setting.
1308         (WebCore::Internals::webGL2Enabled):
1309         (WebCore::Internals::setWebGL2Enabled):
1310         * testing/Internals.h:
1311         * testing/Internals.idl:
1312
1313 2016-05-04  Anders Carlsson  <andersca@apple.com>
1314
1315         Add an override point for drawing named images in ThemeCocoa
1316         https://bugs.webkit.org/show_bug.cgi?id=157357
1317         rdar://problem/25878445
1318
1319         Reviewed by Dean Jackson.
1320
1321         Rename ThemeCocoa.cpp to ThemeCocoa.mm and rearrange the code that draws the wireless-playback image
1322         so we can import ThemeCocoaDrawNamedImage.mm below.
1323
1324         * WebCore.xcodeproj/project.pbxproj:
1325         * platform/cocoa/ThemeCocoa.cpp:
1326         (WebCore::fitContextToBox): Deleted.
1327         (WebCore::ThemeCocoa::drawNamedImage): Deleted.
1328         * platform/cocoa/ThemeCocoa.mm: Renamed from Source/WebCore/platform/cocoa/ThemeCocoa.cpp.
1329         (WebCore::fitContextToBox):
1330         (WebCore::ThemeCocoa::drawNamedImage):
1331
1332 2016-05-04  Jeremy Jones  <jeremyj@apple.com>
1333
1334         Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
1335         https://bugs.webkit.org/show_bug.cgi?id=157337
1336
1337         Reviewed by Jer Noble.
1338
1339         WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
1340         Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
1341         from its delegate, especially since we have no way to reconnect it.
1342
1343         The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
1344         Of importance is that it sets the audio and legible media selctions to nil. We don't want to change 
1345         the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
1346         and causes an assert. This transition to nil selection is now ignored.
1347
1348         * platform/ios/WebAVPlayerController.mm:
1349         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
1350         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
1351         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1352         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
1353
1354 2016-05-04  Chris Dumez  <cdumez@apple.com>
1355
1356         Media elements should not be paused right away when removed from the document
1357         https://bugs.webkit.org/show_bug.cgi?id=157347
1358         <rdar://problem/25888758>
1359
1360         Reviewed by Alex Christensen.
1361
1362         Media elements should not be paused right away when removed from the document.
1363         Instead we should allow the task that removed the media element from the
1364         document to finish because considering pausing.
1365
1366         This avoid inadvertently pausing media elements when the JS merely moves them
1367         on the page (e.g. using Node.replaceChild()).
1368
1369         Text from the HTML specification:
1370         """
1371         When a media element is removed from a Document, the user agent must run the
1372         following steps:
1373         1.  Await a stable state, allowing the task that removed the media element
1374             from the Document to continue. The synchronous section consists of all the
1375             remaining steps of this algorithm. (Steps in the synchronous section are
1376             marked with ⌛.)
1377         2. ⌛ If the media element is in a Document, abort these steps.
1378         3. ⌛ Run the internal pause steps for the media element.
1379         """
1380
1381         c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
1382
1383         Test: media/replaceChild-should-not-pause-video.html
1384
1385         * dom/GenericEventQueue.cpp:
1386         (WebCore::GenericEventQueue::sharedTimerFired):
1387         Copy the queue of events before processing it so that we don't fire events that
1388         get scheduled by the event handlers as a result of us firing the pending events.
1389         Otherwise, we end up firing events synchronously right after they've been queued,
1390         which is wrong. This was causing several W3C tests to fail.
1391
1392         * html/HTMLMediaElement.cpp:
1393         (WebCore::HTMLMediaElement::HTMLMediaElement):
1394         (WebCore::HTMLMediaElement::pauseAfterDetachedTimerFired):
1395         (WebCore::HTMLMediaElement::removedFrom):
1396         * html/HTMLMediaElement.h:
1397         After the media element gets removed from the document, schedule a 0 timer before
1398         pausing the media element, to give the task that removed us a chance to finish.
1399         When the timer fires, we check if we were added back into an active document and
1400         avoid pausing in such case.
1401
1402 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
1403
1404         Speed up JSGlobalObject initialization by making some properties lazy
1405         https://bugs.webkit.org/show_bug.cgi?id=157045
1406
1407         Reviewed by Keith Miller.
1408
1409         No new tests because no change in behavior.
1410         
1411         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
1412         that this was using a curious choice of global object, which may not be right. I decided
1413         to do a very literal refactoring that exactly preserves what this code got before, but I
1414         added a FIXME to reconsider this later.
1415
1416         * bindings/js/JSHTMLElementCustom.cpp:
1417         (WebCore::JSHTMLElement::pushEventHandlerScope):
1418
1419 2016-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
1420
1421         [css-grid] Refactor information stored related to column positions
1422         https://bugs.webkit.org/show_bug.cgi?id=157342
1423
1424         Reviewed by Darin Adler.
1425
1426         In m_columnPositions we were storing position of each column
1427         including the alignment offset, always from the logical left,
1428         and the border and padding, depending on the direction.
1429
1430         This was really confusing as in the case of RTL direction
1431         we were adding the offset from the left and
1432         the right border and padding.
1433
1434         This patches changes it to store always the info from the left,
1435         so even in RTL direction we use the left border and padding.
1436
1437         This allows us to simplify translateRTLCoordinate() as
1438         it doesn't need to care about border and padding anymore.
1439         And also to refactor offsetAndBreadthForPositionedChild()
1440         which became really complex after adding RTL support.
1441
1442         No new tests, no change of behavior.
1443
1444         * rendering/RenderGrid.cpp:
1445         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1446         (WebCore::RenderGrid::populateGridPositions):
1447         (WebCore::RenderGrid::translateRTLCoordinate):
1448
1449 2016-05-04  Mark Lam  <mark.lam@apple.com>
1450
1451         ES6 Function.name inferred from property names of literal objects can break some websites.
1452         https://bugs.webkit.org/show_bug.cgi?id=157246
1453
1454         Reviewed by Geoffrey Garen.
1455
1456         Test: js/dom/regress-157246.html
1457
1458         * bindings/js/JSDOMWindowBase.cpp:
1459         (WebCore::JSDOMWindowBase::finishCreation):
1460         - Set the needsSiteSpecificQuirks flag in the JSGlobalObject if needed.
1461
1462 2016-05-04  Konstantin Tokarev  <annulen@yandex.ru>
1463
1464         Deduplicated initializer lists of BitmapImage constructors.
1465         https://bugs.webkit.org/show_bug.cgi?id=157249
1466
1467         Reviewed by Darin Adler.
1468
1469         No new tests needed.
1470
1471         * platform/graphics/BitmapImage.cpp:
1472         (WebCore::BitmapImage::BitmapImage): Added new private constructor of
1473         BitmapImage for delegation purpose only.
1474         * platform/graphics/BitmapImage.h: Use inline initialization for some
1475         BitmapImage fields.
1476         * platform/graphics/cairo/BitmapImageCairo.cpp:
1477         (WebCore::BitmapImage::BitmapImage): Delegate field initialization to
1478         new private constructor.
1479         * platform/graphics/cg/BitmapImageCG.cpp:
1480         (WebCore::BitmapImage::BitmapImage): Ditto.
1481
1482 2016-05-04  Chris Dumez  <cdumez@apple.com>
1483
1484         Unreviewed, rolling out r200383 and r200406.
1485
1486         Seems to have caused crashes on iOS / ARMv7s
1487
1488         Reverted changesets:
1489
1490         "Speed up JSGlobalObject initialization by making some
1491         properties lazy"
1492         https://bugs.webkit.org/show_bug.cgi?id=157045
1493         http://trac.webkit.org/changeset/200383
1494
1495         "REGRESSION(r200383): Setting lazily initialized properties
1496         across frame boundaries crashes"
1497         https://bugs.webkit.org/show_bug.cgi?id=157333
1498         http://trac.webkit.org/changeset/200406
1499
1500 2016-05-04  Joanmarie Diggs  <jdiggs@igalia.com>
1501
1502         AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named
1503         https://bugs.webkit.org/show_bug.cgi?id=157331
1504
1505         Reviewed by Chris Fleizach.
1506
1507         The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole
1508         AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion
1509         subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to
1510         the LandmarkRegionRole if it has an author-provided accessible name via either
1511         the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole
1512         with no subrole.
1513
1514         Our existing test coverage for exposure of the 'region' role and the 'section'
1515         element is sufficient. These tests were updated to reflect the new behavior.
1516         Several new test cases were added to cover both sections with accessible names
1517         and those without.
1518
1519         * accessibility/AccessibilityObject.cpp:
1520         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
1521         (WebCore::AccessibilityObject::isLandmark):
1522         (WebCore::initializeRoleMap):
1523         * accessibility/AccessibilityObject.h:
1524         * accessibility/AccessibilityRenderObject.cpp:
1525         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1526         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1527         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1528         (atkRole):
1529         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1530         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1531         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1532         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1533         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
1534         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1535         (createAccessibilityRoleMap):
1536         (-[WebAccessibilityObjectWrapper subrole]):
1537         * platform/LocalizedStrings.cpp:
1538         (WebCore::AXARIAContentGroupText):
1539
1540 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1541
1542         Clicks inside button elements are sometimes discarded when the mouse moves
1543         https://bugs.webkit.org/show_bug.cgi?id=39620
1544
1545         Reviewed by Darin Adler.
1546
1547         Test: fast/events/click-over-descendant-elements.html
1548
1549         * dom/Node.cpp:
1550         (WebCore::ancestor):
1551         (WebCore::commonAncestor): Method inspired from
1552         http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
1553         (WebCore::commonAncestorCrossingShadowBoundary): Helper routine
1554         that handles the case of nodes into a shadow node.
1555         * dom/Node.h:
1556         * page/EventHandler.cpp:
1557         (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event
1558         target node according commonAncestorOverShadowBoundary method.
1559         (WebCore::EventHandler::targetNodeForClickEvent): Deleted.
1560
1561 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
1562
1563         Unreviewed, fixing crashing GTK+ tests after r200407.
1564
1565         * platform/graphics/texmap/TextureMapperGL.cpp:
1566         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
1567         Don't use RELEASE_ASSERT. Also fix the actual assertion,
1568         checking that any of the values in the map matches the object
1569         that's being destroyed, instead of checking the keys.
1570
1571 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1572
1573         Add WKPreference for SelectionPaintingWithoutSelectionGaps
1574         https://bugs.webkit.org/show_bug.cgi?id=156900
1575
1576         Reviewed by Michael Catanzaro.
1577
1578         Unlike other browsers WebKit has been drawing selection gaps
1579         between render blocks during the text selection. This often
1580         cause text selection screen looks messy.
1581
1582         This patch adds a setting method to disable the functionality,
1583         and EFL port disables it by default.
1584
1585         * page/Settings.in:
1586         * rendering/RenderBlock.cpp:
1587         (WebCore::RenderBlock::shouldPaintSelectionGaps):
1588
1589 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1590
1591         Rename JSKeyValueIterator as JSDOMIterator
1592         https://bugs.webkit.org/show_bug.cgi?id=157308
1593
1594         Reviewed by Darin Adler.
1595
1596         No change of behavior.
1597
1598         * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
1599         (WebCore::JSDOMIteratorPrototype::create):
1600         (WebCore::JSDOMIteratorPrototype::createStructure):
1601         (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
1602         (WebCore::createKeyValueIterator):
1603         (WebCore::keyValueIteratorForEach):
1604         (WebCore::JSDOMIterator<JSWrapper>::destroy):
1605         (WebCore::JSDOMIterator<JSWrapper>::next):
1606         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
1607         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation):
1608         * bindings/js/JSFontFaceSetCustom.cpp:
1609         * bindings/scripts/CodeGeneratorJS.pm:
1610         (GenerateImplementationIterableFunctions):
1611         * bindings/scripts/test/JS/JSTestObj.cpp:
1612
1613 2016-05-04  Jiewen Tan  <jiewen_tan@apple.com>
1614
1615         CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105
1616         https://bugs.webkit.org/show_bug.cgi?id=157282
1617         <rdar://problem/25391441>
1618
1619         Reviewed by Darin Adler.
1620
1621         A frame could be destroyed in the middle of executing undo/redo command.
1622         Therefore, add an early return.
1623
1624         * editing/CompositeEditCommand.cpp:
1625         (WebCore::EditCommandComposition::unapply):
1626         (WebCore::EditCommandComposition::reapply):
1627
1628 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
1629
1630         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
1631         https://bugs.webkit.org/show_bug.cgi?id=157305
1632
1633         Reviewed by Carlos Garcia Campos.
1634
1635         Split out handling of the root compositing and the view overlay layers
1636         into two separate methods. Both do nothing if the passed-in layer is
1637         the same as the current one. Otherwise, the current one is removed
1638         from the tree and the new one added to it.
1639
1640         No change in behavior is expected.
1641
1642         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1643         (WebCore::CompositingCoordinator::setRootCompositingLayer):
1644         (WebCore::CompositingCoordinator::setViewOverlayRootLayer):
1645         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1646
1647 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
1648
1649         [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData
1650         https://bugs.webkit.org/show_bug.cgi?id=157303
1651
1652         Reviewed by Carlos Garcia Campos.
1653
1654         Torch the TextureMapperGLData and TextureMapperGLData::SharedGLData
1655         classes into a better form.
1656
1657         SharedGLData is now private to the TextureMapperGLData class, but
1658         lists that class as a friend. This enables moving the getShaderProgram()
1659         method to TextureMapperGLData and removes the need to expose the
1660         SharedGLData publicly. SharedGLData also doesn't have to keep a
1661         reference to the GraphicsContext3D object.
1662
1663         TextureMapperGLData now default-initializes the publicly accessible
1664         member variables while making some other members private, not exposing
1665         anything that isn't necessary.
1666
1667         Usual whitespace cleanup included. More elegant HashMap::ensure()
1668         insertions are used where they don't obfuscate object creation.
1669
1670         No new tests -- no change in behavior.
1671
1672         * platform/graphics/texmap/TextureMapperGL.cpp:
1673         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
1674         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
1675         (WebCore::TextureMapperGLData::SharedGLData::contextDataMap):
1676         (WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
1677         (WebCore::TextureMapperGLData::TextureMapperGLData):
1678         (WebCore::TextureMapperGLData::~TextureMapperGLData):
1679         (WebCore::TextureMapperGLData::initializeStencil):
1680         (WebCore::TextureMapperGLData::getStaticVBO):
1681         (WebCore::TextureMapperGLData::getShaderProgram):
1682         (WebCore::TextureMapperGL::TextureMapperGL):
1683         (WebCore::TextureMapperGL::drawBorder):
1684         (WebCore::TextureMapperGL::drawTexture):
1685         (WebCore::TextureMapperGL::drawSolidColor):
1686         (WebCore::TextureMapperGL::drawFiltered):
1687         (WebCore::TextureMapperGL::beginClip):
1688         (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap): Deleted.
1689         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): Deleted.
1690         (WebCore::TextureMapperGLData::sharedGLData): Deleted.
1691         * platform/graphics/texmap/TextureMapperGL.h:
1692
1693 2016-05-03  Chris Dumez  <cdumez@apple.com>
1694
1695         Optimize [StrictTypeChecking] on IDL attributes
1696         https://bugs.webkit.org/show_bug.cgi?id=157321
1697
1698         Reviewed by Geoffrey Garen.
1699
1700         Optimize [StrictTypeChecking] on IDL attributes:
1701         - Only generate extra code for nullable attributes because for non-nullable
1702           attributes, JSXXX::toWrapped() will return null in case of a bad input
1703           type. We will then throw a TypeError when null-checking it already.
1704         - After the JSValue::isNullOrUndefined() check, avoid calling
1705           JSXXX::toWrapped() and set nativeValue to nullptr directly.
1706         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
1707           check on the value returned by JSXXX::toWrapped(). toWrapped() already
1708           does a JSValue::inherits(JSXXX::info() check. Since we only call
1709           toWrapped() if the JSValue is not null/undefined, a null return value
1710           always indicates a bad input type.
1711
1712         * bindings/scripts/CodeGeneratorJS.pm:
1713         (GenerateImplementation):
1714         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1715         (webkit_dom_test_obj_set_strict_type_checking_attribute):
1716         * bindings/scripts/test/JS/JSTestObj.cpp:
1717         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
1718         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1719         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
1720         * bindings/scripts/test/TestObj.idl:
1721
1722 2016-05-03  Chris Dumez  <cdumez@apple.com>
1723
1724         Unreviewed, rolling out r199259 and r200161.
1725
1726         Seems to have caused a ~1.2% PLT regression on iOS
1727
1728         Reverted changesets:
1729
1730         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
1731         determine tiling area"
1732         https://bugs.webkit.org/show_bug.cgi?id=156429
1733         http://trac.webkit.org/changeset/199259
1734
1735         "[iOS WK2] When determining tile size, check whether ancestor
1736         UIScrollViews are actually scrollable"
1737         https://bugs.webkit.org/show_bug.cgi?id=157107
1738         http://trac.webkit.org/changeset/200161
1739
1740 2016-05-03  Filip Pizlo  <fpizlo@apple.com>
1741
1742         Speed up JSGlobalObject initialization by making some properties lazy
1743         https://bugs.webkit.org/show_bug.cgi?id=157045
1744
1745         Reviewed by Keith Miller.
1746
1747         No new tests because no change in behavior.
1748         
1749         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
1750         that this was using a curious choice of global object, which may not be right. I decided
1751         to do a very literal refactoring that exactly preserves what this code got before, but I
1752         added a FIXME to reconsider this later.
1753
1754         * bindings/js/JSHTMLElementCustom.cpp:
1755         (WebCore::JSHTMLElement::pushEventHandlerScope):
1756
1757 2016-05-03  Per Arne Vollan  <peavo@outlook.com>
1758
1759         [Win] Remove Windows XP Compatibility Requirements
1760         https://bugs.webkit.org/show_bug.cgi?id=152899
1761
1762         Reviewed by Brent Fulgham.
1763
1764         Windows XP is not supported anymore, we can remove compatibility workarounds.
1765
1766         * platform/text/win/LocaleWin.cpp:
1767         (WebCore::extractLanguageCode):
1768         (WebCore::LCIDFromLocaleInternal):
1769         (WebCore::LCIDFromLocale):
1770         (WebCore::removeLastComponent): Deleted.
1771         (WebCore::ensureNameToLCIDMap): Deleted.
1772         (WebCore::convertLocaleNameToLCID): Deleted.
1773
1774 2016-05-02  Antti Koivisto  <antti@apple.com>
1775
1776         REGRESSION (r198943): Transitions don't work if they animate display property
1777         https://bugs.webkit.org/show_bug.cgi?id=157244
1778         <rdar://problem/26042189>
1779
1780         Reviewed by Simon Fraser.
1781
1782         Test: transitions/transition-display-property.html
1783
1784         * style/RenderTreeUpdater.cpp:
1785         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1786
1787             Call the common function for ::before/::after updates.
1788
1789         * style/StyleTreeResolver.cpp:
1790         (WebCore::Style::TreeResolver::resolveElement):
1791         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1792
1793             If animation forces render tree reconstruction use the original rather than animated style for update.
1794             Because animations are tied to renderers we start them during renderer construction in this case.
1795
1796             Factor to a function.
1797
1798         (WebCore::Style::elementImplicitVisibility):
1799         * style/StyleTreeResolver.h:
1800
1801 2016-05-03  Pranjal Jumde  <pjumde@apple.com>
1802
1803         WorkerGlobalScope's self, location and navigator attributes should not be replaceable
1804         https://bugs.webkit.org/show_bug.cgi?id=157296
1805         <rdar://problem/25962738>
1806
1807         Reviewed by Chris Dumez.
1808
1809         Tests: http/tests/workers/location-readonly.html
1810                http/tests/workers/navigator-readonly.html
1811                http/tests/workers/self-readonly.html
1812
1813         * workers/WorkerGlobalScope.idl:
1814         The 'self', 'location', and 'navigator' properties of the WorkerGlobalScope must be immutable.
1815         See: https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
1816
1817 2016-05-03  Chris Dumez  <cdumez@apple.com>
1818
1819         Drop some unnecessary exception checking in the generated bindings
1820         https://bugs.webkit.org/show_bug.cgi?id=157299
1821
1822         Reviewed by Darin Adler.
1823
1824         Drop some unnecessary exception checking in the generated bindings.
1825         Only do a check for state->hadException() after converting a JSValue
1826         to a native value when necessary. Update JSValueToNative() to
1827         indicate the caller if converting to the native value may throw an
1828         exception.
1829
1830         This gets rid of a lot of unnecessary branching in the bindings.
1831
1832         No new tests, no intended web-exposed behavior change.
1833
1834         * bindings/scripts/CodeGeneratorJS.pm:
1835         (GenerateImplementation):
1836         (GenerateParametersCheck):
1837         (JSValueToNative):
1838         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1839         * bindings/scripts/test/JS/JSTestInterface.cpp:
1840         * bindings/scripts/test/JS/JSTestObj.cpp:
1841         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1842
1843 2016-05-03  Brady Eidson  <beidson@apple.com>
1844
1845         Add/refactor isolatedCopy methods for 3 IDB classes.
1846         https://bugs.webkit.org/show_bug.cgi?id=157289
1847
1848         Reviewed by Alex Christensen.
1849
1850         No new tests (Refactor, no behavior change).
1851
1852         In an upcoming, much larger patch, I'll need the ability to directly construct these three objects
1853         as isolated copies.
1854         
1855         This is a nice standalone refactor that enables that ability.
1856
1857         * Modules/indexeddb/IDBGetResult.cpp:
1858         (WebCore::IDBGetResult::IDBGetResult):
1859         (WebCore::IDBGetResult::isolatedCopy):
1860         * Modules/indexeddb/IDBGetResult.h:
1861         
1862         * Modules/indexeddb/IDBKeyData.cpp:
1863         (WebCore::IDBKeyData::IDBKeyData):
1864         (WebCore::IDBKeyData::isolatedCopy):
1865         * Modules/indexeddb/IDBKeyData.h:
1866
1867         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1868         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
1869         (WebCore::IDBTransactionInfo::isolatedCopy):
1870         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1871
1872 2016-05-03  Joanmarie Diggs  <jdiggs@igalia.com>
1873
1874         [ATK] accessibility/content-editable-as-textarea.html fails
1875         https://bugs.webkit.org/show_bug.cgi?id=155353
1876
1877         Reviewed by Darin Adler.
1878
1879         The test was timing out because it expected an AXValueChanged notification.
1880         In ATK, AXValueChanged notifications are made for widgets which implement
1881         the AtkValue interface (sliders, progress bars, etc.). We should be listening
1882         for AXTextChanged instead.
1883
1884         In addition, for contenteditable elements, we should emit the notification on
1885         the element itself. Because we were handling the notification in the same way
1886         as native text controls (where the notification we receive from WebCore is for
1887         StaticTextRole children), we were attempting to emit the notification from
1888         the parent of the contenteditable.
1889
1890         Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
1891         methods that are being used as part of the previously-failing test. Those
1892         methods are now implemented so that the ATK results are much more similar
1893         to those on the Mac.
1894
1895         No new tests needed. The previously-failing test now passes.
1896
1897         * accessibility/AccessibilityNodeObject.cpp:
1898         (WebCore::AccessibilityNodeObject::childrenChanged):
1899         * accessibility/AccessibilityObject.cpp:
1900         (WebCore::AccessibilityObject::isNonNativeTextControl):
1901         * accessibility/AccessibilityObject.h:
1902         * accessibility/AccessibilityRenderObject.cpp:
1903         (WebCore::AccessibilityRenderObject::textChanged):
1904         * accessibility/atk/AXObjectCacheAtk.cpp:
1905         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1906
1907 2016-05-02  Sergio Villar Senin  <svillar@igalia.com>
1908
1909         [css-grid] Add support for position resolution with auto-repeat tracks
1910         https://bugs.webkit.org/show_bug.cgi?id=157260
1911
1912         Reviewed by Darin Adler.
1913
1914         This is a generalization of our position resolution code so it now supports every possible
1915         type of resolution (definite position, position spans, automatic resolution, named lines
1916         resolution, grid areas...) under the presence of auto-repeat tracks, i.e., tracks that are
1917         dynamically created by the LayoutGrid depending on the available space and that cannot be
1918         directly inferred from the CSS declarations.
1919
1920         This means that we need two extra things to resolve positions:
1921         - the LayoutGrid needs to provide the number of auto-repeat tracks per axis
1922         - a wrapper is needed to hide the eventual presence of auto-repeat tracks (with their line
1923         names) from the rest of the resolution code which should remain mostly unchanged.
1924
1925         The former is trivial (requires passing a new argument to some functions at the most) but
1926         the latter requires a new class called NamedLineCollection. This class allow us to locate
1927         and resolve named lines without having to insert the auto-repeat named lines in the already
1928         existing data structures. It does it in a very compact representation as it does not
1929         duplicate the names for every single repetition.
1930
1931         No new tests required as there is no change in behavior because the auto-repeat tracks
1932         computation is not implemented yet. Current tests already test this code extensively, and
1933         the auto-repeat code paths will be tested later once
1934         RenderGrid::computeAutoRepeatTracksCount() is implemented.
1935
1936         * rendering/RenderGrid.cpp:
1937         (WebCore::RenderGrid::computeAutoRepeatTracksCount): New method with empty implementation.
1938         (WebCore::RenderGrid::placeItemsOnGrid): Initialize the auto repeat tracks count.
1939         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1940         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1941         * rendering/RenderGrid.h:
1942         * rendering/style/GridPositionsResolver.cpp:
1943         (WebCore::directionFromSide):
1944         (WebCore::NamedLineCollection::NamedLineCollection): New class which is able to resolve the
1945         positions of a given named line in the presence of auto-repeat and "normal" tracks.
1946         (WebCore::NamedLineCollection::isValidNamedLineOrArea): Checks whether the given named line
1947         is a valid line name or area.
1948         (WebCore::NamedLineCollection::hasNamedLines): Checks whether the named line exists in the
1949         given axis (either specified by auto-repeat or "normal" tracks).
1950         (WebCore::NamedLineCollection::find): Looks for a line number whithin the line numbers where
1951         the given named line was found.
1952         (WebCore::NamedLineCollection::contains):
1953         (WebCore::NamedLineCollection::firstPosition): Returns the first line where the given named
1954         line is located.
1955         (WebCore::adjustGridPositionsFromStyle): Use NamedLineCollection.
1956         (WebCore::GridPositionsResolver::explicitGridColumnCount): Include auto repeat tracks.
1957         (WebCore::GridPositionsResolver::explicitGridRowCount): Ditto.
1958         (WebCore::explicitGridSizeForSide): Ditto.
1959         (WebCore::lookAheadForNamedGridLine): Use NamedLineCollection.
1960         (WebCore::lookBackForNamedGridLine): Ditto.
1961         (WebCore::resolveNamedGridLinePositionFromStyle):
1962         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
1963         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
1964         (WebCore::resolveGridPositionAgainstOppositePosition):
1965         (WebCore::resolveGridPositionFromStyle):
1966         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
1967         (WebCore::gridLinesForSide): Deleted.
1968         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea): Deleted.
1969         * rendering/style/GridPositionsResolver.h:
1970
1971 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1972
1973         Unreviewed. Fix GObject DOM bindings API break after r200316.
1974
1975         webkit_dom_tree_walker_set_current_node no longer raises exceptions after r200316, so mark it accordingly.
1976
1977         * bindings/scripts/CodeGeneratorGObject.pm:
1978         (FunctionUsedToRaiseException):
1979
1980 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1981
1982         [OpenType] OpenTypeVerticalData object should not be created if the font is not OpenType
1983         https://bugs.webkit.org/show_bug.cgi?id=157172
1984
1985         Reviewed by Michael Catanzaro.
1986
1987         It's a bit weird that the object is always created and has an isOpenType() method to check whether it's an
1988         OpenType or not. The caller is always deleting the object when it's not an OpenType, so it would be better if
1989         the create method returned nullptr instead of creating the object when the font is not OpenType.
1990
1991         * platform/graphics/FontCache.cpp:
1992         (WebCore::FontCache::verticalData): Do not use isOpenType(), we can now simply use the return value of OpenTypeVerticalData::create().
1993         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
1994         (WebCore::loadHmtxTable): Moved to a helper funtion that returns false if the font is not OpenType.
1995         (WebCore::OpenTypeVerticalData::create): Try to load the Hmtx table, and create the object if succeeded or
1996         return nullptr otherwise.
1997         (WebCore::OpenTypeVerticalData::OpenTypeVerticalData): Receive the advanceWidths as constructor parameter.
1998         (WebCore::OpenTypeVerticalData::loadMetrics): Load all other tables.
1999         * platform/graphics/opentype/OpenTypeVerticalData.h:
2000         (WebCore::OpenTypeVerticalData::isOpenType): Deleted.
2001
2002 2016-05-02  Darin Adler  <darin@apple.com>
2003
2004         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
2005         https://bugs.webkit.org/show_bug.cgi?id=157257
2006
2007         Reviewed by Chris Dumez.
2008
2009         Chris and Alex requested this alternate style, where the enum class for each enumeration
2010         goes inside the class for the interface the enumeration is used in. Also made a rule that
2011         keeps the names short and not redundant with the class name they are nested in.
2012
2013         * Modules/fetch/FetchOptions.h: Moved all the enum class types into the struct.
2014
2015         * Modules/fetch/FetchRequest.cpp:
2016         (WebCore::setReferrerPolicy): Updated.
2017         (WebCore::setMode): Ditto.
2018         (WebCore::setCredentials): Ditto.
2019         (WebCore::setCache): Ditto.
2020         (WebCore::setRedirect): Ditto.
2021         (WebCore::buildOptions): Ditto.
2022         (WebCore::buildHeaders): Ditto.
2023         (WebCore::FetchRequest::create): Ditto.
2024         * Modules/fetch/FetchRequest.h: Used "using" to repeat the types from FetchOptions
2025         here in FetchRequest. That way the generated bindings can find the types, and we don't
2026         need to do any trick like [ImplementedAs] in thd IDL to make it work.
2027
2028         * Modules/fetch/FetchResponse.cpp:
2029         (WebCore::FetchResponse::error): Updated.
2030         (WebCore::FetchResponse::redirect): Ditto.
2031         (WebCore::FetchResponse::FetchResponse): Ditto.
2032         (WebCore::FetchResponse::startFetching): Ditto.
2033         * Modules/fetch/FetchResponse.h: Moved enum class into the class.
2034
2035         * Modules/mediacontrols/MediaControlsHost.cpp:
2036         (WebCore::MediaControlsHost::externalDeviceType): Updated.
2037         * Modules/mediacontrols/MediaControlsHost.h: Moved enum classs into the class.
2038
2039         * Modules/mediasession/MediaSession.cpp:
2040         (WebCore::MediaSession::MediaSession): Updated.
2041         * Modules/mediasession/MediaSession.h: Moved enum classs into the class.
2042
2043         * Modules/mediasource/MediaSource.cpp:
2044         (WebCore::MediaSource::addSourceBuffer): Updated.
2045         (WebCore::MediaSource::removeSourceBuffer): Ditto.
2046
2047         * Modules/mediasource/MediaSource.h: Moved enum class into the class.
2048
2049         * Modules/mediasource/SourceBuffer.cpp:
2050         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Updated.
2051         (WebCore::SourceBuffer::appendError): Ditto.
2052         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
2053         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
2054
2055         * Modules/mediasource/SourceBuffer.h: Removed incorrect forward declaration
2056         of EndOfStreamError that also now seems to be unneeded. Moved enum class into
2057         the class.
2058
2059         * Modules/mediastream/MediaDeviceInfo.cpp:
2060         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Updated.
2061         (WebCore::MediaDeviceInfo::create): Ditto.
2062         * Modules/mediastream/MediaDeviceInfo.h: Moved enum class into the class.
2063
2064         * Modules/mediastream/MediaDevicesRequest.cpp:
2065         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Updated.
2066         * Modules/mediastream/MediaStreamTrack.cpp:
2067         (WebCore::MediaStreamTrack::readyState): Updated.
2068
2069         * Modules/mediastream/MediaStreamTrack.h: Moved enum class into the class.
2070
2071         * Modules/mediastream/RTCConfiguration.h: Moved enum classes into the class.
2072
2073         * Modules/webaudio/AudioContext.h: Moved enum class into the class.
2074
2075         * Modules/webaudio/WaveShaperNode.cpp:
2076         (WebCore::processorType): Updated.
2077         (WebCore::WaveShaperNode::oversample): Ditto.
2078         * Modules/webaudio/WaveShaperNode.h: Moved enum class into the class.
2079
2080         * bindings/js/JSXMLHttpRequestCustom.cpp:
2081         (WebCore::JSXMLHttpRequest::response): Updated.
2082
2083         * bindings/scripts/CodeGeneratorJS.pm:
2084         (GenerateGetOwnPropertySlotBody): Removed unneeded $interfaceName argument.
2085         (GetAttributeGetterName): Ditto.
2086         (GetAttributeSetterName): Ditto.
2087         (GetFunctionName): Tweaked style.
2088         (AttributeShouldBeOnInstanceForCompatibility): Deleted. Was a function that
2089         always returned 0.
2090         (AttributeShouldBeOnInstance): Removed the call to the function above.
2091         (IsClassNameWordBoundary): Added. Helper for function below.
2092         (IsPrefixRemovable): Ditto.
2093         (GetEnumerationClassName): Added an $interface argument and changed this
2094         so it creates a nested name inside the class rather than a top level name
2095         for use at the WebCore namespace level.
2096         (GetEnumerationClassIdentifier): Added. Calls GetEnumerationClassName and
2097         makes a flattened name without "::" that can be used in an identifier.
2098         (GenerateEnumerationImplementationContent): Renamed from GetXXX. Added an
2099         $interface argument, so it can pass that along to the functions above.
2100         (GenerateHeader): Updated to not pass $interfaceName.
2101         (GeneratePropertiesHashTable): Ditto.
2102         (GenerateOverloadedFunction): Removed unneeded $interfaceName argument.
2103         (GenerateImplementation): Updated for changes above. Tweaked formatting.
2104         (GenerateFunctionCastedThis): Removed unneeded $interfaceName argument.
2105         (GenerateParametersCheck): Ditto. Also streamlined implementation a bit
2106         and made the IsEnumType section call the new functions.
2107         (GenerateCallbackImplementation): Ditto.
2108         (JSValueToNative): Added an $interface argument and pass it along when
2109         dealing with enumerations.
2110         (GeneratePrototypeDeclaration): Removed unneeded $interfaceName argument.
2111         (GenerateConstructorDeclaration): Ditto.
2112         (GenerateConstructorDefinitions): Ditto.
2113         (GenerateConstructorDefinition): Ditto.
2114         (GenerateConstructorHelperMethods): Ditto.
2115
2116         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
2117
2118         * bindings/scripts/test/TestObj.idl: Added some new enums that test some
2119         of the logic above.
2120
2121         * crypto/CryptoKey.cpp:
2122         (WebCore::CryptoKey::CryptoKey): Updated.
2123         (WebCore::CryptoKey::usages): Ditto.
2124         * crypto/CryptoKey.h: Moved enum class types inside the CryptoKey class.
2125         Added comments about the two similar but distinct types named
2126         CryptoKeyUsage and CryptoKey::Usage.
2127
2128         * css/FontFace.cpp:
2129         (WebCore::FontFace::status): Updated.
2130         * css/FontFace.h: Moved enum class into the class.
2131
2132         * css/FontFaceSet.cpp:
2133         (WebCore::FontFaceSet::status): Updated.
2134         * css/FontFaceSet.h: Moved enum class into the class.
2135
2136         * dom/Document.cpp:
2137         (WebCore::Document::Document): Updated for the name change back from
2138         ReferrerHeaderPolicy to ReferrerPolicy.
2139         (WebCore::Document::processReferrerPolicy): Ditto.
2140         (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
2141         * dom/Document.h: More of the same.
2142
2143         * html/HTMLMediaElement.cpp:
2144         (WebCore::HTMLMediaElement::loadInternal): Updated.
2145         (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
2146         (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
2147         (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
2148         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
2149         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
2150         (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
2151         (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto.
2152         (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
2153         (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto.
2154         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
2155         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
2156         (WebCore::toPlatform): Ditto.
2157         (WebCore::HTMLMediaElement::outOfBandTrackSources): Ditto.
2158         * html/HTMLTrackElement.cpp:
2159         (WebCore::HTMLTrackElement::scheduleLoad): Ditto.
2160
2161         * html/HTMLVideoElement.h: Moved enum class into class.
2162
2163         * html/HTMLVideoElement.idl: Added the missing conditional on
2164         VideoPresentationMode, and also moved it to the bottom of the file
2165         to work around what is apparently a bug in the IDL parser.
2166
2167         * html/canvas/CanvasRenderingContext2D.cpp:
2168         (WebCore::toWindRule): Updated.
2169         (WebCore::CanvasRenderingContext2D::fill): Ditto.
2170         (WebCore::CanvasRenderingContext2D::clip): Ditto.
2171         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
2172         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
2173         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
2174         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
2175         (WebCore::smoothingToInterpolationQuality): Ditto.
2176
2177         * html/canvas/CanvasRenderingContext2D.h: Moved enum class types into the class.
2178
2179         * html/shadow/MediaControlElements.cpp:
2180         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Updated.
2181         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
2182
2183         * html/track/InbandTextTrack.cpp:
2184         (WebCore::InbandTextTrack::setMode): Updated.
2185         (WebCore::toPrivate): Ditto.
2186         (WebCore::InbandTextTrack::setModeInternal): Ditto.
2187         (WebCore::InbandTextTrack::updateKindFromPrivate): Ditto.
2188         * html/track/InbandTextTrack.h: Ditto.
2189         * html/track/TextTrack.cpp:
2190         (WebCore::TextTrack::TextTrack): Ditto.
2191         (WebCore::TextTrack::enabled): Ditto.
2192         (WebCore::TextTrack::kindKeyword): Ditto.
2193         (WebCore::TextTrack::setKind): Ditto.
2194         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Ditto.
2195         (WebCore::TextTrack::setMode): Ditto.
2196         (WebCore::TextTrack::cues): Ditto.
2197         (WebCore::TextTrack::activeCues): Ditto.
2198         (WebCore::TextTrack::addCue): Ditto.
2199         (WebCore::TextTrack::regions): Ditto.
2200         (WebCore::TextTrack::isRendered): Ditto.
2201         (WebCore::TextTrack::isMainProgramContent): Ditto.
2202         (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto.
2203
2204         * html/track/TextTrack.h: Moved enum class types into the class.
2205
2206         * html/track/TextTrackCue.cpp:
2207         (WebCore::TextTrackCue::dispatchEvent): Updated.
2208         (WebCore::TextTrackCue::isActive): Ditto.
2209         * loader/FrameNetworkingContext.h: Ditto.
2210         * page/CaptionUserPreferences.cpp:
2211         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
2212         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto.
2213         * page/CaptionUserPreferencesMediaAF.cpp:
2214         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto.
2215         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto.
2216
2217         * page/SecurityPolicy.cpp:
2218         (WebCore::SecurityPolicy::generateReferrerHeader): Updated since we
2219         changed ReferrerHeaderPolicy back to ReferrerPolicy.
2220         * page/SecurityPolicy.h: Ditto.
2221
2222         * platform/ReferrerPolicy.h: Changed ReferrerHeaderPolicy name back
2223         to ReferrerPolicy now that nesting inside a class eliminated the conflict;
2224         still should merge them and that FIXME remains.
2225
2226         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2227         (WebPlaybackSessionModelMediaElement::updateForEventName): Updated.
2228         (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto.
2229
2230         * testing/Internals.cpp:
2231         (WebCore::toResourceRequestCachePolicy): Updated.
2232         (WebCore::Internals::setOverrideCachePolicy): Ditto.
2233         (WebCore::toResourceLoadPriority): Ditto.
2234         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
2235         (WebCore::toAutoFillButtonType): Ditto.
2236         (WebCore::Internals::setShowAutoFillButton): Ditto.
2237
2238         * testing/Internals.h: Moved enum class types into class.
2239
2240         * testing/Internals.idl: Removed the "Internals" prefixes we added
2241         to resolve ambiguity before. Nesting these in the class now takes care
2242         of the ambiguity instead.
2243
2244         * xml/XMLHttpRequest.cpp:
2245         (WebCore::XMLHttpRequest::responseText): Updated.
2246         (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto.
2247         (WebCore::XMLHttpRequest::responseXML): Ditto.
2248         (WebCore::XMLHttpRequest::responseBlob): Ditto.
2249         (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto.
2250         (WebCore::XMLHttpRequest::setResponseType): Ditto.
2251         (WebCore::XMLHttpRequest::open): Ditto.
2252         (WebCore::shouldDecodeResponse): Ditto.
2253
2254         * xml/XMLHttpRequest.h: Moved the enum class into the class.
2255
2256 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2257
2258         Don't run transitions to/from 'auto' values
2259         https://bugs.webkit.org/show_bug.cgi?id=38243
2260         rdar://problem/20904225
2261
2262         Reviewed by Dean Jackson.
2263         
2264         The specified behavior of transitions and animations is to not animate when either endpoint is 'auto'.
2265         Previously, we were treating 'auto' as zero and interpolating, which caused unwanted animations
2266         on fandango.com, airbnb.com and others.
2267         
2268         Fix by having blend() return the from value if progress is 0, otherwise the to value. The
2269         isZero() check can be removed, since this was effectively picking up auto value for one endpoint.
2270
2271         Tests: transitions/lengthsize-transition-to-from-auto.html
2272                transitions/transition-to-from-auto.html
2273
2274         * platform/Length.cpp:
2275         (WebCore::blend):
2276
2277 2016-05-02  Chris Dumez  <cdumez@apple.com>
2278
2279         Indexing CSSStyleDeclaration object with out-of-range index should return undefined
2280         https://bugs.webkit.org/show_bug.cgi?id=157283
2281
2282         Reviewed by Darin Adler.
2283
2284         Indexing CSSStyleDeclaration object with out-of-range index should return undefined,
2285         as per:
2286         - http://heycam.github.io/webidl/#idl-indexed-properties
2287         - http://heycam.github.io/webidl/#getownproperty-guts
2288
2289         WebKit was incorrectly returning the empty string in this case. We however, still
2290         return the empty string if calling the indexed property getter via item(), as is
2291         expected.
2292
2293         The new behavior matches Firefox and the Web IDL specification. Chrome returns the
2294         empty string in this case though.
2295
2296         Test: fast/dom/indexed-getters-returning-string.html
2297
2298         * css/CSSComputedStyleDeclaration.cpp:
2299         (WebCore::CSSComputedStyleDeclaration::item):
2300         * css/PropertySetCSSStyleDeclaration.cpp:
2301         (WebCore::PropertySetCSSStyleDeclaration::item):
2302
2303 2016-05-02  Antoine Quint  <graouts@apple.com>
2304
2305         Specifying a longhand property should not serialize to a shorthand property
2306         https://bugs.webkit.org/show_bug.cgi?id=157180
2307
2308         Reviewed by Dean Jackson.
2309
2310         Ensure that we don't serialize to a shorthand property when the required longhand components
2311         are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block.
2312
2313         Test: fast/css/no-shorthand-with-incomplete-longhands.html
2314
2315         * css/StyleProperties.cpp:
2316         (WebCore::StyleProperties::getLayeredShorthandValue):
2317         Returning an empty string here means that calling getPropertyValue() with
2318         the shorthand property matching the currently processed longhand property
2319         in asText() will return an empty string as well and the shorthand property
2320         will be disregarded.
2321
2322 2016-05-02  Dean Jackson  <dino@apple.com>
2323
2324         REGRESSION: Page layout of Manga/Picture books and all Fixed Layout ePubs corrupted
2325         https://bugs.webkit.org/show_bug.cgi?id=157292
2326         <rdar://problem/25750144>
2327
2328         Reviewed by Tim Horton.
2329
2330         The scroll state restoration fixes caused a regression in UIWebViews.
2331         Code in UIKit checks for a non-zero page scale in a history item, and
2332         r199233 changed the initialization from 0 to 1.
2333
2334         * history/HistoryItem.h: Use 0 instead of 1 as the initial m_scale.
2335
2336 2016-05-02  Eric Carlson  <eric.carlson@apple.com>
2337
2338         [Mac] AirPlay fails if target is set before AVPlayer has been created
2339         https://bugs.webkit.org/show_bug.cgi?id=157147
2340         <rdar://problem/24197592>
2341
2342         Reviewed by Dean Jackson.
2343
2344         No new tests, it won't be possible to test this until 
2345         https://bugs.webkit.org/show_bug.cgi?id=157290 has been fixed.
2346
2347         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2348         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2349
2350 2016-05-02  Brady Eidson  <beidson@apple.com>
2351
2352         Const-ify some IDB code.
2353         https://bugs.webkit.org/show_bug.cgi?id=157287
2354
2355         Reviewed by Alex Christensen.
2356
2357         No new tests (Refactor only).
2358
2359         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2360         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2361         (WebCore::InProcessIDBServer::deleteDatabase):
2362         (WebCore::InProcessIDBServer::openDatabase):
2363         (WebCore::InProcessIDBServer::abortTransaction):
2364         (WebCore::InProcessIDBServer::commitTransaction):
2365         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
2366         * Modules/indexeddb/shared/InProcessIDBServer.h:
2367
2368 2016-05-02  Antti Koivisto  <antti@apple.com>
2369
2370         REGRESSION(r199964): Animation on pseudo elements doesn't trigger if first frame matches the current style
2371         https://bugs.webkit.org/show_bug.cgi?id=157284
2372
2373         Reviewed by Simon Fraser.
2374
2375         r199964 accidentally changed the logic for computing style change for animations.
2376
2377         Test: fast/css/animation-pseudo-style-change.html
2378
2379         * style/RenderTreeUpdater.cpp:
2380         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
2381
2382             If there is an animated style determine the style change using it rather than the originally resolved style.
2383
2384         * style/StyleTreeResolver.cpp:
2385         (WebCore::Style::TreeResolver::resolveElement):
2386
2387             Here too.
2388
2389 2016-05-02  Brady Eidson  <beidson@apple.com>
2390
2391         Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts.
2392         https://bugs.webkit.org/show_bug.cgi?id=157274
2393
2394         Reviewed by Alex Christensen.
2395
2396         * platform/Logging.cpp:
2397         (WebCore::setLogChannelToAccumulate): Set the given log channel to accumulate logging,
2398           and dirty the initializeLoggingChannelsIfNecessary flag.
2399         (WebCore::initializeLoggingChannelsIfNecessary): Change from being a one-time-only call to a 
2400           one-time-for-each-time-somebody-calls-setLogChannelToAccumulate call.
2401         * platform/Logging.h:
2402
2403         * testing/js/WebCoreTestSupport.cpp:
2404         (WebCoreTestSupport::setLogChannelToAccumulate):
2405         (WebCoreTestSupport::initializeLoggingChannelsIfNecessary):
2406         * testing/js/WebCoreTestSupport.h:
2407
2408 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2409
2410         Sort the project file.
2411
2412         * WebCore.xcodeproj/project.pbxproj:
2413
2414 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2415
2416         Make Length, LengthSize and LengthPoint blending not use member functions
2417         https://bugs.webkit.org/show_bug.cgi?id=157281
2418
2419         Reviewed by Zalan Bujtas.
2420
2421         Having blend() be a member function is ambiguous because it's hard to tell which are
2422         the 'from' and 'to' values. Fix Length, LengthSize and LengthPoint accordingly.
2423
2424         No behavior change.
2425
2426         * page/animation/CSSPropertyAnimation.cpp:
2427         (WebCore::blendFunc):
2428         * platform/Length.cpp:
2429         (WebCore::blendMixedTypes):
2430         (WebCore::blend):
2431         (WebCore::Length::blendMixedTypes): Deleted.
2432         * platform/Length.h:
2433         (WebCore::Length::blend): Deleted.
2434         * platform/LengthPoint.h:
2435         (WebCore::blend):
2436         (WebCore::LengthPoint::blend): Deleted.
2437         * platform/LengthSize.h:
2438         (WebCore::blend):
2439         (WebCore::LengthSize::blend): Deleted.
2440         * platform/graphics/filters/FilterOperation.cpp:
2441         (WebCore::BlurFilterOperation::blend):
2442         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2443         (WebCore::TranslateTransformOperation::blend):
2444         * rendering/style/BasicShapes.cpp:
2445         (WebCore::BasicShapePolygon::blend):
2446         (WebCore::BasicShapeInset::blend):
2447         * rendering/style/BasicShapes.h:
2448         (WebCore::BasicShapeCenterCoordinate::blend):
2449         (WebCore::BasicShapeRadius::blend):
2450
2451 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2452
2453         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
2454         https://bugs.webkit.org/show_bug.cgi?id=157277
2455
2456         Reviewed by Dean Jackson, Tim Horton.
2457
2458         shouldUpdateScrollLayerPositionSynchronously() gave an answer for the main frame even if
2459         called for a subframe. This could have caused scroll snapping, and isRubberBandInProgress()
2460         to give wrong answers sometimes. Fix by passing in the FrameView.
2461
2462         I was unable to easily come up with a testcase to detect the incorrect behavior.
2463
2464         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
2465
2466         * page/FrameView.cpp:
2467         (WebCore::FrameView::isScrollSnapInProgress):
2468         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
2469         (WebCore::FrameView::isRubberBandInProgress):
2470         (WebCore::FrameView::updatesScrollLayerPositionOnMainThread): Deleted.
2471         * page/FrameView.h:
2472         * page/scrolling/ScrollingCoordinator.cpp:
2473         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
2474         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
2475         * page/scrolling/ScrollingCoordinator.h:
2476         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2477         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
2478         * platform/ScrollableArea.h:
2479         * platform/win/PopupMenuWin.h:
2480         * rendering/RenderLayer.cpp:
2481         (WebCore::RenderLayer::setupFontSubpixelQuantization):
2482         * rendering/RenderLayer.h:
2483         * rendering/RenderListBox.h:
2484
2485 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2486
2487         Add to the Animations log channel output about which properties are being blended
2488         https://bugs.webkit.org/show_bug.cgi?id=157271
2489
2490         Reviewed by Dean Jackson.
2491
2492         Make the Animations log channel dump information as CSS properties are being blended.
2493         Sample output:
2494
2495           blending left from 0px to 400px at 0.57 -> 227.76px
2496           blending transform from translate(0px, 0px, 0px) to translate(400px, 0px, 0px) at 0.74 -> translate(294.97px, 0px, 0px)
2497
2498         This makes it easier to see, for example, transitions to or from "auto" values.
2499
2500         * CMakeLists.txt:
2501         * WebCore.xcodeproj/project.pbxproj:
2502         * page/animation/CSSPropertyAnimation.cpp:
2503         (WebCore::PropertyWrapperGetter::value):
2504         (WebCore::PropertyWrapperMaybeInvalidColor::value):
2505         (WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
2506         (WebCore::CSSPropertyAnimation::blendProperties):
2507         * platform/Length.cpp:
2508         (WebCore::operator<<):
2509         * platform/LengthBox.h:
2510         * platform/graphics/transforms/IdentityTransformOperation.h:
2511         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
2512         (WebCore::Matrix3DTransformOperation::dump):
2513         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2514         * platform/graphics/transforms/MatrixTransformOperation.cpp:
2515         (WebCore::MatrixTransformOperation::dump):
2516         * platform/graphics/transforms/MatrixTransformOperation.h:
2517         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
2518         (WebCore::PerspectiveTransformOperation::dump):
2519         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2520         * platform/graphics/transforms/RotateTransformOperation.cpp:
2521         (WebCore::RotateTransformOperation::dump):
2522         * platform/graphics/transforms/RotateTransformOperation.h:
2523         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2524         (WebCore::ScaleTransformOperation::dump):
2525         * platform/graphics/transforms/ScaleTransformOperation.h:
2526         * platform/graphics/transforms/SkewTransformOperation.cpp:
2527         (WebCore::SkewTransformOperation::dump):
2528         * platform/graphics/transforms/SkewTransformOperation.h:
2529         * platform/graphics/transforms/TransformOperation.h:
2530         * platform/graphics/transforms/TransformOperations.cpp:
2531         (WebCore::operator<<):
2532         * platform/graphics/transforms/TransformOperations.h:
2533         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2534         (WebCore::TranslateTransformOperation::dump):
2535         * platform/graphics/transforms/TranslateTransformOperation.h:
2536         * rendering/style/NinePieceImage.cpp:
2537         (WebCore::operator<<):
2538         * rendering/style/NinePieceImage.h:
2539         * svg/SVGLength.cpp:
2540         (WebCore::operator<<):
2541         * svg/SVGLength.h:
2542
2543 2016-05-02  Chris Dumez  <cdumez@apple.com>
2544
2545         Modernize HTMLConstructionSite
2546         https://bugs.webkit.org/show_bug.cgi?id=157279
2547
2548         Reviewed by Alex Christensen.
2549
2550         Modernize HTMLConstructionSite: Use less raw pointers, more auto, more
2551         range loops and more nullptr.
2552
2553         * dom/ScriptElement.h:
2554         * html/parser/HTMLConstructionSite.cpp:
2555         (WebCore::setAttributes):
2556         (WebCore::shouldUseLengthLimit):
2557         (WebCore::executeReparentTask):
2558         (WebCore::HTMLConstructionSite::attachLater):
2559         (WebCore::HTMLConstructionSite::executeQueuedTasks):
2560         (WebCore::HTMLConstructionSite::HTMLConstructionSite):
2561         (WebCore::HTMLConstructionSite::takeForm):
2562         (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
2563         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
2564         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
2565         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
2566         (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
2567         (WebCore::HTMLConstructionSite::setDefaultCompatibilityMode):
2568         (WebCore::HTMLConstructionSite::setCompatibilityMode):
2569         (WebCore::HTMLConstructionSite::finishedParsing):
2570         (WebCore::HTMLConstructionSite::insertDoctype):
2571         (WebCore::HTMLConstructionSite::insertComment):
2572         (WebCore::HTMLConstructionSite::insertCommentOnDocument):
2573         (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
2574         (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
2575         (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
2576         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
2577         (WebCore::HTMLConstructionSite::insertHTMLElement):
2578         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
2579         (WebCore::HTMLConstructionSite::insertCustomElement):
2580         (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
2581         (WebCore::HTMLConstructionSite::insertFormattingElement):
2582         (WebCore::HTMLConstructionSite::insertScriptElement):
2583         (WebCore::HTMLConstructionSite::insertForeignElement):
2584         (WebCore::HTMLConstructionSite::insertTextNode):
2585         (WebCore::HTMLConstructionSite::reparent):
2586         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild):
2587         (WebCore::HTMLConstructionSite::takeAllChildren):
2588         (WebCore::HTMLConstructionSite::createElement):
2589         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2590         (WebCore::HTMLConstructionSite::createHTMLElement):
2591         (WebCore::HTMLConstructionSite::createElementFromSavedToken):
2592         (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
2593         (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
2594         (WebCore::HTMLConstructionSite::findFosterSite):
2595         (WebCore::HTMLConstructionSite::shouldFosterParent):
2596         (WebCore::HTMLConstructionSite::fosterParent):
2597         (WebCore::HTMLConstructionSite::~HTMLConstructionSite): Deleted.
2598         (WebCore::HTMLConstructionSite::setForm): Deleted.
2599         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Deleted.
2600         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode): Deleted.
2601         (WebCore::HTMLConstructionSite::generateImpliedEndTagsWithExclusion): Deleted.
2602         * html/parser/HTMLConstructionSite.h:
2603         (WebCore::HTMLConstructionSite::inQuirksMode):
2604         (WebCore::HTMLConstructionSite::isTelephoneNumberParsingEnabled):
2605         (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
2606         * html/parser/HTMLElementStack.cpp:
2607         (WebCore::HTMLNames::isRootNode):
2608         (WebCore::HTMLElementStack::ElementRecord::ElementRecord):
2609         (WebCore::HTMLElementStack::ElementRecord::replaceElement):
2610         (WebCore::HTMLElementStack::ElementRecord::isAbove):
2611         (WebCore::HTMLElementStack::popAll):
2612         (WebCore::HTMLElementStack::popUntil):
2613         (WebCore::HTMLElementStack::popUntilPopped):
2614         (WebCore::HTMLElementStack::pushRootNode):
2615         (WebCore::HTMLElementStack::pushHTMLHtmlElement):
2616         (WebCore::HTMLElementStack::pushRootNodeCommon):
2617         (WebCore::HTMLElementStack::pushHTMLHeadElement):
2618         (WebCore::HTMLElementStack::pushHTMLBodyElement):
2619         (WebCore::HTMLElementStack::push):
2620         (WebCore::HTMLElementStack::insertAbove):
2621         (WebCore::HTMLElementStack::removeHTMLHeadElement):
2622         (WebCore::HTMLElementStack::remove):
2623         (WebCore::HTMLElementStack::contains):
2624         (WebCore::inScopeCommon):
2625         (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
2626         (WebCore::HTMLElementStack::inScope):
2627         (WebCore::HTMLElementStack::pushCommon):
2628         (WebCore::HTMLElementStack::popCommon):
2629         (WebCore::HTMLElementStack::removeNonTopCommon):
2630         (WebCore::HTMLElementStack::show):
2631         (WebCore::HTMLElementStack::hasOnlyOneElement): Deleted.
2632         (WebCore::HTMLElementStack::secondElementIsHTMLBodyElement): Deleted.
2633         (WebCore::HTMLElementStack::pop): Deleted.
2634         (WebCore::HTMLElementStack::popUntilTableScopeMarker): Deleted.
2635         (WebCore::HTMLElementStack::oneBelowTop): Deleted.
2636         * html/parser/HTMLElementStack.h:
2637         (WebCore::HTMLElementStack::ElementRecord::stackItem):
2638         (WebCore::HTMLElementStack::ElementRecord::setNext): Deleted.
2639         (WebCore::HTMLElementStack::popUntilPopped): Deleted.
2640         * html/parser/HTMLFormattingElementList.cpp:
2641         (WebCore::HTMLFormattingElementList::contains):
2642         (WebCore::HTMLFormattingElementList::swapTo):
2643         (WebCore::HTMLFormattingElementList::append):
2644         (WebCore::HTMLFormattingElementList::remove):
2645         (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
2646         (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
2647         * html/parser/HTMLFormattingElementList.h:
2648         (WebCore::HTMLFormattingElementList::Entry::Entry):
2649         (WebCore::HTMLFormattingElementList::Entry::replaceElement):
2650         (WebCore::HTMLFormattingElementList::Bookmark::Bookmark):
2651         (WebCore::HTMLFormattingElementList::Bookmark::moveToAfter):
2652         (WebCore::HTMLFormattingElementList::Bookmark::mark):
2653         (WebCore::HTMLFormattingElementList::first):
2654         (WebCore::HTMLFormattingElementList::Entry::isMarker): Deleted.
2655         (WebCore::HTMLFormattingElementList::Entry::stackItem): Deleted.
2656         (WebCore::HTMLFormattingElementList::Entry::operator!=): Deleted.
2657         * html/parser/HTMLTreeBuilder.cpp:
2658         (WebCore::HTMLTreeBuilder::processDoctypeToken):
2659         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
2660         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2661         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
2662         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
2663         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
2664         (WebCore::HTMLTreeBuilder::processStartTag):
2665         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
2666         (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
2667         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
2668         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
2669         (WebCore::HTMLTreeBuilder::processComment):
2670         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
2671         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
2672         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
2673         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
2674         (WebCore::HTMLTreeBuilder::processScriptStartTag):
2675         (WebCore::HTMLTreeBuilder::processTokenInForeignContent):
2676
2677 2016-05-02  Per Arne Vollan  <peavo@outlook.com>
2678
2679         Remove unneeded casts once we upgrade to a version of Visual Studio that is not broken
2680         https://bugs.webkit.org/show_bug.cgi?id=121235
2681
2682         Reviewed by Darin Adler.
2683
2684         * css/MediaQueryEvaluator.cpp:
2685         (WebCore::createFunctionMap):
2686         * dom/make_names.pl:
2687         (printWrapperFactoryCppFile):
2688         * loader/archive/ArchiveFactory.cpp:
2689         (WebCore::archiveMIMETypes):
2690         * rendering/svg/SVGPathData.cpp:
2691         (WebCore::updatePathFromGraphicsElement):
2692
2693 2016-05-02  Anders Carlsson  <andersca@apple.com>
2694
2695         Fix build.
2696
2697         * platform/mac/WebPlaybackControlsManager.h:
2698
2699 2016-05-02  Sam Weinig  <sam@webkit.org>
2700
2701         DataDetector underline color should be based on the text color
2702         https://bugs.webkit.org/show_bug.cgi?id=157272
2703
2704         Fixes:
2705             <rdar://problem/25663930> DataDetectors links should use the default text color for their parent nodes
2706             <rdar://problem/25663983> DataDetectors links underline color update
2707
2708         Reviewed by Tim Horton.
2709
2710         * editing/cocoa/DataDetection.mm:
2711         (WebCore::DataDetection::detectContentInRange):
2712         When using light links, use the color of the parent element as the text color, and that same color with
2713         20% alpha as the underline color.
2714
2715 2016-05-01  Ryosuke Niwa  <rniwa@webkit.org>
2716
2717         document.currentScript must be null when we're executing a script inside a shadow tree
2718         https://bugs.webkit.org/show_bug.cgi?id=157245
2719
2720         Reviewed by Darin Adler.
2721
2722         Fix the bug by not setting currentScript as spec'ed in HTML5 specification:
2723         https://html.spec.whatwg.org/multipage/dom.html#dom-document-currentscript
2724         https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
2725         as of 3dc763829ca1598427b588cf08830c1e2af5a05c
2726
2727         New behavior matches that of Google Chrome Canary.
2728
2729         Test: fast/shadow-dom/Document-prototype-currentScript.html
2730
2731         * dom/CurrentScriptIncrementer.h:
2732         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
2733         (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer):
2734         * dom/ScriptElement.cpp:
2735         (WebCore::ScriptElement::executeScript):
2736
2737 2016-04-29  Alex Christensen  <achristensen@webkit.org>
2738
2739         Do not reuse cache entries with conditional headers
2740         https://bugs.webkit.org/show_bug.cgi?id=157205
2741         rdar://problem/25856933
2742
2743         Reviewed by Chris Dumez.
2744
2745         Test: http/tests/xmlhttprequest/if-modified-since-0.html
2746
2747         * loader/cache/CachedRawResource.cpp:
2748         (WebCore::CachedRawResource::canReuse):
2749         CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional,
2750         which means that it does not have any headers like If-Modified-Since.  They are usually different,
2751         because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because
2752         time has passed since the last If-Modified-Since header was sent.  When a user sets the If-Modified-Since
2753         manually to something that is constant, we reuse cache entries when we should not.
2754         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2755         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2756         Set the source so we can use it in Internals.
2757
2758 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
2759
2760         Speculatively fix the cmake build
2761         https://bugs.webkit.org/show_bug.cgi?id=157262
2762
2763         Reviewed by Darin Adler.
2764
2765         This patch adds WEB_TIMING build flag guards around calls to DOMWindow()->performance(),
2766         in order to make sure builds that have WEB_TIMING disabled (e.g. cmake on Mac) continue
2767         to build.
2768
2769         No new tests as there's no functional change.
2770
2771         * loader/cache/CachedResourceLoader.cpp:
2772         (WebCore::CachedResourceLoader::loadDone):
2773
2774 2016-05-02  Daniel Bates  <dabates@apple.com>
2775
2776         CSP: Add workaround for XtraMath
2777         https://bugs.webkit.org/show_bug.cgi?id=157252
2778
2779         Reviewed by Andy Estes.
2780
2781         * platform/RuntimeApplicationChecks.h:
2782         * platform/RuntimeApplicationChecks.mm:
2783         (WebCore::IOSApplication::isXtraMath): Added.
2784
2785 2016-05-02  Daniel Bates  <dabates@apple.com>
2786
2787         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
2788         https://bugs.webkit.org/show_bug.cgi?id=147672
2789         <rdar://problem/22357464>
2790
2791         Reviewed by Brady Eidson.
2792
2793         Schedule a DatabaseCloseTask when Database::close() is called from a thread other than the
2794         database thread as the database thread is responsible for interacting with the database.
2795
2796         Currently -[WebDatabaseManager startBackgroundTask] and WebProcess::processWillSuspendImminently()
2797         call DatabaseTracker::closeAllDatabases() indirectly and directly, respectively, from a
2798         thread other than the database thread. In a debug build, this causes an assertion failure
2799         in Database::close(). In a release/production build, this starts a race between the calling
2800         thread and the database thread that can lead to a crash. It is the responsibility of the
2801         database thread to manage the database. We should ensure that calling Database::close()
2802         delegates the responsibility of actually closing the database to the database thread to
2803         avoid interfering with the database thread or the need to synchronize access to data
2804         structures used by the database thread.
2805
2806         * Modules/webdatabase/Database.cpp:
2807         (WebCore::Database::interrupt): Added. Turns around and calls SQLiteDatabase::interrupt().
2808         (WebCore::Database::close): Added. Schedules a DatabaseCloseTask to close the database and
2809         wait for it to complete if we have not already scheduled closing the database.
2810         (WebCore::Database::performClose): Renamed; formerly named close.
2811         (WebCore::Database::markAsDeletedAndClose): Extracted logic to schedule a DatabaseCloseTask
2812         from here to Database::close() and modified this function to call Database::close().
2813         * Modules/webdatabase/Database.h:
2814         * Modules/webdatabase/DatabaseTask.cpp:
2815         (WebCore::DatabaseCloseTask::doPerformTask): Call Database::performClose() instead of Database::close()
2816         as the latter has been repurposed to schedule closing the database.
2817         * Modules/webdatabase/DatabaseThread.cpp:
2818         (WebCore::DatabaseThread::databaseThread): Ditto.
2819         * Modules/webdatabase/DatabaseTracker.cpp:
2820         (WebCore::DatabaseTracker::closeAllDatabases): Added argument currentQueryBehavior (defaults
2821         to CurrentQueryBehavior::RunToCompletion - close every database after completion of the
2822         current database query, if any).
2823         * Modules/webdatabase/DatabaseTracker.h:
2824         * platform/sql/SQLiteDatabase.cpp:
2825         (WebCore::SQLiteDatabase::interrupt): Added. This is safe to call regardless of the state
2826         of the database and thread safe by <https://www.sqlite.org/c3ref/interrupt.html>.
2827         * platform/sql/SQLiteDatabase.h:
2828
2829 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
2830
2831         Move ResourceTiming behind a runtime flag
2832         https://bugs.webkit.org/show_bug.cgi?id=157133
2833
2834         Reviewed by Alex Christensen.
2835
2836         Move the ResourceTiming API from being behind a build time flag to be behind an
2837         off-by-default runtime flag, that can be turned on using internals.
2838
2839         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
2840                http/tests/performance/performance-resource-timing-entries.html
2841
2842         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
2843         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
2844         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
2845         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2846         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
2847         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
2848         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
2849         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming, and replaced PERFORMANCE_TIMELINE for WEB_TIMING.
2850         Added build flag around UserTiming related h files.
2851         (WebCore::toJS): Deleted.
2852         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
2853         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
2854         (WebCore::DocumentThreadableLoader::loadRequest):
2855         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
2856         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2857         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
2858         (WebCore::CachedResourceLoader::revalidateResource):
2859         (WebCore::CachedResourceLoader::loadResource):
2860         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
2861         (WebCore::CachedResourceLoader::loadDone):
2862         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
2863         * page/Performance.cpp: Remove #if for ResourceTiming.
2864         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
2865         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
2866         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
2867         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
2868         * page/Performance.h: Remove #if for ResourceTiming.
2869         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
2870         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
2871         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
2872         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
2873         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
2874         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
2875         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
2876         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
2877         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
2878         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
2879         * testing/Internals.cpp: Add a method that enables ResourceTiming.
2880         (WebCore::Internals::setResourceTimingSupport):
2881         * testing/Internals.h: Add a method that enables ResourceTiming.
2882         * testing/Internals.idl: Add a method that enables ResourceTiming.
2883
2884 2016-05-01  Nan Wang  <n_wang@apple.com>
2885
2886         AX: Crash at  WebCore::AccessibilityObject::getAttribute const + 9
2887         https://bugs.webkit.org/show_bug.cgi?id=157256
2888
2889         Reviewed by Chris Fleizach.
2890
2891         When the <label> for the input element has no renderer, it will cause
2892         crash when we ask for the title element text. Fixed it by getting the 
2893         aria-label attribute directly from the <label> element instead of its 
2894         accessibility object. 
2895
2896         Test case covered in accessibility/mac/aria-label-on-label-element.html.
2897
2898         * accessibility/AccessibilityNodeObject.cpp:
2899         (WebCore::AccessibilityNodeObject::titleElementText):
2900
2901 2016-05-01  Darin Adler  <darin@apple.com>
2902
2903         Stop using string-based enumerations in TextTrack, and eliminate support for string-based enumerations
2904         https://bugs.webkit.org/show_bug.cgi?id=157253
2905
2906         Reviewed by Chris Dumez.
2907
2908         This was the most difficult case to convert from the old style of enumeration to enum class.
2909         Afterward there is a bit of messy duplication, but it still seems like an improvement overall.
2910
2911         After this patch, I plan to change the rule for the name of the enumeration; instead of
2912         living at the top level of the WebCore namespace, we will look for them inside the class for the
2913         first interface defined in the same file along with the enumeration, and remove the name prefix,
2914         if the interfaces's name is a prefix of the enumerations's name.
2915
2916         Once that's done, next step is to do something in the bindings for dictionaries. And adopt both the
2917         enumeration and dictionary mechanisms more widely, and remove the old use of "dictionary" as a type name.
2918
2919         * Modules/mediasource/MediaSource.cpp:
2920         (WebCore::MediaSource::removeSourceBuffer): Use enum values instead of keywords.
2921         * Modules/mediasource/SourceBuffer.cpp:
2922         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
2923
2924         * bindings/js/JSTextTrackCustom.cpp:
2925         (WebCore::JSTextTrack::setKind): Deleted.
2926
2927         * bindings/scripts/CodeGenerator.pm:
2928         (IsStringBasedEnumType): Deleted.
2929
2930         * bindings/scripts/CodeGeneratorJS.pm:
2931         (GetEnumerationImplementationContent): Removed IsStringBasedEnumType check.
2932         (GenerateParametersCheck): Ditto.
2933         (GenerateImplementation): Ditto.
2934         (GetNativeType): Ditto.
2935         (JSValueToNative): Ditto.
2936
2937         * html/HTMLMediaElement.cpp:
2938         (WebCore::HTMLMediaElement::loadInternal): Use enum values instead of keywords.
2939         (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
2940         (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
2941         (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
2942         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
2943         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
2944         (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
2945         (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto.
2946         (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
2947         (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto.
2948         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
2949         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
2950         (WebCore::toPlatform): Added helpers for the outOfBandTrackSources function.
2951         (WebCore::HTMLMediaElement::outOfBandTrackSources): Removed unneeded fastHasAttribute
2952         check since getNonEmptyURLAttribute already returns an empty URL when the attribute is
2953         not present. Changed to use enum values instead of keywords.
2954
2955         * html/HTMLTrackElement.cpp:
2956         (WebCore::HTMLTrackElement::parseAttribute): Use new setKindKeywordIgnoringASCIICase
2957         function rather than calling setKind and convertToASCIILowercase. Also use ensureTrack
2958         instead of track since the latter is a cover that calls it and dumbs down the return type.
2959         (WebCore::HTMLTrackElement::kind): Changed return type to const AtomicString& since
2960         that's what we will have for kind keywords and because it matches what we normally have
2961         for attribute getting fuctions. Also use ensureTrack.
2962         (WebCore::HTMLTrackElement::setKind): Changed argument to AtomicString so we don't waste
2963         time making a string and then destroying it before turning it into an AtomicString so it
2964         can be an attribute value.
2965         (WebCore::HTMLTrackElement::srclang): Changed return type to const AtomicString& as is
2966         customary and efficient for attribute value convenience functions. Also use fastGetAttribute.
2967         (WebCore::HTMLTrackElement::setSrclang): Deleted.
2968         (WebCore::HTMLTrackElement::label): Ditto.
2969         (WebCore::HTMLTrackElement::setLabel): Deleted.
2970         (WebCore::HTMLTrackElement::setIsDefault): Deleted.
2971         (WebCore::HTMLTrackElement::scheduleLoad): Use enum values instead of keywords.
2972
2973         * html/HTMLTrackElement.h: Use pragma once. Update for changes mentioned above.
2974         Also mark things final instead of override as per our recent style discussion.
2975
2976         * html/HTMLTrackElement.idl: Use [Reflect] for srclang and label.
2977
2978         * html/shadow/MediaControlElements.cpp:
2979         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Use enum value
2980         instead of keyword.
2981         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
2982
2983         * html/track/AudioTrack.cpp:
2984         (WebCore::AudioTrack::AudioTrack): Use new base class MediaTrackBase.
2985
2986         * html/track/AudioTrack.h: Use pragma once. Make base class be MediaTrackBase instead
2987         of TrackBase.
2988
2989         * html/track/InbandTextTrack.cpp:
2990         (WebCore::InbandTextTrack::setMode): Change argument type to enum instead of string.
2991         (WebCore::toPrivate): Added. Helper for setModeInternal.
2992         (WebCore::InbandTextTrack::setModeInternal): Change argument type to enum instead of string.
2993         (WebCore::InbandTextTrack::updateKindFromPrivate): Use enum instead of string to call setKind.
2994
2995         * html/track/InbandTextTrack.h: Use pragma once. Use TextTrackMode for argument types.
2996
2997         * html/track/TextTrack.cpp:
2998         (WebCore::captionsKeyword): Converted this to a non-member function since it is now
2999         private to this file.
3000         (WebCore::descriptionsKeyword): Ditto.
3001         (WebCore::chaptersKeyword): Ditto.
3002         (WebCore::metadataKeyword): Ditto.
3003         (WebCore::forcedKeyword): Ditto.
3004         (WebCore::TextTrack::disabledKeyword): Deleted.
3005         (WebCore::TextTrack::hiddenKeyword): Deleted.
3006         (WebCore::TextTrack::showingKeyword): Deleted.
3007         (WebCore::TextTrack::TextTrack): Moved some initialization to be done in the header where
3008         the data members are defined. Put the code that is the equivalent to setKindInternal here,
3009         because it turns out it's not needed anywhere else. Over time we might change the types
3010         involved and there's no need to have that be across multiple functions.
3011         (WebCore::TextTrack::~TextTrack): Removed unneeded call to clearClient, right when the
3012         object is about to be destroyed. Perhaps there was an illusion that the old call might
3013         be a virtual function call that invokes the clearClient from a derived class, but that
3014         doesn't work in a destructor, so this code was only clearing out the data member and
3015         that does not need to be done.
3016         (WebCore::TextTrack::isValidKind): Deleted.
3017         (WebCore::TextTrack::enabled): Use enum value instead of keyword.
3018         (WebCore::TextTrack::kindKeyword): Added. Function for callers who need a string, not the
3019         enum value.
3020         (WebCore::TextTrack::setKind): Take enum value instead of keyword. Also changed since
3021         we store the kind in a data member in this class, not inherited.
3022         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Added. For HTMLTrackElement to use
3023         when setting the kind attribute.
3024         (WebCore::TextTrack::setMode): Take enum value instread of keyword. Also removed assertion
3025         since the enum already makes it intrinsically clear what values are valid, unlike a string.
3026         (WebCore::TextTrack::cues): Use enum value instead of keyword.
3027         (WebCore::TextTrack::activeCues): Ditto.
3028         (WebCore::TextTrack::addCue): Ditto.
3029         (WebCore::TextTrack::ensureVTTRegionList): Changed return type to reference.
3030         (WebCore::TextTrack::regions): Use enum value instead of keyword.
3031         (WebCore::TextTrack::addRegion): Use reference.
3032         (WebCore::TextTrack::cueDidChange): Ditto.
3033         (WebCore::TextTrack::isRendered): Use enum values instead of keywords. Also write to be
3034         a boolean expression instead of a couple different if statements.
3035         (WebCore::TextTrack::ensureTextTrackCueList): Changed return type to reference.
3036         (WebCore::TextTrack::isMainProgramContent): Use enum value instead of keyword.
3037         (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto.
3038
3039         * html/track/TextTrack.h: Use pragma once. Removed unneeded include. Added enums for
3040         TextTrackKind and TextTrackMode. Updated for changes to functions listed above.
3041         Added m_mode and m_kind and initialized those data members and some others.
3042
3043         * html/track/TextTrack.idl: Tweaked formatting. Used ImplementedAs for the kind
3044         attribute rather than using a CustomSetter. This preserves the strange behavior
3045         where setting kind does nothing when !ENABLE(MEDIA_SOURCE). If we discover we don't
3046         need that, then we won't need ImplementedAs any more either.
3047
3048         * html/track/TextTrackCue.cpp:
3049         (WebCore::TextTrackCue::dispatchEvent): Use enum instad of keyword.
3050         (WebCore::TextTrackCue::isActive): Ditto.
3051
3052         * html/track/TrackBase.cpp:
3053         (WebCore::TrackBase::TrackBase): Removed unneeded initialization that is handled in
3054         the data member definition in the header now.
3055         (WebCore::MediaTrackBase::MediaTrackBase): Added. Calls through to TrackBase.
3056         (WebCore::MediaTrackBase::setKind): Moved to MediaTrackBase from TrackBase, because
3057         this isn't needed for text tracks.
3058         (WebCore::MediaTrackBase::setKindInternal): Ditto.
3059
3060         * html/track/TrackBase.h: Use pragma once. Move kind, setKind, isValidKind, defaultKindKeyword,
3061         setKindInternal, and m_kind all to a derived class, MediaTrackBase, since TextTrack doesn't need
3062         any of those any more. Later we might adopt enumerations more and it's possible the need for
3063         MediaTrackBase will go away.
3064
3065         * html/track/VideoTrack.cpp:
3066         (WebCore::VideoTrack::VideoTrack): Updated to use MediaTrackBase.
3067         (WebCore::VideoTrack::setLanguage): Ditto.
3068
3069         * html/track/VideoTrack.h: Use pragma once. Removed unneeded header include.
3070         Derive from MediaTrackBase instead of TrackBase.
3071
3072         * page/CaptionUserPreferences.cpp:
3073         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Use enum values instead
3074         of keywords.
3075         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto.
3076         * page/CaptionUserPreferencesMediaAF.cpp:
3077         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto.
3078         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto. Also used
3079         kindKeyword since we want a string for logging.
3080         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3081         (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto.
3082
3083 2016-05-01  Chris Dumez  <cdumez@apple.com>
3084
3085         Pass reference instead of pointer to IDL attribute setters if not nullable
3086         https://bugs.webkit.org/show_bug.cgi?id=157250
3087
3088         Reviewed by Darin Adler.
3089
3090         Update the bindings generator so that we pass wrapper types by reference
3091         to attribute setters instead of by raw pointer when the attribute is not
3092         marked as nullable in the IDL.
3093
3094         There is no intended Web-exposed behavior change.
3095
3096         * Modules/speech/SpeechSynthesisUtterance.idl:
3097         * Modules/webaudio/ConvolverNode.idl:
3098         * bindings/js/JSDataCueCustom.cpp:
3099         (WebCore::constructJSDataCue):
3100         * bindings/scripts/CodeGeneratorJS.pm:
3101         (GenerateImplementation):
3102         * bindings/scripts/CodeGeneratorObjC.pm:
3103         (GenerateImplementation):
3104
3105         * bindings/scripts/test/JS/JSTestInterface.cpp:
3106         * bindings/scripts/test/JS/JSTestObj.cpp:
3107         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
3108         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3109         Rebaseline bindings tests.
3110
3111         * dom/Document.cpp:
3112         (WebCore::Document::moveNodeIteratorsToNewDocument):
3113         * dom/NodeIterator.cpp:
3114         (WebCore::NodeIterator::NodePointer::NodePointer):
3115         (WebCore::NodeIterator::NodePointer::moveToNext):
3116         (WebCore::NodeIterator::NodePointer::moveToPrevious):
3117         (WebCore::NodeIterator::NodeIterator):
3118         (WebCore::NodeIterator::~NodeIterator):
3119         (WebCore::NodeIterator::updateForNodeRemoval):
3120         (WebCore::NodeIterator::NodePointer::clear): Deleted.
3121         (WebCore::NodeIterator::nextNode): Deleted.
3122         * dom/NodeIterator.h:
3123         * dom/Traversal.cpp:
3124         (WebCore::NodeIteratorBase::NodeIteratorBase):
3125         * dom/Traversal.h:
3126         (WebCore::NodeIteratorBase::root):
3127         * dom/TreeWalker.cpp:
3128         (WebCore::TreeWalker::setCurrentNode):
3129         (WebCore::TreeWalker::setCurrent):
3130         (WebCore::TreeWalker::parentNode):
3131         (WebCore::TreeWalker::firstChild):
3132         (WebCore::TreeWalker::lastChild):
3133         (WebCore::TreeWalker::traverseSiblings):
3134         (WebCore::TreeWalker::previousNode):
3135         (WebCore::TreeWalker::nextNode):
3136         * dom/TreeWalker.h:
3137         (WebCore::TreeWalker::currentNode):
3138         * dom/TreeWalker.idl:
3139         * html/HTMLAttachmentElement.idl:
3140         * html/HTMLInputElement.idl:
3141         * html/HTMLTableElement.idl:
3142         * html/track/DataCue.cpp:
3143         (WebCore::DataCue::DataCue):
3144         (WebCore::DataCue::setData):
3145         (WebCore::toDataCue): Deleted.
3146         * html/track/DataCue.h:
3147         * html/track/DataCue.idl:
3148
3149 2016-05-01  Commit Queue  <commit-queue@webkit.org>
3150
3151         Unreviewed, rolling out r200264 and r200266.
3152         https://bugs.webkit.org/show_bug.cgi?id=157251
3153
3154         This change caused existing LayoutTest media/media-source
3155         /media-source-stalled-holds-sleep-assertion.html to time out
3156         on Mac on every run. (Requested by ryanhaddad on #webkit).
3157
3158         Reverted changesets:
3159
3160         "[Mac] AirPlay fails if target is set before AVPlayer has been
3161         created"
3162         https://bugs.webkit.org/show_bug.cgi?id=157147
3163         http://trac.webkit.org/changeset/200264
3164
3165         "[Mac] AirPlay fails if target is set before AVPlayer has been
3166         created"
3167         https://bugs.webkit.org/show_bug.cgi?id=157147
3168         http://trac.webkit.org/changeset/200266
3169
3170 2016-05-01  Chris Dumez  <cdumez@apple.com>
3171
3172         Drop CanUseWTFOptionalForParameter() from bindings generator
3173         https://bugs.webkit.org/show_bug.cgi?id=157247
3174
3175         Reviewed by Darin Adler.
3176
3177         * bindings/scripts/CodeGeneratorJS.pm:
3178         (GenerateParametersCheck):
3179         (CanUseWTFOptionalForParameter): Deleted.
3180
3181 2016-05-01  Darin Adler  <darin@apple.com>
3182
3183         Update Fetch to use enum class instead of string for enumerations
3184         https://bugs.webkit.org/show_bug.cgi?id=157241
3185
3186         Reviewed by Chris Dumez.
3187
3188         * Modules/fetch/FetchOptions.h: Changed this class into a struct,
3189         getting rid of all the getter and setter functions. Moved all the
3190         enumeration types out of this class to the WebCore namespace level
3191         and gave them all the names and values that match the ones from the
3192         IDL file.
3193
3194         * Modules/fetch/FetchRequest.cpp:
3195         (WebCore::setReferrerPolicy): Updated for the changes to FetchOptions.
3196         The string matching here will likely go away when we change dictionary
3197         so it sets up a structure, which will parse the enumeration values, but
3198         that won't be for a while, so this stays for now.
3199         (WebCore::setMode): Ditto.
3200         (WebCore::setCredentials): Ditto.
3201         (WebCore::setCache): Ditto.
3202         (WebCore::setRedirect): Ditto.
3203         (WebCore::buildOptions): Updated for changes to FetchOptions.
3204         (WebCore::buildHeaders): Ditto.
3205         (WebCore::FetchRequest::create): Ditto.
3206         (WebCore::FetchRequest::type): Moved this to the header and changed its
3207         return type to the enum; it's not just a single return statement.
3208         (WebCore::FetchRequest::destination): Ditto.
3209         (WebCore::FetchRequest::referrerPolicy): Ditto.
3210         (WebCore::FetchRequest::mode): Ditto.
3211         (WebCore::FetchRequest::credentials): Ditto.
3212         (WebCore::FetchRequest::cache): Ditto.
3213         (WebCore::FetchRequest::redirect): Ditto.
3214
3215         * Modules/fetch/FetchRequest.h: Changed all the getters that return
3216         enumerations to return the enum class values instead of strings.
3217         Put all the inline versions here in the header.
3218
3219         * bindings/scripts/CodeGenerator.pm: Removed the seven enum types that
3220         are in FetchRequest.idl from the list of "string-based" enums.
3221
3222         * dom/Document.cpp:
3223         (WebCore::Document::Document): Updated for the change where I
3224         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
3225         (WebCore::Document::processReferrerPolicy): Ditto.
3226         (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
3227         * dom/Document.h: Ditto.
3228         * loader/FrameNetworkingContext.h: Ditto.
3229         * page/SecurityPolicy.cpp:
3230         (WebCore::SecurityPolicy::generateReferrerHeader): Ditto.
3231         * page/SecurityPolicy.h: Ditto.
3232
3233         * platform/ReferrerPolicy.h: Renamed this enum from ReferrerPolicy to
3234         ReferrerHeaderPolicy, since the one specified in the Fetch API has the
3235         name ReferrerPolicy. I think the best way to resolve this longer term is
3236         to merge them since they really do represent the same concept, although
3237         the one from the Fetch API has a few more features.
3238
3239 2016-05-01  Chris Dumez  <cdumez@apple.com>
3240
3241         Unreviewed attempt to fix Windows build after r200288.
3242
3243         * bindings/scripts/CodeGeneratorJS.pm:
3244         (GenerateParametersCheck):
3245
3246 2016-05-01  Chris Dumez  <cdumez@apple.com>
3247
3248         Unreviewed attempt to fix Windows build after r200288.
3249
3250         * bindings/scripts/CodeGeneratorJS.pm:
3251         (GetEnumerationImplementationContent):
3252
3253 2016-05-01  Chris Dumez  <cdumez@apple.com>
3254
3255         Unreviewed, rebaseline bindings tests after r200300.
3256
3257         * bindings/scripts/test/JS/JSTestObj.cpp:
3258         (WebCore::jsStringWithCache):
3259
3260 2016-05-01  Darin Adler  <darin@apple.com>
3261
3262         Use enum class instead of string-based enums in RTC code
3263         https://bugs.webkit.org/show_bug.cgi?id=157242
3264
3265         Reviewed by Alex Christensen.
3266
3267         * Modules/mediastream/RTCConfiguration.cpp:
3268         (WebCore::RTCConfiguration::RTCConfiguration): Don't initialize members here,
3269         do it in the header instead.
3270         (WebCore::RTCConfiguration::initialize): Initialize data members to enum values,
3271         not strings.
3272
3273         * Modules/mediastream/RTCConfiguration.h: Tried to keep this class compiling.
3274         Added the new enum class, and changed to use that instead of strings. But note,
3275         this should not even be a class. Needs to become a dictionary.
3276
3277         * Modules/mediastream/RTCConfiguration.idl: Updated the names and values of the
3278         enums to match the current RTC specification. Again, as I said, this should be
3279         a dictionary, not an interface.
3280
3281         * bindings/scripts/CodeGenerator.pm: Removed the RTC enumerations from the list
3282         of string-based enums.
3283
3284 2016-04-30  Antti Koivisto  <antti@apple.com>
3285
3286         REGRESSION (r199640): position:absolute generated content inherits text-decoration from its element
3287         https://bugs.webkit.org/show_bug.cgi?id=157199
3288         <rdar://problem/26013111>
3289
3290         Reviewed by Zalan Bujtas.
3291
3292         Test: fast/css/text-decoration-inheritance-pseudo.html
3293
3294         * css/StyleResolver.cpp:
3295         (WebCore::doesNotInheritTextDecoration):
3296         (WebCore::StyleResolver::adjustRenderStyle):
3297
3298             There was an accidental logic change here. Even if element is null other conditions may make this test true.
3299
3300 2016-04-30  Zalan Bujtas  <zalan@apple.com>
3301
3302         Some content causes deep recursion.
3303         https://bugs.webkit.org/show_bug.cgi?id=157230
3304         <rdar://problem/7694756>
3305
3306         Reviewed by Antti Koivisto.
3307
3308         This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
3309         are still accessible through DOM APIs but
3310         1. we stop generating renderers for them -they behave like display: none. 
3311         2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto) 
3312
3313         Test: fast/block/nested-renderers.html
3314
3315         * page/Settings.h:
3316         * style/StyleTreeResolver.cpp: Skip renderer constructing and continue with the sibling node. 
3317         (WebCore::Style::TreeResolver::resolveComposedTree):
3318
3319 2016-04-30  Darin Adler  <darin@apple.com>
3320
3321         Update XMLHttpRequest to use enum class instead of string for enumeration
3322         https://bugs.webkit.org/show_bug.cgi?id=157238
3323
3324         Reviewed by Chris Dumez.
3325
3326         * bindings/js/JSXMLHttpRequestCustom.cpp:
3327         (WebCore::JSXMLHttpRequest::response): Rewrite to use responseType function
3328         instead of responseTypeCode function.
3329
3330         * bindings/scripts/CodeGenerator.pm: Removed XMLHttpRequestResponseType
3331         from the list of enumerations that use a string-based implementation.
3332
3333         * bindings/scripts/CodeGeneratorJS.pm:
3334         (GetEnumerationImplementationContent): Use emptyString instead of ASCIILiteral
3335         when the string constant is empty, to avoid the assertion.
3336
3337         * xml/XMLHttpRequest.cpp:
3338         (WebCore::XMLHttpRequest::XMLHttpRequest): Move simple scalar data member
3339         initialization to where the data members are defined in the header.
3340         (WebCore::XMLHttpRequest::responseText): Use m_responseType instead of
3341         m_responseTypeCode.
3342         (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto.
3343         (WebCore::XMLHttpRequest::responseXML): Ditto.
3344         (WebCore::XMLHttpRequest::responseBlob): Ditto.
3345         (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto.
3346         (WebCore::XMLHttpRequest::setResponseType): Ditto.
3347         (WebCore::XMLHttpRequest::responseType): Moved to header now that it's a
3348         trivial function that should be inlined.
3349         (WebCore::XMLHttpRequest::open): Use m_responseType instead of
3350         m_responseTypeCode.
3351         (WebCore::XMLHttpRequest::responseMIMEType): Removed one redundant check.
3352         (WebCore::XMLHttpRequest::status): Ditto.
3353         (WebCore::XMLHttpRequest::statusText): Ditto.
3354         (WebCore::shouldDecodeResponse): Moved here from the header. This is now
3355         a non-member function that gets passed a response type. It uses a switch
3356         now instead of ordering the types so that the binary ones are all at the
3357         end of the list.
3358         (WebCore::XMLHttpRequest::didReceiveData): Use the new shouldDecodeResponse.
3359         Also removed an unnecessary check that non-decoded responses are of type
3360         "arraybuffer" or "blob"; that's the same check that shouldDecodeResponse does.
3361
3362         * xml/XMLHttpRequest.h: Removed some unneeded includes and forward declarations.
3363         Removed a comment about the State values needing to be stable numbers; for one
3364         thing the bindings already check that these values have no changed. It's not a
3365         valuable comment. Removed ResponseTypeCode, responseTypeCode, and
3366         m_responseTypeCode. Changed the type of the result of responseType and the
3367         argument to setResponseType from a string to XMLHttpRequestResponseType.
3368         Removed shouldDecodeResponse. Added the initial values for lots of data members
3369         that are simple scalars, matching what was set in the constructor before.
3370
3371 2016-04-30  Darin Adler  <darin@apple.com>
3372
3373         Streamline and remove unused bindings generation code
3374         https://bugs.webkit.org/show_bug.cgi?id=157237
3375
3376         Reviewed by Chris Dumez.
3377
3378         * Modules/notifications/NotificationCenter.idl: Replace non-standard "int"
3379         with standard "long", which means the same thing.
3380
3381         * bindings/scripts/CodeGenerator.pm:
3382         (UpdateFile): Use a better perl idiom for open.
3383         (IsTypedArrayType): Use a hash instead of a list of checks in the code.
3384         (IsRefPtrType): Use GetArrayOrSequenceType. Add handling for "any", which
3385         is not a "RefPtr" type.
3386         (IsWrapperType): Build on top of IsRefPtr type so we don't have to repeat
3387         the list.
3388         (getInterfaceExtendedAttributesFromName): Added a FIXME about why this is no good.
3389         (ComputeIsCallbackInterface): Renamed.
3390         (IsCallbackInterface): Added a cache so we don't keep reading the same file
3391         over and over again. Added a FIXME about why this is no good.
3392         (ComputeIsFunctionOnlyCallbackInterface): Ditto.
3393         (IsFunctionOnlyCallbackInterface): Ditto.
3394
3395         * bindings/scripts/CodeGeneratorJS.pm:
3396         (AddIncludesForType): Use GetArrayOrSequenceType.
3397         (IsScriptProfileType): Deleted.
3398         (AddTypedefForScriptProfileType): Deleted.
3399         (AddClassForwardIfNeeded): Streamlined the code and made the ScriptProfileNode
3400         special case easier to read.
3401         (GenerateParametersCheckExpression): Use GetArrayOrSequenceType.
3402         (GetFunctionLength): Tweaked formatting and argument names.
3403         (GenerateImplementation): Merged a couple checks into a single if statement.
3404         (WillConvertUndefinedToDefaultParameterValue): Streamlined the function by
3405         using a hash instead of a sequence of if statements for most cases.
3406         (GetNativeType): Use GetArrayOrSequenceType.
3407         (JSValueToNative): Do the integer conversion based on a hash rather than
3408         with lots of separate lines of code. Moved more of the simple names down to
3409         the bottom of the function and streamlined the logic. Removed unnecessary
3410         includes of the DOM headers directly, since our header file includes those.
3411         (NativeToJSValue): Factored out the global object handling so it works across
3412         more cases. Simplified the logic for dates. Use IsNumericType instead of
3413         IsPrimitiveType to guard code that is right only for the numeric types.
3414         Removed code to handle "Symbol" since we don't ever use that.
3415
3416         * bindings/scripts/test/JS/JSTestCallback.cpp:
3417         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3418         * bindings/scripts/test/JS/JSTestInterface.cpp:
3419         * bindings/scripts/test/JS/JSTestObj.cpp:
3420         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3421         Regenerated.
3422
3423         * bindings/scripts/test/TestObj.idl: Removed test coverage for Symbol, which
3424         we never use anywhere.
3425
3426         * html/canvas/EXTBlendMinMax.idl: Replace non-standard "int" with standard
3427         "long", which means the same thing.
3428         * html/canvas/EXTTextureFilterAnisotropic.idl: Ditto.
3429         * html/canvas/EXTsRGB.idl: Ditto.
3430         * html/canvas/OESStandardDerivatives.idl: Ditto.
3431         * html/canvas/OESVertexArrayObject.idl: Ditto.
3432         * html/canvas/WebGLCompressedTextureATC.idl: Ditto.
3433         * html/canvas/WebGLCompressedTexturePVRTC.idl: Ditto.
3434         * html/canvas/WebGLCompressedTextureS3TC.idl: Ditto.
3435         * html/canvas/WebGLDebugRendererInfo.idl: Ditto.
3436         * html/canvas/WebGLDepthTexture.idl: Ditto.
3437
3438 2016-04-30  Chris Dumez  <cdumez@apple.com>
3439
3440         [Web IDL] Pass even more types by reference
3441         https://bugs.webkit.org/show_bug.cgi?id=157231
3442
3443         Reviewed by Darin Adler.
3444
3445         Pass even more types by reference when the parameters are not marked as
3446         nullable in the IDL.
3447
3448         * Modules/encryptedmedia/MediaKeySession.cpp:
3449         (WebCore::MediaKeySession::generateKeyRequest):
3450         (WebCore::MediaKeySession::keyRequestTimerFired):
3451         (WebCore::MediaKeySession::update):
3452         (WebCore::MediaKeySession::addKeyTimerFired):
3453         * Modules/encryptedmedia/MediaKeySession.h:
3454         * Modules/encryptedmedia/MediaKeys.cpp:
3455         (WebCore::MediaKeys::createSession):
3456         * Modules/encryptedmedia/MediaKeys.h:
3457         * Modules/encryptedmedia/MediaKeys.idl:
3458         * Modules/mediasource/SourceBuffer.cpp:
3459         (WebCore::SourceBuffer::appendBuffer):
3460         (WebCore::SourceBuffer::resetParserState): Deleted.
3461         * Modules/mediasource/SourceBuffer.h:
3462         * Modules/mediastream/RTCDataChannel.cpp:
3463         (WebCore::RTCDataChannel::send):
3464         * Modules/mediastream/RTCDataChannel.h:
3465         * Modules/webaudio/AnalyserNode.h:
3466         (WebCore::AnalyserNode::getFloatFrequencyData):
3467         (WebCore::AnalyserNode::getByteFrequencyData):
3468         (WebCore::AnalyserNode::getByteTimeDomainData):
3469         * Modules/webaudio/AnalyserNode.idl:
3470         * Modules/webaudio/AudioContext.cpp:
3471         (WebCore::AudioContext::createPeriodicWave):
3472         * Modules/webaudio/AudioContext.h:
3473         * Modules/webaudio/AudioParam.h:
3474         (WebCore::AudioParam::setValueCurveAtTime):
3475         * Modules/webaudio/AudioParam.idl:
3476         * Modules/webaudio/BiquadFilterNode.cpp:
3477         (WebCore::BiquadFilterNode::getFrequencyResponse):
3478         * Modules/webaudio/BiquadFilterNode.h:
3479         * Modules/webaudio/BiquadFilterNode.idl:
3480         * Modules/webaudio/PeriodicWave.cpp:
3481         (WebCore::PeriodicWave::create):
3482         (WebCore::PeriodicWave::createSine): Deleted.
3483         * Modules/webaudio/PeriodicWave.h:
3484         * Modules/websockets/WebSocket.cpp:
3485         (WebCore::WebSocket::send):
3486         * Modules/websockets/WebSocket.h:
3487         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
3488         (WebCore::dataFunctionf):
3489         (WebCore::dataFunctioni):
3490         (WebCore::dataFunctionMatrix):
3491         * bindings/scripts/CodeGeneratorJS.pm:
3492         (GenerateParametersCheck):
3493         (ShouldPassWrapperByReference):
3494         * bindings/scripts/test/JS/JSTestObj.cpp:
3495         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
3496         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3497         (WebCore::constructJSTestOverloadedConstructors2):
3498         * html/HTMLMediaElement.cpp:
3499         (WebCore::HTMLMediaElement::webkitAddKey):
3500         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
3501         * html/HTMLMediaElement.h:
3502         * html/HTMLMediaElement.idl:
3503         * html/ImageData.cpp:
3504         (WebCore::ImageData::create):
3505         (WebCore::ImageData::ImageData):
3506         * html/ImageData.h:
3507         * html/canvas/CanvasRenderingContext2D.cpp:
3508         (WebCore::CanvasRenderingContext2D::getImageData):
3509         * html/canvas/WebGL2RenderingContext.cpp:
3510         (WebCore::WebGL2RenderingContext::texImage3D):
3511         (WebCore::WebGL2RenderingContext::texSubImage3D):
3512         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
3513         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
3514         (WebCore::WebGL2RenderingContext::uniform1uiv):
3515         (WebCore::WebGL2RenderingContext::uniform2uiv):
3516         (WebCore::WebGL2RenderingContext::uniform3uiv):
3517         (WebCore::WebGL2RenderingContext::uniform4uiv):
3518         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
3519         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
3520         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
3521         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
3522         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
3523         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
3524         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
3525         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
3526         (WebCore::WebGL2RenderingContext::clearBufferiv):
3527         (WebCore::WebGL2RenderingContext::clearBufferuiv):
3528         (WebCore::WebGL2RenderingContext::clearBufferfv):
3529         (WebCore::WebGL2RenderingContext::getActiveUniforms):
3530         (WebCore::WebGL2RenderingContext::texSubImage2D):
3531         * html/canvas/WebGL2RenderingContext.h:
3532         * html/canvas/WebGL2RenderingContext.idl:
3533         * html/canvas/WebGLRenderingContext.cpp:
3534         (WebCore::WebGLRenderingContext::texSubImage2D):
3535         * html/canvas/WebGLRenderingContext.h:
3536         * html/canvas/WebGLRenderingContextBase.cpp:
3537         (WebCore::WebGLRenderingContextBase::bufferData):
3538         (WebCore::WebGLRenderingContextBase::bufferSubData):
3539         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
3540         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
3541         (WebCore::WebGLRenderingContextBase::readPixels):
3542         (WebCore::WebGLRenderingContextBase::texImage2D):
3543         (WebCore::WebGLRenderingContextBase::uniform1fv):
3544         (WebCore::WebGLRenderingContextBase::uniform1iv):
3545         (WebCore::WebGLRenderingContextBase::uniform2fv):
3546         (WebCore::WebGLRenderingContextBase::uniform2iv):
3547         (WebCore::WebGLRenderingContextBase::uniform3fv):
3548         (WebCore::WebGLRenderingContextBase::uniform3iv):
3549         (WebCore::WebGLRenderingContextBase::uniform4fv):
3550         (WebCore::WebGLRenderingContextBase::uniform4iv):
3551         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
3552         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
3553         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
3554         (WebCore::WebGLRenderingContextBase::vertexAttrib1fv):
3555         (WebCore::WebGLRenderingContextBase::vertexAttrib2fv):
3556         (WebCore::WebGLRenderingContextBase::vertexAttrib3fv):
3557         (WebCore::WebGLRenderingContextBase::vertexAttrib4fv):
3558         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
3559         (WebCore::WebGLRenderingContextBase::validateUniformParameters):
3560         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
3561         (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl):
3562         (WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
3563         (WebCore::WebGLRenderingContextBase::uniform1i): Deleted.
3564         (WebCore::WebGLRenderingContextBase::uniform2i): Deleted.
3565         (WebCore::WebGLRenderingContextBase::uniform3f): Deleted.
3566         (WebCore::WebGLRenderingContextBase::uniform3i): Deleted.
3567         (WebCore::WebGLRenderingContextBase::uniform4f): Deleted.
3568         (WebCore::WebGLRenderingContextBase::uniform4i): Deleted.
3569         (WebCore::WebGLRenderingContextBase::useProgram): Deleted.
3570         (WebCore::WebGLRenderingContextBase::vertexAttribPointer): Deleted.
3571         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions): Deleted.
3572         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Deleted.
3573         * html/canvas/WebGLRenderingContextBase.h:
3574         * html/canvas/WebGLRenderingContextBase.idl:
3575         * testing/Internals.cpp:
3576         (WebCore::Internals::createTimeRanges):
3577         * testing/Internals.h:
3578
3579 2016-04-30  Ryosuke Niwa  <rniwa@webkit.org>
3580
3581         Node.prototype.rootNode is not Web compatible
3582         https://bugs.webkit.org/show_bug.cgi?id=157233
3583
3584         Reviewed by Chris Dumez.
3585
3586         Turns out that the name rootNode is not Web compatible. Remove the method for now
3587         until we can come up with a better name in https://github.com/whatwg/dom/issues/241.
3588
3589         No new tests since we're just removing a method.
3590
3591         * dom/Node.idl:
3592
3593 2016-04-30  Darin Adler  <darin@apple.com>
3594
3595         Try to fix GTK build.
3596
3597         * testing/Internals.h: Added conditional around include of
3598         MediaSessionInterruptionProvider.h.
3599
3600 2016-04-30  Darin Adler  <darin@apple.com>
3601
3602         Stop using old-style string-based enums in Internals.idl
3603         https://bugs.webkit.org/show_bug.cgi?id=157235
3604
3605         Reviewed by Chris Dumez.
3606
3607         * bindings/scripts/CodeGenerator.pm: Removed the six enumeration names
3608         that are used in Internals.idl.
3609         (GenerateCompileTimeCheckForEnumsIfNeeded): Unrelated cleanup. Tighten
3610         code and use static_assert instead of COMPILE_ASSERT.
3611         (IsStringType): Marked this function as deprecated. Calling a function
3612         just to check if something is specifically "DOMString" isn't a good pattern.
3613         Lots of call sites were checking "DOMString" directly and there is no
3614         reason to mix the two different idioms.
3615
3616         * bindings/scripts/CodeGeneratorJS.pm:
3617         (GetEnumerationImplementationContent): Use GenerateConditionalString.
3618         (GenerateImplementation): Use static_assert instead of COMPILE_ASSERT.
3619         (GenerateCallbackHeader): Tighten code. Remove peculiar code that was
3620         trying to emit COMPILE_ASSERT(false); not an important case to detect, and
3621         if we did want to detect it, then having the code generator report an error
3622         is better than COMPILE_ASSERT when compiling the output.
3623         (NativeToJSValue): Stop using IsStringType.
3624
3625         * bindings/scripts/CodeGeneratorObjC.pm:
3626         (GetClassName): Stop using IsStringType.
3627         (GetPropertyAttributes): Ditto.
3628         (ConversionNeeded): Ditto.
3629         (GetObjCTypeGetter): Ditto.
3630         (AddIncludesForType): Ditto.
3631         (GenerateImplementation): Removed unused @needsAssert. It was a write-only
3632         variable.
3633
3634         * bindings/scripts/IDLParser.pm:
3635         (parseEnum): Put the extended attributes into the enumeration object.
3636
3637         * bindings/scripts/test/TestObj.idl: Added test cases for the Conditional
3638         extended attribute, used with enumerations.
3639
3640         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3641         * bindings/scripts/test/JS/JSTestCallback.cpp:
3642         * bindings/scripts/test/JS/JSTestCallback.h:
3643         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
3644         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3645         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3646         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3647         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3648         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3649         * bindings/scripts/test/JS/JSTestException.cpp:
3650         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3651         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3652         * bindings/scripts/test/JS/JSTestInterface.cpp:
3653         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3654         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3655         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3656         * bindings/scripts/test/JS/JSTestObj.cpp:
3657         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3658         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3659         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3660         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3661         * bindings/scripts/test/JS/JSattribute.cpp:
3662         * bindings/scripts/test/JS/JSreadonly.cpp:
3663         Regenerated.
3664
3665         * testing/Internals.cpp:
3666         (WebCore::toResourceRequestCachePolicy): Take enum instead of string.
3667         (WebCore::Internals::setOverrideCachePolicy): Ditto.
3668         (WebCore::toResourceLoadPriority): Ditto.
3669         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
3670         (WebCore::toAutoFillButtonType): Ditto.
3671         (WebCore::Internals::setShowAutoFillButton): Ditto.
3672         (WebCore::interruptingCategoryFromString): Deleted.
3673         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Ditto.
3674         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
3675         (WebCore::Internals::sendMediaControlEvent): Ditto.
3676         (WebCore::Internals::installMockPageOverlay): Ditto.
3677
3678         * testing/Internals.h: Added enum class and use those instead of strings for
3679         enumerations defined in the IDL.
3680
3681         * testing/Internals.idl: Renamed enumerations that conflict with ones that already
3682         exist in WebCore; added Internals prefix. Made MediaSessionInterruptingCategory and
3683         MediaControlEvent conditional to match the functions they are used on. Added some
3684         FIXMEs about peculiarities of some of the enumerations.
3685
3686 2016-04-30  Darin Adler  <darin@apple.com>
3687
3688         Fixed expected results from bindings tests.
3689
3690         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
3691
3692 2016-04-30  Darin Adler  <darin@apple.com>
3693
3694         Next batch of conversions to use C++ enum class instead of strings for enumerations
3695         https://bugs.webkit.org/show_bug.cgi?id=157232
3696
3697         Reviewed by Chris Dumez.
3698
3699         * Modules/fetch/FetchResponse.cpp:
3700         (WebCore::FetchResponse::error): Use ResponseType.
3701         (WebCore::FetchResponse::redirect): Ditto.
3702         (WebCore::FetchResponse::FetchResponse): Ditto.
3703         (WebCore::FetchResponse::clone): Ditto.
3704         (WebCore::FetchResponse::type): Return ResponseType.
3705         (WebCore::FetchResponse::startFetching): Use auto.
3706         * Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
3707         of the type function, and also to replace FetchResponse::Type.
3708
3709         * Modules/mediacontrols/MediaControlsHost.cpp:
3710         (WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
3711         * Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
3712         return value for the externalDeviceType function.
3713
3714         * Modules/mediasession/MediaSession.cpp:
3715         (WebCore::MediaSession::parseKind): Deleted.
3716         (WebCore::MediaSession::MediaSession): Use MediaSessionKind.
3717         (WebCore::MediaSession::kind): Deleted.
3718         * Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
3719         argument to MediaSession::create and the return type for the kind function.
3720         Probably didn't get this 100% right because this code does not seem to be compiled.
3721         * Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
3722         in the current version of the specification for this class.
3723         * Modules/mediasession/MediaSessionManager.cpp:
3724         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
3725         Tried to update for changes above.
3726         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
3727
3728         * Modules/mediasource/MediaSource.cpp:
3729         (WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
3730         instead of overloading and taking const AtomicString&.
3731         (WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
3732         (WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
3733         used an if statement.
3734         (WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
3735         instead of a pointer.
3736         * Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
3737
3738         * Modules/mediasource/SourceBuffer.cpp:
3739         (WebCore::SourceBuffer::segmentsKeyword): Deleted.
3740         (WebCore::SourceBuffer::sequenceKeyword): Deleted.
3741         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
3742         defined rather than in this constructor.
3743         (WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
3744         (WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
3745         defined rather than in this constructor.
3746         (WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
3747         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
3748         (WebCore::SourceBuffer::decodeError): Deleted.
3749         (WebCore::SourceBuffer::networkError): Deleted.
3750         (WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
3751         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
3752         (WebCore::SourceBuffer::appendError): Use AppendMode.
3753         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3754         (WebCore::SourceBuffer::setMode): Take AppendMode.
3755         * Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
3756         constant functions, initialize more data emebers in this header. Removed unused
3757         sourceBufferPrivateDidEndStream function.
3758
3759         * Modules/mediastream/MediaDeviceInfo.cpp:
3760         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
3761         (WebCore::MediaDeviceInfo::create): Ditto.
3762         (WebCore::MediaDeviceInfo::audioInputType): Deleted.
3763         (WebCore::MediaDeviceInfo::audioOutputType): Deleted.
3764         (WebCore::MediaDeviceInfo::videoInputType): Deleted.
3765         * Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
3766         * Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
3767         to be MediaDeviceKind as in the specification.
3768
3769         * Modules/mediastream/MediaDevicesRequest.cpp:
3770         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
3771         churn the reference countds. Also updated to use String instead of AtomicString for
3772         label, and MediaDeviceKind instead of string for kind.
3773
3774         * Modules/mediastream/MediaStreamTrack.cpp:
3775         (WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
3776         * Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
3777         for the return value from the readyState function.
3778
3779         * Modules/webaudio/AudioContext.cpp:
3780         (WebCore::AudioContext::state): Return AudioContextState.
3781         * Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
3782
3783         * Modules/webaudio/WaveShaperNode.cpp:
3784         (WebCore::processorType): Added.
3785         (WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
3786         (WebCore::WaveShaperNode::oversample): Return OverSampleType.
3787         * Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
3788         * Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
3789
3790         * bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
3791         either don't exist or were converted to no longer pass strings in to the C++ DOM.
3792
3793         * bindings/scripts/CodeGeneratorJS.pm:
3794         (GenerateHeaderContentHeader): Use #pragma once instead of header guards.
3795         (GetEnumerationValueName): Added logic to handle names with "-" and starting with
3796         a numeric digit.
3797         (GetEnumerationImplementationContent): Changed functions so they do more of the
3798         binding work. Added JSValueTraits specialization so we can generate bindings for
3799         a vector of any enumeration. Added special cases for null string. Removed special
3800         case to keep the style checker happy.
3801         (GenerateHeader): Removed the #endif that matched the header guards in
3802         GenerateHeaderContentHeader.
3803         (GenerateImplementation): Use the $type local variable rather than writing out
3804         $attribute->signature->type or $attributeType. Fixed code path that checks for
3805         valid enumeration values to work for non-string-based enumerations.
3806         (CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
3807         For now, leave it on for the old string-based enumerations.
3808         (GenerateParametersCheck): Added appropriate parameter checking for the new
3809         enumerations.
3810         (GenerateCallbackHeader): Removed the #endif that matched the header guards in
3811         GenerateHeaderContentHeader.
3812         (GetNativeType): Use "auto" instead of the enumeration name in generated code.
3813         (JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
3814         to parseMyEnum.
3815         (NativeToJSValue): Took out call to stringValue, since we now overload the
3816         jsStringWithCache function instead.
3817
3818         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3819         * bindings/scripts/test/JS/JSTestCallback.h:
3820         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
3821         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3822         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3823         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3824         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3825         * bindings/scripts/test/JS/JSTestEventTarget.h:
3826         * bindings/scripts/test/JS/JSTestException.h:
3827         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3828         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3829         * bindings/scripts/test/JS/JSTestInterface.h:
3830         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3831         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3832         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3833         * bindings/scripts/test/JS/JSTestNode.h:
3834         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3835         * bindings/scripts/test/JS/JSTestObj.cpp:
3836         * bindings/scripts/test/JS/JSTestObj.h:
3837         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3838         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3839         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3840         * bindings/scripts/test/JS/JSTestTypedefs.h:
3841         * bindings/scripts/test/JS/JSattribute.h:
3842         * bindings/scripts/test/JS/JSreadonly.h:
3843         Regenerated.
3844
3845         * crypto/CryptoKey.cpp:
3846         (WebCore::CryptoKey::type): Use CryptoKeyType.
3847         (WebCore::CryptoKey::usages): Use KeyUsage.
3848         * crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
3849
3850         * css/FontFaceSet.cpp:
3851         (WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
3852         * css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
3853
3854         * html/HTMLMediaElement.cpp:
3855         (WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
3856
3857         * html/HTMLVideoElement.cpp:
3858         (WebCore::presentationModeFullscreen): Deleted.
3859         (WebCore::presentationModePictureInPicture): Deleted.
3860         (WebCore::presentationModeInline): Deleted.
3861         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
3862         (WebCore::toFullscreenMode): Ditto.
3863         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
3864         (WebCore::toPresentationMode): Ditto.
3865         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
3866         * html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
3867
3868         * html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
3869         DefaultSmoothingQuality macro to a constant.
3870         (WebCore::toWindRule): Replaces parseWinding.
3871         (WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
3872         (WebCore::CanvasRenderingContext2D::clip): Ditto.
3873         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
3874         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
3875         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
3876         (WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
3877         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
3878         (WebCore::smoothingToInterpolationQuality): Ditto.
3879         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
3880         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
3881         * html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
3882         ImageSmoothingQuality, and use them throughout the class.
3883
3884         * platform/graphics/SourceBufferPrivateClient.h: Removed unused
3885         sourceBufferPrivateDidEndStream function.
3886
3887 2016-04-30  Nan Wang  <n_wang@apple.com>
3888
3889         AX: @aria-label attribute should work on <label> element
3890         https://bugs.webkit.org/show_bug.cgi?id=157219
3891
3892         Reviewed by Chris Fleizach.
3893
3894         When there's aria-label on a <label> element, we shouldn't expose it
3895         as the titleUIElement. Instead, we return its aria-label as a title.
3896
3897         Test: accessibility/mac/aria-label-on-label-element.html
3898
3899         * accessibility/AccessibilityNodeObject.cpp:
3900         (WebCore::AccessibilityNodeObject::titleElementText):
3901         * accessibility/AccessibilityRenderObject.cpp:
3902         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
3903
3904         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3905         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
3906         Use DeviceType instead of String for externalDeviceType.
3907
3908 2016-04-29  Chris Dumez  <cdumez@apple.com>
3909
3910         [Web IDL] Specify default parameter values for callback parameters
3911         https://bugs.webkit.org/show_bug.cgi?id=157188
3912
3913         Reviewed by Darin Adler.
3914
3915         Specify default parameter values for callback parameters.
3916
3917         * Modules/geolocation/Geolocation.idl:
3918         * Modules/notifications/Notification.cpp:
3919         (WebCore::Notification::requestPermission):
3920         *&n