Modern IDB: SQLite backend mismanages key generator values.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-01-28  Brady Eidson  <beidson@apple.com>
2
3         Modern IDB: SQLite backend mismanages key generator values.
4         https://bugs.webkit.org/show_bug.cgi?id=153625
5
6         Reviewed by Andy Estes.
7
8         No new tests (Many failing tests pass, a few get closer).
9
10         There's mixed assumptions about whether the value stored is the current value or the next value.
11
12         Fixing those assumptions fixes tests.
13         
14         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
15         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
16         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
17         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.
18
19 2016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
20
21         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
22         https://bugs.webkit.org/show_bug.cgi?id=153500
23         <rdar://problem/24352458>
24
25         Reviewed by Timothy Hatcher.
26
27         * bindings/js/JSDOMWindowBase.cpp:
28         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
29         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
30         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
31         * bindings/js/JSDOMWindowBase.h:
32         * bindings/js/JSWorkerGlobalScopeBase.cpp:
33         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
34         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
35         * bindings/js/JSWorkerGlobalScopeBase.h:
36         * inspector/InspectorController.h:
37         * inspector/InspectorController.cpp:
38         (WebCore::InspectorController::legacyProfilerEnabled):
39         (WebCore::InspectorController::setLegacyProfilerEnabled):
40         Be more explicit about enabling legacy profiling.
41
42         * inspector/InspectorTimelineAgent.cpp:
43         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
44         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
45         TimelineAgent doesn't need to recompile if using the sampling profiler.
46         This breaks console.profile, but console.profile should move to using
47         the sampling profiler as well.
48
49         (WebCore::InspectorTimelineAgent::startFromConsole):
50         (WebCore::InspectorTimelineAgent::stopFromConsole):
51         (WebCore::startProfiling): Deleted.
52         (WebCore::stopProfiling): Deleted.
53         Inlined the use once static functions.
54
55         * page/PageConsoleClient.cpp:
56         (WebCore::PageConsoleClient::profile):
57         (WebCore::PageConsoleClient::profileEnd):
58         Added FIXMEs for improving console.profile and profileEnd.
59
60         * testing/Internals.cpp:
61         (WebCore::Internals::resetToConsistentState):
62         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
63         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
64         * testing/Internals.h:
65         * testing/Internals.idl:
66         Be more explicit about enabling legacy profiling.
67
68 2016-01-28  Chris Dumez  <cdumez@apple.com>
69
70         Move attributes to the prototype for List types / and types with indexed/named property getters
71         https://bugs.webkit.org/show_bug.cgi?id=153599
72
73         Reviewed by Darin Adler.
74
75         Move attributes to the prototype for List types / and types with indexed/named property getters.
76
77         We used to keep them on the instance because:
78         1. Our GetOwnProperty lookup used to be in incorrect order for interfaces with indexed/named property getters.
79         -> This was fixed recently and we now match the specification and other browsers.
80         2. This used to regress performance when iterating over those list types
81         -> Local testing seems to show that this is no longer a regression (tested Speedometer and various related Bindings PerformanceTests).
82
83         No new tests, already covered by existing tests.
84
85         * bindings/scripts/CodeGeneratorJS.pm:
86         (InterfaceRequiresAttributesOnInstance): Deleted.
87         (AttributeShouldBeOnInstanceForCompatibility): Deleted.
88
89 2016-01-28  Antti Koivisto  <antti@apple.com>
90
91         Tab suspension code hits asserts
92              
93
94         Reviewed by Chris Dumez.
95
96         Enabling tab suspension and navigating around in a few tabs hits an assert in
97         ScriptExecutionContext::suspendActiveDOMObject. This is because suspend/resume reasons don't pair properly
98
99         * dom/Document.cpp:
100         (WebCore::Document::documentWillBecomeInactive):
101         (WebCore::Document::suspend):
102         (WebCore::Document::resume):
103
104             Provide the reason as argument.
105
106         * dom/Document.h:
107         * history/CachedFrame.cpp:
108         (WebCore::CachedFrameBase::restore):
109
110             No need to call resumeActiveDOMObjects/resumeScriptedAnimationControllerCallbacks explicitly as Document::resume does that.
111
112         (WebCore::CachedFrame::CachedFrame):
113         * loader/FrameLoader.cpp:
114         (WebCore::FrameLoader::commitProvisionalLoad):
115         * page/Page.cpp:
116         (WebCore::Page::canTabSuspend):
117         (WebCore::Page::setIsTabSuspended):
118
119 2016-01-28  Brady Eidson  <beidson@apple.com>
120
121         Modern IDB: Fix several more problems with object store changes during cursor iteration in SQLite backend.
122         https://bugs.webkit.org/show_bug.cgi?id=153616
123
124         Reviewed by Alex Christensen.
125
126         No new tests (A few failing tests pass, a few get closer).
127
128         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
129         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
130         
131         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
132         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
133         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
134         
135         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
136         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
137
138 2016-01-28  Daniel Bates  <dabates@apple.com>
139
140         Cleanup: Make DedicatedWorkerThread::create() an inline template method
141         https://bugs.webkit.org/show_bug.cgi?id=153612
142
143         Reviewed by Andy Estes.
144
145         Make use of variadic template arguments and std::forward() to forward the arguments passed
146         from DedicatedWorkerThread::create() to DedicatedWorkerThread::DedicatedWorkerThread(). This
147         removes the need to duplicate code whenever we modify the parameter types or number of
148         parameters taken by DedicatedWorkerThread::DedicatedWorkerThread().
149
150         * workers/DedicatedWorkerThread.cpp:
151         (WebCore::DedicatedWorkerThread::create): Deleted.
152         * workers/DedicatedWorkerThread.h: Reorganized listing of member functions such that we
153         group the creation/constructor and destructor functions.
154         (WebCore::DedicatedWorkerThread::create): Modified to be an inline template with variadic
155         parameters that std::forward()s its arguments to DedicatedWorkerThread::DedicatedWorkerThread().
156
157 2016-01-28  Brady Eidson  <beidson@apple.com>
158
159         Modern IDB: SQLite backend doesn't handle mutation during cursor iteration.
160         https://bugs.webkit.org/show_bug.cgi?id=153614
161
162         Reviewed by Alex Christensen.
163
164         No new tests (A few failing tests pass, a few get closer).
165
166         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
167         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): Call notifyCursorsOfChanges.
168         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Ditto.
169
170         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
171         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
172         (WebCore::IDBServer::SQLiteIDBCursor::~SQLiteIDBCursor):
173         * Modules/indexeddb/server/SQLiteIDBCursor.h:
174
175         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
176         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor): Remember these transient backing 
177           store cursors so they can be notified of changes.
178         (WebCore::IDBServer::SQLiteIDBTransaction::closeCursor): Handle removing the cursor from the right set.
179         (WebCore::IDBServer::SQLiteIDBTransaction::notifyCursorsOfChanges):
180         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
181
182 2016-01-28  Brady Eidson  <beidson@apple.com>
183
184         Modern IDB: SQLite backend doesn't support deleting ranges with more than one key.
185         https://bugs.webkit.org/show_bug.cgi?id=153604
186
187         Reviewed by Andy Estes.
188
189         No new tests (A few failing tests pass, a few get closer).
190
191         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
192         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
193
194 2016-01-28  Alex Christensen  <achristensen@webkit.org>
195
196         Fix Windows build after r195774.
197
198         * platform/network/ParsedContentRange.cpp:
199
200 2016-01-28  Anders Carlsson  <andersca@apple.com>
201
202         Add an ArrayValue::get overload that returns a string
203         https://bugs.webkit.org/show_bug.cgi?id=153613
204
205         Reviewed by Tim Horton.
206
207         * bindings/js/ArrayValue.cpp:
208         (WebCore::ArrayValue::get):
209         * bindings/js/ArrayValue.h:
210
211 2016-01-28  Chris Dumez  <cdumez@apple.com>
212
213         EventHandler IDL attributes should be enumerable
214         https://bugs.webkit.org/show_bug.cgi?id=153595
215
216         Reviewed by Sam Weinig.
217
218         Most of our EventHandler IDL attributes were marked as [NotEnumerable]
219         but should not have been according to the specification:
220         - https://html.spec.whatwg.org/#globaleventhandlers
221         - https://html.spec.whatwg.org/#windoweventhandlers
222
223         Firefox and Chrome behave according to the specification.
224         This patch aligns our behavior.
225
226         No new tests, already covered by existing tests.
227
228         * dom/Document.idl:
229         * dom/GlobalEventHandlers.idl:
230         * page/WindowEventHandlers.idl:
231
232 2016-01-28  Jer Noble  <jer.noble@apple.com>
233
234         Windows build fix; PRId64 formatting macro for int64_t undefined, so provide Windows-specific alternative.
235
236         * platform/network/ParsedContentRange.cpp:
237
238 2016-01-28  ChangSeok Oh  <changseok.oh@collabora.com>
239
240         [ThreadedCompositor] Fix flickers happening on video when entering/leaving fullscreen.
241         https://bugs.webkit.org/show_bug.cgi?id=153585
242
243         Reviewed by Michael Catanzaro.
244
245         Video thumbnail flickers where threaded compositor is enabled. This is because
246         a content buffer is not set to a target layer which changes before swapBuffer.
247         This is a very rare case though, it happens where video size changes many times in a short period.
248
249         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
250         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
251
252 2016-01-27  Jer Noble  <jer.noble@apple.com>
253
254         Allow CachedResourceLoader clients to opt out of the MemoryCache.
255         https://bugs.webkit.org/show_bug.cgi?id=153549
256
257         Reviewed by Darin Adler.
258
259         Add a flag to ResourceLoaderOptions which allow loader clients to opt out of having
260         resources stored in the MemoryCache. 
261
262         * loader/ResourceLoaderOptions.h:
263         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
264         (WebCore::ResourceLoaderOptions::cachingPolicy):
265
266         Existing clients will have to add the (default) AllowCaching flag when they create a
267         ResourceLoaderOptions object.
268
269         * loader/DocumentLoader.cpp:
270         (WebCore::DocumentLoader::startLoadingMainResource):
271         * loader/MediaResourceLoader.cpp:
272         (WebCore::MediaResourceLoader::start):
273         * loader/NetscapePlugInStreamLoader.cpp:
274         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
275         (WebCore::ResourceLoaderOptions::setCachingPolicy):
276         * loader/icon/IconLoader.cpp:
277         (WebCore::IconLoader::startLoading):
278         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
279         (WebCore::WebCoreAVFResourceLoader::startLoading):
280
281         Every time the CachedResource or CachedResourceLoader accesses the MemoryCache, check
282         to see whether the resource or the request have allowed caching before adding resources
283         to, removing resources from, or sourcing resource data from the MemoryCache.
284
285         * loader/cache/CachedResource.cpp:
286         (WebCore::CachedResource::~CachedResource):
287         (WebCore::CachedResource::failBeforeStarting):
288         (WebCore::CachedResource::addClientToSet):
289         (WebCore::CachedResource::removeClient):
290         (WebCore::CachedResource::setDecodedSize):
291         (WebCore::CachedResource::setEncodedSize):
292         (WebCore::CachedResource::didAccessDecodedData):
293         * loader/cache/CachedResource.h:
294         (WebCore::CachedResource::allowsCaching):
295         * loader/cache/CachedResourceLoader.cpp:
296         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
297         (WebCore::CachedResourceLoader::requestResource):
298         (WebCore::CachedResourceLoader::revalidateResource):
299         (WebCore::CachedResourceLoader::loadResource):
300         (WebCore::CachedResourceLoader::printPreloadStats):
301         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
302         * loader/cache/CachedResourceRequest.h:
303         (WebCore::CachedResourceRequest::allowsCaching):
304
305 2016-01-28  Enrica Casucci  <enrica@apple.com>
306
307         Should avoid navigation for some data detector urls.
308         https://bugs.webkit.org/show_bug.cgi?id=153600
309
310         Reviewed by Tim Horton.
311
312         Adding helper function to decide whether the default action should be performed.
313
314         * editing/cocoa/DataDetection.h:
315         * editing/cocoa/DataDetection.mm:
316         (WebCore::DataDetection::shouldCancelDefaultAction):
317
318 2016-01-28  Dave Hyatt  <hyatt@apple.com>
319
320         Roll out r194555, as it introduced some bad regressions and was not
321         correct.
322
323         * rendering/RenderText.cpp:
324         (WebCore::RenderText::computePreferredLogicalWidths):
325
326 2016-01-28  Brady Eidson  <beidson@apple.com>
327
328         Modern IDB: Index uniqueness broken in the SQLite backend.
329         https://bugs.webkit.org/show_bug.cgi?id=153596
330
331         Reviewed by Alex Christensen.
332
333         No new tests (Many failing tests now pass, others improve).
334
335         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
336         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
337         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
338         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
339         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
340         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
341         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
342         (WebCore::IDBServer::SQLiteIDBBackingStore::updateIndexesForAddRecord): Deleted.
343         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
344
345 2016-01-08  Jer Noble  <jer.noble@apple.com>
346
347         Custom protocol loading through AVFoundation does not support byte-range requests.
348         https://bugs.webkit.org/show_bug.cgi?id=152919
349         <rdar://problem/23664657>
350
351         Reviewed by Alex Christensen.
352
353         Tests: http/tests/xmlhttprequest/blob-request-byte-range.html
354                TestWebkitAPI/Tests/WebCore/ParsedContentRange.cpp
355
356         When loading data through the AVAssetResourceLoaderDelegateProtocol, AVFoundation will issue
357         requests for specific byte-ranges by adding a "Range:" HTTP header to the NSURLRequest it
358         passes to the delegate.  WebCore ignores this header, loads the entire resource, and replies
359         to the callback with the requested subset of the entire resource.
360
361         For byte-range requests near the end of a resource, this is inefficient, as the entire
362         resource up to, and including, the requested range must be loaded before any data can be
363         returned. Explicitly handle byte-range requests by creating a CachedResourceRequest with the
364         underlying NSURLRequest (which includes the "Range:" header) rather than just the request's
365         URL. BlobResourceHandle must be modified to add the "Content-Range:" response header to the
366         ResourceResponse. 
367
368         To facilitate both generating and parsing the "Content-Range:" header, add a new
369         ParsedContentRange class for use by ResourceResponse and its clients. This class provides
370         methods both for parsing a "Content-Range" header value string, and for generating the
371         header value from elemental values.
372
373         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
374         (WebCore::WebCoreAVFResourceLoader::startLoading):
375         (WebCore::WebCoreAVFResourceLoader::responseReceived):
376         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
377         * platform/network/BlobResourceHandle.cpp:
378         (WebCore::BlobResourceHandle::BlobResourceHandle):
379         (WebCore::BlobResourceHandle::didGetSize):
380         (WebCore::BlobResourceHandle::seek):
381         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
382         * platform/network/BlobResourceHandle.h:
383         * platform/network/HTTPHeaderNames.in:
384         * platform/network/ParsedContentRange.cpp: Added.
385         (WebCore::areContentRangeValuesValid):
386         (WebCore::parseContentRange):
387         (WebCore::ParsedContentRange::ParsedContentRange):
388         (WebCore::ParsedContentRange::headerValue):
389         * platform/network/ParsedContentRange.h: Added.
390         (WebCore::ParsedContentRange::ParsedContentRange):
391         (WebCore::ParsedContentRange::isValid):
392         (WebCore::ParsedContentRange::firstBytePosition):
393         (WebCore::ParsedContentRange::lastBytePosition):
394         (WebCore::ParsedContentRange::instanceLength):
395         * platform/network/ResourceResponseBase.cpp:
396         (WebCore::ResourceResponseBase::updateHeaderParsedState):
397         (WebCore::parseContentRangeInHeader):
398         (WebCore::ResourceResponseBase::contentRange):
399         * platform/network/ResourceResponseBase.h:
400         * CMakeLists.txt:
401         * WebCore.vcxproj/WebCore.vcxproj:
402         * WebCore.vcxproj/WebCore.vcxproj.filters:
403         * WebCore.xcodeproj/project.pbxproj:
404
405 2016-01-28  Chris Dumez  <cdumez@apple.com>
406
407         Storage interface's attributes / operations should be enumerable
408         https://bugs.webkit.org/show_bug.cgi?id=153573
409
410         Reviewed by Darin Adler.
411
412         Storage interface's attributes / operations should be enumerable:
413         - https://html.spec.whatwg.org/#the-storage-interface
414
415         Firefox matches the specification.
416
417         No new tests, already covered by existing test.
418
419         * storage/Storage.idl:
420
421 2016-01-26  Ada Chan  <adachan@apple.com>
422
423         Get WebVideoFullscreenManager and related classes to also compile for Mac platform
424         with video presentation mode support.
425         https://bugs.webkit.org/show_bug.cgi?id=153221
426
427         Reviewed by Eric Carlson.
428
429         No new tests, no actual behavior change with a stub implementation of WebVideoFullscreenInterfaceMac.
430
431         * WebCore.xcodeproj/project.pbxproj:
432         Add PlatformView.h, WebVideoFullscreenChangeObserver.h, and WebVideoFullscreenInterfaceMac.h.
433
434         * html/HTMLMediaElement.cpp:
435         (WebCore::HTMLMediaElement::HTMLMediaElement):
436         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
437         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
438         * html/HTMLMediaElement.h:
439         Enable the code that deals with the video fullscreen layer also for Mac platform with
440         video presentation mode support.
441
442         * platform/cocoa/PlatformView.h:
443         Header file for declaring the view types for each Cocoa platform.
444
445         * platform/cocoa/WebVideoFullscreenChangeObserver.h:
446         (WebCore::WebVideoFullscreenChangeObserver::~WebVideoFullscreenChangeObserver):
447         Interface declaration moved from WebVideoFullscreenInterfaceAVKit.h.
448
449         * platform/cocoa/WebVideoFullscreenInterface.h:
450         Stop guarding the declaration of WebVideoFullscreenInterface to be iOS specific. It is now
451         enabled for iOS and Mac platform with video presentation mode support.
452
453         * platform/cocoa/WebVideoFullscreenModel.h:
454         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
455         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
456         Enable also for Mac platform with video presentation mode support.
457         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
458         Set the video fullscreen layer's anchor point to (0, 0) since we are not changing the position of
459         the video layer on Mac.
460
461         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
462         Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
463         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
464         Move the declaration of WebVideoFullscreenChangeObserver to a separate header.
465         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
466         Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
467
468         * platform/mac/WebVideoFullscreenInterfaceMac.h: Added.
469         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
470         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
471         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
472         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver):
473         (WebCore::WebVideoFullscreenInterfaceMac::resetMediaState):
474         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
475         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
476         (WebCore::WebVideoFullscreenInterfaceMac::setBufferedTime):
477         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
478         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
479         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
480         (WebCore::WebVideoFullscreenInterfaceMac::setCanPlayFastReverse):
481         (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
482         (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
483         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
484         (WebCore::WebVideoFullscreenInterfaceMac::setWirelessVideoPlaybackDisabled):
485         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
486         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
487         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
488         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
489         (WebCore::WebVideoFullscreenInterfaceMac::invalidate):
490         (WebCore::WebVideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
491         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
492         (WebCore::WebVideoFullscreenInterfaceMac::setMode):
493         (WebCore::WebVideoFullscreenInterfaceMac::clearMode):
494         (WebCore::WebVideoFullscreenInterfaceMac::mayAutomaticallyShowVideoPictureInPicture):
495         (WebCore::WebVideoFullscreenInterfaceMac::applicationDidBecomeActive):
496         (WebCore::supportsPictureInPicture):
497         Add a stub implementation of WebVideoFullscreenInterfaceMac.
498
499 2016-01-28  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
500
501         [SVG] Add support for 'lighter' operator in feComposite
502         https://bugs.webkit.org/show_bug.cgi?id=141376
503
504         Reviewed by Darin Adler.
505
506         Added new cases where needed to support the lighter (aka 'plus')
507         Porter Duff operator in SVG Filter Effects.
508         https://www.w3.org/TR/filter-effects/#valdef-operator-lighter
509         Note that in the specification, no constant was added to the IDL for
510         the lighter operator. 
511
512         Test: svg/filters/feCompositeOpaque.html
513               svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js
514
515         * platform/graphics/filters/FEComposite.cpp:
516         (WebCore::FEComposite::platformApplySoftware):
517           Add case to support lighter.
518         (WebCore::operator<<):
519           Add case to support lighter for text stream operations.
520         * platform/graphics/filters/FEComposite.h:
521           Add case for lighter to CompositeOperationType enum.
522         * svg/SVGFECompositeElement.h:
523         (WebCore::SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue):
524           Higest exposed value is arithmetic - do not expose lighter.
525         (WebCore::SVGPropertyTraits<CompositeOperationType>::highestEnumValue):
526           Highest possible value is now lighter.
527         (WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
528           Add case to support lighter.
529         (WebCore::SVGPropertyTraits<CompositeOperationType>::fromString):
530           Add case to support lighter.
531
532 2016-01-28  Darin Adler  <darin@apple.com>
533
534         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
535         https://bugs.webkit.org/show_bug.cgi?id=153411
536
537         Reviewed by Ryosuke Niwa.
538
539         Tests: fast/media/media-query-non-ASCII-case-folding.html
540                fast/dom/HTMLAnchorElement/anchor-non-ASCII-case-folding.html
541                fast/xpath/xpath-non-ASCII-case-folding.html
542
543         No tests included that cover the minor behavior changes in Document::setDomain,
544         CSPSource::schemeMatches, CSPSource::hostMatches, OriginAccessEntry::operator==,
545         UserContentURLPattern::matches, UserContentURLPattern::matchesHost,
546         ContentFilterUnblockHandler::canHandleRequest. Would like to add tests for those
547         if possible, but it seems clear all are progressions.
548
549         For background on why this is the right thing to do in almost every case:
550
551         - MIME types are all ASCII and not case sensitive (details in RFC 2045)
552           <http://tools.ietf.org/html/rfc2045>
553         - case insensitive comparisons in HTML are all "ASCII case-insensitive"
554           https://www.w3.org/TR/html/infrastructure.html#ascii-case-insensitive
555         - same for CSS
556
557         * Modules/webdatabase/DatabaseAuthorizer.cpp:
558         (WebCore::DatabaseAuthorizer::denyBasedOnTableName): Use equalIgnoringASCIICase.
559         No change in behavior since the string we are comparing with is always
560         "__WebKitDatabaseInfoTable__" in practice.
561
562         * accessibility/AccessibilityNodeObject.cpp:
563         (WebCore::siblingWithAriaRole): Changed argument type to take a const char*,
564         added some FIXMEs and use equalIgnoringCase. No change in behavior since the
565         strings we are comparing with are "menu" and "menuitem".
566         (WebCore::AccessibilityNodeObject::menuElementForMenuButton): Updated to pass
567         arguments in reverse order.
568         (WebCore::AccessibilityNodeObject::menuItemElementForMenu): Ditto.
569
570         * css/CSSParser.cpp:
571         (WebCore::CSSParser::parseFontFaceValue): Use equalIgnoringASCIICase.
572         No change in behavior because the property names are all ASCII constants.
573
574         * css/CSSParserValues.h: Removed unused equalIgnoringCase function.
575
576         * css/MediaQueryEvaluator.cpp:
577         (WebCore::MediaQueryEvaluator::mediaTypeMatch): Use equalIgnoringASCIICase.
578         Changes behavior: No non-ASCII case folding when matching media types.
579         Covered by new test.
580         (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific): Use equalIgnoringASCIICase.
581         No change in behavior since the only string this is ever called with is "print".
582
583         * dom/DataTransfer.cpp:
584         (WebCore::DataTransfer::hasFileOfType): Use equalIgnoringASCIICase.
585         No change in behavior because local files will not have content types with
586         non-ASCII characters in them. In the extremely unlikely case that this is incorrect,
587         the change in behavior is a progression.
588
589         * dom/Document.cpp:
590         (WebCore::Document::setDomain): Use equalIgnoringASCIICase.
591         Changes behavior: Domains considered equal because of non-ASCII case folding
592         would get through without an error before, and now will properly throw an exception.
593
594         * dom/Element.cpp:
595         (WebCore::isStyleAttribute): Refactored into a helper function. Use
596         equalLettersIgnoringASCIICase. No change in behavior.
597         (WebCore::Element::synchronizeAttribute): Use isStyleAttribute.
598
599         * dom/TreeScope.cpp:
600         (WebCore::TreeScope::findAnchor): Use equalIgnoringASCIICase.
601         Changes behavior: Could go to an anchor and it would be considered a match because
602         of non-ASCII case folding. Covered by new test.
603
604         * html/HiddenInputType.cpp:
605         (WebCore::HiddenInputType::appendFormData): Use equalIgnoringASCIICase.
606         No change in behavior: comparing with an ASCII literal.
607         * html/canvas/WebGL2RenderingContext.cpp:
608         (WebCore::WebGL2RenderingContext::getExtension): Ditto.
609         * html/canvas/WebGLRenderingContext.cpp:
610         (WebCore::WebGLRenderingContext::getExtension): Ditto.
611
612         * html/parser/CSSPreloadScanner.cpp:
613         (WebCore::CSSPreloadScanner::emitRule): Use equalLettersIgnoringASCIICase and
614         StringView to avoid needing a special ruleEqualIgnoringCase function.
615         No change in behavior.
616
617         * inspector/InspectorNodeFinder.cpp:
618         (WebCore::InspectorNodeFinder::matchesElement): Use equalIgnoringASCIICase.
619         Changes behavior, but it's an inspector UI thing, not a web behavior thing,
620         so I don't think a new regression test is needed.
621
622         * loader/HistoryController.cpp:
623         (WebCore::HistoryController::currentItemShouldBeReplaced): Use
624         equalIgnoringASCIICase. No change in behavior because we are comparing
625         with "about:blank".
626
627         * loader/SubframeLoader.cpp:
628         (WebCore::findPluginMIMETypeFromURL): Use equalIgnoringASCIICase.
629         No change in behavior unless a plug-in claims an extension with non-ASCII
630         characters. I don't think a new regression test is needed.
631
632         * loader/appcache/ApplicationCacheHost.cpp:
633         (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
634         Use equalIgnoringASCIICase. No change in behavior because both strings are
635         protocols from URLs and we don't parse non-ASCII characters into protocol strings;
636         non-ASCII are already encoding as punycode.
637         * loader/appcache/ManifestParser.cpp:
638         (WebCore::parseManifest): Ditto.
639
640         * page/ContentSecurityPolicy.cpp:
641         (WebCore::isExperimentalDirectiveName): Added. Used by isDirectiveName.
642         Uses equalLettersIgnoringASCIICase. No change in behavior.
643         (WebCore::isDirectiveName): Use equalLettersIgnoringASCIICase.
644         No change in behavior.
645         (WebCore::isSourceListNone): Use equalLettersIgnoringASCIICase. No
646         change in behavior.
647         (WebCore::CSPSource::schemeMatches): Use equalLettersIgnoringASCIICase
648         and equalIgnoringASCIICase. It's all about comparing URL protocols. The
649         old code might have done something strange if someone specified a protocol
650         with a non-ASCII character in it.
651         (WebCore::CSPSource::hostMatches): Use equalIgnoringASCIICase.
652         (WebCore::CSPSourceList::parseSource): Use equalLettersIgnoringASCIICase.
653         No change in behavior.
654         (WebCore::CSPDirectiveList::checkSourceAndReportViolation): Tweaked code
655         to do less unnecessary String allocation.
656         (WebCore::CSPDirectiveList::parseReflectedXSS): Use
657         equalLettersIgnoringASCIICase. No change in behavior.
658         (WebCore::CSPDirectiveList::addDirective): Ditto.
659         (WebCore::ContentSecurityPolicy::reportUnsupportedDirective): Use
660         equalLettersIgnoringASCIICase and remove unneeded global constant strings.
661         No change in behavior.
662         (WebCore::ContentSecurityPolicy::reportDirectiveAsSourceExpression):
663         Tweak code to eliminate unneeded local.
664         (WebCore::ContentSecurityPolicy::reportDuplicateDirective): Ditto.
665         (WebCore::ContentSecurityPolicy::reportInvalidSourceExpression): Use
666         equalLettersIgnoringASCIICase. No change in behavior.
667
668         * page/OriginAccessEntry.h:
669         (WebCore::operator==): Use equalLettersIgnoringASCIICase.
670
671         * page/Performance.cpp:
672         (WebCore::Performance::webkitGetEntriesByName): Use equalLettersIgnoringASCIICase.
673         No change in behavior.
674
675         * page/UserContentURLPattern.cpp:
676         (WebCore::UserContentURLPattern::matches): Use equalIgnoringASCIICase to match
677         schemes.
678         (WebCore::UserContentURLPattern::matchesHost): Use equalIgnoringASCIICase to
679         match host names.
680
681         * platform/URL.cpp:
682         (WebCore::URL::init): Use equalIgnoringASCIICase, and also use StringView to
683         avoid having to allocate a second string just for comparison purposes. Should be
684         better for efficiency with no change in behavior.
685
686         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
687         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Use equalIgnoringASCIICase
688         to compare hosts.
689
690         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
691         (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName): Use StringView and
692         equalIgnoringASCIICase to compare language tags. No test needed because there are
693         no language tags with non-ASCII characters in them.
694
695         * platform/graphics/FontCache.cpp:
696         (WebCore::FontPlatformDataCacheKey::operator==): Changed to use the equal
697         function from CaseFoldingHash. In a subsequent patch we will change this to be
698         ASCIICaseFoldingHash since font names don't need to compare non-ASCII characters
699         in a case folding manner, but for now preserve behavior.
700         (WebCore::alternateFamilyName): Use equalLettersIgnoringASCIICase to avoid having
701         to use a special familyNameEqualIgnoringCase function. This does mean there will
702         be a null check and a length check that wasn't there before, but the actual
703         comparison function will be tighter. Guessing it will be a wash. Also improved
704         the comments and sorted the Windows cases in with the others. No behavior change.
705
706         * platform/graphics/FontCascade.cpp:
707         (WebCore::operator==): Changed to use the equal function from CaseFoldingHash.
708         Same rationale as above in FontPlatformDataCacheKey.
709
710         * platform/graphics/FontDescription.cpp:
711         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
712         equalIgnoringASCIICase to compare font family names. Only possible change in
713         behavior would be if actual fonts with non-ASCII names but that were specified
714         with different case in style sheets. Highly unlikely this exists.
715
716         * platform/graphics/MediaPlayer.cpp:
717         (WebCore::MediaPlayer::supportsType): Use equalLettersIgnoringASCIICase.
718         No change in behavior.
719         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
720         (WebCore::keySystemIsSupported): Ditto.
721
722         * platform/graphics/freetype/FontCacheFreeType.cpp:
723         (WebCore::isCommonlyUsedGenericFamily): Added.
724         (WebCore::FontCache::createFontPlatformData): Moved code into the
725         isCommonlyUsedGenericFamily helper and used equalIgnoringASCIICase.
726
727         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
728         (WebCore::FontCustomPlatformData::supportsFormat): Use
729         equalLettersIgnoringASCIICase. No change in behavior.
730         * platform/graphics/win/FontCacheWin.cpp:
731         (WebCore::adjustedGDIFontWeight): Ditto.
732         (WebCore::FontCache::createFontPlatformData): Ditto.
733         * platform/graphics/win/FontCustomPlatformData.cpp:
734         (WebCore::FontCustomPlatformData::supportsFormat): Ditto.
735         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
736         (WebCore::FontCustomPlatformData::supportsFormat): Ditto.
737
738         * platform/mac/PlatformSpeechSynthesizerMac.mm:
739         (-[WebSpeechSynthesisWrapper speakUtterance:]): Use equalIgnoringASCIICase to
740         compare languages. No change in behavior because languages have all-ASCII names.
741
742         * platform/network/CacheValidation.cpp:
743         (WebCore::shouldUpdateHeaderAfterRevalidation): Use equalIgnoringASCIICase.
744         No change in behavior since it's a fixed list of all ASCII headers.
745         * platform/network/curl/ResourceHandleManager.cpp:
746         (WebCore::isAppendableHeader): Ditto.
747
748         * platform/network/mac/ResourceHandleMac.mm:
749         (WebCore::ResourceHandle::willSendRequest): Use equalIgnoringASCIICase.
750         No change in behavior because HTTP methods are all ASCII letters.
751
752         * platform/text/mac/LocaleMac.mm:
753         (WebCore::determineLocale): Use equalIgnoringASCIICase. No change in behavior
754         because locale languages identifiers are all ASCII.
755         * platform/text/win/LocaleWin.cpp:
756         (WebCore::LCIDFromLocaleInternal): Ditto.
757
758         * svg/SVGToOTFFontConversion.cpp:
759         (WebCore::SVGToOTFFontConverter::appendArabicReplacementSubtable):
760         Use equalIgnoringASCIICase. No change in behavior because Arabic form attribute
761         values are all ASCII.
762
763         * xml/XMLHttpRequest.cpp:
764         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Use equalIgnoringASCIICase.
765         No change in behavior because these are all fixed known ASCII HTTP method names.
766
767         * xml/XPathFunctions.cpp:
768         (WebCore::XPath::FunLang::evaluate): Use equalIgnoringASCIICase. Changes behavior
769         if specifying a non-ASCII character. Covered by new test.
770
771         * xml/XPathStep.cpp:
772         (WebCore::XPath::nodeMatchesBasicTest): Use equalIgnoringASCIICase. Changes
773         behavior if an element local name or XPath predicate has a non-ASCII character.
774         Covered by new test.
775
776 2016-01-28  Zalan Bujtas  <zalan@apple.com>
777
778         Unexpected content wrapping at http://email.osh.com/H/2/v100000152474feb8ec7c1a1f4bbe5c7c0/HTML
779         https://bugs.webkit.org/show_bug.cgi?id=153430
780
781         Reviewed by Simon Fraser.
782
783         Ensure that min/max preferred and computed widths never shrink while converting LayoutUnit to float and back.
784
785         Test: fast/table/fixed-size-table-with-fixed-size-content.html
786
787         * rendering/AutoTableLayout.cpp:
788         (WebCore::AutoTableLayout::recalcColumn):
789         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
790         (WebCore::AutoTableLayout::layout):
791         * rendering/RenderBlock.cpp:
792         (WebCore::RenderBlock::computePreferredLogicalWidths): Deleted.
793
794 2016-01-28  Gwang Yoon Hwang  <yoon@igalia.com>
795
796         [GStreamer] Clean up includes and headers related with GStreamerGL
797         https://bugs.webkit.org/show_bug.cgi?id=153590
798
799         Reviewed by Philippe Normand.
800
801         Remove gstglmemory from the including list and reorder includes to
802         organize GSTREAMER_GL related headers. It violates style rules of the
803         include order, but there is no clean way to include gst/gl/gl.h
804         without violating it.
805
806         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
807         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
808
809 2016-01-28  Gwang Yoon Hwang  <yoon@igalia.com>
810
811         [GStreamer] MediaPlayerPrivateGStreamerBase::handleSyncMessage leaks GstContext
812         https://bugs.webkit.org/show_bug.cgi?id=153580
813
814         Reviewed by Philippe Normand.
815
816         When we creates GstContext using gst_context_new it increases refcount itself.
817         And the refcount of GstContext is increased when it is passed to
818         gst_element_set_context, also. Therefore We should unref GstContext after
819         using it to prevent GstContext leaks.
820
821         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
822         (WTF::adoptGRef): Added for GstContext.
823         (WTF::refGPtr<GstContext>): Ditto
824         (WTF::derefGPtr<GstContext>): Ditto
825         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
826         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
827         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
828         Use GRefPtr<GstContext> to handle currect refcounting
829
830 2016-01-27  Alex Christensen  <achristensen@webkit.org>
831
832         Fix clean CMake build after r195711.
833
834         * PlatformWin.cmake:
835         Copy forwarding headers from the new directory to find ContentSecurityPolicy.h.
836         This should fix EWS issues like the one seen in bug 153573.
837
838 2016-01-27  Chris Dumez  <cdumez@apple.com>
839
840         Expose ValidityState on the global Window object
841         https://bugs.webkit.org/show_bug.cgi?id=153582
842
843         Reviewed by Antti Koivisto.
844
845         Expose ValidityState on the global Window object:
846         https://html.spec.whatwg.org/#validitystate
847
848         Firefox and Chrome match the specification.
849
850         No new tests, already covered by existing tests.
851
852         * html/ValidityState.idl:
853
854 2016-01-27  Chris Dumez  <cdumez@apple.com>
855
856         Expose ApplicationCache on the global Window object
857         https://bugs.webkit.org/show_bug.cgi?id=153578
858
859         Reviewed by Antti Koivisto.
860
861         Expose ApplicationCache on the global Window object as per:
862         https://html.spec.whatwg.org/#the-storage-interface
863
864         Chrome follows the spec.
865
866         No new tests, already covered by existing test.
867
868         * loader/appcache/DOMApplicationCache.idl:
869
870 2016-01-27  Ryosuke Niwa  <rniwa@webkit.org>
871
872         REGRESSION(r190430): Assertion failure in Text::~Text()
873         https://bugs.webkit.org/show_bug.cgi?id=153577
874
875         Reviewed by Antti Koivisto.
876
877         The bug was caused by destroyRenderTreeIfNeeded exiting early on all HTMLSlotElement as it lacks a render object.
878         Fixed it by explicitly avoiding the early return when child is a HTMLSlotElement.
879
880         Test: fast/shadow-dom/slot-removal-crash-2.html
881
882         * dom/ContainerNode.cpp:
883         (WebCore::destroyRenderTreeIfNeeded):
884
885 2016-01-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
886
887         Garbage is displayed when root svg element has mix-blend-mode set
888         https://bugs.webkit.org/show_bug.cgi?id=150556
889
890         Reviewed by Darin Adler.
891
892         This bug happens when compositing on a CALayer and drawing on a transparent
893         layer, so it happens with WK2 with <svg style="mix-blend-mode...">. And it
894         can happen with WK1 also with <svg style="opacity=...;mix-blend-mode...">.
895         But in both cases, the SVG root renderer should be the root of the render
896         tree. So it happens only with the stand alone SVG documents.
897
898         SVGRenderContext::prepareToRenderSVGContent() ignores the opacity of
899         the SVG root but it creates a transparent layer for the blend-mode.
900
901         But RenderLayer::beginTransparencyLayers() creates a transparent layer
902         for opacity and it sets the blend-mode also.
903
904         The fix is to begin two transparent layers for the SVG root renderer: one
905         for the opacity and the second for the blend-mode. The opacity transparent
906         layer will be still managed by RenderLayer::beginTransparencyLayers(). While
907         the blend-mode transparent layer will be managed by SVGRenderContext
908         ::prepareToRenderSVGContent().
909
910         Tests: svg/css/mix-blend-mode-background-root.svg
911                svg/css/mix-blend-mode-opacity-root.svg
912
913         * rendering/RenderLayer.cpp:
914         (WebCore::RenderLayer::beginTransparencyLayers):
915
916 2016-01-27  Enrica Casucci  <enrica@apple.com>
917
918         Cache results of data detection in the UI process when load completes.
919         https://bugs.webkit.org/show_bug.cgi?id=153560
920
921         Reviewed by Tim Horton.
922
923         Adding new FrameLoaderClient method to notify that data
924         detection is complete and provide the results.
925
926         * loader/EmptyClients.h:
927         * loader/FrameLoader.cpp:
928         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
929         * loader/FrameLoaderClient.h:
930
931 2016-01-27  Daniel Bates  <dabates@apple.com>
932
933         Move ContentSecurityPolicy.{cpp, h} to its own directory
934         https://bugs.webkit.org/show_bug.cgi?id=153527
935         <rdar://problem/24359892>
936
937         Reviewed by Sam Weinig.
938
939         Move ContentSecurityPolicy.{cpp, h} from Source/WebCore/page to Source/WebCore/page/csp.
940         This will facilitate separating out the policy support classes (e.g. CSPDirectiveList)
941         into their own files to improve the hackability of this code.
942
943         * CMakeLists.txt:
944         * WebCore.vcxproj/WebCore.vcxproj:
945         * WebCore.vcxproj/WebCore.vcxproj.filters:
946         * WebCore.xcodeproj/project.pbxproj:
947         * page/csp/ContentSecurityPolicy.cpp: Renamed from Source/WebCore/page/ContentSecurityPolicy.cpp.
948         * page/csp/ContentSecurityPolicy.h: Renamed from Source/WebCore/page/ContentSecurityPolicy.h.
949
950 2016-01-27  Brady Eidson  <beidson@apple.com>
951
952         Modern IDB: Incorrect handling of iterating cursors to their end.
953         https://bugs.webkit.org/show_bug.cgi?id=153569
954
955         Reviewed by Alex Christensen.
956
957         No new tests (3 tests now pass, others are closer to passing).
958
959         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
960         (WebCore::IDBServer::SQLiteIDBCursor::advance):
961         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
962
963 2016-01-27  Nan Wang  <n_wang@apple.com>
964
965         AX: Crash in AccessibilityTableColumn::headerObject
966         https://bugs.webkit.org/show_bug.cgi?id=153553
967         <rdar://problem/23196278>
968
969         Reviewed by Chris Fleizach.
970
971         Webkit was crashing sometimes when we asked for column headers of a table.
972         The columns vector of the table was reset during the iteration when we
973         were asking for the headerObject of each column. The column's addChildren()
974         function calls elementRect() for each child cell and that sometimes causes 
975         the parent table to reset its children.
976         Fixed it by caching the columns vector and moving out the elementRect() logic
977         from AccessibilityTalbeColumn::addChildren().  
978
979         * accessibility/AccessibilityTable.cpp:
980         (WebCore::AccessibilityTable::columnHeaders):
981         (WebCore::AccessibilityTable::rowHeaders):
982         * accessibility/AccessibilityTableColumn.cpp:
983         (WebCore::AccessibilityTableColumn::elementRect):
984         (WebCore::AccessibilityTableColumn::headerObject):
985         (WebCore::AccessibilityTableColumn::addChildren):
986         * accessibility/AccessibilityTableColumn.h:
987
988 2016-01-27  Chris Dumez  <cdumez@apple.com>
989
990         Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
991         https://bugs.webkit.org/show_bug.cgi?id=153504
992         <rdar://problem/24353072>
993
994         Reviewed by Ryosuke Niwa.
995
996         Settings a reflected DOMString attribute to null should set it to the "null"
997         string rather than the empty string:
998         - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
999         - http://heycam.github.io/webidl/#es-DOMString
1000         - http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
1001
1002         Firefox and Chrome match the specification here.
1003
1004         This is causing a lot of W3C HTML reflection tests to fail on WebKit, e.g.:
1005         - http://w3c-test.org/html/dom/reflection-text.html
1006
1007         No new tests, already covered by existing tests.
1008
1009         * bindings/scripts/CodeGeneratorJS.pm:
1010         (JSValueToNative):
1011         Call toString() instead of valueToStringWithNullCheck() for reflected
1012         attributes. This way, null gets converted to the string "null", as
1013         expected, instead of a null String object.
1014
1015         * html/HTMLInputElement.idl:
1016         Dropping [TreatNullAs=NullString] IDL extended attribute for
1017         input.defaultValue, as this is not present in the specification:
1018         - https://html.spec.whatwg.org/#htmlinputelement
1019
1020         Without this change, assigning null to input.defaultValue would not
1021         set to to the "null" string, as is expected.
1022
1023         * html/HTMLTextAreaElement.idl:
1024         Dropping [TreatNullAs=NullString] IDL extended attribute for
1025         textArea.defaultValue, as this is not present in the specification:
1026         - https://html.spec.whatwg.org/#htmltextareaelement
1027
1028         Without this change, assigning null to textArea.defaultValue would not
1029         set to to the "null" string, as is expected.
1030
1031         * html/HTMLTitleElement.idl:
1032         Dropping [TreatNullAs=NullString] IDL extended attribute for
1033         title.text, as this is not present in the specification:
1034         - https://html.spec.whatwg.org/#htmltitleelement
1035
1036         Without this change, assigning null to title.text would not
1037         set to to the "null" string, as is expected.
1038
1039 2016-01-27  Simon Fraser  <simon.fraser@apple.com>
1040
1041         Support CSS3 Images values for the image-rendering property
1042         https://bugs.webkit.org/show_bug.cgi?id=153556
1043
1044         Reviewed by Dean Jackson.
1045
1046         CSS3 Images has the following values for image-rendering:
1047             auto, crisp-edges, pixelated
1048
1049         The old code supported:
1050             optimizeSpeed, optimizeQuality, -webkit-crisp-edges, -webkit-optimize-contrast
1051
1052         Add support for the new values without prefixes. Map -webkit-crisp-edges to crisp-edges,
1053         and -webkit-optimize-contrast to crisp-edges. Support pixelated which behaves like 
1054         crisp-edges (a low quality scale).
1055
1056         The spec says that optimizeQuality should behave like 'auto', but that would be
1057         a behavior change since ImageQualityController::shouldPaintAtLowQuality() currently
1058         uses it as a trigger to avoid low quality scaling, so don't change that for now.
1059
1060         No new tests, covered by fast/css/script-tests/image-rendering-parsing.js
1061
1062         * css/CSSParser.cpp:
1063         (WebCore::isValidKeywordPropertyAndValue):
1064         * css/CSSPrimitiveValueMappings.h:
1065         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1066         (WebCore::CSSPrimitiveValue::operator EImageRendering):
1067         * css/CSSValueKeywords.in:
1068         * rendering/ImageQualityController.cpp:
1069         (WebCore::ImageQualityController::shouldPaintAtLowQuality):
1070         * rendering/RenderHTMLCanvas.cpp:
1071         (WebCore::RenderHTMLCanvas::paintReplaced):
1072         * rendering/style/RenderStyleConstants.h:
1073         * rendering/style/StyleRareInheritedData.h: Need another bit.
1074
1075 2016-01-27  Anders Carlsson  <andersca@apple.com>
1076
1077         Add WebKitAdditions extension points to WebCore, WebKit and WebKitLegacy
1078         https://bugs.webkit.org/show_bug.cgi?id=153550
1079
1080         Reviewed by Sam Weinig.
1081
1082         * DerivedSources.make:
1083         Add the ability for WebKitAdditions to add events and event targets.
1084
1085         * WebCore.xcodeproj/project.pbxproj:
1086         Add new files.
1087
1088         * bindings/scripts/InFilesCompiler.pm:
1089         (initializeFromCommandLine):
1090         (compile):
1091         Handle multiple --input parameters.
1092
1093         * dom/EventNames.h:
1094         Handle adding more event names.
1095
1096         * loader/EmptyClients.cpp:
1097         (WebCore::fillWithEmptyClients):
1098         * page/MainFrame.cpp:
1099         (WebCore::MainFrame::MainFrame):
1100         * page/MainFrame.h:
1101         * page/PageConfiguration.h:
1102         Add extension points.
1103
1104         * platform/cocoa/WebKitAdditions.mm: Added.
1105         Import additions.
1106
1107 2016-01-27  Brady Eidson  <beidson@apple.com>
1108
1109         Modern IDB: Fix many Index tests.
1110         https://bugs.webkit.org/show_bug.cgi?id=153561
1111
1112         Reviewed by Alex Christensen.
1113
1114         No new tests (Many failing tests now pass).
1115
1116         * Modules/indexeddb/server/MemoryIndex.cpp:
1117         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange):
1118         
1119         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1120         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1121         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1122         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1123         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1124         
1125         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1126         (WebCore::IDBServer::SQLiteIDBCursor::didComplete):
1127
1128 2016-01-27  Brady Eidson  <beidson@apple.com>
1129
1130         Modern IDB: Cursors are utterly broken in the SQLite backend.
1131         https://bugs.webkit.org/show_bug.cgi?id=153558
1132
1133         Reviewed by Alex Christensen.
1134
1135         No new tests (35 failures now pass, others improve).
1136
1137         - Fixes incorrect usage of Index cursors when ObjectStore cursors are intended.
1138         - Improves the state of getting the cursor value vs. reaching the end of a cursor.
1139
1140         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1141         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1142         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1143
1144         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1145         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1146         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1147         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1148
1149 2016-01-27  Chris Dumez  <cdumez@apple.com>
1150
1151         Getting / Setting property on prototype object must throw TypeError
1152         https://bugs.webkit.org/show_bug.cgi?id=153547
1153         <rdar://problem/24370650>
1154
1155         Reviewed by Ryosuke Niwa.
1156
1157         Gettingi / Setting property on prototype object must throw TypeError as per
1158         Web IDL specification:
1159         http://heycam.github.io/webidl/#dfn-attribute-getter (Step 2.4.2)
1160         http://heycam.github.io/webidl/#dfn-attribute-setter (Step 3.5)
1161
1162         Firefox and Chrome already throw a TypeError in this case, as per
1163         the specification. However, WebKit was returning null and merely
1164         logging a deprecation error message. This patch aligns our behavior
1165         with other browsers and the specification.
1166
1167         This patch also adds support for the [LenientThis] IDL extended
1168         attribute:
1169         http://heycam.github.io/webidl/#LenientThis
1170
1171         For [LenientThis] attributes, we do not throw a TypeError if the
1172         attribute getter / setter is called on an object which does not
1173         implement the expected interface, as per:
1174         http://heycam.github.io/webidl/#dfn-attribute-getter (Step 2.4.1)
1175         http://heycam.github.io/webidl/#dfn-attribute-setter (Step 3.5)
1176
1177         No new tests, already covered by existing tests.
1178
1179         * bindings/scripts/CodeGeneratorJS.pm:
1180         (GenerateImplementation):
1181         * bindings/scripts/IDLAttributes.txt:
1182         Add support for [LenientThis]:
1183         http://heycam.github.io/webidl/#LenientThis
1184
1185         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1186         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1187         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1188         * bindings/scripts/test/JS/JSTestInterface.cpp:
1189         * bindings/scripts/test/JS/JSTestNode.cpp:
1190         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1191         * bindings/scripts/test/JS/JSTestObj.cpp:
1192         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1193         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1194         * bindings/scripts/test/JS/JSattribute.cpp:
1195         * bindings/scripts/test/ObjC/DOMTestObj.h:
1196         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1197         Rebaseline bindings tests.
1198
1199         * bindings/scripts/test/TestObj.idl:
1200         Add coverage for [LenientThis] attributes.
1201
1202         * dom/Document.idl:
1203         Mark 'onreadystatechange' as [LenientThis] as per the HTML
1204         specification:
1205         https://html.spec.whatwg.org/#document
1206
1207         * dom/GlobalEventHandlers.idl:
1208         Mark 'onmouseeneter' / 'onmouseleave' as [LenientThis] as per the
1209         HTML specification:
1210         https://html.spec.whatwg.org/#globaleventhandlers
1211
1212 2016-01-27  Chris Dumez  <cdumez@apple.com>
1213
1214         window.atob() should ignore spaces in input
1215         https://bugs.webkit.org/show_bug.cgi?id=153522
1216         <rdar://problem/24357822>
1217
1218         Reviewed by Benjamin Poulain.
1219
1220         window.atob() should ignore spaces in input as per:
1221         - https://html.spec.whatwg.org/#dom-windowbase64-atob (Step 3)
1222
1223         Previously, WebKit would throw an exception and it was the only browser
1224         to do so. Firefox and Chrome behavior according to the specification.
1225
1226         This was causing us to fail 10 checks in the following W3C HTML test:
1227         http://w3c-test.org/html/webappapis/atob/base64.html
1228
1229         No new tests, updated existing test.
1230
1231         * page/DOMWindow.cpp:
1232         (WebCore::DOMWindow::atob):
1233         * page/Page.cpp:
1234         (WebCore::Page::userStyleSheetLocationChanged):
1235         * platform/network/DataURL.cpp:
1236         (WebCore::handleDataURL):
1237         * platform/network/DataURLDecoder.cpp:
1238         (WebCore::DataURLDecoder::decodeBase64):
1239
1240 2016-01-27  Ada Chan  <adachan@apple.com>
1241
1242         Move some logic related to the presentation mode button from mediaControlsiOS.js to mediaControlsApple.js
1243         https://bugs.webkit.org/show_bug.cgi?id=153476
1244
1245         Reviewed by Eric Carlson.
1246
1247         Also, add the necessary styles to support that control in mediaControlsApple.css.
1248
1249         * Modules/mediacontrols/mediaControlsApple.css:
1250         (video::-webkit-media-controls-panel.picture-in-picture):
1251         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
1252         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
1253         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
1254         (video::-webkit-media-controls-panel .picture-in-picture-button):
1255         Use the same mask image as iOS, but with a different size and a background color specified
1256         (since there's another rule that makes buttons within the panel have a transparent
1257         background color).
1258         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
1259
1260         * Modules/mediacontrols/mediaControlsApple.js:
1261         (Controller.prototype.addVideoListeners):
1262         (Controller.prototype.removeVideoListeners):
1263         Listen for (and stop listening for) the webkitpresentationmodechanged event if presentation
1264         mode is supported for this video element.
1265         (Controller.prototype.createControls):
1266         Add a class name to the pictureInPictureButton so we can query for it in the stylesheet.
1267         (Controller.prototype.configureInlineControls):
1268         Call updatePictureInPictureButton().
1269         (Controller.prototype.presentationMode):
1270         Moved from mediaControlsiOS.js.
1271         (Controller.prototype.isFullScreen):
1272         Ditto, with a bug fix to not call presentationMode(), since that method calls isFullScreen(),
1273         resulting in infinite recursion.
1274         (Controller.prototype.updatePictureInPictureButton):
1275         Ditto.
1276         (Controller.prototype.handlePresentationModeChange):
1277         Ditto.
1278         (Controller.prototype.handleFullscreenChange):
1279         Call handlePresentationModeChanged() if presentation mode is supported for this video element.
1280         (Controller.prototype.controlsAlwaysVisible):
1281         Ditto.
1282         (Controller.prototype.handlePictureInPictureButtonClicked):
1283         Ditto.
1284         * Modules/mediacontrols/mediaControlsiOS.js:
1285         (ControllerIOS.prototype.handlePresentationModeChange):
1286         Most logic has been moved to the same method in mediaControlsApple.js, except
1287         updating the style of the panelContainer, which doesn't exist in the Mac controls.
1288         (ControllerIOS.prototype.addVideoListeners): Deleted.
1289         (ControllerIOS.prototype.removeVideoListeners): Deleted.
1290         (ControllerIOS.prototype.presentationMode): Deleted.
1291         (ControllerIOS.prototype.isFullScreen): Deleted.
1292         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Deleted.
1293         (ControllerIOS.prototype.updatePictureInPictureButton): Deleted.
1294         (ControllerIOS.prototype.handleFullscreenChange): Deleted.
1295         (ControllerIOS.prototype.controlsAlwaysVisible): Deleted.
1296         Delete all code that's already handled in the Controller.
1297
1298 2016-01-26  Ada Chan  <adachan@apple.com>
1299
1300         Enable API related to the video fullscreen layer in MediaPlayerPrivateMediaSourceAVFObjC
1301         also on Mac platform with video presentation mode support.
1302         https://bugs.webkit.org/show_bug.cgi?id=153223
1303
1304         Reviewed by Jer Noble.
1305
1306         Reuse VideoFullscreenLayerManager to manage moving the video layer between the fullscreen
1307         layer and the inline layer depending on the current presentation mode.
1308
1309         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1310         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1311         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1312         Create m_videoFullscreenLayerManager.
1313         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer):
1314         Return the video inline layer from the VideoFullscreenLayerManager.
1315         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer):
1316         Call VideoFullscreenLayerManager::setVideoLayer() with the m_sampleBufferDisplayLayer.
1317         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer):
1318         Call VideoFullscreenLayerManager::didDestroyVideoLayer().
1319         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
1320         Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
1321         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
1322         Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
1323
1324 2016-01-27  Brady Eidson  <beidson@apple.com>
1325
1326         Modern IDB: SQLite backend doesn't update index records as object records are added.
1327         https://bugs.webkit.org/show_bug.cgi?id=153548
1328
1329         Reviewed by Alex Christensen.
1330
1331         No new tests (4 more tests pass, others improve).
1332
1333         * Modules/indexeddb/server/IDBBackingStore.h:
1334         
1335         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1336         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
1337         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1338         
1339         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1340         (WebCore::IDBServer::SQLiteIDBBackingStore::initializeVM):
1341         (WebCore::IDBServer::SQLiteIDBBackingStore::vm):
1342         (WebCore::IDBServer::SQLiteIDBBackingStore::globalObject):
1343         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1344         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1345         (WebCore::IDBServer::SQLiteIDBBackingStore::updateIndexesForAddRecord):
1346         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1347         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1348         
1349         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1350         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1351         
1352         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1353
1354 2016-01-27  Ryosuke Niwa  <rniwa@webkit.org>
1355
1356         Add API to access closed shadowRoot in InjectedBundle
1357         https://bugs.webkit.org/show_bug.cgi?id=153533
1358
1359         Reviewed by Antti Koivisto.
1360
1361         Always return the shadow root in Element.shadowRootForBindings when the DOM wrapper world has
1362         shadowRootIsAlwaysOpen set to true. Also renamed bindingShadowRoot to shadowRootForBindings
1363         to be consistent.
1364
1365         * bindings/js/DOMWrapperWorld.h:
1366         (WebCore::DOMWrapperWorld::setShadowRootIsAlwaysOpen): Added.
1367         (WebCore::DOMWrapperWorld::shadowRootIsAlwaysOpen): Added.
1368         * dom/Element.cpp:
1369         (WebCore::Element::shadowRootForBindings): Renamed from bindingShadowRoot.
1370         * dom/Element.h:
1371         * dom/Element.idl:
1372
1373 2016-01-27  Zhuo Li  <zachli@apple.com>
1374
1375         Need ability to specify alternate image for AutoFill button in input fields.
1376         https://bugs.webkit.org/show_bug.cgi?id=153116.
1377         rdar://problem/23384854.
1378
1379         Reviewed by Darin Adler.
1380
1381         Add a new AutoFill button that can be shown in <input> elements.
1382
1383         Tests: fast/forms/auto-fill-button/input-contacts-auto-fill-button.html
1384                fast/forms/auto-fill-button/show-correct-auto-fill-button-when-auto-fill-button-type-changes.html
1385
1386         * css/html.css:
1387         (input::-webkit-contacts-auto-fill-button):
1388         (input::-webkit-contacts-auto-fill-button:hover):
1389         (input::-webkit-contacts-auto-fill-button:active):
1390         Add default style rules for the Contacts AutoFill button based on the ones used for
1391         Manual AutoFill button.
1392
1393         * html/HTMLInputElement.cpp:
1394         (WebCore::HTMLInputElement::setShowAutoFillButton):
1395         * html/HTMLInputElement.h:
1396         (WebCore::HTMLInputElement::autoFillButtonType):
1397         - Replace the boolean parameter with a new parameter to specify the type of the AutoFill button.
1398         - Declare a private variable to keep a record of the type of the current AutoFill
1399         button.
1400         (WebCore::HTMLInputElement::showAutoFillButton): Deleted.
1401
1402         * html/HTMLTextFormControlElement.h:
1403         Declare enum for AutoFill button type.
1404
1405         * html/TextFieldInputType.cpp:
1406         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
1407         (WebCore::isAutoFillButtonTypeChanged):
1408         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): None means the AutoFill button is not
1409         enabled.
1410         (WebCore::TextFieldInputType::createAutoFillButton): Only create the AutoFill button
1411         if the type is expected.
1412         (WebCore::TextFieldInputType::updateAutoFillButton):
1413         Handle the case where AutoFill button type changes in the text field.
1414         * html/TextFieldInputType.h:
1415
1416         * testing/Internals.cpp:
1417         (WebCore::stringToAutoFillButtonType): Convert the string to AutoFill button type.
1418         (WebCore::Internals::setShowAutoFillButton): Add a new parameter to specify the type of the AutoFill button.
1419         * testing/Internals.h: Ditto.
1420         * testing/Internals.idl: Ditto.
1421
1422 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
1423
1424         Add Node.treeRoot
1425         https://bugs.webkit.org/show_bug.cgi?id=153537
1426
1427         Reviewed by Antti Koivisto.
1428
1429         Exposed highestAncestor as Node.prototype.treeRoot, which was added to shadow DOM spec in
1430         https://github.com/w3c/webcomponents/commit/6864a40fe4efa8a737e78512e3c85319ddc5bf8b
1431
1432         See also:
1433         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-node-interface
1434
1435         Test: fast/shadow-dom/Node-interface-treeRoot.html
1436
1437         * dom/Node.idl:
1438
1439 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
1440
1441         Rename HTMLSlotElement.getDistributedNodes to getAssignedNodes
1442         https://bugs.webkit.org/show_bug.cgi?id=153534
1443
1444         Reviewed by Antti Koivisto.
1445
1446         Did the rename.
1447
1448         * html/HTMLSlotElement.idl:
1449
1450 2016-01-27  Tim Horton  <timothy_horton@apple.com>
1451
1452         Need to be able to specify MIME type for <attachment> without filename or handle
1453         https://bugs.webkit.org/show_bug.cgi?id=153552
1454         <rdar://problem/20145857>
1455
1456         Reviewed by Anders Carlsson.
1457
1458         Tests: fast/attachment/attachment-default-icon.html
1459                fast/attachment/attachment-type-attribute.html
1460
1461         * html/HTMLAttachmentElement.cpp:
1462         (WebCore::HTMLAttachmentElement::parseAttribute):
1463         Invalidate attachment when 'type' attribute changes.
1464
1465         (WebCore::HTMLAttachmentElement::attachmentType):
1466         * html/HTMLAttachmentElement.h:
1467         * platform/graphics/Icon.h:
1468         * platform/graphics/mac/IconMac.mm:
1469         (WebCore::Icon::createIconForUTI):
1470         (WebCore::Icon::createIconForMIMEType):
1471         Add Icon class methods to retrieve an icon given a UTI or MIME type.
1472
1473         * rendering/RenderThemeMac.mm:
1474         (WebCore::paintAttachmentIcon):
1475         Use the 'type' attribute (a MIME type) if we have one. Otherwise,
1476         use the filename. Lastly fall back to a plain file icon (using the root
1477         file UTI, public.data).
1478
1479 2016-01-27  Alexey Proskuryakov  <ap@apple.com>
1480
1481         Remove ENABLE_CURRENTSRC
1482         https://bugs.webkit.org/show_bug.cgi?id=153545
1483
1484         Reviewed by Simon Fraser.
1485
1486         * Configurations/FeatureDefines.xcconfig:
1487
1488 2016-01-26  Anders Carlsson  <andersca@apple.com>
1489
1490         Stop echoing echo commands to stdout
1491         https://bugs.webkit.org/show_bug.cgi?id=153531
1492
1493         Reviewed by Csaba Osztrogon√°c.
1494
1495         * DerivedSources.make:
1496
1497 2016-01-26  Jer Noble  <jer.noble@apple.com>
1498
1499         Calling video.controls=true during a scrub operation cancels scrub.
1500         https://bugs.webkit.org/show_bug.cgi?id=153494
1501
1502         Reviewed by Eric Carlson.
1503
1504         Test: media/media-controls-drag-timeline-set-controls-property.html
1505
1506         Verify that the video.controls attribute actually changed before tearing down and
1507         re-adding the media controls to the Shadow DOM.
1508
1509         * Modules/mediacontrols/mediaControlsApple.js:
1510         (Controller.prototype.handleControlsChange):
1511         (Controller.prototype.hasControls):
1512
1513 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1514
1515         [GTK][EFL] Rename ScrollAnimationNone as ScrollAnimationSmooth
1516         https://bugs.webkit.org/show_bug.cgi?id=153481
1517
1518         Reviewed by Simon Fraser.
1519
1520         ScrollAnimationNone has always been used by EFL and GTK ports to
1521         implement smooth scrolling. I think it should be possible for
1522         other scroll animators to implement smooth scrolling or even
1523         implement other kind of scroll animations. For example, in the
1524         future I would like to have kinetic scrolling implemented for the
1525         GTK+ port to match all other GTK+ application and decide at
1526         runtime between different animations without having to use a
1527         different scroll animator class. So, this patch also moves the
1528         smooth scrolling animation implementation to its own class
1529         ScrollAnimationSmooth that impements an interface ScrollAnimation
1530         that could be used to implement other animations. This will allow
1531         the GTK+ port to add its own scroll animator class and still
1532         support smooth scrolling sharing the code with the
1533         ScrollAnimationSmooth.
1534
1535         * PlatformEfl.cmake: Add new files to compilation and remove ScrollAnimationNone.
1536         * PlatformGTK.cmake: Ditto.
1537         * platform/ScrollAnimation.h: Added.
1538         (WebCore::ScrollAnimation::serviceAnimation):
1539         (WebCore::ScrollAnimation::ScrollAnimation):
1540         * platform/ScrollAnimationSmooth.cpp: Added.
1541         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
1542         (WebCore::ScrollAnimationSmooth::scroll):
1543         (WebCore::ScrollAnimationSmooth::stop):
1544         (WebCore::ScrollAnimationSmooth::updateVisibleLengths):
1545         (WebCore::ScrollAnimationSmooth::setCurrentPosition):
1546         (WebCore::ScrollAnimationSmooth::serviceAnimation):
1547         (WebCore::ScrollAnimationSmooth::~ScrollAnimationSmooth):
1548         (WebCore::curveAt):
1549         (WebCore::attackCurve):
1550         (WebCore::releaseCurve):
1551         (WebCore::coastCurve):
1552         (WebCore::curveIntegralAt):
1553         (WebCore::attackArea):
1554         (WebCore::releaseArea):
1555         (WebCore::getAnimationParametersForGranularity):
1556         (WebCore::ScrollAnimationSmooth::updatePerAxisData):
1557         (WebCore::ScrollAnimationSmooth::animateScroll):
1558         (WebCore::ScrollAnimationSmooth::animationTimerFired):
1559         (WebCore::ScrollAnimationSmooth::startNextTimer):
1560         (WebCore::ScrollAnimationSmooth::animationTimerActive):
1561         * platform/ScrollAnimationSmooth.h: Added.
1562         * platform/ScrollAnimator.cpp:
1563         (WebCore::ScrollAnimator::scroll):
1564         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
1565         (WebCore::ScrollAnimator::setCurrentPosition):
1566         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset):
1567         (WebCore::ScrollAnimator::notifyPositionChanged):
1568         (WebCore::ScrollAnimator::scrollOffsetOnAxis):
1569         * platform/ScrollAnimator.h:
1570         (WebCore::ScrollAnimator::ScrollAnimator::currentPosition):
1571         * platform/ScrollAnimatorNone.cpp: Removed.
1572         * platform/ScrollAnimatorNone.h: Removed.
1573         * platform/ScrollAnimatorSmooth.cpp: Added.
1574         (WebCore::ScrollAnimator::create):
1575         (WebCore::ScrollAnimatorSmooth::ScrollAnimatorSmooth):
1576         (WebCore::ScrollAnimatorSmooth::~ScrollAnimatorSmooth):
1577         (WebCore::ScrollAnimatorSmooth::scroll):
1578         (WebCore::ScrollAnimatorSmooth::scrollToOffsetWithoutAnimation):
1579         (WebCore::ScrollAnimatorSmooth::cancelAnimations):
1580         (WebCore::ScrollAnimatorSmooth::serviceScrollAnimations):
1581         (WebCore::ScrollAnimatorSmooth::willEndLiveResize):
1582         (WebCore::ScrollAnimatorSmooth::didAddVerticalScrollbar):
1583         (WebCore::ScrollAnimatorSmooth::didAddHorizontalScrollbar):
1584         * platform/ScrollAnimatorSmooth.h: Added.
1585         * platform/mac/ScrollAnimatorMac.mm:
1586         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
1587         (WebCore::ScrollAnimatorMac::immediateScrollBy):
1588
1589 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1590
1591         Overlay scrollbars should always use the whole contents
1592         https://bugs.webkit.org/show_bug.cgi?id=153352
1593
1594         Reviewed by Michael Catanzaro.
1595
1596         In case of having both horizontal and vertical scrollbars, the
1597         scrollbars respect the scroll corner. That looks good for legacy
1598         scrollbars that show the track, but with the overlay indicators
1599         it looks weird that the indicator stops so early before the end of
1600         the contents, giving the impression that there's something else to
1601         scroll. This happens because the scroll corner is transparent, so
1602         it's not obvious that's the scroll corner. It also happens with
1603         the text areas having a resizer. Legacy scrollbars take into
1604         account the resizer, which is good, but I expect overlay
1605         scrollbars to be rendered also over the resizer. The resizer takes
1606         precedence so you can still click and drag to resize the text area.
1607         In the case of main frame scrollbars we are indeed returning an
1608         empty rectangle from ScrollView::scrollCornerRect() when using
1609         overlay scrollbars, but when calculating the size of the
1610         scrollbars we are using the actual width/height instead of the
1611         occupied with/height. For other scrollbars
1612         RenderLayer::scrollCornerRect() is not checking whether scrollbars
1613         are overlay or not and we are always returning a scroll corner
1614         rectangle when scrollbars are present.
1615
1616         * platform/ScrollView.cpp:
1617         (WebCore::ScrollView::updateScrollbars): Use the occupied
1618         width/height when calculating the space the one scrollbar
1619         should leave for the other.
1620         * rendering/RenderLayer.cpp:
1621         (WebCore::RenderLayer::scrollCornerRect): Return an empty
1622         rectangle when using overlay scrollbars.
1623
1624 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1625
1626         ScrollAnimator is not notified when mouse entered, moved or exited a RenderListBox
1627         https://bugs.webkit.org/show_bug.cgi?id=153398
1628
1629         Reviewed by Michael Catanzaro.
1630
1631         EvenHandler is checking whether the enclosing layer of a node is
1632         registered as scrollable area of its frame view. That doesn't work
1633         for list boxes, because they are the scrollable area
1634         themselves. Also when entering a list box the node under mouse is
1635         not usually the list box itself, but any of its children, a
1636         HTMLOptionElement or a HTMLOptGroupElement. Instead of comparing
1637         layers, we should find the enclosing scrollable area of the target
1638         elements and compare them to decide whether the mouse has entered,
1639         left or moved a scrollable area.
1640
1641         * page/EventHandler.cpp:
1642         (WebCore::enclosingScrollableArea): Return the enclosing
1643         scrollable area of the given node. If the node doesn't have a
1644         renderer, it traverses its parents. If the renderer is a
1645         RenderListBox it is returned, otherwhise the enclosing layer is
1646         returned.
1647         (WebCore::EventHandler::mouseMoved): Use enclosingScrollableArea.
1648         (WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
1649
1650 2016-01-26  Sam Weinig  <sam@webkit.org>
1651
1652         Try touching DerivedSources.make to force rebuilding.
1653
1654         * DerivedSources.make:
1655         * page/DOMWindow.idl:
1656
1657 2016-01-26  Sam Weinig  <sam@webkit.org>
1658
1659         Try to force a rebuild.
1660
1661         * page/DOMWindow.idl:
1662
1663 2016-01-26  Chris Dumez  <cdumez@apple.com>
1664
1665         fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes
1666         https://bugs.webkit.org/show_bug.cgi?id=153525
1667
1668         Reviewed by Andreas Kling.
1669
1670         The test was crashing because DatabaseThread::hasPendingDatabaseActivity()
1671         was accessing m_openDatabaseSet from the main thread without any locking
1672         mechanism. This is an issue because m_openDatabaseSet is altered by the
1673         database thread.
1674
1675         No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html.
1676
1677         * Modules/webdatabase/DatabaseThread.cpp:
1678         (WebCore::DatabaseThread::databaseThread):
1679         (WebCore::DatabaseThread::recordDatabaseOpen):
1680         (WebCore::DatabaseThread::recordDatabaseClosed):
1681         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
1682         * Modules/webdatabase/DatabaseThread.h:
1683
1684 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
1685
1686         Unreviewed CMake build fix after r195644.
1687
1688         * PlatformMac.cmake:
1689
1690 2016-01-26  Brady Eidson  <beidson@apple.com>
1691
1692         Modern IDB: Key generator support for SQLite backend.
1693         https://bugs.webkit.org/show_bug.cgi?id=153427
1694
1695         Reviewed by Alex Christensen.
1696
1697         No new tests (Existing failing tests now pass, others improved).
1698
1699         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1700         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
1701         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1702         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1703         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
1704         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1705         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1706
1707 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
1708
1709         Allow canvas to use display-list drawing for testing
1710         https://bugs.webkit.org/show_bug.cgi?id=153475
1711
1712         Reviewed by Dean Jackson.
1713
1714         Optionally have 2D <canvas> use display-list drawing, which is only enabled
1715         via Internals for now.
1716
1717         Support displayListAsText() and replayDisplayListAsText() on canvas, so we can
1718         use it to test playback optimizations. [Note that displayListAsText() always
1719         returns an empty string currently, because the display list is cleared when the
1720         canvas is painted to the page.]
1721
1722         Display list rendering is implemented by giving CanvasRenderingContext2D an
1723         optional DisplayListDrawingContext, which packages up a display list, recorder
1724         and recording context. The existing paintRenderingResultsToCanvas() is overridden
1725         to replay the recorded display list into the primary canvas context.
1726
1727         Tracked replay display lists are stored in a static map, keyed by the CanvasRenderingContext2D.
1728
1729         Test: displaylists/canvas-display-list.html
1730
1731         * html/HTMLCanvasElement.cpp:
1732         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
1733         (WebCore::HTMLCanvasElement::getContext):
1734         (WebCore::HTMLCanvasElement::paint):
1735         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
1736         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
1737         (WebCore::HTMLCanvasElement::displayListAsText):
1738         (WebCore::HTMLCanvasElement::replayDisplayListAsText):
1739         * html/HTMLCanvasElement.h:
1740         * html/canvas/CanvasRenderingContext.h:
1741         * html/canvas/CanvasRenderingContext2D.cpp:
1742         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
1743         (WebCore::contextDisplayListMap):
1744         (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
1745         (WebCore::CanvasRenderingContext2D::setTracksDisplayListReplay):
1746         (WebCore::CanvasRenderingContext2D::displayListAsText):
1747         (WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
1748         (WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
1749         (WebCore::CanvasRenderingContext2D::drawingContext):
1750         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): Deleted.
1751         * html/canvas/CanvasRenderingContext2D.h:
1752         * testing/Internals.cpp:
1753         (WebCore::Internals::setElementUsesDisplayListDrawing):
1754         (WebCore::Internals::setElementTracksDisplayListReplay):
1755         (WebCore::Internals::displayListForElement):
1756         (WebCore::Internals::replayDisplayListForElement):
1757
1758 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
1759
1760         Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
1761         https://bugs.webkit.org/show_bug.cgi?id=153509
1762         <rdar://problem/24354291>
1763
1764         Reviewed by Andreas Kling.
1765
1766         * CMakeLists.txt:
1767         * PlatformMac.cmake:
1768         * WebCore.xcodeproj/project.pbxproj:
1769         * page/Page.cpp:
1770         * page/Page.h:
1771         * page/Settings.cpp:
1772         * page/Settings.h:
1773         * page/ResourceUsageOverlay.cpp:
1774         * page/ResourceUsageOverlay.h:
1775         Add new files to the build and updated ENABLE flag name.
1776
1777         * page/ResourceUsageData.cpp: Added.
1778         (WebCore::ResourceUsageData::ResourceUsageData):
1779         * page/ResourceUsageData.h: Added.
1780         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
1781         Platform agnostic resource data that may be used by multiple clients,
1782         such as the ResourceUsageOverlay and later the Inspector.
1783
1784         * page/ResourceUsageThread.h: Added.
1785         * page/ResourceUsageThread.cpp: Added.
1786         (WebCore::ResourceUsageThread::ResourceUsageThread):
1787         (WebCore::ResourceUsageThread::singleton):
1788         (WebCore::ResourceUsageThread::addObserver):
1789         (WebCore::ResourceUsageThread::removeObserver):
1790         (WebCore::ResourceUsageThread::waitUntilObservers):
1791         (WebCore::ResourceUsageThread::notifyObservers):
1792         (WebCore::ResourceUsageThread::createThreadIfNeeded):
1793         (WebCore::ResourceUsageThread::threadCallback):
1794         (WebCore::ResourceUsageThread::threadBody):
1795         Platform agnostic resource usage thread that can be used to gather data
1796         into a ResourceUsageData struct on a background thread and notify observers
1797         on the main thread. Platforms need only implement ResourceUsageThread::platformThreadBody
1798         to populate the ResourceUsageData struct with data.
1799
1800         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1801         (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
1802         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
1803         (WebCore::historicUsageData):
1804         (WebCore::appendDataToHistory):
1805         (WebCore::ResourceUsageOverlay::platformInitialize):
1806         (WebCore::ResourceUsageOverlay::platformDestroy):
1807         (WebCore::drawMemHistory):
1808         (WebCore::drawMemoryPie):
1809         (WebCore::ResourceUsageOverlay::platformDraw):
1810         Move CPU and memory resource usage calculations to ResourceUsageThread.
1811         The overlay adds itself as an observer, and builds its RingBuffer list
1812         of data from notifications from the ResourceUsageThread. Renamed
1813         some of the fields.
1814
1815         * page/cocoa/ResourceUsageThreadCocoa.mm: Added.
1816         (WebCore::vmPageSize):
1817         (WebCore::TagInfo::TagInfo):
1818         (WebCore::pagesPerVMTag):
1819         (WebCore::cpuUsage):
1820         (WebCore::categoryForVMTag):
1821         (WebCore::ResourceUsageThread::platformThreadBody):
1822         Extracted from ResourceUsageOverlayCocoa.
1823
1824         * page/scrolling/ScrollingThread.cpp:
1825         (WebCore::ScrollingThread::dispatch):
1826         Drive-by, don't call singleton again, we already have the result.
1827
1828 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
1829
1830         Use initializers in HTMLCanvasElement
1831         https://bugs.webkit.org/show_bug.cgi?id=153472
1832
1833         Reviewed by Michael Catanzaro.
1834
1835         Use initializers, and re-order member variables for better packing.
1836
1837         * html/HTMLCanvasElement.cpp:
1838         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
1839         * html/HTMLCanvasElement.h:
1840
1841 2016-01-26  Chris Dumez  <cdumez@apple.com>
1842
1843         Setting HTMLInputElement.value to null to set its value to the empty string
1844         https://bugs.webkit.org/show_bug.cgi?id=153519
1845
1846         Reviewed by Ryosuke Niwa.
1847
1848         Setting HTMLInputElement.value to null to set its value to the empty string:
1849         - https://html.spec.whatwg.org/#htmlinputelement
1850         - http://heycam.github.io/webidl/#TreatNullAs
1851
1852         WebKit would previously unset the value attribute instead, which caused
1853         it to fallback to input.defaultValue if set.
1854
1855         Firefox and Chrome behave correctly.
1856
1857         Test: fast/dom/HTMLInputElement/input-value-set-null.html
1858
1859         * html/HTMLInputElement.cpp:
1860         (WebCore::HTMLInputElement::setValue):
1861
1862 2016-01-26  Anders Carlsson  <andersca@apple.com>
1863
1864         WebKitAdditions should be able to modify derived source rules
1865         https://bugs.webkit.org/show_bug.cgi?id=153514
1866
1867         Reviewed by Tim Horton.
1868
1869         * DerivedSources.make:
1870         Include WebCoreDerivedSourcesAdditions.make.
1871
1872         * WebCore.xcodeproj/project.pbxproj:
1873         Pass our WebKitAdditions paths as include paths to make.
1874
1875 2016-01-26  Chris Dumez  <cdumez@apple.com>
1876
1877         document.open() / write() should be prevented in beforeunload event handlers
1878         https://bugs.webkit.org/show_bug.cgi?id=153432
1879
1880         Reviewed by Ryosuke Niwa.
1881
1882         document.open() / write() should be prevented in beforeunload event handlers:
1883         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
1884         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
1885         - https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
1886         - https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
1887
1888         Test: fast/frames/page-beforeunload-document-open.html
1889
1890         * loader/FrameLoader.cpp:
1891         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
1892
1893 2016-01-26  Chris Dumez  <cdumez@apple.com>
1894
1895         Add support for HTMLDataElement
1896         https://bugs.webkit.org/show_bug.cgi?id=153459
1897
1898         Reviewed by Ryosuke Niwa.
1899
1900         Add support for HTMLDataElement:
1901         https://html.spec.whatwg.org/multipage/semantics.html#the-data-element
1902
1903         Firefox already supports it.
1904
1905         No new tests, already covered by existing tests.
1906
1907         * CMakeLists.txt:
1908         * DerivedSources.cpp:
1909         * DerivedSources.make:
1910         * WebCore.vcxproj/WebCore.vcxproj:
1911         * WebCore.vcxproj/WebCore.vcxproj.filters:
1912         * WebCore.xcodeproj/project.pbxproj:
1913         * html/HTMLDataElement.cpp: Added.
1914         (WebCore::HTMLDataElement::create):
1915         (WebCore::HTMLDataElement::HTMLDataElement):
1916         * html/HTMLDataElement.h: Added.
1917         * html/HTMLDataElement.idl: Added.
1918         * html/HTMLElementsAllInOne.cpp:
1919         * html/HTMLTagNames.in:
1920
1921 2016-01-26  Commit Queue  <commit-queue@webkit.org>
1922
1923         Unreviewed, rolling out r195610.
1924         https://bugs.webkit.org/show_bug.cgi?id=153513
1925
1926         The test added with this change is timing out on almost every
1927         run (Requested by ryanhaddad on #webkit).
1928
1929         Reverted changeset:
1930
1931         "Calling video.controls=true during a scrub operation cancels
1932         scrub."
1933         https://bugs.webkit.org/show_bug.cgi?id=153494
1934         http://trac.webkit.org/changeset/195610
1935
1936 2016-01-26  Brady Eidson  <beidson@apple.com>
1937
1938         History.pushState causes intense memory pressure.
1939         https://bugs.webkit.org/show_bug.cgi?id=153435
1940
1941         Reviewed by Sam Weinig, Oliver Hunt, and Geoff Garen.
1942
1943         Tests: fast/loader/stateobjects/pushstate-frequency-iframe.html
1944                fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html
1945                fast/loader/stateobjects/pushstate-frequency.html
1946                fast/loader/stateobjects/replacestate-frequency-iframe.html
1947                fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html
1948                fast/loader/stateobjects/replacestate-frequency.html
1949                loader/stateobjects/pushstate-size-iframe.html
1950                loader/stateobjects/pushstate-size.html
1951                loader/stateobjects/replacestate-size-iframe.html
1952                loader/stateobjects/replacestate-size.html
1953
1954         Add restrictions on how frequently push/replaceState can be called,
1955         as well as how much of a cumulative payload they can deliver.
1956         
1957         * bindings/js/JSHistoryCustom.cpp:
1958         (WebCore::JSHistory::pushState):
1959         (WebCore::JSHistory::replaceState):
1960         
1961         * page/History.cpp:
1962         (WebCore::History::stateObjectAdded):
1963         * page/History.h:
1964
1965 2016-01-26  Anders Carlsson  <andersca@apple.com>
1966
1967         Add a Dictionary overload that returns an Optional result
1968         https://bugs.webkit.org/show_bug.cgi?id=153507
1969
1970         Reviewed by Tim Horton.
1971
1972         * bindings/js/Dictionary.h:
1973         (WebCore::Dictionary::get):
1974
1975 2016-01-26  Philip Rogers  <pdr@chromium.org>
1976
1977         Let SVG images not taint canvases except when containing foreignObjects
1978         https://bugs.webkit.org/show_bug.cgi?id=119639
1979
1980         Reviewed by Brent Fulgham.
1981
1982         r153876 caused SVG images to not taint canvases but the patch allowed
1983         for subimage resources. This can be a problem if a subimage (e.g., data
1984         uri image) contains a foreignObject which can violate security (e.g.,
1985         visited links).
1986
1987         This patch updates SVGImage::hasSingleSecurityOrigin to check if the
1988         image contains any foreignObjects or images that themselves contain
1989         foreignObjects. SVG images without foreignObjects are allowed to not
1990         taint canvases.
1991
1992         Canvas patterns are problematic because an animated SVG image can switch
1993         between tainting and not tainting the canvas. A FIXME has been added to
1994         solve this, and in the meantime we cause SVG images to taint patterns.
1995
1996         Tests: svg/as-image/svg-canvas-pattern-with-link-tainted.html
1997                svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted.html
1998                svg/as-image/svg-canvas-svg-with-image-with-link-tainted.html
1999
2000         * html/canvas/CanvasPattern.cpp:
2001         (WebCore::CanvasPattern::CanvasPattern):
2002         (WebCore::CanvasPattern::~CanvasPattern):
2003         * svg/SVGFEImageElement.cpp:
2004         (WebCore::SVGFEImageElement::~SVGFEImageElement):
2005         (WebCore::SVGFEImageElement::hasSingleSecurityOrigin):
2006         (WebCore::SVGFEImageElement::clearResourceReferences):
2007         * svg/SVGFEImageElement.h:
2008         * svg/SVGImageElement.cpp:
2009         (WebCore::SVGImageElement::create):
2010         (WebCore::SVGImageElement::hasSingleSecurityOrigin):
2011         (WebCore::SVGImageElement::isSupportedAttribute):
2012         * svg/SVGImageElement.h:
2013         * svg/graphics/SVGImage.cpp:
2014         (WebCore::SVGImage::hasSingleSecurityOrigin):
2015
2016 2016-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2017
2018         CSSGrammar.y:1742.31-34: warning: unused value: $3
2019         https://bugs.webkit.org/show_bug.cgi?id=153462
2020
2021         Reviewed by Alex Christensen.
2022
2023         This warning indicates that we have a memory leak. From the bison manual:
2024
2025         "Right-hand side symbols of a rule that explicitly triggers a syntax error via YYERROR are
2026         not discarded automatically. As a rule of thumb, destructors are invoked only when user
2027         actions cannot manage the memory."
2028
2029         Arguably a design error, but that's how it is.
2030
2031         * css/CSSGrammar.y.in:
2032
2033 2016-01-26  Jer Noble  <jer.noble@apple.com>
2034
2035         Calling video.controls=true during a scrub operation cancels scrub.
2036         https://bugs.webkit.org/show_bug.cgi?id=153494
2037
2038         Reviewed by Eric Carlson.
2039
2040         Test: media/media-controls-drag-timeline-set-controls-property.html
2041
2042         Verify that the video.controls attribute actually changed before tearing down and
2043         re-adding the media controls to the Shadow DOM.
2044
2045         * Modules/mediacontrols/mediaControlsApple.js:
2046         (Controller.prototype.handleControlsChange):
2047         (Controller.prototype.hasControls):
2048
2049 2016-01-26  Jeremy Noble  <jer.noble@apple.com>
2050
2051         [EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
2052         https://bugs.webkit.org/show_bug.cgi?id=153495
2053
2054         Reviewed by Eric Carlson.
2055
2056         When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
2057         namely, immediately create an AVStreamSession object in
2058         willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.
2059
2060         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2061         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2062
2063 2016-01-26  Dean Jackson  <dino@apple.com>
2064
2065         [iOS] Documents without an explicit width should not get fast tapping
2066         https://bugs.webkit.org/show_bug.cgi?id=153465
2067         <rdar://problem/23962529>
2068
2069         Reviewed by Simon Fraser (and Wenson Hseih).
2070
2071         As the title says, documents that do not set a viewport should
2072         not get the fast click behaviour. There were complaints that we broke
2073         double-tap to scroll in ImageDocuments where the image was narrow and long.
2074
2075         The fix is to just keep a flag that tells the UI process if the
2076         width was explicit. However, it turns out that those ImageDocuments
2077         are given an explicit device-width, which is fine for scaling but
2078         really should behave as auto for fast tapping. So we also need
2079         to tell the UIProcess if the viewport arguments came from an
2080         ImageDocument.
2081
2082         Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html
2083
2084         * dom/ViewportArguments.cpp:
2085         (WebCore::findSizeValue): Add a parameter that toggles a flag
2086         if the size was explicitly set.
2087         (WebCore::setViewportFeature): Remember if the width was
2088         explicit.
2089         * dom/ViewportArguments.h: Add a widthWasExplicit flag.
2090         (WebCore::ViewportArguments::operator==):
2091
2092 2016-01-25  Dave Hyatt  <hyatt@apple.com>
2093
2094         Speculative fixes for crashing in viewportChangeAffectedPicture
2095         https://bugs.webkit.org/show_bug.cgi?id=153450
2096
2097         Reviewed by Dean Jackson.
2098
2099         Don't attach any conditions to the removal of a picture element from
2100         the document's HashSet. This ensures that if the condition is ever
2101         wrong for any reason, we'll still remove the picture element on
2102         destruction.
2103
2104         Fix the media query evaluation to match the other evaluations (used by
2105         the preload scanner and HTMLImageElement). This includes using the
2106         document element's computed style instead of our own and also null
2107         checking the document element first. This is the likely cause of the
2108         crashes.
2109
2110         * html/HTMLPictureElement.cpp:
2111         (WebCore::HTMLPictureElement::~HTMLPictureElement):
2112         (WebCore::HTMLPictureElement::didMoveToNewDocument):
2113         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
2114
2115 2016-01-26  Chris Dumez  <cdumez@apple.com>
2116
2117         Make sure a page is still PageCache-able after firing the 'pagehide' events
2118         https://bugs.webkit.org/show_bug.cgi?id=153449
2119
2120         Reviewed by Andreas Kling.
2121
2122         Make sure a page is still PageCache-able after firing the 'pagehide'
2123         events and abort if it isn't. This should improve robustness and it is
2124         easy for pagehide event handlers to do things that would make a Page no
2125         longer PageCache-able and this leads to bugs that are difficult to
2126         investigate.
2127
2128         To achieve this, the 'pagehide' event firing logic was moved out of the
2129         CachedFrame constructor. It now happens earlier in
2130         PageCache::addIfCacheable() after checking if the page is cacheable and
2131         before constructing the CachedPage / CachedFrames. After firing the
2132         'pagehide' event in PageCache::addIfCacheable(), we check again that
2133         the page is still cacheable and we abort early if it is not.
2134
2135         * history/CachedFrame.cpp:
2136         (WebCore::CachedFrame::CachedFrame):
2137         * history/PageCache.cpp:
2138         (WebCore::setInPageCache):
2139         (WebCore::firePageHideEventRecursively):
2140         (WebCore::PageCache::addIfCacheable):
2141         * history/PageCache.h:
2142         * loader/FrameLoader.cpp:
2143         (WebCore::FrameLoader::commitProvisionalLoad):
2144
2145 2016-01-26  Beth Dakin  <bdakin@apple.com>
2146
2147         Rubber-stamped by Tim Horton.
2148
2149         Add one more bit of SPI.
2150         * platform/spi/mac/NSSpellCheckerSPI.h:
2151
2152 2016-01-26  Olivier Blin  <olivier.blin@softathome.com>
2153
2154         Fix build with ENABLE_DEVICE_ORIENTATION on non-iOS platforms
2155         https://bugs.webkit.org/show_bug.cgi?id=153490
2156
2157         Reviewed by Michael Catanzaro.
2158
2159         This has been broken since r178702, which changed the Page
2160         argument from a pointer to a reference in logCanCachePageDecision().
2161
2162         No new tests since this is a build fix.
2163
2164         * history/PageCache.cpp:
2165         (WebCore::canCachePage):
2166
2167 2016-01-25  Ada Chan  <adachan@apple.com>
2168
2169         Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
2170         https://bugs.webkit.org/show_bug.cgi?id=153473
2171
2172         Reviewed by Eric Carlson.
2173
2174         No new tests, just moving files.
2175
2176         * WebCore.xcodeproj/project.pbxproj:
2177         Update due to changes to the file locations.
2178         * platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
2179         * platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
2180         (WebCore::WebVideoFullscreenModelVideoElement::create):
2181         Fix a style error by moving the opening curly brace down one line.
2182         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.
2183
2184 2016-01-26  Konstantin Tokarev  <annulen@yandex.ru>
2185
2186         Do not convert GlyphBufferAdvance to FloatSize
2187         https://bugs.webkit.org/show_bug.cgi?id=153429
2188
2189         GlyphBufferAdvance is not necessaryly convertible to FloatSize.
2190         Also, this code was doing extra work by transforming height value.
2191
2192         Reviewed by Antti Koivisto.
2193
2194         No new tests needed.
2195
2196         * rendering/svg/SVGTextRunRenderingContext.cpp:
2197         (WebCore::SVGGlyphToPathTranslator::extents):
2198
2199 2016-01-22  Ada Chan  <adachan@apple.com>
2200
2201         Enable API related to the video fullscreen layer in MediaPlayerPrivateAVFoundationObjC
2202         also on Mac with video presentation mode support.
2203         https://bugs.webkit.org/show_bug.cgi?id=153222
2204
2205         Reviewed by Eric Carlson.
2206
2207         No new tests. Covered by existing tests.
2208
2209         Introduce VideoFullscreenLayerManager to deal with the video layer when switching
2210         between inline and fullscreen mode. We'll reuse it in other MediaPlayerPrivateInterface
2211         implementations.
2212
2213         Now that MediaPlayerPrivateAVFoundationObjC's platform layer can be a WebVideoContainerLayer,
2214         this exposes a bug in PlatformCALayerCocoa::clone() where we assumed the platform layer
2215         is always an AVPlayerLayer if the PlatformCALayer's layer type is LayerTypeAVPlayerLayer.
2216         Add a helper method to get an AVPlayerLayer from a PlatformCALayerCocoa (which also handles
2217         WebVideoContainerLayer case) and use it in PlatformCALayerCocoa::clone().
2218
2219         * WebCore.xcodeproj/project.pbxproj:
2220         Add VideoFullscreenLayerManager to the project.
2221
2222         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2223         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2224         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2225         Create m_videoFullscreenLayerManager. The video inline layer, video fullscreen layer,
2226         and the video fullscreen frame are now managed by that class.
2227         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2228         Just call VideoFullscreenLayerManager::setVideoLayer() to handle adding the video
2229         layer in either the inline or fullscreen layer.
2230         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2231         Call VideoFullscreenLayerManager::didDestroyVideoLayer().
2232         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
2233         Get the video inline layer from VideoFullscreenLayerManager.
2234         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2235         Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
2236         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
2237         Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
2238         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
2239         Guard the iOS specific code properly.
2240         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2241         Get the video fullscreen layer from VideoFullscreenLayerManager.
2242         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation):
2243         Ditto.
2244         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
2245         Get the video fullscreen layer and video fullscreen frame from VideoFullscreenLayerManager.
2246         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
2247         Get the video fullscreen layer from VideoFullscreenLayerManager.
2248
2249         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Added.
2250         (WebCore::VideoFullscreenLayerManager::videoInlineLayer):
2251         (WebCore::VideoFullscreenLayerManager::videoFullscreenLayer):
2252         (WebCore::VideoFullscreenLayerManager::videoFullscreenFrame):
2253         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: Added.
2254         (-[WebVideoContainerLayer setBounds:]):
2255         (-[WebVideoContainerLayer setPosition:]):
2256         WebVideoContainerLayer was moved from MediaPlayerPrivateAVFoundationObjC.mm.
2257         (WebCore::VideoFullscreenLayerManager::create):
2258         (WebCore::VideoFullscreenLayerManager::VideoFullscreenLayerManager):
2259         (WebCore::VideoFullscreenLayerManager::setVideoLayer):
2260         Code moved from MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer().
2261         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
2262         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer().
2263         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame):
2264         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame().
2265         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer):
2266         Code moved from MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer().
2267
2268         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2269         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2270         (PlatformCALayerCocoa::clone):
2271         Use the new PlatformCALayerCocoa::avPlayerLayer() method to get the AVPlayerLayer from both the
2272         destination and source PlatformCALayers.
2273         (PlatformCALayerCocoa::avPlayerLayer):
2274         Return nil if the layer type is not LayerTypeAVPlayerLayer. Otherwise, return the
2275         platform layer if it is indeed an AVPlayerLayer. If not, it should be a WebVideoContainerLayer
2276         and we should return its sublayer which should be an AVPlayerLayer.
2277
2278 2016-01-26  Chris Dumez  <cdumez@apple.com>
2279
2280         First parameter to window.showModalDialog() should be mandatory
2281         https://bugs.webkit.org/show_bug.cgi?id=153436
2282
2283         Reviewed by Youenn Fablet.
2284
2285         Make window.showModalDialog()'s first parameter mandatory to match the
2286         last specification containing it:
2287         http://dev.w3.org/html5/spec-preview/user-prompts.html#dialogs-implemented-using-separate-documents
2288
2289         The new behavior also matches Firefox, while Chrome no longer supports
2290         this operation.
2291
2292         With this change, the W3C HTML test suite no longer hangs in the middle
2293         because it mistakenly pops up a modal dialog during testing.
2294
2295         Test: fast/dom/Window/showModalDialog-mandatory-parameter.html
2296
2297         * bindings/js/JSDOMWindowCustom.cpp:
2298         (WebCore::JSDOMWindow::showModalDialog):
2299
2300 2016-01-26  Eric Carlson  <eric.carlson@apple.com>
2301
2302         LayoutTest media/airplay-target-availability.html is flaky
2303         https://bugs.webkit.org/show_bug.cgi?id=153100
2304         <rdar://problem/24346796>
2305
2306         Reviewed by Daniel Bates.
2307
2308         No new tests, media/airplay-target-availability.html was updated
2309
2310         * Modules/mediasession/WebMediaSessionManager.cpp:
2311         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule a configuration scan if
2312           any of the config flags have changed.
2313         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): Update logging.
2314
2315 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2316
2317         Main frame scrollbars not updated on hovering when using overlay scrollbars
2318         https://bugs.webkit.org/show_bug.cgi?id=153304
2319
2320         Reviewed by Michael Catanzaro.
2321
2322         Legacy scrollbars were fixed in r194155, but overlay scrollbars
2323         are not notified when they are hovered. This is because the layer
2324         hit test in RenderView::hitTest always returns true when using
2325         overlay scrollbars and we are returning early in such case,
2326         ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
2327         case of using overlay scrollbars we still need to check the
2328         RenderView scrollbars even when the layer hit test succeeded.
2329
2330         * rendering/RenderView.cpp:
2331         (WebCore::RenderView::hitTest):
2332
2333 2016-01-26  Daniel Bates  <dabates@apple.com>
2334
2335         LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
2336         https://bugs.webkit.org/show_bug.cgi?id=153250
2337         <rdar://problem/12172843>
2338         And
2339         <rdar://problem/24248040>
2340
2341         Reviewed by Alexey Proskuryakov.
2342
2343         Remove an incorrect assertion that the absolute URL associated with a protection space cannot
2344         contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
2345         This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
2346         with the invariants for WebCore::protectionSpaceMapKeyFromURL().
2347
2348         Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
2349                http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
2350
2351         * platform/network/CredentialStorage.cpp:
2352         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
2353
2354 2016-01-26  Daniel Bates  <dabates@apple.com>
2355
2356         Remove XMLHttpRequestException
2357         https://bugs.webkit.org/show_bug.cgi?id=102698
2358         <rdar://problem/24338476>
2359
2360         Reviewed by Chris Dumez.
2361
2362         Inspired by a patch by Erik Arvidsson.
2363
2364         As per <https://xhr.spec.whatwg.org> (21 January 2016) and <https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts> (25 January 2016)
2365         XMLHttpRequest and WorkerGlobalScope.importScripts() should throw a DOMException object instead
2366         of a XMLHttpRequestException object when a NetworkError, AbortError, or TimeoutError occur. This
2367         makes the behavior of WebKit more closely conform to these standards as well as the behavior of
2368         other browsers.
2369
2370         * CMakeLists.txt: Remove entries for XMLHttpRequestException.idl and XMLHttpRequestException.cpp.
2371         * DerivedSources.make: Remove entry for XMLHttpRequestException.idl.
2372         * WebCore.order: Remove exported symbols for XMLHttpRequestException.
2373         * WebCore.vcxproj/WebCore.vcxproj: Remove entries for JSXMLHttpRequestException.{cpp, h}, XMLHttpRequestException.{cpp, h}
2374         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2375         * WebCore.xcodeproj/project.pbxproj: Ditto.
2376         * bindings/js/JSExceptionBase.cpp:
2377         (WebCore::toExceptionBase): Remove logic for XMLHttpRequestException.
2378         * dom/DOMExceptions.in: Remove entry for XMLHttpRequestException.
2379         * workers/WorkerGlobalScope.cpp:
2380         (WebCore::WorkerGlobalScope::importScripts): Throw DOMException.NETWORK_ERR instead of XMLHttpRequestException.NETWORK_ERR.
2381         * xml/XMLHttpRequest.cpp:
2382         (WebCore::XMLHttpRequest::createRequest): Ditto.
2383         (WebCore::XMLHttpRequest::didFail): Throw DOMException.ABORT_ERR instead of XMLHttpRequestException.ABORT_ERR.
2384         (WebCore::XMLHttpRequest::didReachTimeout): Throw DOMException.TIMEOUT_ERR instead of XMLHttpRequestException.TIMEOUT_ERR.
2385         * xml/XMLHttpRequestException.cpp: Removed.
2386         * xml/XMLHttpRequestException.h: Removed.
2387         * xml/XMLHttpRequestException.idl: Removed.
2388
2389 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2390
2391         WebCoreJSBuiltins do not use to do conditional include
2392         https://bugs.webkit.org/show_bug.cgi?id=153306
2393
2394         Reviewed by Alex Christensen.
2395
2396         Removing compilation guards as builtin generator adds them in the files themselves.
2397         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
2398
2399         No change in behavior.
2400
2401         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
2402         * Modules/mediastream/NavigatorUserMedia.js: Making it @conditional.
2403         * bindings/js/WebCoreJSBuiltins.cpp:
2404         * bindings/js/WebCoreJSBuiltins.h:
2405
2406 2016-01-25  Alex Christensen  <achristensen@webkit.org>
2407
2408         Fix internal Windows build
2409         https://bugs.webkit.org/show_bug.cgi?id=153469
2410
2411         Reviewed by Brent Fulgham.
2412
2413         * CMakeLists.txt:
2414         Pass the GPERF_EXECUTABLE that we found to perl scripts so they can use it instead of just calling gperf.
2415         This is needed for builds where gperf is not in the PATH.
2416         * DerivedSources.make:
2417         Pass "gperf" as the gperf command to retain existing functionality on mac.
2418         * bindings/scripts/preprocess-idls.pl:
2419         (CygwinPathIfNeeded):
2420         * bindings/scripts/preprocessor.pm:
2421         (applyPreprocessor):
2422         Add /cygdrive/c/cygwin/bin to the PATH before calling cygpath.
2423         This is needed for builds where we are using cygwin, but C:/cygwin/bin is not in the PATH.
2424         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2425         * css/makeSelectorPseudoElementsMap.py:
2426         * css/makeprop.pl:
2427         * platform/network/create-http-header-name-table:
2428         Use the gperf executable passed in as a command line parameter if it is given.
2429
2430 2016-01-25  Simon Fraser  <simon.fraser@apple.com>
2431
2432         DisplayList items can log paths now
2433         https://bugs.webkit.org/show_bug.cgi?id=153417
2434
2435         Reviewed by Zalan Bujtas.
2436
2437         Now that Path supports TextStream logging, clean up its output a little and
2438         enable dumping of Paths in DisplayListItems.
2439
2440         * platform/graphics/Path.cpp:
2441         (WebCore::operator<<):
2442         * platform/graphics/displaylists/DisplayListItems.cpp:
2443         (WebCore::DisplayList::operator<<):
2444
2445 2016-01-25  Antti Koivisto  <antti@apple.com>
2446
2447         Fix the comment.
2448
2449         * rendering/style/RenderStyle.h:
2450
2451 2016-01-25  Enrica Casucci  <enrica@apple.com>
2452
2453         Add support for DataDetectors in WK (iOS).
2454         https://bugs.webkit.org/show_bug.cgi?id=152989
2455         rdar://problem/22855960
2456
2457         Reviewed by Tim Horton.
2458
2459         Adding new helper functions for data detection related tasks.
2460         The patch also fixes a bug when creating DOM ranges from DDQueryRange
2461         spanning multiple fragments.
2462
2463         * editing/cocoa/DataDetection.h:
2464         * editing/cocoa/DataDetection.mm:
2465         (WebCore::DataDetection::isDataDetectorLink):
2466         (WebCore::DataDetection::dataDetectorIdentifier):
2467         (WebCore::detectItemAtPositionWithRange):
2468         (WebCore::DataDetection::detectItemAroundHitTestResult):
2469         (WebCore::resultIsURL):
2470         (WebCore::removeResultLinksFromAnchor):
2471         (WebCore::searchForLinkRemovingExistingDDLinks):
2472         (WebCore::DataDetection::detectContentInRange):
2473
2474 2016-01-25  Myles C. Maxfield  <mmaxfield@apple.com>
2475
2476         Remove broken cache from CSSFontFaceSource
2477         https://bugs.webkit.org/show_bug.cgi?id=153440
2478
2479         Reviewed by Simon Fraser.
2480
2481         This cache has been broken since 2013 (r158085). Given we didn't notice a perf
2482         hit when it broke, and the fact it's been broken for years, it clearly isn't
2483         necessary.
2484
2485         https://bugs.webkit.org/show_bug.cgi?id=153414 consists of a fairly invasive
2486         change to CSSFontFaceSource; this patch includes a working version of this
2487         cache, along with an easy way to enable/disable it (to measure possible perf
2488         changes).
2489
2490         This patch is a short-term cleanup patch in the mean time until the above
2491         invasive change gets landed.
2492
2493         No new tests because there is no behavior (or performance!) change.
2494
2495         * css/CSSFontFaceSource.cpp:
2496         (WebCore::CSSFontFaceSource::font):
2497         (WebCore::CSSFontFaceSource::~CSSFontFaceSource): Deleted.
2498         (WebCore::CSSFontFaceSource::pruneTable): Deleted.
2499         (WebCore::CSSFontFaceSource::fontLoaded): Deleted.
2500         * css/CSSFontFaceSource.h:
2501
2502 2016-01-25  Sam Weinig  <sam@webkit.org>
2503
2504         Try to fix the simulator build.
2505
2506         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2507
2508 2016-01-25  Sam Weinig  <sam@webkit.org>
2509
2510         Roll back in r195559 with a build fix.
2511
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * editing/cocoa/DataDetection.mm:
2514         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
2515         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
2516         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2517
2518 2016-01-25  Commit Queue  <commit-queue@webkit.org>
2519
2520         Unreviewed, rolling out r195559.
2521         https://bugs.webkit.org/show_bug.cgi?id=153458
2522
2523         This change broke the iOS build (Requested by ryanhaddad on
2524         #webkit).
2525
2526         Reverted changeset:
2527
2528         "Fix the ASAN build."
2529         http://trac.webkit.org/changeset/195559
2530
2531 2016-01-25  Antti Koivisto  <antti@apple.com>
2532
2533         Resolving direction and writing mode properties should not mutate document
2534         https://bugs.webkit.org/show_bug.cgi?id=153446
2535
2536         Reviewed by Andreas Kling.
2537
2538         Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.
2539
2540         * css/StyleBuilderCustom.h:
2541         (WebCore::StyleBuilderCustom::applyValueDirection):
2542         (WebCore::StyleBuilderCustom::resetEffectiveZoom):
2543         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
2544         (WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
2545         * css/StyleResolver.cpp:
2546         (WebCore::StyleResolver::styleForElement):
2547         * dom/Document.cpp:
2548         (WebCore::Document::Document):
2549         * dom/Document.h:
2550         (WebCore::Document::markers):
2551         (WebCore::Document::directionSetOnDocumentElement): Deleted.
2552         (WebCore::Document::writingModeSetOnDocumentElement): Deleted.
2553         (WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
2554         (WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
2555         * rendering/RenderBox.cpp:
2556         (WebCore::RenderBox::styleDidChange):
2557         * rendering/style/RenderStyle.h:
2558         * style/StyleResolveForDocument.cpp:
2559         (WebCore::Style::resolveForDocument):
2560
2561 2016-01-25  Sam Weinig  <sam@webkit.org>
2562
2563         Fix the ASAN build.
2564
2565         * WebCore.xcodeproj/project.pbxproj:
2566         * editing/cocoa/DataDetection.mm:
2567         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
2568         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
2569         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2570
2571 2016-01-25  Alex Christensen  <achristensen@webkit.org>
2572
2573         [Win] Another build fix after r195545
2574
2575         * CMakeLists.txt:
2576         r195548 didn't change all the pre-builds back to post-builds.
2577
2578 2016-01-25  Alex Christensen  <achristensen@webkit.org>
2579
2580         [Win] Fix clean build after r195545.
2581
2582         * CMakeLists.txt:
2583         * PlatformWin.cmake:
2584         I got a little carried away.  WebCore already had a pre-build event.  It was correct before r195545.
2585
2586 2016-01-25  Beth Dakin  <bdakin@apple.com>
2587
2588         Handle soft spaces after accepted candidates
2589         https://bugs.webkit.org/show_bug.cgi?id=153331
2590         -and corresponding-
2591         rdar://problem/23958418
2592
2593         Reviewed by Darin Adler.
2594
2595         Candidates now come with built-in spaces, so we should not insert a space for 
2596         them.
2597         * editing/Editor.cpp:
2598         (WebCore::Editor::handleAcceptedCandidate):
2599
2600         New SPI to properly handle these soft spaces.
2601         * platform/spi/mac/NSSpellCheckerSPI.h:
2602
2603 2016-01-25  Alex Christensen  <achristensen@webkit.org>
2604
2605         [Win] Copy forwarding headers before building a project
2606         https://bugs.webkit.org/show_bug.cgi?id=153434
2607
2608         Reviewed by Brent Fulgham.
2609
2610         * CMakeLists.txt:
2611         * PlatformWin.cmake:
2612
2613 2016-01-25  Brady Eidson  <beidson@apple.com>
2614
2615         Modern IDB: Implement getIndexRecord in the SQLite backing store.
2616         https://bugs.webkit.org/show_bug.cgi?id=153425
2617
2618         Reviewed by Darin Adler.
2619
2620         No new tests (Some failures now pass, other failures progressed closer to passing).
2621
2622         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2623         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2624
2625 2016-01-25  Eric Carlson  <eric.carlson@apple.com>
2626
2627         Media "ended" event incorrectly fires when currentTime is set
2628         https://bugs.webkit.org/show_bug.cgi?id=150348
2629         <rdar://problem/24247974>
2630
2631         Reviewed by Jer Noble.
2632
2633         Test: media/media-ended-fired-once.html
2634
2635         * html/HTMLMediaElement.cpp:
2636         (WebCore::HTMLMediaElement::invalidateCachedTime): Always mark m_cachedTime as invalid.
2637
2638 2016-01-25  Konstantin Tokarev  <annulen@yandex.ru>
2639
2640         Do not convert GlyphBufferAdvance to FloatSize
2641         https://bugs.webkit.org/show_bug.cgi?id=153421
2642
2643         Reviewed by Simon Fraser.
2644
2645         No new tests needed.
2646
2647         * platform/graphics/displaylists/DisplayListItems.cpp:
2648         (WebCore::DisplayList::DrawGlyphs::computeBounds):
2649
2650 2016-01-22  Ryosuke Niwa  <rniwa@webkit.org>
2651
2652         document.createElement should be able to create a custom element
2653         https://bugs.webkit.org/show_bug.cgi?id=153173
2654
2655         Reviewed by Darin Adler.
2656
2657         Added the support for constructing a custom element via document.createElement.
2658
2659         Extracted HTMLElementFactory::createKnownElement, which returns nullptr when the specified name doesn't match
2660         any builtin element instead of out of HTMLUnknownElement, out of HTMLElementFactory::createElement.
2661
2662         Test: fast/custom-elements/Document-createElement.html
2663
2664         * bindings/js/JSCustomElementInterface.cpp:
2665         (WebCore::JSCustomElementInterface::constructHTMLElement): Added. Constructs a custom element by invoking its
2666         constructor. We allow exceptions to be thrown by the constructor so the caller is responsible for checking
2667         any exceptions in the ExecState before preceeding if the returned value is null.
2668
2669         * bindings/js/JSCustomElementInterface.h:
2670         (WebCore::JSCustomElementInterface::constructSVGElement): Added.
2671         * bindings/js/JSElementCustom.cpp:
2672         (WebCore::toJSNewlyCreated): Exit early if the element is a custom element as the wrapper had already been
2673         created by super() call inside the custom element'c constructor.
2674
2675         * bindings/js/JSMainThreadExecState.h:
2676         (WebCore::JSMainThreadExecState):
2677         * bindings/js/JSMainThreadExecStateInstrumentation.h:
2678         (WebCore::JSMainThreadExecState::instrumentFunctionInternal): Generalized from instrumentFunctionCall so that
2679         we can use it for both call and construct.
2680         (WebCore::JSMainThreadExecState::instrumentFunctionCall): Specialized the above function for call.
2681         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct): Ditto for construct.
2682
2683         * dom/CustomElementDefinitions.cpp:
2684         (WebCore::CustomElementDefinitions::findInterface): Added.
2685         * dom/CustomElementDefinitions.h:
2686
2687         * dom/Document.cpp:
2688         (WebCore::createHTMLElementWithNameValidation): Extracted from createElement.
2689         (WebCore::Document::createElementForBindings): Renamed from createElement. Specifies
2690         ShouldCreateCustomElement::Create to create a custom element before using fallback elements.
2691         * dom/Document.h:
2692         * dom/Document.idl:
2693
2694         * dom/Node.h:
2695         (WebCore::Node::isCustomElement): Added. This flag is used to identify a custom element.
2696         (WebCore::Node::setIsCustomElement): Added.
2697
2698         * dom/make_names.pl: Extracted createKnownElement from createElement for createHTMLElementWithNameValidation.
2699
2700         * inspector/InspectorCSSAgent.cpp:
2701         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Use qualified name object to instantiate
2702         a style element and set type content attribute.
2703         * inspector/InspectorDOMAgent.cpp:
2704         (WebCore::InspectorDOMAgent::setNodeName): Use createElementForBindings here since we might be creating an
2705         arbitrary element here. Also use RefPtr instead of raw pointers while mutating DOM for safety.
2706
2707 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2708
2709         REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773
2710         https://bugs.webkit.org/show_bug.cgi?id=153194
2711
2712         Reviewed by Michael Catanzaro.
2713
2714         In r192773 we implemented the JavaScriptCore garbage collector
2715         timers for the GTK+ port. Those timers schedule sources in the
2716         current thread default main context, but JS web worker threads
2717         implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop
2718         class that doesn't create a GMainContext for the new thread. This
2719         means that for web sites using workers, we are now doing garbage
2720         collection of worker VMs in the main thread which ends up in a
2721         deadlock at some point. We need to ensure that worker threads
2722         create a GMainContext and push it as the default one for the
2723         thread before the WorkerGlobalScope is created. This way when the
2724         worker Heap is created, the GC timers use the right context to
2725         schedule their sources. And then we need to check if there are
2726         sources pending in the thread main context on every worker run
2727         loop iteration.
2728
2729         * workers/WorkerRunLoop.cpp:
2730         (WebCore::WorkerRunLoop::runInMode):
2731         * workers/WorkerThread.cpp:
2732         (WebCore::WorkerThread::workerThread):
2733
2734 2016-01-25  Commit Queue  <commit-queue@webkit.org>
2735
2736         Unreviewed, rolling out r195533.
2737         https://bugs.webkit.org/show_bug.cgi?id=153423
2738
2739         It is again breaking builds of several ports (Requested by
2740         youenn on #webkit).
2741
2742         Reverted changeset:
2743
2744         "WebCoreJSBuiltins do not use to do conditional include"
2745         https://bugs.webkit.org/show_bug.cgi?id=153306
2746         http://trac.webkit.org/changeset/195533
2747
2748 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2749
2750         WebCoreJSBuiltins do not use to do conditional include
2751         https://bugs.webkit.org/show_bug.cgi?id=153306
2752
2753         Reviewed by Alex Christensen.
2754
2755         Removing compilation guards as builtin generator adds them in the files themselves.
2756         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
2757
2758         No change in behavior.
2759
2760         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
2761         * bindings/js/WebCoreJSBuiltins.cpp:
2762         * bindings/js/WebCoreJSBuiltins.h:
2763
2764 2016-01-25  Commit Queue  <commit-queue@webkit.org>
2765
2766         Unreviewed, rolling out r195531.
2767         https://bugs.webkit.org/show_bug.cgi?id=153420
2768
2769         It is breaking builds of several ports (Requested by youenn on
2770         #webkit).
2771
2772         Reverted changeset:
2773
2774         "WebCoreJSBuiltins do not use to do conditional include"
2775         https://bugs.webkit.org/show_bug.cgi?id=153306
2776         http://trac.webkit.org/changeset/195531
2777
2778 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2779
2780         WebCoreJSBuiltins do not use to do conditional include
2781         https://bugs.webkit.org/show_bug.cgi?id=153306
2782
2783         Reviewed by Alex Christensen.
2784
2785         Removing compilation guards as builtin generator adds them in the files themselves.
2786
2787         No change in behavior.
2788
2789         * bindings/js/WebCoreJSBuiltins.cpp:
2790         * bindings/js/WebCoreJSBuiltins.h:
2791
2792 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2793
2794         [Fetch API] Implement Fetch API Headers
2795         https://bugs.webkit.org/show_bug.cgi?id=152384
2796
2797         Reviewed by Darin Adler.
2798
2799         Adding Fetch Headers API as a wapper around HTTPHeaderMap.
2800
2801         Tests: imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html
2802                imported/w3c/web-platform-tests/fetch/api/headers/headers-casing.html
2803                imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html
2804                imported/w3c/web-platform-tests/fetch/api/headers/headers-idl.html
2805                imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake.html
2806                imported/w3c/web-platform-tests/fetch/api/headers/headers-normalize.html
2807                imported/w3c/web-platform-tests/fetch/api/headers/headers-structure.html
2808
2809         * CMakeLists.txt:
2810         * DerivedSources.cpp:
2811         * DerivedSources.make:
2812         * Modules/fetch/FetchHeaders.cpp: Added.
2813         (WebCore::FetchHeaders::initializeWith):
2814         (WebCore::isForbiddenHeaderName):
2815         (WebCore::isForbiddenResponseHeaderName):
2816         (WebCore::isSimpleHeader):
2817         (WebCore::canWriteHeader):
2818         (WebCore::FetchHeaders::append):
2819         (WebCore::FetchHeaders::remove):
2820         (WebCore::FetchHeaders::get):
2821         (WebCore::FetchHeaders::has):
2822         (WebCore::FetchHeaders::set):
2823         * Modules/fetch/FetchHeaders.h: Added.
2824         (WebCore::FetchHeaders::create):
2825         (WebCore::FetchHeaders::~FetchHeaders):
2826         (WebCore::FetchHeaders::internalHeaders):
2827         (WebCore::FetchHeaders::FetchHeaders):
2828         * Modules/fetch/FetchHeaders.idl: Added.
2829         * Modules/fetch/FetchHeaders.js: Added.
2830         (initializeFetchHeaders):
2831         * WebCore.xcodeproj/project.pbxproj:
2832         * bindings/js/WebCoreBuiltinNames.h:
2833         * bindings/js/WebCoreJSBuiltins.cpp:
2834         * bindings/js/WebCoreJSBuiltins.h:
2835         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
2836         (WebCore::JSBuiltinFunctions::fetchHeadersBuiltins):
2837         * platform/network/HTTPHeaderMap.cpp:
2838         (WebCore::HTTPHeaderMap::contains):
2839         (WebCore::HTTPHeaderMap::remove):
2840         * platform/network/HTTPHeaderMap.h:
2841
2842 2016-01-22  Sergio Villar Senin  <svillar@igalia.com>
2843
2844         [css-grid] grid shorthand must reset gap properties to their initial values
2845         https://bugs.webkit.org/show_bug.cgi?id=153354
2846
2847         Reviewed by Darin Adler.
2848
2849         Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
2850         'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
2851         their values, it must in any case reset them to the initial ones.
2852
2853         * css/CSSParser.cpp:
2854         (WebCore::CSSParser::parseGridShorthand):
2855         * css/CSSPropertyNames.in:
2856
2857 2016-01-24  Brady Eidson  <beidson@apple.com>
2858
2859         Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
2860         https://bugs.webkit.org/show_bug.cgi?id=153415
2861
2862         Reviewed by Darin Adler.
2863
2864         No new tests (Handful of tests now pass, improvements on a handful of others).
2865
2866         * Modules/indexeddb/server/IDBBackingStore.h:
2867         
2868         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2869         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
2870         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2871         
2872         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2873         (WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
2874         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
2875         (WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
2876         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
2877         * Modules/indexeddb/server/MemoryObjectStore.h:
2878         
2879         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2880         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2881         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2882         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
2883         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2884         
2885         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2886         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
2887         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
2888         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2889         
2890         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2891         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
2892         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2893         
2894         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2895         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
2896         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
2897         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
2898         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2899         
2900         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2901         (WebCore::IDBObjectStoreInfo::deleteIndex):
2902         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2903
2904 2016-01-24  Brady Eidson  <beidson@apple.com>
2905
2906         Unreviewed, speculative fix for:
2907         Modern IDB: Some IDB tests crash in ~SQLiteIDBBackingStore
2908         https://bugs.webkit.org/show_bug.cgi?id=153418
2909
2910         No new tests.
2911
2912         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2913         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore): Clear the global object
2914           before wiping out the VM.
2915
2916 2016-01-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2917
2918         Reduce PassRefPtr uses in dom - 4
2919         https://bugs.webkit.org/show_bug.cgi?id=153270
2920
2921         Reviewed by Darin Adler.
2922
2923         As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
2924
2925         * bindings/js/JSDeviceMotionEventCustom.cpp:
2926         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
2927         * dom/DeviceMotionData.cpp:
2928         (WebCore::DeviceMotionData::create):
2929         (WebCore::DeviceMotionData::DeviceMotionData):
2930         * dom/DeviceMotionData.h:
2931         * dom/Document.cpp:
2932         (WebCore::Document::setBodyOrFrameset):
2933         (WebCore::Document::setFocusedElement):
2934         (WebCore::Document::setDecoder):
2935         (WebCore::Document::pushCurrentScript):
2936         * dom/Document.h:
2937         * dom/Event.cpp:
2938         (WebCore::Event::cloneFor):
2939         * dom/Event.h:
2940         * dom/MouseEvent.cpp:
2941         (WebCore::MouseEvent::cloneFor):
2942         * dom/MouseEvent.h:
2943         * dom/NodeIterator.cpp:
2944         (WebCore::NodeIterator::NodePointer::NodePointer):
2945         (WebCore::NodeIterator::NodeIterator):
2946         * dom/NodeIterator.h:
2947         (WebCore::NodeIterator::create):
2948         * html/RadioInputType.cpp:
2949         (WebCore::RadioInputType::handleKeydownEvent):
2950         * platform/ios/DeviceMotionClientIOS.mm:
2951         (WebCore::DeviceMotionClientIOS::motionChanged):
2952         * xml/XSLTProcessor.cpp:
2953         (WebCore::XSLTProcessor::createDocumentFromSource):
2954
2955 2016-01-24  Myles C. Maxfield  <mmaxfield@apple.com>
2956
2957         [Font Loading] General cleanup
2958         https://bugs.webkit.org/show_bug.cgi?id=153403
2959
2960         Reviewed by Darin Adler.
2961
2962         It turns out that CSSFontFaceSource::m_hasExternalSVGFont exactly equals
2963         whether or not CSSFontFaceSource::m_font is a CachedSVGFont. Therefore,
2964         the variable is redundant.
2965
2966         In addition, it was being passed to functions on CSSFontFaceSource::m_font,
2967         which means it was always true inside the CachedSVGFont subclass and
2968         always false for the CachedFont. Therefore, there is no reason pass this
2969         variable to these functions because its value can be determined at
2970         authorship time.
2971
2972         No new tests because there is no behavior change.
2973
2974         * css/CSSFontFaceSource.cpp:
2975         (WebCore::CSSFontFaceSource::font):
2976         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
2977         * css/CSSFontFaceSource.h:
2978         * css/CSSFontSelector.cpp:
2979         (WebCore::createFontFace):
2980         * loader/cache/CachedFont.cpp:
2981         (WebCore::CachedFont::ensureCustomFontData):
2982         (WebCore::CachedFont::createFont):
2983         * loader/cache/CachedFont.h:
2984         * loader/cache/CachedSVGFont.cpp:
2985         (WebCore::CachedSVGFont::createFont):
2986         (WebCore::CachedSVGFont::ensureCustomFontData):
2987         * loader/cache/CachedSVGFont.h:
2988         * platform/network/HTTPParsers.cpp:
2989         (WebCore::isValidHTTPToken):
2990         * xml/XMLHttpRequest.cpp:
2991         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):
2992
2993 2016-01-24  Chris Dumez  <cdumez@apple.com>
2994
2995         An XMLDocument interface should be exposed on the global Window object
2996         https://bugs.webkit.org/show_bug.cgi?id=153378
2997         <rdar://problem/24315465>
2998
2999         Reviewed by Darin Adler.
3000
3001         Expose an XMLDocument interface on the global Window object, as per:
3002         - https://dom.spec.whatwg.org/#xmldocument
3003
3004         DOMImplementation.createDocument() now returns an XMLDocument instead
3005         of a Document, as per:
3006         - https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
3007
3008         Previously, WebKit would alias XMLDocument to Document which caused
3009         some W3C tests to fail.
3010
3011         Chrome and Firefox already match the specification here.
3012
3013         No new tests, already covered by existing tests.
3014
3015         * CMakeLists.txt:
3016         * DerivedSources.cpp:
3017         * DerivedSources.make:
3018         * WebCore.vcxproj/WebCore.vcxproj:
3019         * WebCore.vcxproj/WebCore.vcxproj.filters:
3020         * WebCore.xcodeproj/project.pbxproj:
3021         * bindings/js/JSBindingsAllInOne.cpp:
3022         * bindings/js/JSDocumentCustom.cpp:
3023         (WebCore::createNewDocumentWrapper):
3024         * dom/DOMImplementation.cpp:
3025         (WebCore::DOMImplementation::createDocument):
3026         * dom/DOMImplementation.h:
3027         * dom/DOMImplementation.idl:
3028         * dom/Document.cpp:
3029         (WebCore::Document::cloneDocumentWithoutChildren):
3030         * dom/Document.h:
3031         (WebCore::Document::isXMLDocument):
3032         (WebCore::Document::create): Deleted.
3033         (WebCore::Document::createNonRenderedPlaceholder): Deleted.
3034         * dom/XMLDocument.h: Added.
3035         (WebCore::XMLDocument::create):
3036         (WebCore::XMLDocument::createXHTML):
3037         (WebCore::XMLDocument::XMLDocument):
3038         (isType):
3039         * dom/XMLDocument.idl: Added.
3040         * inspector/DOMPatchSupport.cpp:
3041         (WebCore::DOMPatchSupport::patchDocument):
3042         * inspector/InspectorDOMAgent.cpp:
3043         (WebCore::InspectorDOMAgent::setOuterHTML):
3044         * page/DOMWindow.idl:
3045         * page/PageSerializer.cpp:
3046         (WebCore::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
3047         * svg/SVGDocument.cpp:
3048         (WebCore::SVGDocument::SVGDocument):
3049         * svg/SVGDocument.h:
3050         * svg/SVGDocument.idl:
3051         * xml/XMLHttpRequest.cpp:
3052         (WebCore::XMLHttpRequest::responseXML):
3053         * xml/XSLTProcessor.cpp:
3054         (WebCore::XSLTProcessor::createDocumentFromSource):
3055
3056 2016-01-24  Brady Eidson  <beidson@apple.com>
3057
3058         Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store.
3059         https://bugs.webkit.org/show_bug.cgi?id=153410
3060
3061         Reviewed by Darin Adler.
3062
3063         No new tests (Covered by unskipping many existing tests).
3064
3065         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3066         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
3067         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3068         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
3069         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
3070         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3071
3072         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3073         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
3074         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
3075         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3076
3077         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3078         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
3079         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
3080
3081 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
3082
3083         Make the dumped display list representation a bit more compact
3084         https://bugs.webkit.org/show_bug.cgi?id=153409
3085
3086         Reviewed by Zalan Bujtas.
3087
3088         Don't make a group for every display list item.
3089
3090         * platform/graphics/displaylists/DisplayList.cpp:
3091         (WebCore::DisplayList::DisplayList::asText):
3092
3093 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
3094
3095         Add testing for display list replay, and skip clipped-out items on replay
3096         https://bugs.webkit.org/show_bug.cgi?id=153408
3097
3098         Reviewed by Zalan Bujtas.
3099         
3100         Make it possible to save and serialize a DisplayList of Items which were
3101         actually applied on replay, so that replay-time optimizations can be tested.
3102         
3103         This exposes internals.setElementTracksDisplayListReplay() and
3104         internals.replayDisplayListForElement().
3105         
3106         Do a trivial replay-time optimization, which is to skip items whose extents are
3107         outside the replay clip.
3108
3109         Test: displaylists/replay-skip-clipped-rect.html
3110
3111         * platform/graphics/GraphicsLayer.cpp:
3112         (WebCore::GraphicsLayer::GraphicsLayer):
3113         * platform/graphics/GraphicsLayer.h:
3114         (WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
3115         (WebCore::GraphicsLayer::isTrackingDisplayListReplay):
3116         (WebCore::GraphicsLayer::replayDisplayListAsText):
3117         * platform/graphics/ca/GraphicsLayerCA.cpp:
3118         (WebCore::layerDisplayListMap): Use a singleton map to store the replay display lists
3119         to avoid bloating GraphicsLayerCA for test-only code. The map stores a pair of the
3120         replay list and a clip rect, which are both dumped. Dumping the clip rect ensures that
3121         we're reporting the replay for the correct tile in a test (since there will be a replay
3122         for each tile).
3123         (WebCore::GraphicsLayerCA::~GraphicsLayerCA):
3124         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3125         (WebCore::GraphicsLayerCA::setIsTrackingDisplayListReplay):
3126         (WebCore::GraphicsLayerCA::replayDisplayListAsText):
3127         * platform/graphics/ca/GraphicsLayerCA.h:
3128         * platform/graphics/displaylists/DisplayList.h:
3129         (WebCore::DisplayList::DisplayList::appendItem):
3130         * platform/graphics/displaylists/DisplayListReplayer.cpp:
3131         (WebCore::DisplayList::Replayer::replay): In the unlikely event of tracking replays,
3132         allocate a new DisplayList and append to it items which actually get applied.
3133         * platform/graphics/displaylists/DisplayListReplayer.h:
3134         * rendering/RenderLayerBacking.cpp:
3135         (WebCore::RenderLayerBacking::setIsTrackingDisplayListReplay):
3136         (WebCore::RenderLayerBacking::replayDisplayListAsText):
3137         * rendering/RenderLayerBacking.h:
3138         * testing/Internals.cpp:
3139         (WebCore::Internals::setElementTracksDisplayListReplay):
3140         (WebCore::Internals::replayDisplayListForElement):
3141         * testing/Internals.h:
3142         * testing/Internals.idl:
3143
3144 2016-01-23  Wonchul Lee  <wonchul.lee@collabora.co.uk>
3145
3146         [GTK] Fix media controls displaying without controls attribute
3147         https://bugs.webkit.org/show_bug.cgi?id=152500
3148
3149         Media controls is not displayed without controls attribute by default
3150         when the video element has text track. It'll be displayed on fullscreen
3151         regardless of controls attribute.
3152
3153         Reviewed by Michael Catanzaro.
3154
3155         * Modules/mediacontrols/mediaControlsGtk.js:
3156         (ControllerGtk.prototype.shouldHaveControls):
3157         (ControllerGtk.prototype.reconnectControls):
3158         (ControllerGtk.prototype.removeControls):
3159         (ControllerGtk.prototype.configureControls): Deleted.
3160 2016-01-23  Alex Christensen  <achristensen@webkit.org>
3161
3162         Use credentials from a URL with NetworkSession like we did with ResourceHandle
3163         https://bugs.webkit.org/show_bug.cgi?id=153328
3164
3165         Reviewed by Alexey Proskuryakov.
3166
3167         This patch fixes at least http/tests/xmlhttprequest/basic-auth-credentials-escaping.html when using NetworkSession.
3168
3169         * platform/network/ProtectionSpaceBase.h:
3170         (WebCore::ProtectionSpaceBase::encodingRequiresPlatformData):
3171         * platform/network/ResourceRequestBase.h:
3172         Add some WEBCORE_EXPORT macros for functions that are now used in WebKit2.
3173
3174 2016-01-23  Brady Eidson  <beidson@apple.com>
3175
3176         Modern IDB: Implement clearing object stores and opening cursors in the SQLite backend.
3177         https://bugs.webkit.org/show_bug.cgi?id=153396
3178
3179         Reviewed by Alex Christensen.
3180
3181         No new tests (Some failing tests now pass, others improved).
3182
3183         Copy more LegacyIDB SQLite backend code over to the new SQLite backend.
3184         
3185         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3186         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3187         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
3188         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
3189
3190 2016-01-22  Commit Queue  <commit-queue@webkit.org>
3191
3192         Unreviewed, rolling out r195493.
3193         https://bugs.webkit.org/show_bug.cgi?id=153397
3194
3195         Broke authenticaiton tests (leaks credentials) (Requested by
3196         ap on #webkit).
3197
3198         Reverted changeset:
3199
3200         "LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-
3201         unterminated.html crashing"
3202         https://bugs.webkit.org/show_bug.cgi?id=153250
3203         http://trac.webkit.org/changeset/195493
3204
3205 2016-01-20  Ryosuke Niwa  <rniwa@webkit.org>
3206
3207         HTMLElement::nodeName should not upper case non-ASCII characters
3208         https://bugs.webkit.org/show_bug.cgi?id=153231
3209
3210         Reviewed by Darin Adler.
3211
3212         Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.
3213
3214         Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html
3215
3216         * dom/QualifiedName.cpp:
3217         (WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
3218         * html/HTMLElement.cpp:
3219         (WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.
3220
3221 2016-01-22  Brady Eidson  <beidson@apple.com>
3222
3223         Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
3224         https://bugs.webkit.org/show_bug.cgi?id=153381
3225
3226         Reviewed by Alex Christensen.
3227
3228         No new tests (This resolves many of the currently crashing/asserting tests).
3229
3230         Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
3231         
3232         The way the Legacy backend works is restricted to one transaction at a time.
3233         
3234         There's many tricks we can play to resolve this, but that task is better performed
3235         once all of the basic functionality is done.
3236         
3237         Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
3238
3239         * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
3240         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3241         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3242         
3243         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3244         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3245         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3246         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
3247         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
3248           not support simultaneous transactions but there is a transaction in progress, return.
3249         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3250
3251 2016-01-22  Chris Dumez  <cdumez@apple.com>
3252
3253         document.charset should be an alias for document.characterSet
3254         https://bugs.webkit.org/show_bug.cgi?id=153367
3255
3256         Reviewed by Ryosuke Niwa.
3257
3258         document.charset should be an alias for document.characterSet:
3259         - https://dom.spec.whatwg.org/#dom-document-charset
3260
3261         It should also be read-only.
3262
3263         Chrome matches the specification.
3264
3265         No new tests, already covered by existing tests.
3266
3267         * dom/Document.h:
3268         * dom/Document.idl:
3269
3270 2016-01-22  Chris Dumez  <cdumez@apple.com>
3271
3272         Document.open / Document.write should be prevented while the document is being unloaded
3273         https://bugs.webkit.org/show_bug.cgi?id=153255
3274         <rdar://problem/22741293>
3275
3276         Reviewed by Ryosuke Niwa.
3277
3278         Document.open / Document.write should be prevented while the document
3279         is being unloaded, as per the HTML specification:
3280         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
3281         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
3282
3283         This patch is aligning our behavior with the specification and Firefox.
3284         Calling Document.open / Document.write during the document was being
3285         unloaded would cause us to crash as this was unexpected.
3286
3287         Tests: fast/frames/page-hide-document-open.html
3288                fast/frames/page-unload-document-open.html
3289
3290         * WebCore.xcodeproj/project.pbxproj:
3291         Add new IgnoreOpensDuringUnloadCountIncrementer.h header.
3292
3293         * dom/Document.cpp:
3294         (WebCore::Document::open):
3295         Abort if the document's ignore-opens-during-unload counter is greater
3296         than zero, as per:
3297         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
3298
3299         (WebCore::Document::write):
3300         Abort if the insertion point is undefined and the document's
3301         ignore-opens-during-unload counter is greater than zero, as per:
3302         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
3303
3304         * dom/Document.h:
3305         Add data member to maintain the document's ignore-opens-during-unload counter:
3306         https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
3307
3308         * dom/IgnoreOpensDuringUnloadCountIncrementer.h: Added.
3309         Add utility class to increment / decrement a document's
3310         ignore-opens-during-unload counter.
3311
3312         * history/CachedFrame.cpp:
3313         (WebCore::CachedFrame::CachedFrame):
3314         When a page goes into PageCache, we don't end up calling
3315         FrameLoader::detachChildren() so we need to increment the document's
3316         ignore-opens-during-unload counter before calling stopLoading() on each
3317         subframe.
3318
3319         * loader/FrameLoader.cpp:
3320         (WebCore::FrameLoader::detachChildren):
3321         detachChildren() will end up firing the pagehide / unload events in each
3322         child frame so we increment the parent frame's document's
3323         ignore-opens-during-unload counter. This behavior matches the text of:
3324         https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
3325
3326         As per the spec, the document's ignore-opens-during-unload counter should
3327         be incremented before firing the pagehide / unload events at the document's
3328         Window object. It should be decremented only after firing the pagehide /
3329         unload events in each subframe. This is needed in case a subframe tries to
3330         call document.open / document.write on a parent frame's document, from its
3331         pagehide or unload handler.
3332
3333         (WebCore::FrameLoader::dispatchUnloadEvents):
3334         Increment the document's ignore-opens-during-unload counter before firing
3335         the pagehide / unload events and decrement it after. As per the spec, we
3336         are not supposed to decrement this early. We actually supposed to wait
3337         until the pagehide / unload events have been fired in all the subframes.
3338         For this reason, we take care of re-incrementing the document's
3339         ignore-opens-during-unload in detachChildren(), which will take care of
3340         firing the pagehide / unload in the subframes.
3341
3342 2016-01-22  Brady Eidson  <beidson@apple.com>
3343
3344         Modern IDB: Implement put, get, and delete records for the SQLite backend.
3345         https://bugs.webkit.org/show_bug.cgi?id=153375
3346
3347         Reviewed by Alex Christensen.
3348
3349         No new tests (Covered by many existing tests now passing).
3350
3351         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3352         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
3353         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
3354         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
3355         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3356         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3357         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3358
3359 2016-01-22  Enrica Casucci  <enrica@apple.com>
3360
3361         Add support for DataDetectors in WK (iOS).
3362         https://bugs.webkit.org/show_bug.cgi?id=152989
3363         rdar://problem/22855960
3364
3365         Reviewed by Tim Horton.
3366
3367         This patch adds the logic to perform data detection and modify
3368         the DOM by adding data detector links as appropriate.
3369         The data detector results returned by detectContentInRange are
3370         stored in the Frame object.
3371
3372         * editing/cocoa/DataDetection.h:
3373         * editing/cocoa/DataDetection.mm:
3374         (WebCore::resultIsURL):
3375         (WebCore::constructURLStringForResult):
3376         (WebCore::removeResultLinksFromAnchor):
3377         (WebCore::searchForLinkRemovingExistingDDLinks):
3378         (WebCore::dataDetectorTypeForCategory):
3379         (WebCore::buildQuery):
3380         (WebCore::DataDetection::detectContentInRange):
3381         * loader/FrameLoader.cpp:
3382         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
3383         * page/Frame.h:
3384         (WebCore::Frame::setDataDetectionResults):
3385         (WebCore::Frame::dataDetectionResults):
3386         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3387         (DDQueryOffsetCompare):
3388
3389 2016-01-22  Daniel Bates  <dabates@apple.com>
3390
3391         LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
3392         https://bugs.webkit.org/show_bug.cgi?id=153250
3393         <rdar://problem/12172843>
3394         And
3395         <rdar://problem/24248040>
3396
3397         Reviewed by Alexey Proskuryakov.
3398
3399         Remove an incorrect assertion that the absolute URL associated with a protection space cannot
3400         contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
3401         This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
3402         with the invariants for WebCore::protectionSpaceMapKeyFromURL().
3403
3404         Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
3405                http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
3406
3407         * platform/network/CredentialStorage.cpp:
3408         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
3409
3410 2016-01-22  Chris Dumez  <cdumez@apple.com>
3411
3412         DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element
3413         https://bugs.webkit.org/show_bug.cgi?id=153374
3414
3415         Reviewed by Ryosuke Niwa.
3416
3417         DOMImplementation.createHTMLDocument("") should append an empty Text
3418         Node to the title Element as per the steps at:
3419         - https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument (step 6)
3420
3421         Firefox and Chrome follow the specification here.
3422
3423         Previously, WebKit would rely on HTMLTitleElement.text setter which
3424         does not create a Text Node if the title is the empty string, as per:
3425         - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
3426         - https://dom.spec.whatwg.org/#dom-node-textcontent
3427
3428         No new tests, already covered by existing test.
3429
3430         * dom/DOMImplementation.cpp:
3431         (WebCore::DOMImplementation::createHTMLDocument):
3432
3433 2016-01-17  Ada Chan  <adachan@apple.com>
3434
3435         Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
3436         https://bugs.webkit.org/show_bug.cgi?id=153220
3437
3438         Reviewed by Eric Carlson.
3439
3440         No new tests, just code refactoring.
3441
3442         * Modules/mediacontrols/MediaControlsHost.cpp:
3443         (WebCore::MediaControlsHost::supportsFullscreen):
3444         Just pass in VideoFullscreenModeStandard as this is used for checking the standard fullscreen case.
3445
3446         * html/HTMLMediaElement.cpp:
3447         (WebCore::HTMLMediaElement::enterFullscreen):
3448         Only use the FullScreen API if the mode is VideoFullscreenModeStandard. Call ChromeClient::supportsVideoFullscreen()
3449         with the mode.
3450         (WebCore::HTMLMediaElement::exitFullscreen):
3451         Move the fullscreen element check up so