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