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