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