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