Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-04  Brady Eidson  <beidson@apple.com>
2
3         Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
4         https://bugs.webkit.org/show_bug.cgi?id=153438.
5
6         Reviewed by Alex Christensen.
7
8         Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
9                storage/indexeddb/modern/idbkey-array-equality.html
10
11         * Modules/indexeddb/IDBKeyData.cpp:
12         (WebCore::IDBKeyData::loggingString):
13         (WebCore::IDBKeyData::operator==): Fix obvious bug.
14
15 2016-02-04  Chris Dumez  <cdumez@apple.com>
16
17         Unreviewed, fix the EFL clean build after r196123
18         https://bugs.webkit.org/show_bug.cgi?id=153875
19
20         * CMakeLists.txt:
21         * PlatformGTK.cmake:
22         * PlatformMac.cmake:
23         * html/DOMSettableTokenList.h:
24         * html/DOMSettableTokenList.idl:
25
26 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
27
28         PageGroup::captionPreferences should return a reference
29         https://bugs.webkit.org/show_bug.cgi?id=153877
30         <rdar://problem/24506917>
31
32         Reviewed by Jer Noble.
33
34         No new tests, no functional change.
35
36         * Modules/mediacontrols/MediaControlsHost.cpp:
37         (WebCore::MediaControlsHost::sortedTrackListForMenu):
38         (WebCore::MediaControlsHost::displayNameForTrack):
39         (WebCore::MediaControlsHost::captionMenuOffItem):
40         (WebCore::MediaControlsHost::captionDisplayMode):
41         * dom/Document.cpp:
42         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
43         * html/HTMLMediaElement.cpp:
44         (WebCore::HTMLMediaElement::HTMLMediaElement):
45         (WebCore::HTMLMediaElement::addTextTrack):
46         (WebCore::HTMLMediaElement::configureTextTrackGroup):
47         (WebCore::HTMLMediaElement::setSelectedTextTrack):
48         (WebCore::HTMLMediaElement::configureTextTracks):
49         (WebCore::HTMLMediaElement::captionPreferencesChanged):
50         (WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics):
51         * html/shadow/MediaControlElements.cpp:
52         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
53         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
54         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
55         * page/PageGroup.cpp:
56         (WebCore::PageGroup::captionPreferencesChanged):
57         (WebCore::PageGroup::captionPreferences):
58         * page/PageGroup.h:
59         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
60         (WebVideoFullscreenModelVideoElement::updateLegibleOptions):
61         * testing/InternalSettings.cpp:
62         (WebCore::InternalSettings::setShouldDisplayTrackKind):
63         (WebCore::InternalSettings::shouldDisplayTrackKind):
64         * testing/Internals.cpp:
65         (WebCore::Internals::resetToConsistentState):
66         (WebCore::Internals::Internals):
67         (WebCore::Internals::userPreferredAudioCharacteristics):
68         (WebCore::Internals::setUserPreferredAudioCharacteristic):
69         (WebCore::Internals::captionsStyleSheetOverride):
70         (WebCore::Internals::setCaptionsStyleSheetOverride):
71         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
72         (WebCore::Internals::setCaptionDisplayMode):
73
74 2016-02-04  Konstantin Tokarev  <annulen@yandex.ru>
75
76         Removed unused Settings::setPrivateBrowsingEnabled.
77         https://bugs.webkit.org/show_bug.cgi?id=153869
78
79         Reviewed by Alexey Proskuryakov.
80
81         Implementation of Settings::setPrivateBrowsingEnabled was removed
82         in r166661, but declaration is still here.
83
84         No new tests needed.
85
86         * page/Settings.h:
87         (WebCore::Settings::setPrivateBrowsingEnabled): Deleted.
88
89 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
90
91         Don't discard in-band cues with negative start times
92         https://bugs.webkit.org/show_bug.cgi?id=153867
93         <rdar://problem/19588632>
94
95         Reviewed by Jer Noble.
96
97         No new tests, updated and un-skipped http/tests/media/track-in-band-hls-metadata.html.
98
99         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
100         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):  ASSERT if passed negative time value.
101         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto. Correct logging.
102
103         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
104         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): ASSERT if passed negative time value.
105         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Convert negative cue times to zero.
106         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
107           Ditto.
108
109 2016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
110
111         Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
112         https://bugs.webkit.org/show_bug.cgi?id=150925
113
114         Reviewed by Darin Adler.
115
116         createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
117         for invalid numberOfInputs value.
118         createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
119
120         Tests: webaudio/audiochannelmerger-basic.html
121                webaudio/audiochannelsplitter.html
122                webaudio/periodicwave-lengths.html
123
124         * Modules/webaudio/AudioContext.cpp:
125         (WebCore::AudioContext::createChannelSplitter):
126         (WebCore::AudioContext::createChannelMerger):
127         (WebCore::AudioContext::createPeriodicWave):
128
129 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
130
131         [Fetch API] Add support for iterating over Headers
132         https://bugs.webkit.org/show_bug.cgi?id=153787
133
134         Reviewed by Darin Adler.
135
136         Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.
137
138         Covered by updated tests.
139         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
140         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
141         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
142
143         * CMakeLists.txt:
144         * Modules/fetch/FetchHeaders.cpp:
145         (WebCore::FetchHeaders::Iterator::next):
146         (WebCore::FetchHeaders::Iterator::Iterator):
147         * Modules/fetch/FetchHeaders.h:
148         (WebCore::FetchHeaders::createIterator):
149         * Modules/fetch/FetchHeaders.idl:
150         * WebCore.xcodeproj/project.pbxproj:
151         * bindings/js/JSBindingsAllInOne.cpp:
152         * bindings/js/JSDOMBinding.h:
153         (WebCore::jsPair):
154         * bindings/js/JSFetchHeadersCustom.cpp: Added.
155         (WebCore::JSFetchHeaders::entries):
156         (WebCore::JSFetchHeaders::keys):
157         (WebCore::JSFetchHeaders::values):
158         * bindings/js/JSKeyValueIterator.h: Added.
159         (WebCore::JSKeyValueIteratorPrototype::create):
160         (WebCore::JSKeyValueIteratorPrototype::createStructure):
161         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
162         (WebCore::createIterator):
163         (WebCore::DOMWrapped>::destroy):
164         (WebCore::DOMWrapped>::next):
165         (WebCore::DOMWrapped>::finishCreation):
166
167 2016-02-04  Chris Dumez  <cdumez@apple.com>
168
169         Merge DOMTokenList and DOMSettableTokenList
170         https://bugs.webkit.org/show_bug.cgi?id=153677
171         <rdar://problem/24419675>
172
173         Reviewed by Sam Weinig.
174
175         Merge DOMTokenList and DOMSettableTokenList, as per a recent
176         specification change:
177         - https://github.com/whatwg/dom/pull/120
178         - https://github.com/whatwg/html/issues/361
179
180         No new tests, already covered by existing tests.
181
182         * CMakeLists.txt:
183         * DerivedSources.cpp:
184         * WebCore.vcxproj/WebCore.vcxproj:
185         * WebCore.vcxproj/WebCore.vcxproj.filters:
186         * WebCore.xcodeproj/project.pbxproj:
187         * dom/Element.idl:
188         * dom/Node.h:
189         * dom/NodeRareData.h:
190         * html/AttributeDOMTokenList.h:
191         * html/DOMSettableTokenList.cpp: Removed.
192         * html/DOMSettableTokenList.h:
193         * html/DOMSettableTokenList.idl:
194         * html/DOMTokenList.cpp:
195         (WebCore::DOMTokenList::setValue):
196         * html/DOMTokenList.h:
197         * html/DOMTokenList.idl:
198         * html/HTMLAnchorElement.idl:
199         * html/HTMLAreaElement.idl:
200         * html/HTMLElement.cpp:
201         * html/HTMLElement.idl:
202         * html/HTMLIFrameElement.cpp:
203         (WebCore::HTMLIFrameElement::sandbox):
204         * html/HTMLIFrameElement.h:
205         * html/HTMLIFrameElement.idl:
206         * html/HTMLLinkElement.cpp:
207         (WebCore::HTMLLinkElement::sizes):
208         * html/HTMLLinkElement.h:
209         * html/HTMLLinkElement.idl:
210         * html/HTMLOutputElement.cpp:
211         (WebCore::HTMLOutputElement::htmlFor):
212         * html/HTMLOutputElement.h:
213         * html/HTMLOutputElement.idl:
214         * html/HTMLTableCellElement.idl:
215         * page/DOMWindow.cpp:
216         * page/DOMWindow.idl:
217
218 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
219
220         Unreviewed.
221         Reverting r196115 and r19116, related tohttps://bugs.webkit.org/show_bug.cgi?id=153787.
222
223 2016-02-04  Alejandro G. Castro  <alex@igalia.com>
224
225         [GTK] Implement mediastream mediaplayer
226         https://bugs.webkit.org/show_bug.cgi?id=153541
227
228         Reviewed by Martin Robinson.
229
230         Added the implementation of the mediaplayer for the
231         mediastream. The code was implemented by Philippe Normand and
232         Alessandro Decina.
233
234         * PlatformGTK.cmake: Added the file to the compilation.
235         * html/HTMLMediaElement.cpp:
236         (WebCore::HTMLMediaElement::setSrcObject): Set the src of the
237         media element to the mediastream.
238         * platform/graphics/MediaPlayer.cpp:
239         (WebCore::buildMediaEnginesVector): Register the mediastream
240         mediaplayer as an option in the media engines vector.
241         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Added.
242         (WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
243         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
244         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
245         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
246         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo):
247         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio):
248         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
249         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
250         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed):
251         (WebCore::MediaPlayerPrivateGStreamerOwr::didLoadingProgress):
252         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
253         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
254         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
255         (WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
256         (WebCore::MediaPlayerPrivateGStreamerOwr::supportsType):
257         (WebCore::MediaPlayerPrivateGStreamerOwr::isAvailable):
258         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
259         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped):
260         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
261         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
262         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
263         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
264         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Added.
265         (WebCore::MediaPlayerPrivateGStreamerOwr::engineDescription):
266         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
267         (WebCore::MediaPlayerPrivateGStreamerOwr::cancelLoad):
268         (WebCore::MediaPlayerPrivateGStreamerOwr::prepareToPlay):
269         (WebCore::MediaPlayerPrivateGStreamerOwr::duration):
270         (WebCore::MediaPlayerPrivateGStreamerOwr::seek):
271         (WebCore::MediaPlayerPrivateGStreamerOwr::seeking):
272         (WebCore::MediaPlayerPrivateGStreamerOwr::setRate):
273         (WebCore::MediaPlayerPrivateGStreamerOwr::setPreservesPitch):
274         (WebCore::MediaPlayerPrivateGStreamerOwr::paused):
275         (WebCore::MediaPlayerPrivateGStreamerOwr::hasClosedCaptions):
276         (WebCore::MediaPlayerPrivateGStreamerOwr::setClosedCaptionsVisible):
277         (WebCore::MediaPlayerPrivateGStreamerOwr::maxTimeSeekable):
278         (WebCore::MediaPlayerPrivateGStreamerOwr::buffered):
279         (WebCore::MediaPlayerPrivateGStreamerOwr::totalBytes):
280         (WebCore::MediaPlayerPrivateGStreamerOwr::bytesLoaded):
281         (WebCore::MediaPlayerPrivateGStreamerOwr::canLoadPoster):
282         (WebCore::MediaPlayerPrivateGStreamerOwr::setPoster):
283         (WebCore::MediaPlayerPrivateGStreamerOwr::isLiveStream):
284         (WebCore::MediaPlayerPrivateGStreamerOwr::audioSink):
285
286 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
287
288         [Fetch API] Add support for iterating over Headers
289         https://bugs.webkit.org/show_bug.cgi?id=153787
290
291         Reviewed by Darin Adler.
292
293         Covered by updated tests.
294         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
295         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
296         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
297
298         * CMakeLists.txt:
299         * Modules/fetch/FetchHeaders.cpp:
300         (WebCore::FetchHeaders::Iterator::next):
301         (WebCore::FetchHeaders::Iterator::Iterator):
302         * Modules/fetch/FetchHeaders.h:
303         (WebCore::FetchHeaders::createIterator):
304         * Modules/fetch/FetchHeaders.idl:
305         * WebCore.xcodeproj/project.pbxproj:
306         * bindings/js/JSDOMBinding.h:
307         (WebCore::jsPair):
308         * bindings/js/JSBindingsAllInOne.cpp:
309         * bindings/js/JSFetchHeadersCustom.cpp: Added.
310         (WebCore::JSFetchHeaders::entries):
311         (WebCore::JSFetchHeaders::keys):
312         (WebCore::JSFetchHeaders::values):
313         * bindings/js/JSKeyValueIterator.h: Added.
314         (WebCore::JSKeyValueIteratorPrototype::create):
315         (WebCore::JSKeyValueIteratorPrototype::createStructure):
316         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
317         (WebCore::JSKeyValueIteratorPrototypeFuncNext):
318
319 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
320
321         Do not show context menu when right clicking on a scrollbar
322         https://bugs.webkit.org/show_bug.cgi?id=153493
323
324         Reviewed by Michael Catanzaro.
325
326         Scrollbars don't currently handle right clicks, but we are showing
327         the context menu when they are right clicked. This is not desired
328         at least in GTK+ and I've checked that it isn't consistent with
329         other applications in Mac either.
330
331         Test: fast/events/contextmenu-on-scrollbars.html
332
333         * page/EventHandler.cpp:
334         (WebCore::EventHandler::sendContextMenuEvent):
335
336 2016-02-03  Andreas Kling  <akling@apple.com>
337
338         [iOS] Throw away linked code when navigating to a new page.
339         <https://webkit.org/b/153851>
340
341         Reviewed by Gavin Barraclough.
342
343         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
344         Linked code is tied to a specific global object, and as we're creating a new one for the
345         new page, none of it is useful to us here.
346         In the event that the user navigates back, the cost of relinking some code will be far
347         lower than the memory cost of keeping all of it around.
348
349         * bindings/js/GCController.cpp:
350         (WebCore::GCController::deleteAllLinkedCode):
351         * bindings/js/GCController.h:
352         * loader/FrameLoader.cpp:
353         (WebCore::FrameLoader::commitProvisionalLoad):
354
355 2016-02-03  Alex Christensen  <achristensen@webkit.org>
356
357         Report wasBlocked and cannotShowURL errors when using NetworkSession
358         https://bugs.webkit.org/show_bug.cgi?id=153846
359
360         Reviewed by Antti Koivisto.
361
362         No new tests, but this fixes http/tests/xmlhttprequest/redirect-cross-origin-2.html
363         when using NetworkSession.
364
365         * platform/URL.h:
366         WEBCORE_EXPORT because we are using portAllowed in WebKit2 now.
367
368 2016-02-03  Jer Noble  <jer.noble@apple.com>
369
370         iOS build fix after Yosemite build fix broke iOS build.
371
372         * platform/network/cocoa/WebCoreNSURLSession.h:
373         * platform/network/cocoa/WebCoreNSURLSession.mm:
374
375 2016-02-03  Beth Dakin  <bdakin@apple.com>
376
377         Accepted candidates should not be autocorrected
378         https://bugs.webkit.org/show_bug.cgi?id=153813
379         -and corresponding-
380         rdar://problem/24066924
381
382         Reviewed by Darin Adler.
383
384         New document marker to mark inserted candidates. This was we can treat 
385         inserted candidates just like a RejectedCorrection and we won’t accidentally 
386         autocorrect them later on.
387         * dom/DocumentMarker.h:
388         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
389         * editing/AlternativeTextController.cpp:
390         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
391
392         When handling an acceptant candidate, set m_isHandlingAcceptedCandidate to
393         true while the text is being inserted, and then mark the range as an accepted 
394         candidate.
395         * editing/Editor.cpp:
396         (WebCore::Editor::handleAcceptedCandidate):
397         * editing/Editor.h:
398         (WebCore::Editor::isHandlingAcceptedCandidate):
399
400         If frame.editor. isHandlingAcceptedCandidate() then return early from 
401         markMisspellingsAfterTyping.
402         * editing/TypingCommand.cpp:
403         (WebCore::TypingCommand::markMisspellingsAfterTyping):
404
405         Add some test infrastructure. 
406         * testing/Internals.cpp:
407         (WebCore::Internals::handleAcceptedCandidate):
408         * testing/Internals.h:
409         * testing/Internals.idl:
410
411 2016-02-03  Jer Noble  <jer.noble@apple.com>
412
413         [Win] Pass entire request (rather than just URL) to clients of WebCoreAVCFResourceLoader
414         https://bugs.webkit.org/show_bug.cgi?id=153653
415
416         Reviewed by Brent Fulgham.
417
418         This will allow those clients to see the byte-range request ("Range:") header and respond
419         appropriately.
420
421         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
422         (WebCore::WebCoreAVCFResourceLoader::startLoading):
423
424 2016-02-03  Jer Noble  <jer.noble@apple.com>
425
426         Yosemite build fix; hide the entire WebCoreNSURLSessionDataTask class from Yosemite and prior.
427
428         * platform/network/cocoa/WebCoreNSURLSession.h:
429         * platform/network/cocoa/WebCoreNSURLSession.mm:
430         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
431         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
432
433 2016-02-03  Jer Noble  <jer.noble@apple.com>
434
435         [EME][Mac] MediaKeys.createSession() fails with initData containing a contentId whose length is > 1/2 the initData.
436         https://bugs.webkit.org/show_bug.cgi?id=153517
437         <rdar://problem/24303782>
438
439         Reviewed by Eric Carlson.
440
441         The length of contentId is given in bytes, not Uint16 characters. Use the former when extracting
442         the contentId string from the initData.
443
444         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
445         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
446
447 2016-02-03  Jer Noble  <jer.noble@apple.com>
448
449         [Mac] Wrap a resource and resource loader in a NSURLSession-like object for use by lower level frameworks
450         https://bugs.webkit.org/show_bug.cgi?id=153669
451
452         Reviewed by Alex Christensen.
453
454         API Test: WebCore.WebCoreNSURLSession
455
456         Add a NSURLSession-like object, which wraps a CachedResourceLoader and CachedRawResource, which we can
457         hand to lower-level frameworks, so that network loads by those frameworks use WebKit's loader.
458
459         * platform/network/cocoa/WebCoreNSURLSession.h: Added.
460         * platform/network/cocoa/WebCoreNSURLSession.mm: Added.
461         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]):
462         (-[WebCoreNSURLSession dealloc]):
463         (-[WebCoreNSURLSession copyWithZone:]):
464         (-[WebCoreNSURLSession delegateQueue]):
465         (-[WebCoreNSURLSession configuration]):
466         (-[WebCoreNSURLSession loader]):
467         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
468         (-[WebCoreNSURLSession invalidateAndCancel]):
469         (-[WebCoreNSURLSession resetWithCompletionHandler:]):
470         (-[WebCoreNSURLSession flushWithCompletionHandler:]):
471         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
472         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
473         (-[WebCoreNSURLSession dataTaskWithRequest:]):
474         (-[WebCoreNSURLSession dataTaskWithURL:]):
475         (-[WebCoreNSURLSession uploadTaskWithRequest:fromFile:]):
476         (-[WebCoreNSURLSession uploadTaskWithRequest:fromData:]):
477         (-[WebCoreNSURLSession uploadTaskWithStreamedRequest:]):
478         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
479         (-[WebCoreNSURLSession downloadTaskWithURL:]):
480         (-[WebCoreNSURLSession downloadTaskWithResumeData:]):
481         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
482         (-[WebCoreNSURLSession streamTaskWithNetService:]):
483         (-[WebCoreNSURLSession isKindOfClass:]):
484
485         Add a C++ class which can act as a CachedRawResourceClient, passing the results back to a WebCoreNSURLSessionDataTask:
486
487         (WebCore::WebCoreNSURLSessionDataTaskClient::WebCoreNSURLSessionDataTaskClient):
488         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
489         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
490         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
491         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
492         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished):
493
494         Add a NSURLSessionDataTask-like object, which takes a request, then uses it to create and wrap a CachedRawResource.
495         Becase NSURSessionDataTask is intended to be used off-main-thread, care must be taken to dispatch back to the main-
496         (or web-) thread before calling CachedRawResource functions.
497
498         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
499         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
500         (-[WebCoreNSURLSessionDataTask copyWithZone:]):
501         (-[WebCoreNSURLSessionDataTask _restart]):
502         (-[WebCoreNSURLSessionDataTask _cancel]):
503         (-[WebCoreNSURLSessionDataTask _finish]):
504         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]):
505         (-[WebCoreNSURLSessionDataTask cancel]):
506         (-[WebCoreNSURLSessionDataTask suspend]):
507         (-[WebCoreNSURLSessionDataTask resume]):
508         (-[WebCoreNSURLSessionDataTask _timingData]):
509         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
510         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
511         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
512         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
513         (-[WebCoreNSURLSessionDataTask resourceFinished:]):
514         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
515
516 2016-02-03  Darin Adler  <darin@apple.com>
517
518         Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
519         https://bugs.webkit.org/show_bug.cgi?id=153789
520
521         Reviewed by Sam Weinig.
522
523         * dom/DOMImplementation.cpp:
524         (WebCore::DOMImplementation::isXMLMIMEType): Use equalLettersIgnoringASCIICase
525         and the boolean argument to endsWith to ignore ASCII case.
526         (WebCore::DOMImplementation::isTextMIMEType): Ditto. Also simplified the logic
527         by removing an if statement.
528
529         * dom/Document.cpp:
530         (WebCore::isSeparator): Deleted. Moved to WindowFeatures.cpp.
531         (WebCore::processArguments): Ditto.
532         (WebCore::Document::processViewport): Call the processFeaturesString function
533         from WindowFeatures.h; the code here was originally just a pasted copy of that code!
534         (WebCore::Document::processFormatDetection): Ditto.
535
536         * html/HTMLCanvasElement.cpp:
537         (WebCore::HTMLCanvasElement::toEncodingMimeType): Remove now-unneeded
538         lowercasing of MIME type before calling isSupportedImageMIMETypeForEncoding,
539         since the MIME type registry now ignores ASCII case. Use convertToASCIILowercase
540         on the return value, to preserve behavior.
541         (WebCore::HTMLCanvasElement::toDataURL): Minor coding style tweaks.
542
543         * html/HTMLEmbedElement.cpp:
544         (WebCore::HTMLEmbedElement::parseAttribute): Use convertToASCIILowercase for
545         the service type here.
546
547         * html/HTMLImageElement.cpp:
548         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Remove now-unneeded
549         lowercasing since MIME type registry now ignores ASCII case. And use
550         equalLettersIgnoringASCIICase for the case here.
551
552         * html/HTMLInputElement.cpp:
553         (WebCore::parseAcceptAttribute): Use convertToASCIILowercase for the type here.
554
555         * html/HTMLLinkElement.cpp:
556         (WebCore::HTMLLinkElement::parseAttribute): Use convertToASCIILowercase for the
557         media value here.
558
559         * html/HTMLMediaElement.cpp:
560         (WebCore::HTMLMediaElement::canPlayType): Use convertToASCIILowercase for the
561         content type here.
562         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
563
564         * html/HTMLObjectElement.cpp:
565         (WebCore::HTMLObjectElement::parseAttribute): Use convertToASCIILowercase for
566         the service type here.
567
568         * html/HTMLTrackElement.cpp:
569         (WebCore::HTMLTrackElement::parseAttribute): Use convertToASCIILowercase for
570         the kind here.
571         (WebCore::HTMLTrackElement::ensureTrack): Ditto. Also use fastGetAttribute
572         since this is neither the style attribute nor an animatable SVG attribute.
573
574         * html/parser/HTMLTreeBuilder.cpp:
575         (WebCore::createCaseMap): Use convertToASCIILowercase for the local names here.
576
577         * inspector/DOMPatchSupport.cpp:
578         (WebCore::DOMPatchSupport::patchNode): Use containsIgnoringASCIICase instead
579         of combining lower with find == notFound here.
580         (WebCore::nodeName): Use convertToASCIILowercase here.
581
582         * inspector/InspectorOverlay.cpp:
583         (WebCore::buildObjectForElementData): Use convertToASCIILowercase for node
584         name here.
585
586         * inspector/InspectorPageAgent.cpp:
587         (WebCore::createXHRTextDecoder): Remove a now-unneeded call to lower since
588         DOMImplementation::isXMLMIMEType now ignores ASCII case.
589
590         * inspector/InspectorStyleSheet.cpp:
591         (WebCore::lowercasePropertyName): Use convertToASCIILowercase for property
592         names here. Also use startsWith rather than a hand-written alternative.
593         (WebCore::InspectorStyle::populateAllProperties): Use the return value of
594         the add function to avoid doing a double hash table lookp.
595         (WebCore::InspectorStyle::styleWithProperties): Use convertToASCIILowercase
596         to lowercase the property name.
597
598         * inspector/NetworkResourcesData.cpp:
599         (WebCore::createOtherResourceTextDecoder): Remove unneeded call to lower since
600         DOMImplement::isXMLMIMEType now ignores ASCII case.
601
602         * loader/CrossOriginAccessControl.cpp:
603         (WebCore::createAccessControlPreflightRequest): Use convertToASCIILowercase
604         to lowercase the access control request header field value.
605
606         * loader/cache/CachedScript.cpp:
607         (WebCore::CachedScript::mimeType): Use convertToASCIILowercase on the content type.
608
609         * page/CaptionUserPreferencesMediaAF.cpp:
610         (WebCore::languageIdentifier): Use convertToASCIILowercase on the language code.
611
612         * page/DOMWindow.cpp:
613         (WebCore::DOMWindow::open): Call parseWindowFeatures instead of using the
614         constructor for WindowFeatures.
615         (WebCore::DOMWindow::showModalDialog): Call parseDialogFeatures instead of
616         using the constructor for WindowFeatures.
617
618         * page/EventHandler.cpp:
619         (WebCore::findDropZone): Remove unneeded lowercasing and empty string checking,
620         and use the option SpaceSplitString already has to convert to lowercase.
621         (WebCore::EventHandler::handleAccessKey): Remove unneeded call to lower since
622         getElementByAccessKey now ignores case. Also tweaked coding style a bit.
623
624         * page/OriginAccessEntry.cpp:
625         (WebCore::OriginAccessEntry::OriginAccessEntry): Use convertToASCIILowercase
626         on the protocol and host.
627         (WebCore::OriginAccessEntry::matchesOrigin): Ditto.
628
629         * page/SecurityOrigin.cpp:
630         (WebCore::shouldTreatAsUniqueOrigin): Remove unneeded call to lower since
631         SchemeRegistry now ignores ASCII case.
632         (WebCore::SecurityOrigin::SecurityOrigin): Use convertToASCIILowercase on
633         the protocol and host.
634         (WebCore::SecurityOrigin::setDomainFromDOM): Use convertToASCIILowercase on
635         the domain.
636         (WebCore::SecurityOrigin::canDisplay): Remove call to lower since SchemeRegistry
637         now ignores ASCII case and because this now uses equalIgnoringASCIICase in
638         one place that used to use exact matching.
639
640         * page/WindowFeatures.cpp: Refactored so this is now some helper functions
641         plus a struct rather than a class.
642         (WebCore::isSeparator): Renamed this and removed special handling for NUL.
643         (WebCore::parseWindowFeatures): Moved the code that was formerly in the
644         WindowFeatures constructor in here. Refactored the parsing into the
645         processFeaturesString function, shared with the functions in Document that
646         do the same kind of parsing. Removed the code that converts the entire string
647         to lowercase before parsing.
648         (WebCore::processFeaturesString): Moved the improved version of this function
649         here from Document.cpp; more efficient because it doesn't allocate strings.
650         (WebCore::setWindowFeature): Changed to be a function private to this file
651         with internal linkage. Use equalLettersIgnoringASCIICase so we no longer
652         rely on converting the string to lowercase before parsing.
653         (WebCore::parseDialogFeatures): Similar refactoring, but also changed all
654         the default handling to use Optional<> instead of default values.
655         (WebCore::boolFeature): Changed to use option and to ignore ASCII case.
656         (WebCore::floatFeature): Ditto.
657         (WebCore::parseDialogFeaturesMap): Removed the calls to lower, which are
658         not needed any more.
659
660         * page/WindowFeatures.h: Added default values for all the data members,
661         and removed all the functions from the WindowFeatures struct. Added the two
662         functions for parsing window and dialog features. Also added the
663         processFeaturesString function so we can share it with Document.cpp.
664
665         * platform/SchemeRegistry.cpp:
666         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Use
667         equalLettersIgnoringASCIICase to ignore ASCII case.
668
669         * platform/efl/MIMETypeRegistryEfl.cpp:
670         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
671         and equalIgnoringASCIICase rather than calling lower.
672
673         * platform/graphics/MediaPlayer.cpp:
674         (WebCore::MediaPlayer::load): Use convertToASCIILowercase on MIME type and
675         key system.
676         (WebCore::MediaPlayer::generateKeyRequest): Ditto.
677         (WebCore::MediaPlayer::addKey): Ditto.
678         (WebCore::MediaPlayer::cancelKeyRequest): Ditto.
679
680         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
681         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Use
682         convertToASCIILowercase on vendor string.
683
684         * platform/gtk/MIMETypeRegistryGtk.cpp:
685         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
686         and equalIgnoringASCIICase rather than calling lower.
687
688         * platform/mac/PasteboardMac.mm:
689         (WebCore::cocoaTypeFromHTMLClipboardType): Use convertToASCIILowercase
690         on the type. Also did a bit of renaming and tweaking the logic.
691
692 2016-02-03  Dave Hyatt  <hyatt@apple.com>
693
694         Implement hanging-punctuation property parsing.
695         https://bugs.webkit.org/show_bug.cgi?id=18109.
696
697         Reviewed by Zalan Bujtas.
698
699         Added parsing test in fast/css.
700
701         * css/CSSComputedStyleDeclaration.cpp:
702         (WebCore::renderEmphasisPositionFlagsToCSSValue):
703         (WebCore::hangingPunctuationToCSSValue):
704         (WebCore::fillRepeatToCSSValue):
705         (WebCore::ComputedStyleExtractor::propertyValue):
706         * css/CSSParser.cpp:
707         (WebCore::CSSParser::parseValue):
708         (WebCore::CSSParser::parseTextIndent):
709         (WebCore::CSSParser::parseHangingPunctuation):
710         (WebCore::CSSParser::parseLineBoxContain):
711         * css/CSSParser.h:
712         * css/CSSPrimitiveValueMappings.h:
713         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
714         (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
715         (WebCore::CSSPrimitiveValue::operator LineBreak):
716         * css/CSSPropertyNames.in:
717         * css/CSSValueKeywords.in:
718         * css/StyleBuilderConverter.h:
719         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
720         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
721         * rendering/style/RenderStyle.cpp:
722         (WebCore::RenderStyle::changeRequiresLayout):
723         * rendering/style/RenderStyle.h:
724         * rendering/style/RenderStyleConstants.h:
725         (WebCore::operator| ):
726         (WebCore::operator|= ):
727         * rendering/style/StyleRareInheritedData.cpp:
728         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
729         (WebCore::StyleRareInheritedData::operator==):
730         * rendering/style/StyleRareInheritedData.h:
731
732 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
733
734         Build fix.
735
736         [NSEvent context] has always returned nil. Replace uses with nullptr.
737
738         * page/mac/EventHandlerMac.mm:
739         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
740
741 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
742
743         [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing
744         https://bugs.webkit.org/show_bug.cgi?id=145253
745
746         Reviewed by Michael Catanzaro.
747
748         The problem is that when the load is cancelled while the
749         connection is still being established,
750         SoupMessage::notify::tls-errors is emitted and the handler calls
751         ResourceHandleClient::didFail() which can delete the ResourceHandle.
752
753         * platform/network/soup/ResourceHandleSoup.cpp:
754         (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle
755         for the scope of the callback because
756         ResourceHandleClient::didFail() could delete the object.
757
758 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
759
760         REGRESSION(r191948): [GStreamer] 4 new timeouts on layout tests.
761         https://bugs.webkit.org/show_bug.cgi?id=152797
762
763         Reviewed by Darin Adler.
764
765         Always schedule messages to the main thread, even when the bus
766         sync handlder was called in the main thread. It seems that
767         GStreamer expects things to happen in the next main loop
768         iteration.
769
770         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
771         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
772
773 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
774
775         [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
776         https://bugs.webkit.org/show_bug.cgi?id=152058
777
778         Reviewed by Michael Catanzaro.
779
780         Previously, the CompositingCoordinator only added the overlay layer to the
781         layer tree, but flushing its compositing state is also required. For that to
782         happen, CompositingCoordinator has to store a pointer to the overlay layer
783         object and flush it in ::flushPendingLayerChanges().
784
785         Overlay layers are most prominently used by the Web Inspector to highlight
786         the DOM elements on the Web page that are being hovered in the inspector.
787
788         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
789         (WebCore::CompositingCoordinator::CompositingCoordinator):
790         (WebCore::CompositingCoordinator::setRootCompositingLayer):
791         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
792         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
793
794 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
795
796         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
797         https://bugs.webkit.org/show_bug.cgi?id=153823
798
799         Reviewed by Carlos Garcia Campos.
800
801         Purging the backing stores during the CompositingCoordinator destructor
802         is also scheduling layer flushes in the object's client, which is an object
803         of the LayerTreeHost-deriving class that owns the CompositingCoordinator
804         object in question and is also being destroyed.
805
806         In case of ThreadedCoordinatedLayerTreeHost, this scheduling can access
807         the RunLoop::Timer object which has already been destroyed, causing a
808         crash. Another problem with this is that we're invoking a virtual function
809         on an object that's being destructed, which works well enough in this case
810         but should be discouraged in general.
811
812         In order to avoid this, add the m_isDestructing boolean to the
813         CompositingCoordinator class, flip it to true during the destruction,
814         and check for its falseness before scheduling a layer flush.
815
816         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
817         (WebCore::CompositingCoordinator::CompositingCoordinator):
818         (WebCore::CompositingCoordinator::~CompositingCoordinator):
819         (WebCore::CompositingCoordinator::notifyFlushRequired):
820         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
821
822 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
823
824         [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive()
825         https://bugs.webkit.org/show_bug.cgi?id=153822
826
827         Reviewed by Carlos Garcia Campos.
828
829         * platform/graphics/texmap/TextureMapperLayer.cpp:
830         (WebCore::TextureMapperLayer::computeTransformsRecursive):
831         Use ASSERT to check that the m_children members are indeed children
832         of the current layer, RELEASE_ASSERT probably slipped in unnoticed
833         at some point.
834
835 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
836
837         PlatformPathCairo: Lazily allocate the path surface
838         https://bugs.webkit.org/show_bug.cgi?id=153821
839
840         Reviewed by Carlos Garcia Campos.
841
842         Move the static variable that holds the Cairo surface into
843         the pathSurface() function (previously getPathSurface). This
844         way the surface will only be allocated once the function is
845         called for the first time from the CairoPath surface.
846
847         No change in functionality, just a cleanup.
848
849         * platform/graphics/cairo/PlatformPathCairo.cpp:
850         (WebCore::pathSurface):
851         (WebCore::CairoPath::CairoPath):
852         (WebCore::getPathSurface): Deleted.
853
854 2016-02-02  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
855
856         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
857         https://bugs.webkit.org/show_bug.cgi?id=153576
858
859         Reviewed by Darin Adler.
860
861         Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
862
863         The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
864         because of the uniqueness of LayoutUnit::round introduced by this bug
865         <https://bugs.webkit.org/show_bug.cgi?id=107208>.
866         Should convert a FloatPoint to a LayoutPoint before rounding.
867
868         * rendering/RenderGeometryMap.cpp:
869         (WebCore::RenderGeometryMap::mapToContainer):
870
871 2016-02-02  Aakash Jain  <aakash_jain@apple.com>
872
873         Remove references to CallFrameInlines.h
874         https://bugs.webkit.org/show_bug.cgi?id=153810
875
876         Reviewed by Mark Lam.
877
878         * ForwardingHeaders/interpreter/CallFrameInlines.h: Removed.
879
880 2016-02-02  Jinyoung Hur  <hur.ims@navercorp.com>
881
882         WEBGL_debug_shaders should be disabled for OpenGLES backend also
883         https://bugs.webkit.org/show_bug.cgi?id=153788
884
885         Reviewed by Darin Adler.
886
887         WEBGL_debug_shaders extension is disabled for OpenGL backed platform
888         because the implementation is not fully compliant to the spec yet.
889         Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension
890         should be disabled for OpenGLES backed platforms also.
891
892         No new tests, already covered by existing tests.
893
894         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
895         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
896         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
897         (WebCore::Extensions3DOpenGLCommon::supports):
898
899 2016-02-02  Brady Eidson  <beidson@apple.com>
900
901         Modern IDB: storage/indexeddb/cursor-primary-key-order.html fails with SQLite backend.
902         https://bugs.webkit.org/show_bug.cgi?id=153800
903
904         Reviewed by Alex Christensen.
905
906         No new tests (Existing tests now unskipped).
907
908         The IndexRecords SQL schema did not order things by primaryKey.
909         
910         Easy fix to the schema. Sadly requires a migration...
911
912         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
913         (WebCore::IDBServer::v1IndexRecordsTableSchema):
914         (WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
915         (WebCore::IDBServer::v2IndexRecordsTableSchema):
916         (WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
917         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
918         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
919         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
920
921 2016-02-02  Tim Horton  <timothy_horton@apple.com>
922
923         <attachment> should attempt to guess the icon from the file extension if all else fails
924         https://bugs.webkit.org/show_bug.cgi?id=153804
925         <rdar://problem/24448146>
926
927         Reviewed by Anders Carlsson.
928
929         Test: fast/attachment/attachment-icon-from-file-extension.html
930
931         * platform/graphics/Icon.h:
932         * platform/graphics/mac/IconMac.mm:
933         (WebCore::Icon::createIconForFileExtension):
934         * rendering/RenderThemeMac.mm:
935         (WebCore::iconForAttachment):
936         If we can't find an icon any other way, try assuming that the title is a filename,
937         grab its extension, and have NSWorkspace try to work out an icon for it.
938
939 2016-02-02  Antti Koivisto  <antti@apple.com>
940
941         Factor style sharing code out of StyleResolver
942         https://bugs.webkit.org/show_bug.cgi?id=153768
943
944         Reviewed by Darin Adler.
945
946         Move the code to a new class, Style::SharingResolver.
947
948         When resolving document style we query the sharing resolver first before using the regular style resolver.
949         Other paths that call style resolver were mostly already disabling it with DisallowStyleSharing flag.
950
951         * WebCore.xcodeproj/project.pbxproj:
952         * css/ElementRuleCollector.cpp:
953         (WebCore::MatchRequest::MatchRequest):
954         (WebCore::ElementRuleCollector::matchAllRules):
955         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
956
957             More const.
958
959         * css/ElementRuleCollector.h:
960         (WebCore::ElementRuleCollector::setRegionForStyling):
961         (WebCore::ElementRuleCollector::setMedium):
962         * css/MediaQueryMatcher.cpp:
963         (WebCore::MediaQueryMatcher::prepareEvaluator):
964         * css/StyleMedia.cpp:
965         (WebCore::StyleMedia::matchMedium):
966         * css/StyleResolver.cpp:
967         (WebCore::StyleResolver::State::cacheBorderAndBackground):
968         (WebCore::StyleResolver::StyleResolver):
969         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
970         (WebCore::StyleResolver::State::State):
971         (WebCore::StyleResolver::State::setStyle):
972         (WebCore::isAtShadowBoundary):
973         (WebCore::StyleResolver::styleForElement):
974         (WebCore::StyleResolver::classNamesAffectedByRules): Deleted.
975         (WebCore::parentElementPreventsSharing): Deleted.
976         (WebCore::StyleResolver::locateCousinList): Deleted.
977         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): Deleted.
978         (WebCore::StyleResolver::canShareStyleWithControl): Deleted.
979         (WebCore::elementHasDirectionAuto): Deleted.
980         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
981         (WebCore::StyleResolver::canShareStyleWithElement): Deleted.
982         (WebCore::StyleResolver::findSiblingForStyleSharing): Deleted.
983         (WebCore::StyleResolver::locateSharedStyle): Deleted.
984
985             Style sharing code moves to SharingResolver.
986
987         * css/StyleResolver.h:
988         (WebCore::StyleResolver::mediaQueryEvaluator):
989         (WebCore::StyleResolver::State::regionForStyling):
990         (WebCore::StyleResolver::State::elementLinkState):
991         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
992         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
993         (WebCore::StyleResolver::state):
994         (WebCore::StyleResolver::setTextOrientation):
995         (WebCore::StyleResolver::State::setElementAffectedByClassRules): Deleted.
996         (WebCore::StyleResolver::State::elementAffectedByClassRules): Deleted.
997         (WebCore::StyleResolver::styleNotYetAvailable): Deleted.
998
999             Placeholder code moves to TreeResolver.
1000
1001         * dom/VisitedLinkState.cpp:
1002         (WebCore::linkAttribute):
1003         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
1004         (WebCore::linkHashForElement):
1005         (WebCore::VisitedLinkState::invalidateStyleForLink):
1006         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1007         * dom/VisitedLinkState.h:
1008         (WebCore::VisitedLinkState::determineLinkState):
1009         * html/HTMLFormControlElement.h:
1010         * rendering/RenderElement.cpp:
1011         (WebCore::RenderElement::getUncachedPseudoStyle):
1012         * rendering/RenderNamedFlowFragment.cpp:
1013         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
1014         * rendering/style/RenderStyle.cpp:
1015         (WebCore::RenderStyle::isStyleAvailable):
1016         (WebCore::RenderStyle::hasUniquePseudoStyle):
1017         * style/StyleSharingResolver.cpp: Added.
1018         (WebCore::Style::SharingResolver::SharingResolver):
1019         (WebCore::Style::parentElementPreventsSharing):
1020         (WebCore::Style::elementHasDirectionAuto):
1021         (WebCore::Style::SharingResolver::searchSimilar):
1022         (WebCore::Style::SharingResolver::findSibling):
1023         (WebCore::Style::SharingResolver::locateCousinList):
1024         (WebCore::Style::canShareStyleWithControl):
1025         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1026         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
1027         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
1028         (WebCore::Style::SharingResolver::classNamesAffectedByRules):
1029         * style/StyleSharingResolver.h: Added.
1030         * style/StyleTreeResolver.cpp:
1031         (WebCore::Style::ensurePlaceholderStyle):
1032         (WebCore::Style::TreeResolver::TreeResolver):
1033         (WebCore::Style::TreeResolver::styleForElement):
1034
1035             Try to use SharingResolver first.
1036             Also move placeholder style handling here, it is only relevant when resolving document style.
1037
1038         (WebCore::Style::postResolutionCallbacksAreSuspended):
1039         (WebCore::Style::isPlaceholderStyle):
1040         * style/StyleTreeResolver.h:
1041         * svg/SVGElement.cpp:
1042         (WebCore::SVGElement::customStyleForRenderer):
1043         * svg/SVGElementRareData.h:
1044         (WebCore::SVGElementRareData::overrideComputedStyle):
1045
1046 2016-02-02  Tim Horton  <timothy_horton@apple.com>
1047
1048         <attachment> icon should be a folder for the custom MIME type multipart/x-folder
1049         https://bugs.webkit.org/show_bug.cgi?id=153795
1050         <rdar://problem/24416632>
1051
1052         Reviewed by Anders Carlsson.
1053
1054         Test: fast/attachment/attachment-folder-icon.html
1055
1056         * rendering/RenderThemeMac.mm:
1057         (WebCore::iconForAttachment):
1058         (WebCore::paintAttachmentIcon):
1059         Mail uses this special MIME type to indicate that something is a folder, which there
1060         isn't a normal non-deprecated MIME type for.
1061
1062 2016-02-02  Brady Eidson  <beidson@apple.com>
1063
1064         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
1065         https://bugs.webkit.org/show_bug.cgi?id=153791
1066
1067         Reviewed by Alex Christensen.
1068
1069         No new tests (Existing test now unskipped).
1070
1071         There was a preexisting check in the SQLite cursor for remembering the current record and
1072         refusing to refetch it.
1073         
1074         This check was causing this bug, because we needed to refetch the current record.
1075         
1076         Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
1077
1078         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1079         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
1080         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1081         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1082
1083 2016-02-01  Dave Hyatt  <hyatt@apple.com>
1084
1085         Add a line grid pagination SPI to WebKit.
1086         https://bugs.webkit.org/show_bug.cgi?id=153757
1087         <rdar://problem/23041598>
1088
1089         Reviewed by Anders Carlsson.
1090
1091         New tests in fast/multicol/pagination.
1092
1093         * page/Page.cpp:
1094         (WebCore::Page::setPaginationLineGridEnabled):
1095         * page/Page.h:
1096         (WebCore::Page::paginationLineGridEnabled):
1097         Add a boolean to the page to turn the line grid on and off.
1098
1099         * rendering/RenderBox.cpp:
1100         (WebCore::RenderBox::styleDidChange):
1101         Propagate the body's font up to the paginated RenderView so that
1102         it can be used to establish the line grid.
1103
1104         * style/StyleResolveForDocument.cpp:
1105         (WebCore::Style::resolveForDocument):
1106         Set up a line grid with containment snapping by default if the
1107         line grid enabled flag is set.
1108
1109         * testing/Internals.cpp:
1110         (WebCore::Internals::resetToConsistentState):
1111         (WebCore::Internals::setPagination):
1112         (WebCore::Internals::setPaginationLineGridEnabled):
1113         (WebCore::Internals::configurationForViewport):
1114         * testing/Internals.h:
1115         (WebCore::Internals::setPagination):
1116         * testing/Internals.idl:
1117         Add support for testing the grid being enabled.
1118
1119 2016-02-01  Antti Koivisto  <antti@apple.com>
1120
1121         Tab suspension code shouldn't use page cache cacheability logic
1122         https://bugs.webkit.org/show_bug.cgi?id=153680
1123
1124         Reviewed by Andreas Kling.
1125
1126         Most of PageCache::canCache() is unnecessary for tab suspension.
1127
1128         Also improve robustness and introduce 1 minute delay before suspending.
1129
1130         * page/Page.cpp:
1131         (WebCore::Page::setPageActivityState):
1132         (WebCore::Page::setIsVisible):
1133         (WebCore::Page::setIsVisibleInternal):
1134         (WebCore::Page::setIsPrerender):
1135         (WebCore::Page::canTabSuspend):
1136
1137             Include visibility test here.
1138
1139             Instead of calling PageCache::canCache() just check for each frame
1140             - that the document is loaded
1141             - that active DOM objects allow suspension
1142
1143         (WebCore::Page::setIsTabSuspended):
1144         (WebCore::Page::setTabSuspensionEnabled):
1145         (WebCore::Page::updateTabSuspensionState):
1146
1147             Refactor for robustness.
1148
1149         (WebCore::Page::tabSuspensionTimerFired):
1150
1151             Call canTabSuspend, the result might have changed.
1152
1153         (WebCore::Page::scheduleTabSuspension): Deleted.
1154         * page/Page.h:
1155
1156 2016-02-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1157
1158         [JSC] Introduce BytecodeIntrinsic constant rep like @undefined
1159         https://bugs.webkit.org/show_bug.cgi?id=153737
1160
1161         Reviewed by Darin Adler.
1162
1163         * Modules/fetch/FetchHeaders.js:
1164         (initializeFetchHeaders):
1165         * Modules/streams/ReadableStream.js:
1166         (initializeReadableStream):
1167         (closeDestination):
1168         (abortDestination):
1169         (pipeTo):
1170         * Modules/streams/ReadableStreamInternals.js:
1171         (privateInitializeReadableStreamController):
1172         (teeReadableStream):
1173         (isReadableStreamReader):
1174         (errorReadableStream):
1175         (finishClosingReadableStream):
1176         (enqueueInReadableStream):
1177         (readFromReadableStreamReader):
1178         * Modules/streams/ReadableStreamReader.js:
1179         (releaseLock):
1180         * Modules/streams/StreamInternals.js:
1181         (shieldingPromiseResolve):
1182         (promiseInvokeOrNoopNoCatch):
1183         (promiseInvokeOrFallbackOrNoop):
1184         (validateAndNormalizeQueuingStrategy):
1185         * Modules/streams/WritableStream.js:
1186         (initializeWritableStream):
1187         (write):
1188         * Modules/streams/WritableStreamInternals.js:
1189         (errorWritableStream):
1190
1191 2016-02-02  Brady Eidson  <beidson@apple.com>
1192
1193         Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
1194         https://bugs.webkit.org/show_bug.cgi?id=153790
1195
1196         Reviewed by Tim Horton.
1197
1198         No new tests (Failing test now unskipped).
1199
1200         This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation 
1201         multiple times while it was already in-progress on the server thread.
1202
1203         There was already a flag meant to cover this race, and it just needed to be applied to one more site.
1204         
1205         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1206         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1207         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1208
1209 2016-02-02  Daniel Bates  <dabates@apple.com>
1210
1211         CSP: Support checking content security policy without a script execution context
1212         https://bugs.webkit.org/show_bug.cgi?id=153748
1213         <rdar://problem/24439149>
1214
1215         Reviewed by Darin Alder.
1216
1217         Towards checking a Web Worker's content security policy against a redirected worker
1218         script load or redirected XHR request for an XHR request initiated from it, we should
1219         support instantiating a ContentSecurityPolicy object without a ScriptExecutionContext.
1220
1221         No functionality was changed. So, no new tests.
1222
1223         * dom/Document.cpp:
1224         (WebCore::Document::initSecurityContext): Pass |this| as a reference instead of as a pointer.
1225         * page/csp/ContentSecurityPolicy.cpp: Remove extraneous includes ScriptState.h, TextEncoding.h,
1226         and URL.h as they are included by ContentSecurityPolicy.h, FormDataList.h and FormData.h, respectively.
1227         (WebCore::CSPSource::CSPSource): Take a constant reference to a ContentSecurityPolicy instead
1228         of a pointer since we never expected a null pointer.
1229         (WebCore::CSPSource::schemeMatches): Move logic for checking the protocol of source "self"
1230         from here to ContentSecurityPolicy::protocolMatchesSelf() because we may not have a security
1231         origin if ContentSecurityPolicy was initiated without a ScriptExecutionContext object.
1232         (WebCore::CSPSourceList::allowSelf): Added.
1233         (WebCore::CSPSourceList::CSPSourceList): Take a constant reference to a ContentSecurityPolicy
1234         instead of a pointer since we never expected a null pointer. Remove fields from member
1235         initialization list that can be initialized using C++11 in-class initialization syntax.
1236         (WebCore::CSPSourceList::matches): Call ContentSecurityPolicy::urlMatchesSelf() to match the
1237         effective URL against the URL of source "self".
1238         (WebCore::CSPSourceList::parse): Update code as necessary now that m_policy is a reference
1239         instead of a pointer.
1240         (WebCore::CSPSourceList::parseSource): Simplify code by setting internal member fields directly
1241         instead of via member functions.
1242         (WebCore::CSPSourceList::parsePath): Update code as necessary now that m_policy is a reference
1243         instead of a pointer.
1244         (WebCore::CSPDirective::CSPDirective): Take a constant reference to a ContentSecurityPolicy
1245         instead of a pointer since we never expected a null pointer.
1246         (WebCore::CSPDirective::policy): Return a reference to a const ContentSecurityPolicy.
1247         (WebCore::MediaListDirective::MediaListDirective): Take a constant reference to a ContentSecurityPolicy
1248         instead of a pointer since we never expected a null pointer.
1249         (WebCore::MediaListDirective::parse): Update code as necessary now that m_policy is a reference
1250         instead of a pointer.
1251         (WebCore::SourceListDirective::SourceListDirective): Take a constant reference to a ContentSecurityPolicy
1252         instead of a pointer since we never expected a null pointer.
1253         (WebCore::SourceListDirective::allows): Write in terms of CSPSourceList::allowSelf() because we
1254         may not have a security origin to get a URL from if ContentSecurityPolicy was initiated without
1255         a ScriptExecutionContext object.
1256         (WebCore::CSPDirectiveList::reportURIs): Change return type from Vector<URL> to Vector<String>
1257         The caller will convert the strings to URLs with respect to the script execution context.
1258         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1259         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1260         was initiated without a ScriptExecutionContext object.
1261         (WebCore::CSPDirectiveList::CSPDirectiveList): Take a reference to a ContentSecurityPolicy
1262         instead of a pointer since we never expected a null pointer. It would be better to take a const
1263         reference to a ContentSecurityPolicy, but ContentSecurityPolicy::applySandboxPolicy() needs to set
1264         state on ContentSecurityPolicy :(
1265         (WebCore::CSPDirectiveList::create): Ditto.
1266         (WebCore::CSPDirectiveList::reportViolation): Update code as necessary now that m_policy is a reference
1267         instead of a pointer.
1268         (WebCore::CSPDirectiveList::checkEvalAndReportViolation): Ditto.
1269         (WebCore::CSPDirectiveList::checkInlineAndReportViolation): Ditto.
1270         (WebCore::CSPDirectiveList::parseDirective): Ditto.
1271         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1272         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1273         was initiated without a ScriptExecutionContext object.
1274         (WebCore::CSPDirectiveList::setCSPDirective): Update code as necessary now that m_policy is a reference
1275         instead of a pointer.
1276         (WebCore::CSPDirectiveList::applySandboxPolicy): Ditto.
1277         (WebCore::CSPDirectiveList::parseReflectedXSS): Ditto.
1278         (WebCore::CSPDirectiveList::addDirective): Ditto.
1279         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take the ScriptExecutionObject
1280         as a reference and compute the CSPSource object for "self" and cache the protocol for "self". Removed
1281         field m_overrideInlineStyleAllowed from the member initialization list and used C++11 in-class
1282         initialization syntax to initialize it. Added overloaded constructor that takes a SecurityOrigin object.
1283         We are not making use of this overloaded constructor at this time. We will in a subsequent patch.
1284         (WebCore::ContentSecurityPolicy::didReceiveHeader): Store the eval disabled error message for
1285         the last parsed policy in a member field instead of using it as part of disabling eval execution
1286         on the script execution context because we may not have such a context.
1287         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Applies the content security
1288         policy eval and sandbox restrictions to the script execution context.
1289         (WebCore::ContentSecurityPolicy::urlMatchesSelf): Match the specified URL against the URL for
1290         source "self".
1291         (WebCore::ContentSecurityPolicy::protocolMatchesSelf): Match the protocol of the specified URL
1292         against the protocol for source "self".
1293         (WebCore::ContentSecurityPolicy::gatherReportURIs): Modified to use the script execution context
1294         to compute the absolute URL for each report URI.
1295         (WebCore::ContentSecurityPolicy::reportViolation): Bail out if we do not have a script execution
1296         context.
1297         (WebCore::ContentSecurityPolicy::logToConsole): Only log to the console if we have a script
1298         execution context.
1299         (WebCore::ContentSecurityPolicy::reportBlockedScriptExecutionToInspector): Only report blocked
1300         script execution to the Web Inspector if we have a script execution context.
1301         (WebCore::CSPSourceList::addSourceSelf): Deleted.
1302         (WebCore::CSPSourceList::addSourceStar): Deleted.
1303         (WebCore::CSPSourceList::addSourceUnsafeInline): Deleted.
1304         (WebCore::CSPSourceList::addSourceUnsafeEval): Deleted.
1305         (WebCore::CSPDirectiveList::gatherReportURIs): Deleted.
1306         (WebCore::ContentSecurityPolicy::securityOrigin): Deleted.
1307         (WebCore::ContentSecurityPolicy::url): Deleted.
1308         (WebCore::ContentSecurityPolicy::completeURL): Deleted.
1309         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Deleted.
1310         * page/csp/ContentSecurityPolicy.h:
1311         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Accumulates the parsed sandbox flags. We
1312         will apply the sandbox flags in ContentSecurityPolicy::applyPolicyToScriptExecutionContext().
1313         * workers/WorkerGlobalScope.cpp:
1314         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate ContentSecurityPolicy.
1315         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Move instantiation of
1316         ContentSecurityPolicy from here to constructor.
1317
1318 2016-02-02  Eric Carlson  <eric.carlson@apple.com>
1319
1320         Allow ports to disable automatic text track selection
1321         https://bugs.webkit.org/show_bug.cgi?id=153761
1322         <rdar://problem/24416768>
1323
1324         Reviewed by Darin Adler.
1325
1326         Test: media/track/track-manual-mode.html
1327
1328         * Modules/mediacontrols/MediaControlsHost.cpp:
1329         (WebCore::MediaControlsHost::manualKeyword): New.
1330         (WebCore::MediaControlsHost::captionDisplayMode): Support 'manual' mode.
1331         * Modules/mediacontrols/MediaControlsHost.h:
1332
1333         * Modules/mediacontrols/mediaControlsApple.js:
1334         (Controller.prototype.buildCaptionMenu): Check the 'off' item when in manual mode.
1335
1336         * html/HTMLMediaElement.cpp:
1337         (WebCore::HTMLMediaElement::addTextTrack): Update m_captionDisplayMode when called for the first
1338           time so it is always correct. Set the track's manual selection mode as appropriate.
1339         (WebCore::HTMLMediaElement::captionPreferencesChanged): Set each track's manual selection 
1340           mode as appropriate.
1341
1342         * html/track/TextTrack.cpp:
1343         (WebCore::TextTrack::kind): Return 'subtitles' for forced tracks when in manual mode.
1344         * html/track/TextTrack.h:
1345
1346         * html/track/TrackBase.h:
1347         (WebCore::TrackBase::kind): Make virtual.
1348
1349         * page/CaptionUserPreferences.cpp:
1350         (WebCore::CaptionUserPreferences::beginBlockingNotifications): New.
1351         (WebCore::CaptionUserPreferences::endBlockingNotifications): Ditto.
1352         (WebCore::CaptionUserPreferences::notify): Don't notify when blocked.
1353         * page/CaptionUserPreferences.h:
1354
1355         * page/CaptionUserPreferencesMediaAF.cpp:
1356         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF): Set manual mode 
1357           when appropriate.
1358         (WebCore::CaptionUserPreferencesMediaAF::captionDisplayMode): Check manual mode.
1359         (WebCore::CaptionUserPreferencesMediaAF::setCaptionDisplayMode): Ditto.
1360         (WebCore::CaptionUserPreferencesMediaAF::setPreferredLanguage): Ditto.
1361         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Return zero when in manual mode.
1362         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Consider manual mode. Fix
1363           typos in logging.
1364
1365         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1366         (WebCore::mediaDescriptionForKind): Return 'auxiliary' when in manual mode.
1367
1368         * testing/Internals.cpp:
1369         (WebCore::Internals::setCaptionDisplayMode): Support manual mode.
1370
1371 2016-02-02  Adrien Plazas  <aplazas@igalia.com>
1372
1373         REGRESSION(r195899): ASSERTION FAILED: is<Target>(source) in EventPath::retargetTouch() since r195899
1374         https://bugs.webkit.org/show_bug.cgi?id=153741
1375
1376         Reviewed by Ryosuke Niwa.
1377
1378         * dom/EventDispatcher.cpp:
1379         (WebCore::EventPath::retargetTouch):
1380
1381 2016-02-01  Joseph Pecoraro  <pecoraro@apple.com>
1382
1383         Web Inspector: High Level Memory Overview Instrument
1384         https://bugs.webkit.org/show_bug.cgi?id=153516
1385         <rdar://problem/24356378>
1386
1387         Reviewed by Brian Burg.
1388
1389         Add a new agent that gathers data from the ResourceUsageThread
1390         and sends to the frontend.
1391
1392         Test: inspector/memory/tracking.html
1393
1394         * CMakeLists.txt:
1395         * Configurations/FeatureDefines.xcconfig:
1396         * WebCore.xcodeproj/project.pbxproj:
1397         New files.
1398
1399         * inspector/InspectorController.cpp:
1400         (WebCore::InspectorController::InspectorController):
1401         Add the new agent.
1402
1403         * inspector/InspectorMemoryAgent.h: Added.
1404         * inspector/InspectorMemoryAgent.cpp: Added.
1405         (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
1406         (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
1407         (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
1408         (WebCore::InspectorMemoryAgent::startTracking):
1409         (WebCore::InspectorMemoryAgent::stopTracking):
1410         (WebCore::InspectorMemoryAgent::collectSample):
1411         Implement the agent by adding / removing it as a ResourceUsage
1412         observer. When receiving the data forward it to the frontend.
1413
1414 2016-02-01  Alex Christensen  <achristensen@webkit.org>
1415
1416         Fix CMake build.
1417
1418         * PlatformMac.cmake:
1419
1420 2016-02-01  Brady Eidson  <beidson@apple.com>
1421
1422         Modern IDB: Cursors (still) do not keep their opening request alive.
1423         https://bugs.webkit.org/show_bug.cgi?id=153724
1424
1425         Reviewed by Alex Christensen.
1426
1427         No new tests (All existing tests pass without flakiness).
1428
1429         IDBCursors did not properly keep their JS wrappers alive.
1430         Making them ActiveDOMObjects that keep track of how many requests might be in flight fixes this.
1431         This also makes them actually keep their opening-request live via the opaque-root mechanism.
1432         
1433         IDBCursorWithValue also needed to opt in to all of these mechanisms.
1434
1435         * CMakeLists.txt:
1436         * WebCore.xcodeproj/project.pbxproj:
1437
1438         * Modules/indexeddb/IDBCursor.h:
1439         (WebCore::IDBCursor::hasPendingActivity): The base IDBCursor always has no pending activity,
1440           to maintain current behavior in LegacyIDB. This weirdness will go away when LegacyIDB does.
1441         * Modules/indexeddb/IDBCursor.idl:
1442         * Modules/indexeddb/IDBCursorWithValue.idl:
1443
1444         Track a count for all outstanding requests to keep the cursor alive as an ActiveDOMObject.
1445         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1446         (WebCore::IDBClient::IDBCursor::IDBCursor):
1447         (WebCore::IDBClient::IDBCursor::update):
1448         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
1449         (WebCore::IDBClient::IDBCursor::deleteFunction):
1450         (WebCore::IDBClient::IDBCursor::activeDOMObjectName):
1451         (WebCore::IDBClient::IDBCursor::canSuspendForDocumentSuspension):
1452         (WebCore::IDBClient::IDBCursor::hasPendingActivity):
1453         (WebCore::IDBClient::IDBCursor::decrementOutstandingRequestCount):
1454         * Modules/indexeddb/client/IDBCursorImpl.h:
1455         
1456         Rework the "delete" family of functions on the object store to allow for returning a modern IDBRequest.
1457         A lot of this can go away when LegacyIDB does.
1458         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1459         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
1460         (WebCore::IDBClient::IDBObjectStore::doDelete):
1461         (WebCore::IDBClient::IDBObjectStore::modernDelete):
1462         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1463         
1464         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1465         (WebCore::IDBClient::IDBRequest::setSource): Setup a ScopeGuard to decrement the cursor's request
1466           count whenever it makes sense to do so.
1467         (WebCore::IDBClient::IDBRequest::dispatchEvent): Clear the ScopeGuard (if it exists) to decrement the count.
1468         (WebCore::IDBClient::IDBRequest::willIterateCursor): Set the ScopeGuard.
1469         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): Clear the ScopeGuard (if it exists) to decrement the count.
1470         * Modules/indexeddb/client/IDBRequestImpl.h:
1471         
1472         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1473         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Deleted.
1474         (WebCore::IDBServer::ScopeGuard::~ScopeGuard): Deleted.
1475         (WebCore::IDBServer::ScopeGuard::enable): Deleted.
1476         (WebCore::IDBServer::ScopeGuard::disable): Deleted.
1477         
1478         * bindings/js/JSIDBCursorWithValueCustom.cpp: Added.
1479         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
1480         
1481         * platform/ScopeGuard.h: Added.
1482         (WebCore::ScopeGuard::ScopeGuard):
1483         (WebCore::ScopeGuard::~ScopeGuard):
1484         (WebCore::ScopeGuard::enable):
1485         (WebCore::ScopeGuard::disable):
1486
1487 2016-02-01  Sun-woo Nam  <sunny.nam@samsung.com>
1488
1489         Free Colormap when XWindow is destroyed.
1490         https://bugs.webkit.org/show_bug.cgi?id=153413
1491
1492         Reviewed by Žan Doberšek.
1493
1494         Colormap is needed to create XWindow and it should be freed when XWindow is destroyed.
1495         Unless Colormap is freed before destroying XWindow, memory leak is suspected.
1496         XFreeColormap therefore is needed on X11Helper.
1497
1498         * platform/graphics/surfaces/glx/X11Helper.cpp: Added XFreeColormap.
1499         (WebCore::X11Helper::destroyWindow):
1500
1501 2016-02-01  Tim Horton  <timothy_horton@apple.com>
1502
1503         Move some SPI declarations into the appropriate SPI header
1504         https://bugs.webkit.org/show_bug.cgi?id=153755
1505
1506         Reviewed by Darin Adler.
1507
1508         * platform/graphics/cocoa/IOSurface.mm:
1509         * platform/spi/cg/CoreGraphicsSPI.h:
1510
1511 2016-02-01  Tim Horton  <timothy_horton@apple.com>
1512
1513         Snapshot surfaces are forever wired after being compressed
1514         https://bugs.webkit.org/show_bug.cgi?id=153751
1515         <rdar://problem/24354546>
1516
1517         Reviewed by Darin Adler.
1518
1519         * platform/graphics/cocoa/IOSurface.mm:
1520         (IOSurface::convertToFormat):
1521         Allow IOSurfaceAccelerator to unwire surfaces after they're transformed.
1522
1523 2016-02-01  Dan Bernstein  <mitz@apple.com>
1524
1525         <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
1526         https://bugs.webkit.org/show_bug.cgi?id=153754
1527
1528         Reviewed by Darin Adler.
1529
1530         * English.lproj/Localizable.strings: Updated for removal of WebKit2 string.
1531
1532 2016-02-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1533
1534         Cache the Path instead of creating it every time it is required
1535         https://bugs.webkit.org/show_bug.cgi?id=152939
1536
1537         Reviewed by Darin Adler.
1538
1539         Instead of creating the Path object every time it is required, we should 
1540         cache it in an LRU cache. TinyLRUCache returns a reference to the cached
1541         entry so we do not have to pay the cost of copying it either.
1542
1543         * platform/graphics/FloatRoundedRect.h:
1544         (WebCore::operator!=):
1545         Implement the inequality operator for FloatRoundedRect since it is
1546         called by TinyLRUCache.
1547         
1548         * rendering/ClipPathOperation.h:
1549         Return a reference to the path in the cache since instead of creating a
1550         new copy.
1551         
1552         * rendering/style/BasicShapes.cpp:
1553         (WebCore::SVGPathTranslatedByteStream::SVGPathTranslatedByteStream):
1554         (WebCore::SVGPathTranslatedByteStream::operator==):
1555         (WebCore::SVGPathTranslatedByteStream::operator!=):
1556         (WebCore::SVGPathTranslatedByteStream::isEmpty):
1557         (WebCore::SVGPathTranslatedByteStream::path):
1558         This struct holds an offset and an SVGPathByteStream. It is the key of 
1559         the LRU cache for the the translated SVGPathByteStream.
1560         
1561         (WebCore::EllipsePathPolicy::isKeyNull):
1562         (WebCore::EllipsePathPolicy::createValueForKey):
1563         (WebCore::RoundedRectPathPolicy::isKeyNull):
1564         (WebCore::RoundedRectPathPolicy::createValueForKey):
1565         (WebCore::PolygonPathPolicy::isKeyNull):
1566         (WebCore::PolygonPathPolicy::createValueForKey):
1567         (WebCore::TranslatedByteStreamPathPolicy::isKeyNull):
1568         (WebCore::TranslatedByteStreamPathPolicy::createValueForKey):
1569         Inherit from the LRU cache policy template, so have a specific name for
1570         the desired path contents and pass this class explicitly to the LRU cache
1571         template.
1572         
1573         (WebCore::cachedEllipsePath):
1574         (WebCore::cachedRoundedRectPath):
1575         (WebCore::cachedPolygonPath):
1576         (WebCore::cachedTranslatedByteStreamPath):
1577         Return a cached path object for specific path contents.
1578         
1579         (WebCore::BasicShapeCircle::path):
1580         (WebCore::BasicShapeEllipse::path):
1581         (WebCore::BasicShapePolygon::path):
1582         (WebCore::BasicShapePath::path):
1583         (WebCore::BasicShapeInset::path):
1584         Get the Path object from the cache; create a new one if it does not exist.
1585         
1586         * rendering/style/BasicShapes.h:
1587         Change the prototype of the path() function to return a reference to the
1588         path in the cache instead of a having to copying it.
1589         
1590         * svg/SVGPathByteStream.h:
1591         (WebCore::SVGPathByteStream::operator!=):
1592         Implement the inequality operator for SVGPathByteStream because it is
1593         called by TinyLRUCache.
1594
1595 2016-02-01  Chris Dumez  <cdumez@apple.com>
1596
1597         Move properties that use custom bindings to the prototype
1598         https://bugs.webkit.org/show_bug.cgi?id=153735
1599
1600         Reviewed by Darin Adler.
1601
1602         Move properties that use custom bindings to the prototype. Whether a
1603         property's bindings code is generated or custom-written should not
1604         impact where the property is located.
1605
1606         No new tests, already covered by existing tests.
1607
1608         * bindings/js/JSHTMLDocumentCustom.cpp:
1609         (WebCore::JSHTMLDocument::getOwnPropertySlot):
1610         Add null-check for staticPropHashTable. HTMLDocument no longer has
1611         any property on the instance so staticPropHashTable is now null.
1612
1613         * bindings/scripts/CodeGeneratorJS.pm:
1614
1615 2016-02-01  Jer Noble  <jer.noble@apple.com>
1616
1617         REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy
1618         https://bugs.webkit.org/show_bug.cgi?id=153727
1619         <rdar://problem/24429886>
1620
1621         Reviewed by Chris Dumez.
1622
1623         The `this` object may be freed after calling deleteIfPossible(). Make the early-return-if-
1624         deleted more explicit, and only check allowsCaching() after the deleteIfPossible() return
1625         value check.
1626
1627         * loader/cache/CachedResource.cpp:
1628         (WebCore::CachedResource::removeClient):
1629
1630 2016-02-01  Dan Bernstein  <mitz@apple.com>
1631
1632         Tried to fix a build after r195899.
1633
1634         * dom/EventContext.h: Enabled TouchEventContext type trait specialization on iOS.
1635
1636 2016-02-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1637
1638         [Fetch API] Implement Fetch API Request
1639         https://bugs.webkit.org/show_bug.cgi?id=153437
1640
1641         Added support for Fetch Request and Body.
1642         Body is sharing functionality between Request and Response.
1643         Conversion between various body types are not implemented yet.
1644
1645         Added a FetchOptions class. Options in this class are partially redundant with ResourceLoaderOptions.
1646
1647         Fixing bug in Headers constructor.
1648         Making error reporting in case of modifying headers compliant with the spec.
1649
1650         Reviewed by Darin Adler.
1651
1652         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html
1653                imported/w3c/web-platform-tests/fetch/api/request/request-consume.html
1654                imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html
1655                imported/w3c/web-platform-tests/fetch/api/request/request-error.html
1656                imported/w3c/web-platform-tests/fetch/api/request/request-headers.html
1657                imported/w3c/web-platform-tests/fetch/api/request/request-idl.html
1658                imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html
1659                imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
1660                imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
1661                imported/w3c/web-platform-tests/fetch/api/request/request-structure.html
1662
1663         * CMakeLists.txt:
1664         * DerivedSources.cpp:
1665         * DerivedSources.make:
1666         * Modules/fetch/FetchBody.cpp: Added.
1667         (WebCore::FetchBody::initBody):
1668         (WebCore::FetchBody::clear):
1669         (WebCore::FetchBody::processIfEmptyOrDisturbed):
1670         (WebCore::FetchBody::arrayBuffer):
1671         (WebCore::FetchBody::formData):
1672         (WebCore::FetchBody::blob):
1673         (WebCore::FetchBody::text):
1674         (WebCore::FetchBody::json):
1675         * Modules/fetch/FetchBody.h: Added.
1676         (WebCore::FetchBody::~FetchBody):
1677         (WebCore::FetchBody::isEmpty):
1678         (WebCore::FetchBody::isDisturbed):
1679         (WebCore::FetchBody::setDisturbed):
1680         (WebCore::FetchBody::setMimeType):
1681         (WebCore::FetchBody::mimeType):
1682         * Modules/fetch/FetchBody.idl: Added.
1683         * Modules/fetch/FetchHeaders.cpp:
1684         (WebCore::canWriteHeader):
1685         (WebCore::FetchHeaders::append):
1686         (WebCore::FetchHeaders::remove):
1687         (WebCore::FetchHeaders::set):
1688         (WebCore::FetchHeaders::fill): Helper routine implementing https://fetch.spec.whatwg.org/#concept-headers-fill
1689         * Modules/fetch/FetchHeaders.h: Adding header getter/setter for FetchRequest.
1690         (WebCore::FetchHeaders::fastGet):
1691         (WebCore::FetchHeaders::fastSet):
1692         * Modules/fetch/FetchHeaders.js: Fixing bug in constructor (covered by modified headers-basc.html test).
1693         (initializeFetchHeaders):
1694         * Modules/fetch/FetchOptions.h: Added.
1695         (WebCore::FetchOptions::FetchOptions):
1696         (WebCore::FetchOptions::type):
1697         (WebCore::FetchOptions::destination):
1698         (WebCore::FetchOptions::mode):
1699         (WebCore::FetchOptions::credentials):
1700         (WebCore::FetchOptions::cache):
1701         (WebCore::FetchOptions::redirect):
1702         (WebCore::FetchOptions::referrerPolicy):
1703         (WebCore::FetchOptions::setType):
1704         (WebCore::FetchOptions::setDestination):
1705         (WebCore::FetchOptions::setMode):
1706         (WebCore::FetchOptions::setCredentials):
1707         (WebCore::FetchOptions::setCache):
1708         (WebCore::FetchOptions::setRedirect):
1709         (WebCore::FetchOptions::setReferrerPolicy):
1710         * Modules/fetch/FetchRequest.cpp: Added.
1711         (WebCore::FetchRequest::create):
1712         (WebCore::FetchRequest::FetchRequest):
1713         (WebCore::FetchRequest::init):
1714         (WebCore::FetchRequest::setReferrer):
1715         (WebCore::FetchRequest::setReferrerPolicy):
1716         (WebCore::FetchRequest::setMode):
1717         (WebCore::FetchRequest::setCredentials):
1718         (WebCore::FetchRequest::setCache):
1719         (WebCore::FetchRequest::setRedirect):
1720         (WebCore::FetchRequest::type):
1721         (WebCore::FetchRequest::destination):
1722         (WebCore::FetchRequest::referrerPolicy):
1723         (WebCore::FetchRequest::referrer):
1724         (WebCore::FetchRequest::mode):
1725         (WebCore::FetchRequest::credentials):
1726         (WebCore::FetchRequest::cache):
1727         (WebCore::FetchRequest::redirect):
1728         (WebCore::FetchRequest::setMethod):
1729         (WebCore::FetchRequest::clone):
1730         * Modules/fetch/FetchRequest.h: Added.
1731         (WebCore::FetchRequest::method):
1732         (WebCore::FetchRequest::url):
1733         (WebCore::FetchRequest::integrity):
1734         (WebCore::FetchRequest::headers):
1735         * Modules/fetch/FetchRequest.idl: Added.
1736         * WebCore.xcodeproj/project.pbxproj:
1737         * bindings/js/Dictionary.h:
1738         (WebCore::Dictionary::execState):
1739         * bindings/js/JSDictionary.cpp:
1740         (WebCore::JSDictionary::convertValue):
1741         * bindings/js/JSDictionary.h:
1742         (WebCore::JSDictionary::get):
1743
1744 2016-01-31  Jeremy Jones  <jeremyj@apple.com>
1745
1746         Add resize event for HTMLMediaElement
1747         https://bugs.webkit.org/show_bug.cgi?id=125715
1748
1749         Reviewed by Darin Adler.
1750
1751         Tests: http/tests/media/hls/hls-video-resize.html
1752                media/video-resize.html
1753
1754         Move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl
1755         per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers
1756
1757         Post resize event from video element when metadata loads and when content size changes.
1758
1759         * dom/GlobalEventHandlers.idl: Add onresize.
1760         * html/HTMLElement.cpp:
1761         (WebCore::HTMLElement::createEventHandlerNameMap): Add onresizeAttr.
1762         * html/HTMLMediaElement.cpp:
1763         (WebCore::HTMLMediaElement::setReadyState):
1764         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
1765         * html/HTMLMediaElement.h:
1766         (WebCore::HTMLMediaElement::scheduleResizeEvent):
1767         (WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged):
1768         * html/HTMLVideoElement.cpp:
1769         (WebCore::HTMLVideoElement::scheduleResizeEvent): Sechedule event.
1770         (WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged): Schedule event if size has changed.
1771         * html/HTMLVideoElement.h: Add declarations.
1772         * page/DOMWindow.idl: Remove onresize.
1773
1774 2016-01-31  Darin Adler  <darin@apple.com>
1775
1776         Revert accidental behavior change from previous patch.
1777
1778         * platform/URL.cpp:
1779         (WebCore::mimeTypeFromDataURL): Restore behavior where an empty MIME type would
1780         be turned into "text/plain".
1781
1782 2016-01-31  Darin Adler  <darin@apple.com>
1783
1784         Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
1785         https://bugs.webkit.org/show_bug.cgi?id=153732
1786
1787         Reviewed by Dean Jackson.
1788
1789         * Modules/mediasource/MediaSource.cpp:
1790         (WebCore::MediaSource::isTypeSupported): Added comment about mysterious call
1791         to lower(); should probably return here and remove it.
1792
1793         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1794         (WebCore::initProtocolHandlerWhitelist): Deleted. Moved into isProtocolWhitelisted.
1795         (WebCore::isProtocolWhitelisted): Changed set to be ASCIICaseInsensitiveHash and
1796         initialized it using a lambda instead of a separate function.
1797         (WebCore::verifyProtocolHandlerScheme): Added a FIXME about some case sensitive
1798         checking of the protocol prefix here.
1799
1800         * Modules/plugins/QuickTimePluginReplacement.mm:
1801         (WebCore::QuickTimePluginReplacement::supportsMimeType): Changed set to be
1802         ASCIICaseInsensitiveHash and initialized it using a lambda instead of using
1803         an explict check for empty.
1804         (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
1805
1806         * Modules/plugins/YouTubePluginReplacement.cpp:
1807         (WebCore::queryKeysAndValues): Use convertToASCIILowercase. The keys here are
1808         going to be all ASCII.
1809         (WebCore::isYouTubeURL): Use equalLettersIgnoringASCIICase instead of lowercasing
1810         the string.
1811         (WebCore::processAndCreateYouTubeURL): Use url.protocolIsInHTTPFamily instead of
1812         listing "http" and then "https" explicitly. Use equalLettersIgnoringASCIICase
1813         instead of lowercasing a string.
1814         (WebCore::YouTubePluginReplacement::youTubeURL): Ditto.
1815
1816         * Modules/websockets/WebSocketHandshake.cpp:
1817         (WebCore::hostName): Use convertToASCIILowercase on host name.
1818         (WebCore::WebSocketHandshake::host): Ditto.
1819
1820         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1821         (webkitAccessibleGetAttributes): Call convertToASCIILowercase instead of lower
1822         to lowercase an element's tag name. This is a strange way to do things; typically
1823         would be better to use some other function on Element, since tagName goes out of
1824         its way to be capitalized, but some ATK expert can improve this later.
1825
1826         * css/CSSGrammar.y.in: Use the new convertToASCIILowercaseInPlace function rather
1827         than the old lower function. We only need to lowercase the ASCII letters, and it's
1828         also better to have the function have a clearer name.
1829
1830         * css/CSSParser.cpp:
1831         (WebCore::convertToASCIILowercaseInPlace): Renamed from makeLower and made it deal
1832         with only ASCII lowercasing.
1833         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Renamed from lower.
1834         (WebCore::isUniversalKeyword): Added. Helper for the function below that uses
1835         equalLettersIgnoringASCIICase rather than lowercasing the string.
1836         (WebCore::parseKeywordValue): Use isUniversalKeyword. Also clarified a comment.
1837         (WebCore::CSSParser::parseAttr): Use convertToASCIILowercaseInPlace and delay
1838         String creation until later in the function, using CSSParserString operations more.
1839
1840         * css/CSSParserValues.cpp:
1841         (WebCore::CSSParserSelector::parsePseudoElementSelector): Use
1842         convertToASCIILowercaseInPlace by its new name, with its new behavior.
1843
1844         * css/CSSParserValues.h: Tweaked comment and formatting a bit. Replaced the lower
1845         function with the convertToASCIILowercaseInPlace function.
1846
1847         * css/CSSSelector.cpp:
1848         (WebCore::CSSSelector::RareData::parseNth): Rewrote this to avoid the need to
1849         make a lowercased copy of m_argument. Use equalLettersIgnoringASCIICase, and two
1850         calls to find. Also use String::toIntStrict so we don't have to create String
1851         objects for substrings.
1852
1853         * css/MediaQuery.cpp:
1854         (WebCore::MediaQuery::MediaQuery): Use convertToASCIILowercase for media type name.
1855         * css/MediaQueryExp.cpp:
1856         (WebCore::MediaQueryExp::serialize): Use convertToASCIILowercase for media feature name.
1857
1858         * dom/Document.cpp:
1859         (WebCore::isSeparator): Tweaked formatting and removed non-helpful comment.
1860         (WebCore::processArguments): Changed this from a static member function to a non-member
1861         file internal function. Use a std::function instead of a function pointer with a void*
1862         pointer. Rewrote algorithm to simplify it and use StringView instead of String for the
1863         keys and values.
1864         (WebCore::Document::processViewport): Use a lambda instead of a function pointer to
1865         call setViewportFeature, so that function's interface is no longer dictated by
1866         the exact type of the function pointer argument to processArguments.
1867         (WebCore::Document::processFormatDetection): Use a lambda instead of the
1868         setParserFeature function above; use equalLettersIgnoringASCIICase for both the
1869         key and the value, since processArguments no longer lowercases the string.
1870         (WebCore::Document::processArguments): Deleted.
1871
1872         * dom/Document.h: Removed unnecessary declaration of processArguments and
1873         ArgumentsCallback. Both are now private to the cpp file.
1874
1875         * dom/Element.cpp:
1876         (WebCore::makeIdForStyleResolution): Use convertToASCIILowercase. When in quirks mode,
1877         we want to match IDs in an ASCII case-insensitive way not match compatibility caseless.
1878
1879         * dom/ScriptElement.cpp:
1880         (WebCore::ScriptElement::isScriptTypeSupported): Remove the use of lower here since
1881         the MIME type registry is now itself ASCII case-insensitive.
1882
1883         * dom/ViewportArguments.cpp:
1884         (WebCore::numericPrefix): Changed to use StringView and take a Document&, rearranged
1885         argument order so Document& comes first.
1886         (WebCore::findSizeValue): Ditto.
1887         (WebCore::findScaleValue): Ditto.
1888         (WebCore::findBooleanValue): Ditto. Also use std::abs instead of fabs, possibly
1889         avoiding a conversion from float to double (not sure it was happening before but it's
1890         definitely not happening now).
1891         (WebCore::setViewportFeature): Changed to put arguments in a more logical order, to take
1892         the ViewportArguments as a reference, not a void*, and to use StringView to avoid forcing
1893         the caller to allocate strings. Also changed to use equalLettersIgnoringASCIICase so we
1894         don't rely on the caller to make the key lowercase for us.
1895         (WebCore::reportViewportWarning): Changed argument types. Added a couple comments about
1896         mistakes in the function.
1897
1898         * dom/ViewportArguments.h: Removed unnecessary declaration of reportViewportWarning,
1899         which is now private to the cpp file. Updated for new arguments to setViewportFeature.
1900
1901         * editing/EditorCommand.cpp:
1902         (WebCore::executeFormatBlock): Use convertToASCIILowercase on the argument, which is
1903         specifying a tag name.
1904
1905         * fileapi/Blob.cpp:
1906         (WebCore::Blob::isValidContentType): Removed unnecessary separate loops for
1907         8-bit and 16-bit strings. Content types are short strings and this small optimization is
1908         not worth the additional code complexity.
1909         (WebCore::Blob::normalizedContentType): Use convertToASCIILowercase since valid
1910         content types are guaranteed to be all ASCII.
1911         (WebCore::Blob::isNormalizedContentType): Removed unnecessary separate loops for
1912         8-bit and 16-bit strings. Content types are short strings and this small optimization is
1913         not worth the additional code complexity.
1914
1915         * html/parser/HTMLParserIdioms.cpp: Added now-needed include of QualifiedName.h.
1916
1917         * html/parser/HTMLParserIdioms.h: Removed unneeded include of QualifiedName.h and
1918         WTFString.h. Made sure every function is declared first, even if it's also defined
1919         later in the header in the section for functions templates and inline functions.
1920
1921         * loader/archive/ArchiveFactory.cpp:
1922         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): Use auto& for the type of
1923         the set of MIME types here, since it's now using ASCIICaseInsensitiveHash.
1924
1925         * platform/MIMETypeRegistry.cpp: Changed the MIME type sets to use
1926         ASCIICaseInsensitiveHash since MIME type are not case sensitive.
1927         (WebCore::initializeSupportedImageMIMETypes): Use a modern for loop.
1928         (WebCore::initializeSupportedImageMIMETypesForEncoding): Updated for HashSet type change.
1929         (WebCore::initializePDFMIMETypes): Use a modern for loop.
1930         (WebCore::initializeSupportedNonImageMimeTypes): Use a modern for loop.
1931         (WebCore::initializeSupportedMediaMIMETypes): Updated for HashSet type change.
1932         (WebCore::initializeUnsupportedTextMIMETypes): Use a modern for loop.
1933         (WebCore::initializeMIMETypeRegistry): Updated for HashSet type change.
1934         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Ditto.
1935         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Ditto.
1936         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Ditto.
1937         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Ditto.
1938         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Ditto.
1939         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Ditto.
1940         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Ditto.
1941         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Ditto.
1942         (WebCore::mimeTypeAssociationMap): Use ASCIICaseInsensitiveHash.
1943         (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Use auto to make code tighter.
1944
1945         * platform/MIMETypeRegistry.h: Changed return types of the getMIMETypes functions
1946         to use ASCIICaseInsensitiveHash.
1947
1948         * platform/SchemeRegistry.cpp:
1949         (WebCore::schemesForbiddenFromDomainRelaxation): Changed type to
1950         use ASCIICaseInsensitiveHash.
1951
1952         * platform/URL.cpp:
1953         (WebCore::mimeTypeFromDataURL): Use convertToASCIILowercase instead of lower.
1954         Also removed some dead code that tried to handle the case where the data URL
1955         has a comma as one of the first 5 characters: That can't happen since it's a
1956         precondition of this function that the first five characters are "data:".
1957
1958         * platform/graphics/MediaPlayer.cpp:
1959         (WebCore::MediaPlayer::getSupportedTypes): Change type of argument to
1960         a HashSet with ASCIICaseInsensitiveHash.
1961         * platform/graphics/MediaPlayer.h: Ditto.
1962
1963         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1964         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
1965         Changed type of HashSet to use ASCIICaseInsensitiveHash.
1966         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Ditto.
1967
1968         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1969         (WebCore::avfMIMETypes):
1970         Changed type of HashSet to use ASCIICaseInsensitiveHash.
1971         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes): Ditto.
1972         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto.
1973
1974         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1975         Changed type of HashSet to use ASCIICaseInsensitiveHash.
1976         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1977         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Removed
1978         an unnecessary line of code to set a local variable to 0 just before it falls
1979         out of scope.
1980         (WebCore::avfMIMETypes): Ditto. Also tightened up the code a bit.
1981         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Ditto.
1982
1983         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1984         Changed type of HashSet to use ASCIICaseInsensitiveHash.
1985         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1986         (WebCore::mimeTypeCache): Ditto.
1987         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
1988
1989         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Ditto.
1990         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1991         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Ditto.
1992
1993         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1994         (WebCore::mimeTypeCache): Ditto.
1995         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Ditto.
1996         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
1997
1998         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
1999         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2000         (WebCore::shouldRejectMIMEType): Made this non-case-sensitive by using startsWith
2001         and the "false" argument. Later change this to startsWithIgnoringASCIICase or
2002         startsWithLettersIgnoringASCIICase.
2003         (WebCore::addFileTypesToCache): Use ASCIICaseInsensitiveHash. ALso rewrote to
2004         tighten up the code a bit and use modern Objective-C for loops.
2005         (WebCore::mimeCommonTypesCache): Use ASCIICaseInsensitiveHash.
2006         (WebCore::mimeModernTypesCache): Ditto.
2007         (WebCore::concatenateHashSets): Ditto.
2008         (WebCore::MediaPlayerPrivateQTKit::getSupportedTypes): Ditto.
2009         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Initialied
2010         track type set using lambda, but left it case sensitive.
2011
2012         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2013         (WebCore::mimeTypeCache): Changed type of HashSet to use ASCIICaseInsensitiveHash.
2014         (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes): Ditto.
2015         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2016
2017         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2018         (WebCore::mimeTypeCache): Ditto.
2019         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes): Ditto.
2020         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Ditto.
2021
2022 2016-01-31  Brent Fulgham  <bfulgham@apple.com>
2023
2024         Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
2025         https://bugs.webkit.org/show_bug.cgi?id=153657
2026         <rdar://problem/24413107>
2027
2028         Reviewed by Darin Adler.
2029
2030         Tested by http/tests/plugins/visible_plugins.html.
2031
2032         A number of poorly-coded sites break when WebKit reports that it understands PDF mime types,
2033         but does not have a list of plugins that the site can iterate through.
2034
2035         To avoid this compatibility problem, we should also expose the "WebKit built-in PDF" plugin
2036         to avoid this edge case.
2037
2038         * plugins/PluginData.cpp:
2039         (WebCore::shouldBePubliclyVisible): Add "WebKit built-in PDF" plugin.
2040
2041 2016-01-31  Doug Russell  <d_russell@apple.com>
2042
2043         AX: Add a boundary value to AXTextStateChangeType
2044         https://bugs.webkit.org/show_bug.cgi?id=153085
2045
2046         Reviewed by Darin Adler.
2047
2048         Post an AT notification when navigation is attempted past
2049         an editable element's boundaries.
2050
2051         Test: accessibility/mac/selection-boundary-userinfo.html
2052
2053         * accessibility/AXObjectCache.cpp:
2054         (WebCore::AXObjectCache::showIntent):
2055         * accessibility/AXTextStateChangeIntent.h:
2056         * accessibility/mac/AXObjectCacheMac.mm:
2057         (platformChangeTypeForWebCoreChangeType):
2058         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2059         * editing/FrameSelection.cpp:
2060         (WebCore::FrameSelection::modifyMovingRight):
2061         (WebCore::FrameSelection::modifyMovingForward):
2062         (WebCore::FrameSelection::modifyMovingLeft):
2063         (WebCore::FrameSelection::modifyMovingBackward):
2064         (WebCore::textSelectionWithDirectionAndGranularity):
2065         (WebCore::FrameSelection::modify):
2066         (WebCore::FrameSelection::modifyExtendingBackward): Deleted.
2067         (WebCore::FrameSelection::textSelectionIntent): Deleted.
2068         * editing/FrameSelection.h:
2069         * editing/VisiblePosition.cpp:
2070         (WebCore::VisiblePosition::next):
2071         (WebCore::VisiblePosition::previous):
2072         (WebCore::VisiblePosition::left):
2073         (WebCore::VisiblePosition::right):
2074         (WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
2075         (WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
2076         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): Deleted.
2077         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): Deleted.
2078         * editing/VisiblePosition.h:
2079         * editing/VisibleUnits.cpp:
2080         (WebCore::startOfLine):
2081         (WebCore::logicalStartOfLine):
2082         (WebCore::endOfLine):
2083         (WebCore::logicalEndOfLine):
2084         (WebCore::leftBoundaryOfLine):
2085         (WebCore::rightBoundaryOfLine):
2086         (WebCore::inSameLogicalLine): Deleted.
2087         (WebCore::endOfEditableContent): Deleted.
2088         (WebCore::isEndOfEditableOrNonEditableContent): Deleted.
2089         * editing/VisibleUnits.h:
2090
2091 2016-01-31  Daniel Bates  <dabates@apple.com>
2092
2093         CSP: Use the served CSP header for dedicated workers
2094         https://bugs.webkit.org/show_bug.cgi?id=153157
2095         <rdar://problem/24383254>
2096         And
2097         https://bugs.webkit.org/show_bug.cgi?id=153156
2098         <rdar://problem/24383246>
2099
2100         Reviewed by Brent Fulgham.
2101
2102         Inspired by Blink commit:
2103         <https://src.chromium.org/viewvc/blink?revision=194143&view=revision>
2104
2105         Implement support for respecting Content Security Policy (CSP) HTTP headers included in the
2106         HTTP response for a Web Worker's script as per section Workers of the CSP 2.0 spec,
2107         <https://w3c.github.io/webappsec-csp/2/#processing-model-workers> (29 August 2015).
2108
2109         Currently a Web Worker always inherits the CSP of its owner document. Instead a web worker
2110         will inherit the CSP of its owner document only if its script is incapable of defining a
2111         content security policy (i.e. its origin is a globally unique identifier). Otherwise, the
2112         CSP HTTP headers delivered with the script will be used to define the CSP for the worker.
2113
2114         Tests: fast/workers/worker-inherits-csp-blocks-eval.html
2115                fast/workers/worker-inherits-csp-blocks-xhr.html
2116                http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval.html
2117
2118         * CMakeLists.txt: Add file ContentSecurityPolicyResponseHeaders.cpp.
2119         * WebCore.vcxproj/WebCore.vcxproj: Add files ContentSecurityPolicyResponseHeaders.{cpp, h}.
2120         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2121         * WebCore.xcodeproj/project.pbxproj: Ditto.
2122         * dom/Document.cpp:
2123         (WebCore::Document::processHttpEquiv): Update code to use enum class ContentSecurityPolicyHeaderType.
2124         * loader/FrameLoader.cpp:
2125         (WebCore::FrameLoader::didBeginDocument): Extract logic to collect Content Security Policy HTTP headers
2126         into class ContentSecurityPolicyResponseHeaders and make use of it here.
2127         * page/csp/ContentSecurityPolicy.cpp:
2128         (WebCore::CSPDirectiveList::headerType): Modified to use enum class ContentSecurityPolicyHeaderType.
2129         (WebCore::CSPDirectiveList::CSPDirectiveList): Ditto.
2130         (WebCore::CSPDirectiveList::create): Ditto.
2131         (WebCore::ContentSecurityPolicy::responseHeaders): Creates and returns a ContentSecurityPolicyResponseHeaders
2132         object with the parsed CSP policy headers.
2133         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Processed the CSP policy headers represented by the
2134         specified ContentSecurityPolicyResponseHeaders object.
2135         (WebCore::ContentSecurityPolicy::deprecatedHeader): Deleted.
2136         (WebCore::ContentSecurityPolicy::deprecatedHeaderType): Deleted.
2137         * page/csp/ContentSecurityPolicy.h: Defines a class that represents a collection of CSP policy headers.
2138         This class has two purposes:
2139             - It extracts the CSP policy headers from a HTTP response (ResourceResponse object). We make use of
2140             this functionality in both FrameLoader::didBeginDocument() and Worker::didReceiveResponse().
2141             - It serves as a memento that externalizes the internal CSP policy details of an instance of
2142             ContentSecurityPolicy. We make use of this memento functionality to support inheriting the
2143             CSP policy of the worker's owner document in a thread-safe manner. You can create and restore
2144             a memento using ContentSecurityPolicy::responseHeaders() and ContentSecurityPolicy::didReceiveHeaders(), respectively.
2145         * page/csp/ContentSecurityPolicyResponseHeaders.cpp: Added.
2146         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders): Extracts the
2147         CSP HTTP headers from a ResourceResponse object.
2148         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy): Make a copy of this object that is
2149         safe to pass to another thread.
2150         * page/csp/ContentSecurityPolicyResponseHeaders.h: Added.
2151         * workers/DedicatedWorkerGlobalScope.cpp:
2152         (WebCore::DedicatedWorkerGlobalScope::create): Modified to use class ContentSecurityPolicyResponseHeaders.
2153         * workers/DedicatedWorkerGlobalScope.h:
2154         * workers/DedicatedWorkerThread.cpp:
2155         (WebCore::DedicatedWorkerThread::create): Ditto.
2156         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): Ditto.
2157         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Ditto.
2158         * workers/DedicatedWorkerThread.h:
2159         * workers/Worker.cpp:
2160         (WebCore::Worker::didReceiveResponse): Create a ContentSecurityPolicyResponseHeaders if the origin of
2161         the worker's script is capable of providing a CSP. Otherwise, we will inherit the CSP of the worker's owner
2162         document in Worker::notifyFinished().
2163         (WebCore::Worker::notifyFinished): Pass the appropriate CSP response headers to WorkerMessagingProxy::startWorkerGlobalScope().
2164         * workers/Worker.h:
2165         * workers/WorkerGlobalScope.cpp:
2166         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Renamed; formerly named applyContentSecurityPolicyFromString().
2167         Modified to take a ContentSecurityPolicyResponseHeaders and apply it to the ContentSecurityPolicy object associated with the worker.
2168         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString): Deleted.
2169         * workers/WorkerGlobalScope.h:
2170         * workers/WorkerMessagingProxy.cpp:
2171         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Pass the worker's ContentSecurityPolicyResponseHeaders object.
2172         * workers/WorkerThread.cpp:
2173         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Added field m_contentSecurityPolicyResponseHeaders to store
2174         the CSP response headers to be applied to the worker's ContentSecurityPolicy object.
2175         (WebCore::WorkerThread::WorkerThread): Modified to use ContentSecurityPolicyResponseHeaders.
2176         (WebCore::WorkerThread::workerThread): Pass the ContentSecurityPolicyResponseHeaders object from the start up data struct
2177         to DedicatedWorkerThread::createWorkerGlobalScope().
2178         * workers/WorkerThread.h:
2179
2180 2016-01-31  Darin Adler  <darin@apple.com>
2181
2182         Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
2183         https://bugs.webkit.org/show_bug.cgi?id=153715
2184
2185         Reviewed by Gyuyoung Kim.
2186
2187         * editing/cocoa/HTMLConverter.mm:
2188         (HTMLConverter::computedAttributesForElement): Use convertToASCIILowercase to fold
2189         ASCII case when searching for fonts by name.
2190
2191         * platform/network/cf/ResourceResponseCFNet.cpp:
2192         (WebCore::ResourceResponse::platformLazyInit): Use convertToASCIIUppercase to make
2193         the HTTP version string canonical. Not sure why it's needed at all, but the letters
2194         we might be uppercasing are "HTTP", so no need to handle non-ASCII.
2195         * platform/network/cocoa/ResourceResponseCocoa.mm:
2196         (WebCore::ResourceResponse::platformLazyInit): Ditto.
2197
2198         * rendering/svg/SVGRenderTreeAsText.cpp:
2199         (WebCore::operator<<): Use convertToASCIIUppercase when writing the spread
2200         method type into a text stream. The method types are all ASCII.
2201
2202 2016-01-31  Dan Bernstein  <mitz@apple.com>
2203
2204         [Cocoa] Remove __has_include guards around use of WebKitAdditions
2205         https://bugs.webkit.org/show_bug.cgi?id=153728
2206
2207         Reviewed by Andy Estes.
2208
2209         Guard WebKitAdditions includes with #if USE(APPLE_INTERNAL_SDK) rather than with __has_include.
2210
2211         * dom/EventNames.h:
2212         * loader/EmptyClients.cpp:
2213         (WebCore::fillWithEmptyClients):
2214         * page/MainFrame.cpp:
2215         (WebCore::MainFrame::MainFrame):
2216         * page/MainFrame.h:
2217         * page/PageConfiguration.h:
2218         * platform/cocoa/WebKitAdditions.mm:
2219         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2220         * platform/ios/LegacyTileGridTile.mm:
2221
2222 2016-01-31  Darin Adler  <darin@apple.com>
2223
2224         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
2225         https://bugs.webkit.org/show_bug.cgi?id=153639
2226
2227         Reviewed by Filip Pizlo.
2228
2229         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
2230         for whitelisted functions. Function names are all ASCII.
2231
2232         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
2233         for ARIA roles. ARIA roles are all ASCII.
2234
2235         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
2236         crypto algorithm names. Algorithm names are all ASCII.
2237
2238         * css/CSSFontSelector.cpp:
2239         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
2240         for font faces. Face names should use ASCII case insensitive matching;
2241         there is no need for non-ASCII case folding.
2242         * css/CSSFontSelector.h: Ditto.
2243
2244         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
2245         FeatureSet. The features are all ASCII.
2246
2247         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
2248         map. Access keys are all ASCII.
2249
2250         * dom/ScriptElement.cpp:
2251         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
2252         for the language set. These strings are all ASCII.
2253
2254         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
2255         command names. These names are all ASCII.
2256
2257         * html/HTMLObjectElement.cpp:
2258         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
2259         for parameter names. These names are all ASCII.
2260
2261         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
2262         The input types are all ASCII.
2263
2264         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
2265         HTTP header field names. These names are all ASCII.
2266         * loader/CrossOriginPreflightResultCache.h: Ditto.
2267
2268         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
2269         MIME types. MIME types are all ASCII.
2270         * platform/MIMETypeRegistry.cpp:
2271         (WebCore::initializeSupportedImageMIMETypes): Ditto.
2272
2273         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
2274         URL schemes are all ASCII.
2275         * platform/URL.cpp: Ditto.
2276
2277         * platform/graphics/FontCache.cpp:
2278         (WebCore::FontPlatformDataCacheKey::operator==): Use ASCIICaseInsensitiveHash.
2279         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
2280
2281         * platform/graphics/FontCascade.cpp:
2282         (WebCore::keysMatch): Rename from operator== since this operation is not
2283         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
2284         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
2285         better memory use.
2286         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
2287         a hash more efficient by eliminating the overhead of building a vector and
2288         even possible heap allocation and deallocation.
2289         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
2290
2291         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
2292         for font family names. These names should use ASCII case insensitive matching;
2293         there is no need for non-ASCII case folding.
2294
2295         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
2296         HTTP header field names. These names are all ASCII.
2297
2298         * rendering/style/RenderStyle.cpp:
2299         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
2300         to compute a hash. Use ASCIICaseInsensitiveHash.
2301
2302 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2303
2304         Reduce PassRefPtr uses in dom - 5
2305         https://bugs.webkit.org/show_bug.cgi?id=153470
2306
2307         Reviewed by Darin Adler.
2308
2309         As a step to remove PassRefPtr, this patch reduces uses of PassRefPtr in WebCore/dom. 
2310
2311         * dom/Document.cpp:
2312         (WebCore::Document::adoptNode):
2313         (WebCore::Document::implicitClose):
2314         (WebCore::Document::enqueuePopstateEvent):
2315         (WebCore::Document::setInputCursor):
2316         * dom/Document.h:
2317         * dom/DocumentMarker.cpp:
2318         (WebCore::DocumentMarkerTextMatch::instanceFor):
2319         * dom/Event.cpp:
2320         (WebCore::Event::setUnderlyingEvent):
2321         * dom/Event.h:
2322         * dom/EventDispatcher.h:
2323         * dom/GenericEventQueue.cpp:
2324         (WebCore::GenericEventQueue::enqueueEvent):
2325         * dom/GenericEventQueue.h:
2326         * dom/MouseEvent.cpp:
2327         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2328         * dom/Node.cpp:
2329         (WebCore::Node::dispatchDOMActivateEvent):
2330         * dom/NodeIterator.h:
2331         * dom/PendingScript.h:
2332         * dom/PopStateEvent.cpp:
2333         (WebCore::PopStateEvent::create):
2334         * dom/PopStateEvent.h:
2335         * dom/ProcessingInstruction.cpp:
2336         (WebCore::ProcessingInstruction::setCSSStyleSheet): Deleted. Nobody calls this function.
2337         * dom/ProcessingInstruction.h:
2338         * dom/RangeBoundaryPoint.h:
2339         (WebCore::RangeBoundaryPoint::RangeBoundaryPoint):
2340         * dom/TextEvent.cpp:
2341         (WebCore::TextEvent::createForFragmentPaste):
2342         (WebCore::TextEvent::TextEvent):
2343         * dom/TextEvent.h:
2344         * editing/Editor.cpp:
2345         (WebCore::Editor::pasteAsFragment):
2346         * editing/Editor.h:
2347         * editing/mac/EditorMac.mm:
2348         (WebCore::Editor::replaceNodeFromPasteboard):
2349
2350 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2351
2352         Use std::make_unique<> when creating an unique_ptr object.
2353         https://bugs.webkit.org/show_bug.cgi?id=153705
2354
2355         Reviewed by Darin Adler.
2356
2357         Some factory functions have used std::unique_ptr<> for creating an unique_ptr object.
2358         It is wrong. We have to use std::make_unique<>.
2359
2360         * Modules/mediasession/WebMediaSessionManager.cpp:
2361         (WebCore::WebMediaSessionManager::mockPicker):
2362         * inspector/InspectorTimelineAgent.cpp:
2363         (WebCore::InspectorTimelineAgent::internalStart):
2364         * platform/cf/RunLoopObserver.cpp:
2365         (WebCore::RunLoopObserver::create): Deleted.
2366         * platform/cf/RunLoopObserver.h:
2367         (WebCore::RunLoopObserver::RunLoopObserver):
2368         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
2369         (WebCore::WebMediaSessionManagerMac::platformPicker):
2370         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2371         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2372         (WebCore::MediaPlaybackTargetPickerMac::create): Deleted.
2373         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
2374         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
2375         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2376         (WebCore::MediaPlaybackTargetPickerMock::create): Deleted.
2377         * platform/mock/MediaPlaybackTargetPickerMock.h:
2378         * rendering/FloatingObjects.cpp:
2379         (WebCore::FloatingObject::copyToNewContainer):
2380
2381 2016-01-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2382
2383         Unreviewed, fix GTK debug build after r195899
2384
2385         * dom/EventContext.h:
2386         (isType):
2387
2388 2016-01-30  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2389
2390         Add missing include to fix building debug configuration
2391         https://bugs.webkit.org/show_bug.cgi?id=153719
2392
2393         Reviewed by Darin Adler.
2394
2395         No new tests.
2396
2397         * rendering/RenderObject.cpp:
2398
2399 2016-01-30  Commit Queue  <commit-queue@webkit.org>
2400
2401         Unreviewed, rolling out r195911.
2402         https://bugs.webkit.org/show_bug.cgi?id=153723
2403
2404         Caused frequent assertion failures on bots (Requested by ap on
2405         #webkit).
2406
2407         Reverted changeset:
2408
2409         "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
2410         https://bugs.webkit.org/show_bug.cgi?id=153639
2411         http://trac.webkit.org/changeset/195911
2412
2413 2016-01-30  Commit Queue  <commit-queue@webkit.org>
2414
2415         Unreviewed, rolling out r195799 and r195828.
2416         https://bugs.webkit.org/show_bug.cgi?id=153722
2417
2418         Caused assertion failures, severely affecting EWS (Requested
2419         by ap on #webkit).
2420
2421         Reverted changesets:
2422
2423         "Web Inspector: InspectorTimelineAgent doesn't need to
2424         recompile functions because it now uses the sampling profiler"
2425         https://bugs.webkit.org/show_bug.cgi?id=153500
2426         http://trac.webkit.org/changeset/195799
2427
2428         "Attempt to fix the Windows build after r195799"
2429         http://trac.webkit.org/changeset/195828
2430
2431 2016-01-30  Brady Eidson  <beidson@apple.com>
2432
2433         Modern IDB: Some tests crash with specific odd database names.
2434         https://bugs.webkit.org/show_bug.cgi?id=153688
2435
2436         Reviewed by Darin Adler.
2437
2438         No new tests (2 existing tests now pass).
2439
2440         * platform/FileSystem.cpp:
2441         (WebCore::shouldEscapeUChar): Return true for some surrogate-pair situations.
2442         (WebCore::encodeForFileName): Pass along the previous and next characters, as well,
2443           and do a two byte escaping for some characters.
2444
2445 2016-01-30  Eric Carlson  <eric.carlson@apple.com>
2446
2447         More than one audio and/or text track sometimes selected in media controls menu
2448         https://bugs.webkit.org/show_bug.cgi?id=153664
2449
2450         Use an <img> element for the track menu item checkmark instead of a background image and
2451         the ::before selector.
2452
2453         Reviewed by Jer Noble.
2454
2455         Test: media/controls/track-menu.html
2456
2457         * Modules/mediacontrols/mediaControlsApple.css:
2458         (audio::-webkit-media-controls-closed-captions-container li:hover):
2459         (audio::-webkit-media-controls-closed-captions-container li .checkmark-container):
2460         (audio::-webkit-media-controls-closed-captions-container li.selected .checkmark-container):
2461         (audio::-webkit-media-controls-closed-captions-container li.selected:hover .checkmark-container):
2462         (audio::-webkit-media-controls-closed-captions-container li.selected::before): Deleted.
2463         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before): Deleted.
2464         * Modules/mediacontrols/mediaControlsApple.js:
2465         (Controller.prototype.buildCaptionMenu):
2466         (Controller.prototype.):
2467         (Controller.prototype.getCurrentControlsStatus):
2468
2469 2016-01-30  Darin Adler  <darin@apple.com>
2470
2471         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
2472         https://bugs.webkit.org/show_bug.cgi?id=153639
2473
2474         Reviewed by Filip Pizlo.
2475
2476         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
2477         for whitelisted functions. Function names are all ASCII.
2478
2479         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
2480         for ARIA roles. ARIA roles are all ASCII.
2481
2482         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
2483         crypto algorithm names. Algorithm names are all ASCII.
2484
2485         * css/CSSFontSelector.cpp:
2486         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
2487         for font faces. Face names should use ASCII case insensitive matching;
2488         there is no need for non-ASCII case folding.
2489         * css/CSSFontSelector.h: Ditto.
2490
2491         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
2492         FeatureSet. The features are all ASCII.
2493
2494         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
2495         map. Access keys are all ASCII.
2496
2497         * dom/ScriptElement.cpp:
2498         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
2499         for the language set. These strings are all ASCII.
2500
2501         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
2502         command names. These names are all ASCII.
2503
2504         * html/HTMLObjectElement.cpp:
2505         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
2506         for parameter names. These names are all ASCII.
2507
2508         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
2509         The input types are all ASCII.
2510
2511         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
2512         HTTP header field names. These names are all ASCII.
2513         * loader/CrossOriginPreflightResultCache.h: Ditto.
2514
2515         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
2516         MIME types. MIME types are all ASCII.
2517         * platform/MIMETypeRegistry.cpp:
2518         (WebCore::initializeSupportedImageMIMETypes): Ditto.
2519
2520         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
2521         URL schemes are all ASCII.
2522         * platform/URL.cpp: Ditto.
2523
2524         * platform/graphics/FontCache.cpp: Reworked FontPlatformDataCacheKey struct:
2525         Made it a conventional struct with non-prefixed data members names. Removed
2526         the "==" operator since it was appropriate for hash table lookup but wasn't
2527         a true equality operator. Tightened the implementations of the constructors.
2528         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
2529         (WebCore::FontPlatformDataCacheKeyHash::equal): Do the equality check here,
2530         not using the == operator. And use equalIgnoringASCIICase.
2531         (WebCore::FontPlatformDataCacheKeyTraits::isEmptyValue): Added this entire
2532         traits struct so we check empty values in a more efficient way.
2533         (WebCore::FontCache::getCachedFontPlatformData): Added comments and tweaked
2534         style in this function.
2535
2536         * platform/graphics/FontCascade.cpp:
2537         (WebCore::keysMatch): Rename from operator== since this operation is not
2538         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
2539         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
2540         better memory use.
2541         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
2542         a hash more efficient by eliminating the overhead of building a vector and
2543         even possible heap allocation and deallocation.
2544         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
2545
2546         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
2547         for font family names. These names should use ASCII case insensitive matching;
2548         there is no need for non-ASCII case folding.
2549
2550         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
2551         HTTP header field names. These names are all ASCII.
2552
2553         * rendering/style/RenderStyle.cpp:
2554         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
2555         to compute a hash. Use ASCIICaseInsensitiveHash.
2556
2557 2016-01-30  Chris Dumez  <cdumez@apple.com>
2558
2559         Unreviewed, rolling out r195871.
2560
2561         Caused several layout tests to time out
2562
2563         Reverted changeset:
2564
2565         "Tab suspension code shouldn't use page cache cacheability
2566         logic"
2567         https://bugs.webkit.org/show_bug.cgi?id=153680
2568         http://trac.webkit.org/changeset/195871
2569
2570 2016-01-30  Chris Dumez  <cdumez@apple.com>
2571
2572         Unreviewed, rebaseline bindings tests after r195904.
2573
2574         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2575         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
2576         (WebCore::jsTestCustomNamedGetterConstructor):
2577         (WebCore::setJSTestCustomNamedGetterConstructor):
2578         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2579         (WebCore::JSTestEventTarget::getOwnPropertySlot):
2580         (WebCore::jsTestEventTargetConstructor):
2581         (WebCore::setJSTestEventTargetConstructor):
2582         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2583         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
2584         (WebCore::jsTestOverrideBuiltinsConstructor):
2585         (WebCore::setJSTestOverrideBuiltinsConstructor):
2586
2587 2016-01-30  Chris Dumez  <cdumez@apple.com>
2588
2589         [JS Bindings] prototype.constructor should be writable
2590         https://bugs.webkit.org/show_bug.cgi?id=149412
2591         <rdar://problem/22545096>
2592
2593         Reviewed by Darin Adler.
2594
2595         prototype.constructor should have the following properties:
2596         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
2597
2598         as per the Web IDL specification:
2599         https://heycam.github.io/webidl/#interface-prototype-object
2600
2601         In WebKit, it is currently not writable. It is writable in Firefox.
2602
2603         This patch was first landed in r190085 but was rolled out for causing
2604         crashes: <rdar://problem/22825602>. The issue was that even though we
2605         marked constructor as writable, we failed to generate a setter for it.
2606         This patch addresses the issue and the crash in <rdar://problem/22825602>
2607         no longer occurs after this change. A regression test is also added for
2608         this crash.
2609
2610         Tests:
2611         fast/dom/HTMLDocument/constructor-setter-crash.html
2612         fast/dom/prototype-constructor-setter.html
2613
2614         * bindings/scripts/CodeGeneratorJS.pm:
2615         (GenerateAttributesHashTable):
2616         (GenerateImplementation):
2617         * bindings/scripts/IDLAttributes.txt:
2618         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2619         (WebCore::setJSTestActiveDOMObjectConstructor):
2620         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2621         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
2622         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2623         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
2624         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2625         (WebCore::setJSTestCustomNamedGetterConstructor):
2626         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2627         (WebCore::setJSTestEventConstructorConstructor):
2628         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2629         (WebCore::setJSTestEventTargetConstructor):
2630         * bindings/scripts/test/JS/JSTestException.cpp:
2631         (WebCore::setJSTestExceptionConstructor):
2632         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2633         (WebCore::setJSTestGenerateIsReachableConstructor):
2634         * bindings/scripts/test/JS/JSTestInterface.cpp:
2635         (WebCore::setJSTestInterfaceConstructor):
2636         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2637         (WebCore::setJSTestJSBuiltinConstructorConstructor):
2638         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2639         (WebCore::setJSTestMediaQueryListListenerConstructor):
2640         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2641         (WebCore::setJSTestNamedConstructorConstructor):
2642         * bindings/scripts/test/JS/JSTestNode.cpp:
2643         (WebCore::setJSTestNodeConstructor):
2644         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2645         (WebCore::setJSTestNondeterministicConstructor):
2646         * bindings/scripts/test/JS/JSTestObj.cpp:
2647         (WebCore::setJSTestObjConstructor):
2648         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2649         (WebCore::setJSTestOverloadedConstructorsConstructor):
2650         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2651         (WebCore::setJSTestOverrideBuiltinsConstructor):
2652         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2653         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
2654         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2655         (WebCore::setJSTestTypedefsConstructor):
2656         * bindings/scripts/test/JS/JSattribute.cpp:
2657         (WebCore::setJSattributeConstructor):
2658         * bindings/scripts/test/JS/JSreadonly.cpp:
2659         (WebCore::setJSreadonlyConstructor):
2660         * page/DOMWindow.idl:
2661
2662 2016-01-30  Chris Dumez  <cdumez@apple.com>
2663
2664         Move more 'constructor' properties to the prototype
2665         https://bugs.webkit.org/show_bug.cgi?id=153667
2666
2667         Reviewed by Darin Adler.
2668
2669         Move more 'constructor' properties to the prototype. In particular, we
2670         used to keep the 'constructor' on the instance for interfaces that have
2671         an indexed / named property getter because our getOwnPropertySlot()
2672         implementation used to be wrong for such interfaces.
2673
2674         However, getOwnPropertySlot() should be correct after r188590 so we
2675         should now be able to move the 'constructor' up to the prototype for
2676         these interfaces, as per the specification:
2677         http://heycam.github.io/webidl/#interface-prototype-object
2678
2679         No new tests, already covered by existing tests.
2680
2681         * bindings/js/JSPluginElementFunctions.h:
2682         (WebCore::pluginElementCustomGetOwnPropertySlot):
2683         Add a null check for staticPropHashTable. It is now null because this
2684         type no longer has any property on the instance now that 'constructor'
2685         is on the prototype.
2686
2687         * bindings/scripts/CodeGeneratorJS.pm:
2688         (ConstructorShouldBeOnInstance):
2689
2690 2016-01-29  Ada Chan  <adachan@apple.com>
2691
2692         Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
2693         https://bugs.webkit.org/show_bug.cgi?id=153665
2694
2695         Reviewed by Dan Bernstein.
2696
2697         * Configurations/FeatureDefines.xcconfig:
2698
2699 2016-01-30  David Kilzer  <ddkilzer@apple.com>
2700
2701         [iOS] WebKit1 apps crash in ___ZN7WebCore16DiskCacheMonitorC2ERKNS_15ResourceRequestENS_9SessionIDEPK20_CFCachedURLResponse_block_invoke1
2702         <http://webkit.org/b/153710>
2703         <rdar://problem/23116706>
2704
2705         Reviewed by Darin Adler.
2706
2707         * loader/cocoa/DiskCacheMonitorCocoa.mm:
2708         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
2709         - Fix race condition on iOS WebKit1 clients by calling the block
2710           to cancel the DiskCacheMonitor on the WebThread, which is the
2711           same thread where the CFCachedURLResponseCallBackBlock is
2712           called.
2713         - Removed whitespace to adhere to style.
2714
2715 2016-01-30  Ryosuke Niwa  <rniwa@webkit.org>
2716
2717         TouchList should be retargeted
2718         https://bugs.webkit.org/show_bug.cgi?id=149592
2719
2720         Reviewed by Antti Koivisto.
2721
2722         Retarget touch target's using the same algorithm as the one used for related targets instead of
2723         EventRelatedNodeResolver which is removed in this patch.
2724
2725         Also enable the retargeting on iOS.
2726
2727         Test: fast/shadow-dom/touch-event-ios.html
2728
2729         * dom/EventContext.cpp:
2730         (WebCore::TouchEventContext::TouchEventContext):
2731         (WebCore::TouchEventContext::handleLocalEvents):
2732         (WebCore::TouchEventContext::checkReachability):
2733         * dom/EventContext.h:
2734         (WebCore::toTouchEventContext):
2735         (WebCore::EventContext::isUnreachableNode):
2736         * dom/EventDispatcher.cpp:
2737         (WebCore::EventRelatedNodeResolver): Deleted.
2738         (WebCore::EventPath::EventPath):
2739         (WebCore::EventDispatcher::dispatchEvent): 
2740         (WebCore::addRelatedNodeResolversForTouchList): Deleted.
2741         (WebCore::EventPath::updateTouchLists): Deleted.
2742         (WebCore::EventPath::setRelatedTarget): Removed superfluous UNUSED_PARAM since the argument is always used.
2743         (WebCore::EventPath::retargetTouch): Extracted from updateTouchLists/setRelatedTarget. Clones Touch object
2744         with the new target for each event context just like related targets.
2745         (WebCore::EventPath::retargetTouchLists): Renamed from updateTouchLists. Calls retargetTouch on each Touch
2746         object in each TouchList.
2747         * dom/TouchEvent.h:
2748
2749 2016-01-30 Dave Hyatt  <hyatt@apple.com>
2750
2751         Support break-after, break-before and break-inside.
2752         https://bugs.webkit.org/show_bug.cgi?id=148814
2753
2754         Reviewed by Dean Jackson.
2755
2756         New tests added in printing/, fast/multicol/, and fast/regions.
2757
2758         * css/CSSComputedStyleDeclaration.cpp:
2759         (WebCore::convertToPageBreak):
2760         (WebCore::convertToColumnBreak):
2761         (WebCore::convertToRegionBreak):
2762         For backwards compatibility, keep support for all the old properties in
2763         computed style. This means we have to convert the break-* property values
2764         into keywords that make sense for the legacy properties. This mainly
2765         involves mapping "page", "column", "region" to "always" (similar rule for
2766         the avoid-* versions as well).
2767
2768         (WebCore::ComputedStyleExtractor::propertyValue):
2769         Add support for the three new break-* properties.
2770
2771         * css/CSSParser.cpp:
2772         (WebCore::isValidKeywordPropertyAndValue):
2773         (WebCore::isKeywordPropertyID):
2774         (WebCore::CSSParser::parseValue):
2775         Add support for the new break properties.
2776
2777         * css/CSSPrimitiveValueMappings.h:
2778         (WebCore::CSSPrimitiveValue::operator BreakBetween):
2779         (WebCore::CSSPrimitiveValue::operator BreakInside):
2780         Add converters for the new BreakBetween and BreakInside enums. Remove
2781         the EPageBreak enum, since it is no longer used.
2782
2783         * css/CSSPropertyNames.in:
2784         * css/CSSValueKeywords.in:
2785         Add the new properties and the new values supported by the properties
2786         to the keywords lists.
2787
2788         * css/StyleBuilderConverter.h:
2789         (WebCore::StyleBuilderConverter::convertFontSynthesis):
2790         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
2791         (WebCore::StyleBuilderConverter::convertPageBreakInside):
2792         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
2793         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
2794         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
2795         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
2796         In order to map the legacy properties into the new break-* values
2797         we have custom converter functions.
2798
2799         * rendering/RenderBlock.cpp:
2800         (WebCore::RenderBlock::paintChild):
2801         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation):
2802         (WebCore::RenderBlock::computeRegionRangeForBoxChild):
2803         * rendering/RenderBlockFlow.cpp:
2804         (WebCore::RenderBlockFlow::applyBeforeBreak):
2805         (WebCore::RenderBlockFlow::applyAfterBreak):
2806         Patch the block code to check the correct new break-* constants. For
2807         avoidance, this means checking both the general avoid value and the
2808         specific value (e.g., avoid-page). In place of "always", we check
2809         the specific value (e.g., column) and then for page specifically, we
2810         also treat "left", "right", "recto" and "verso" as "always break" for now.
2811
2812         * rendering/style/RenderStyle.cpp:
2813         (WebCore::RenderStyle::changeRequiresLayout):
2814         Make sure changes to the break properties trigger relayout.
2815
2816         * rendering/style/RenderStyle.h:
2817         Add getters and setters for the break-* properties and remove all
2818         occurrences of the legacy page, column and region values from the RenderStyle.
2819
2820         * rendering/style/RenderStyleConstants.cpp:
2821         (WebCore::alwaysPageBreak):
2822         We have a helper function here for mapping several constant values to "page".
2823
2824         * rendering/style/RenderStyleConstants.h:
2825         Definitions of the new BreakBetween and BreakInside enums.
2826
2827         * rendering/style/StyleMultiColData.cpp:
2828         (WebCore::StyleMultiColData::StyleMultiColData):
2829         (WebCore::StyleMultiColData::operator==):
2830         * rendering/style/StyleMultiColData.h:
2831         Remove the column-specific break data.
2832
2833         * rendering/style/StyleRareNonInheritedData.cpp:
2834         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2835         (WebCore::StyleRareNonInheritedData::operator==):
2836         * rendering/style/StyleRareNonInheritedData.h:
2837         Remove the region-specific break data and replace it with generic break
2838         data that is now used by all three pagination models.
2839
2840 2016-01-29  Per Arne Vollan  <peavo@outlook.com>
2841
2842         [Win] Fix compile error.
2843         https://bugs.webkit.org/show_bug.cgi?id=153646
2844
2845         Reviewed by Darin Adler.
2846
2847         * platform/text/win/LocaleWin.cpp:
2848         (WebCore::LCIDFromLocaleInternal):
2849
2850 2016-01-29  Antti Koivisto  <antti@apple.com>
2851
2852         Tab suspension code shouldn't use page cache cacheability logic
2853         https://bugs.webkit.org/show_bug.cgi?id=153680
2854
2855         Reviewed by Andreas Kling.
2856
2857         Most of PageCache::canCache() is unnecessary for tab suspension.
2858
2859         Also improve robustness.
2860
2861         * page/Page.cpp:
2862         (WebCore::Page::setPageActivityState):
2863         (WebCore::Page::setIsVisible):
2864         (WebCore::Page::setIsVisibleInternal):
2865         (WebCore::Page::setIsPrerender):
2866         (WebCore::Page::canTabSuspend):
2867
2868             Include visibility test here.
2869
2870             Instead of calling PageCache::canCache() just check for each frame that
2871             - that the document is loaded
2872             - that active DOM objects allow suspension
2873
2874         (WebCore::Page::setIsTabSuspended):
2875         (WebCore::Page::setTabSuspensionEnabled):
2876         (WebCore::Page::updateTabSuspensionState):
2877
2878             Refactor for robustness.
2879
2880         (WebCore::Page::tabSuspensionTimerFired):
2881
2882             Call canTabSuspend, the result might have changed.
2883
2884         (WebCore::Page::scheduleTabSuspension): Deleted.
2885         * page/Page.h:
2886
2887 2016-01-29  Ryosuke Niwa  <rniwa@webkit.org>
2888
2889         fast/shadow-dom/Element-interface-attachShadow.html fails on iOS
2890         https://bugs.webkit.org/show_bug.cgi?id=153681
2891
2892         Reviewed by Antti Koivisto.
2893
2894         The bug was caused by canHaveUserAgentShadowRoot() returning false on a meter element since it's disabled on iOS.
2895         Override HTMLUnknownElement's canHaveUserAgentShadowRoot to return false for compatbility on iOS.
2896
2897         * html/HTMLUnknownElement.h:
2898         (WebCore::HTMLUnknownElement::canHaveUserAgentShadowRoot):
2899
2900 2016-01-29  Brady Eidson  <beidson@apple.com>
2901
2902         Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
2903         https://bugs.webkit.org/show_bug.cgi?id=153666
2904
2905         Reviewed by Tim Horton.
2906
2907         No new tests (Two failing tests now pass).
2908
2909         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2910         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2911
2912 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
2913
2914         image-rendering: -webkit-optimize-contrast not working for background images
2915         https://bugs.webkit.org/show_bug.cgi?id=97991
2916
2917         Reviewed by Darin Adler.
2918         
2919         Don't equate "pixelated" and "crisp-edges" values for image-rendering with low
2920         quality scaling; they should map to InterpolationNone, not InterpolationLow.
2921         
2922         To support this change ImageQualityController to return a InterpolationQuality
2923         from the renamed chooseInterpolationQuality(). If the returned value is not
2924         InterpolationDefault, set the GraphicsContext image interpolation when drawing
2925         images and image buffers.
2926         
2927         Remove the redundant "useLowQualityScale" from 
2928
2929         Test: fast/images/image-rendering-interpolation.html
2930
2931         * html/HTMLCanvasElement.cpp:
2932         (WebCore::HTMLCanvasElement::paint):
2933         * html/HTMLCanvasElement.h:
2934         * page/DragController.cpp:
2935         (WebCore::DragController::doImageDrag):
2936         * platform/graphics/GraphicsContext.cpp:
2937         (WebCore::GraphicsContext::drawImage):
2938         (WebCore::GraphicsContext::drawTiledImage):
2939         (WebCore::GraphicsContext::drawImageBuffer):
2940         (WebCore::GraphicsContext::drawConsumingImageBuffer):
2941         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer): Deleted.
2942         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer): Deleted.
2943         * platform/graphics/GraphicsContext.h:
2944         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
2945         (WebCore::ImagePaintingOptions::usesDefaultInterpolation):
2946         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
2947         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer):
2948         * platform/graphics/GraphicsTypes.h:
2949         * platform/graphics/ImageBuffer.h:
2950         * platform/graphics/cg/ImageBufferCG.cpp:
2951         (WebCore::ImageBuffer::drawConsuming):
2952         (WebCore::ImageBuffer::draw):
2953         * rendering/ImageQualityController.cpp:
2954         (WebCore::ImageQualityController::interpolationQualityFromStyle):
2955         (WebCore::ImageQualityController::chooseInterpolationQuality):
2956         (WebCore::ImageQualityController::ImageQualityController): Deleted.
2957         (WebCore::ImageQualityController::shouldPaintAtLowQuality): Deleted.
2958         * rendering/ImageQualityController.h:
2959         * rendering/RenderBoxModelObject.cpp:
2960         (WebCore::RenderBoxModelObject::chooseInterpolationQuality):
2961         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2962         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality): Deleted.
2963         * rendering/RenderBoxModelObject.h:
2964         * rendering/RenderEmbeddedObject.cpp:
2965         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
2966         * rendering/RenderHTMLCanvas.cpp:
2967         (WebCore::RenderHTMLCanvas::paintReplaced):
2968         * rendering/RenderImage.cpp:
2969         (WebCore::RenderImage::paintIntoRect):
2970         * rendering/RenderSnapshottedPlugIn.cpp:
2971         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2972         * rendering/style/RenderStyle.h:
2973
2974 2016-01-29  Brady Eidson  <beidson@apple.com>
2975
2976         Modern IDB: storage/indexeddb/modern/index-3.html fails.
2977         https://bugs.webkit.org/show_bug.cgi?id=153661
2978
2979         Reviewed by Tim Horton.
2980
2981         No new tests (1 failing test now passes, others get closer).
2982
2983         When indexing a new record fails due to uniqueness constraints, remove all traces of the record.
2984
2985         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2986         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2987         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2988         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2989
2990 2016-01-29  Brent Fulgham  <bfulgham@apple.com>
2991
2992         [WebGL] Check vertex array bounds before permitting a glDrawArrays to execute
2993         https://bugs.webkit.org/show_bug.cgi?id=153643
2994         <rdar://problem/23424456>
2995
2996         Reviewed by Dean Jackson.
2997
2998         Tested by fast/canvas/webgl/webgl-drawarrays-crash.html.
2999
3000         * html/canvas/WebGLRenderingContextBase.cpp:
3001         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Make sure that we have at
3002         least one buffer bound to a program if a drawArray call with a non-zero range of
3003         requested data is being made.
3004         (WebCore::WebGLRenderingContextBase::validateDrawElements): Drive-by formatting fix.
3005
3006 2016-01-29  Brady Eidson  <beidson@apple.com>
3007
3008         Modern IDB: Fix logging that overwhelms python with strings of excessive length.
3009         https://bugs.webkit.org/show_bug.cgi?id=153652
3010
3011         Reviewed by Tim Horton.
3012
3013         No new tests (Two skipped tests now pass).
3014
3015         * Modules/indexeddb/IDBKeyData.cpp:
3016         (WebCore::IDBKeyData::loggingString): Limit the length of the string.
3017         
3018         * Modules/indexeddb/IDBKeyRangeData.cpp:
3019         (WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.
3020
3021 2016-01-29  Jer Noble  <jer.noble@apple.com>
3022
3023         Unreviewed Windows build fix; one more ResourceLoaderOptions call site which needs to
3024         be updated after adding the CachingPolicy parameter.
3025
3026         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3027         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3028
3029 2016-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3030
3031         [GTK] Implement overlay scrollbars
3032         https://bugs.webkit.org/show_bug.cgi?id=153405
3033
3034         Reviewed by Michael Catanzaro.
3035
3036         Add support for overlay scrollbars to GTK+ platform following the
3037         same style and behavior than GtkScrolledWindow. They are only
3038         available for GTK+ >= 3.19, but honoring the GTK_OVERLAY_SCROLLING
3039         environment variable, so they could be disable at run time, except
3040         when threaded compositor is enabled. A new ScrollAnimator class
3041         has been added for GTK+ to implement overlay scrollbars and still
3042         allow smooth scrolling when available.
3043
3044         * PlatformGTK.cmake: Add ScrollAnimatorGtk and stop building ScrollAnimatorSmooth.
3045         * platform/ScrollAnimator.h:
3046         (WebCore::ScrollAnimator::ScrollAnimator::mouseEnteredContentArea):
3047         Remove const to allow the ScrollAnimator to be updated.
3048         (WebCore::ScrollAnimator::ScrollAnimator::mouseExitedContentArea): Ditto.
3049         (WebCore::ScrollAnimator::ScrollAnimator::mouseMovedInContentArea): Ditto.
3050         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidShow): Ditto.
3051         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidHide): Ditto.
3052         * platform/Scrollbar.h:
3053         (WebCore::Scrollbar::opacity): Get scrollbar opacity.
3054         (WebCore::Scrollbar::setOpacity): Set scrollbar opacity.
3055         * platform/gtk/ScrollAnimatorGtk.cpp: Added.
3056         (WebCore::ScrollAnimator::create): Create a ScrollAnimatorGtk.
3057         (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
3058         (WebCore::ScrollAnimatorGtk::~ScrollAnimatorGtk):
3059         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
3060         Initialize the ScrollAnimationSmooth if it doesn't exist.
3061         (WebCore::ScrollAnimatorGtk::scroll): Ensure we have a
3062         ScrollAnimationSmooth if smooth scrolling is enabled. This also
3063         fixes the problem of having to reload the page after changing the
3064         smooth scrolling setting.
3065         (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
3066         (WebCore::ScrollAnimatorGtk::willEndLiveResize):
3067         (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar): Register
3068         the scrollbar if it's an overlay scrollbar and make it visible
3069         without animating it. Start the hide animation.
3070         (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar): Ditto.
3071         (WebCore::ScrollAnimatorGtk::willRemoveVerticalScrollbar):
3072         Unregister the scrollbar if it was registered and resrt the
3073         animation state if it was the only scrollbar.
3074         (WebCore::ScrollAnimatorGtk::willRemoveHorizontalScrollbar): Ditto.
3075         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Update
3076         the scrollbars opacity and invalidate the indicator.
3077         (WebCore::easeOutCubic):
3078         (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
3079         Update the scrollbars opacity and schedule a next frame if the
3080         animation didn't finish or start the hide animation otherwhise.
3081         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): Start the
3082         fade animation to show the scrollbars if needed.
3083         (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars): Start the
3084         dafe animation to hide the scrollbars if needed.
3085         (WebCore::ScrollAnimatorGtk::mouseEnteredContentArea): Call
3086         showOverlayScrollbars().
3087         (WebCore::ScrollAnimatorGtk::mouseExitedContentArea): Call
3088         hideOverlayScrollbars().
3089         (WebCore::ScrollAnimatorGtk::mouseMovedInContentArea): Call
3090         showOverlayScrollbars().
3091         (WebCore::ScrollAnimatorGtk::contentAreaDidShow): Ditto.
3092         (WebCore::ScrollAnimatorGtk::contentAreaDidHide): Hide the
3093         scrollbars without animations.
3094         (WebCore::ScrollAnimatorGtk::notifyContentAreaScrolled): Call
3095         showOverlayScrollbars().
3096         (WebCore::ScrollAnimatorGtk::lockOverlayScrollbarStateToHidden):
3097         Update the lock state and hide or show the scrollbars when locked
3098         or unlocked.
3099         * platform/gtk/ScrollAnimatorGtk.h: Added.
3100         * platform/gtk/ScrollbarThemeGtk.cpp:
3101         (WebCore::ScrollbarThemeGtk::backButtonRect): Pass
3102         StyleContextMode to getOrCreateStyleContext depending on the
3103         painting parameter.
3104         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3105         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
3106         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
3107         StyleContextMode parameter to add the hovering class
3108         unconditionally when using overlay scrollbars in layout mode. In
3109         paint mode we add the hovering clas only when the scrollbar is
3110         hovered. This way we always claim the size of the scrollbar when
3111         hovered to be able to show the full scrollbar when the mouse is
3112         close enough to the indicator.
3113         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Initialize
3114         m_usesOverlayScrollbars.
3115         (WebCore::ScrollbarThemeGtk::thumbRect): Pass the scrollbar to
3116         getOrCreateStyleContext().
3117         (WebCore::adjustRectAccordingToMargin): Fix the top margin.
3118         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Pass the
3119         scrollbar and paint mode to getOrCreateStyleContext().
3120         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Ditto.
3121         (WebCore::ScrollbarThemeGtk::paintThumb): Adjust the thumb
3122         rectangle when overlay scrollbar is not hovered to its current
3123         size, since we always claim the size of the scrollbar in hovered
3124         mode.
3125         (WebCore::ScrollbarThemeGtk::paintButton): Pass the scrollbar and
3126         paint mode to getOrCreateStyleContext().
3127         (WebCore::ScrollbarThemeGtk::paint): Take the scrollbar opacity
3128         into account when rendering overlay scrollbars as indicators. Also
3129         get the scrollbar opacity from the GTK+ theme and use a
3130         transparency group when the global opacity is not full opaque.
3131         (WebCore::ScrollbarThemeGtk::buttonSize): Pass the scrollbar to
3132         getOrCreateStyleContext().
3133         * platform/gtk/ScrollbarThemeGtk.h:
3134         * platform/mac/ScrollAnimatorMac.h:
3135         * platform/mac/ScrollAnimatorMac.mm:
3136         (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
3137         (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
3138         (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
3139         (WebCore::ScrollAnimatorMac::contentAreaDidShow):
3140         (WebCore::ScrollAnimatorMac::contentAreaDidHide):
3141
3142 2016-01-29  ChangSeok Oh  <changseok.oh@collabora.com>
3143
3144         [GStreamer] built-in media player doesn't update
3145         https://bugs.webkit.org/show_bug.cgi?id=151816
3146
3147         Reviewed by Xabier Rodriguez-Calvar.
3148
3149         The timeline of audio controls in media document is not properly updated since it is assumed
3150         that the controls are hidden as soon as playing. However, such full page audio always has
3151         opacity : 1 declared by video:-webkit-full-page-media::-webkit-media-controls-panel.no-video.
3152         i.e. it is not actually hidden. We can fix this by simply returning false for no-video media
3153         in controlsAreHidden();
3154
3155         Test: media/audio-controls-timeline-in-media-document.html
3156
3157         * Modules/mediacontrols/mediaControlsBase.js:
3158         (Controller.prototype.controlsAreAlwaysVisible):
3159         (Controller.prototype.controlsAreHidden):
3160
3161 2016-01-29  Manuel Rego Casasnovas  <rego@igalia.com>
3162
3163         [css-grid] Store lines instead of tracks in GridResolvedPosition
3164         https://bugs.webkit.org/show_bug.cgi?id=153592
3165
3166         Reviewed by Sergio Villar Senin.
3167
3168         Due to the new feature that allows to create implicit tracks before the
3169         explicit ones, we will need to use lines instead of tracks in the
3170         code to be able to implement it properly.
3171
3172         This is just a first simple patch using lines instead of tracks in
3173         GridResolvedPosition. It modifies the code that was using it, as it was
3174         considering that the resolvedFinalPosition was a track index and
3175         not a line index.
3176
3177         So if we've an item positioned like:
3178           grid-column: 2 / 5;
3179           grid-row: 1 / span 2;
3180
3181         Before we were storing this information on the GridSpan:
3182         * columns:
3183           * resolvedInitialPosition: 1
3184           * resolvedFinalPosition:  3
3185         * rows:
3186           * resolvedInitialPosition: 0
3187           * resolvedFinalPosition:  1
3188
3189         And now we're storing:
3190         * columns:
3191           * resolvedInitialPosition: 1
3192           * resolvedFinalPosition:  4
3193         * rows:
3194           * resolvedInitialPosition: 0
3195           * resolvedFinalPosition:  2
3196
3197         No new tests, no change of behavior.
3198
3199         * css/CSSGridTemplateAreasValue.cpp:
3200         (WebCore::stringForPosition):
3201         * css/CSSParser.cpp:
3202         (WebCore::CSSParser::parseGridTemplateAreasRow):
3203         * css/StyleBuilderConverter.h:
3204         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
3205         * rendering/RenderGrid.cpp:
3206         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
3207         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3208         (WebCore::RenderGrid::ensureGridSize):
3209         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3210         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
3211         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3212         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
3213         (WebCore::RenderGrid::columnAxisOffsetForChild):
3214         (WebCore::RenderGrid::rowAxisOffsetForChild):
3215         * rendering/RenderGrid.h:
3216         * rendering/style/GridCoordinate.h:
3217         (WebCore::GridSpan::GridSpan):
3218         (WebCore::GridSpan::integerSpan):
3219         (WebCore::GridSpan::end):
3220         (WebCore::GridCoordinate::GridCoordinate):
3221         * rendering/style/GridResolvedPosition.cpp:
3222         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
3223         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
3224         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
3225         (WebCore::resolveGridPositionAgainstOppositePosition):
3226         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
3227         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
3228         (WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
3229         * rendering/style/GridResolvedPosition.h:
3230
3231 2016-01-28  Brady Eidson  <beidson@apple.com>
3232
3233         Modern IDB: SQLite backend mismanages key generator values.
3234         https://bugs.webkit.org/show_bug.cgi?id=153625
3235
3236         Reviewed by Andy Estes.
3237
3238         No new tests (Many failing tests pass, a few get closer).
3239
3240         There's mixed assumptions about whether the value stored is the current value or the next value.
3241
3242         Fixing those assumptions fixes tests.
3243         
3244         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3245         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
3246         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
3247         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.
3248
3249 2016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
3250
3251         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
3252         https://bugs.webkit.org/show_bug.cgi?id=153500
3253         <rdar://problem/24352458>
3254
3255         Reviewed by Timothy Hatcher.
3256
3257         * bindings/js/JSDOMWindowBase.cpp:
3258         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
3259         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
3260         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
3261         * bindings/js/JSDOMWindowBase.h:
3262         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3263         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
3264         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
3265         * bindings/js/JSWorkerGlobalScopeBase.h:
3266         * inspector/InspectorController.h:
3267         * inspector/InspectorController.cpp:
3268         (WebCore::InspectorController::legacyProfilerEnabled):
3269         (WebCore::InspectorController::setLegacyProfilerEnabled):
3270         Be more explicit about enabling legacy profiling.
3271
3272         * inspector/InspectorTimelineAgent.cpp:
3273         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3274         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
3275         TimelineAgent doesn't need to recompile if using the sampling profiler.
3276         This breaks console.profile, but console.profile should move to using
3277         the sampling profiler as well.
3278
3279         (WebCore::InspectorTimelineAgent::startFromConsole):
3280         (WebCore::InspectorTimelineAgent::stopFromConsole):
3281         (WebCore::startProfiling): Deleted.
3282         (WebCore::stopProfiling): Deleted.
3283         Inlined the use once static functions.
3284
3285         * page/PageConsoleClient.cpp:
3286         (WebCore::PageConsoleClient::profile):
3287         (WebCore::PageConsoleClient::profileEnd):
3288         Added FIXMEs for improving console.profile and profileEnd.
3289
3290         * testing/Internals.cpp:
3291         (WebCore::Internals::resetToConsistentState):
3292         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
3293         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
3294         * testing/Internals.h:
3295         * testing/Internals.idl:
3296         Be more explicit about enabling legacy profiling.
3297
3298 2016-01-28  Chris Dumez  <cdumez@apple.com>
3299
3300         Move attributes to the prototype for List types / and types with indexed/named property getters
3301         https://bugs.webkit.org/show_bug.cgi?id=153599
3302
3303         Reviewed by Darin Adler.
3304
3305         Move attributes to the prototype for List types / and types with indexed/named property getters.
3306
3307         We used to keep them on the instance because:
3308         1. Our GetOwnProperty lookup used to be in incorrect order for interfaces with indexed/named property getters.
3309         -> This was fixed recently and we now match the specification and other browsers.
3310         2. This used to regress performance when iterating over those list types
3311         -> Local testing seems to show that this is no longer a regression (tested Speedometer and various related Bindings PerformanceTests).
3312
3313         No new tests, already covered by existing tests.
3314
3315         * bindings/scripts/CodeGeneratorJS.pm:
3316         (InterfaceRequiresAttributesOnInstance): Deleted.
3317         (AttributeShouldBeOnInstanceForCompatibility): Deleted.
3318
3319 2016-01-28  Antti Koivisto  <antti@apple.com>
3320
3321         Tab suspension code hits asserts
3322              
3323
3324         Reviewed by Chris Dumez.
3325
3326         Enabling tab suspension and navigating around in a few tabs hits an assert in
3327         ScriptExecutionContext::suspendActiveDOMObject. This is because suspend/resume reasons don't pair properly
3328
3329         * dom/Document.cpp:
3330         (WebCore::Document::documentWillBecomeInactive):
3331         (WebCore::Document::suspend):
3332         (WebCore::Document::resume):
3333
3334             Provide the reason as argument.
3335
3336         * dom/Document.h:
3337         * history/CachedFrame.cpp:
3338         (WebCore::CachedFrameBase::restore):
3339
3340             No need to call resumeActiveDOMObjects/resumeScriptedAnimationControllerCallbacks explicitly as Document::resume does that.
3341
3342         (WebCore::CachedFrame::CachedFrame):
3343         * loader/FrameLoader.cpp:
3344         (WebCore::FrameLoader::commitProvisionalLoad):
3345         * page/Page.cpp:
3346         (WebCore::Page::canTabSuspend):
3347         (WebCore::Page::setIsTabSuspended):
3348
3349 2016-01-28  Brady Eidson  <beidson@apple.com>
3350
3351         Modern IDB: Fix several more problems with object store changes during cursor iteration in SQLite backend.
3352         https://bugs.webkit.org/show_bug.cgi?id=153616
3353
3354         Reviewed by Alex Christensen.
3355
3356         No new tests (A few failing tests pass, a few get closer).
3357
3358         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3359         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3360         
3361         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3362         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
3363         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
3364         
3365         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3366         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
3367
3368 2016-01-28  Daniel Bates  <dabates@apple.com>
3369
3370         Cleanup: Make DedicatedWorkerThread::create() an inline template method
3371         https://bugs.webkit.org/show_bug.cgi?id=153612
3372
3373         Reviewed by Andy Estes.
3374
3375         Make use of variadic template arguments and std::forward() to forward the arguments passed
3376         from DedicatedWorkerThread::create() to DedicatedWorkerThread::DedicatedWorkerThread(). This
3377         removes the need to duplicate code whenever we modify the parameter types or number of
3378         parameters taken by DedicatedWorkerThread::DedicatedWorkerThread().
3379
3380         * workers/DedicatedWorkerThread.cpp:
3381         (WebCore::DedicatedWorkerThread::create): Deleted.
3382         * workers/DedicatedWorkerThread.h: Reorganized listing of member functions such that we
3383         group the creation/constructor and destructor functions.
3384         (WebCore::DedicatedWorkerThread::create): Modified to be an inline template with variadic
3385         parameters that std::forward()s its arguments to DedicatedWorkerThread::DedicatedWorkerThread().
3386
3387 2016-01-28  Brady Eidson  <beidson@apple.com>
3388
3389         Modern IDB: SQLite backend doesn't handle mutation during cursor iteration.
3390         https://bugs.webkit.org/show_bug.cgi?id=153614
3391
3392         Reviewed by Alex Christensen.
3393
3394         No new tests (A few failing tests pass, a few get closer).
3395
3396         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3397         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): Call notifyCursorsOfCha