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