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