RenderVideo should always update the intrinsic size before layout.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-21  Zalan Bujtas  <zalan@apple.com>
2
3         RenderVideo should always update the intrinsic size before layout.
4         https://bugs.webkit.org/show_bug.cgi?id=156878
5
6         Reviewed by Simon Fraser.
7
8         In order to layout video element properly we need to know the correct intrinsic size.
9         This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
10
11         This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
12
13         * rendering/RenderVideo.cpp:
14         (WebCore::RenderVideo::updateIntrinsicSize):
15         (WebCore::RenderVideo::layout):
16         (WebCore::RenderVideo::updatePlayer):
17         * rendering/RenderVideo.h:
18
19 2016-04-21  Brady Eidson  <beidson@apple.com>
20
21         Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
22         https://bugs.webkit.org/show_bug.cgi?id=156877
23
24         Reviewed by Tim Horton.
25
26         No new tests (Covered by changes to existing tests).
27
28         * workers/WorkerMessagingProxy.cpp:
29         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
30           where we can get the IDBConnectionProxy from the Document and pass it down through Worker
31           machinery so it can end up at the WorkerGlobalScope.
32         
33         Everything else is this patch is just passing it along as needed.
34
35         And cleaning up header style for neglected headers.
36
37         * workers/DedicatedWorkerGlobalScope.cpp:
38         (WebCore::DedicatedWorkerGlobalScope::create):
39         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
40         * workers/DedicatedWorkerGlobalScope.h:
41
42         * workers/DedicatedWorkerThread.cpp:
43         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
44         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
45         * workers/DedicatedWorkerThread.h:
46         (WebCore::DedicatedWorkerThread::create):
47         (WebCore::DedicatedWorkerThread::workerObjectProxy):
48
49         * workers/WorkerGlobalScope.cpp:
50         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
51         (WebCore::WorkerGlobalScope::idbConnectionProxy):
52         * workers/WorkerGlobalScope.h:
53
54         * workers/WorkerThread.cpp:
55         (WebCore::WorkerThread::WorkerThread):
56         (WebCore::WorkerThread::idbConnectionProxy):
57         * workers/WorkerThread.h:
58         (WebCore::WorkerThread::threadID):
59         (WebCore::WorkerThread::runLoop):
60         (WebCore::WorkerThread::workerLoaderProxy):
61         (WebCore::WorkerThread::workerReportingProxy):
62         (WebCore::WorkerThread::getNotificationClient):
63         (WebCore::WorkerThread::setNotificationClient):
64         (WebCore::WorkerThread::workerGlobalScope):
65
66 2016-04-21  Anders Carlsson  <andersca@apple.com>
67
68         Fix crashes when loading SVG images.
69
70         * loader/EmptyClients.cpp:
71         (WebCore::fillWithEmptyClients):
72         Give the SVG page its own application cache storage.
73
74 2016-04-21  Anders Carlsson  <andersca@apple.com>
75
76         Get rid of ApplicationCacheStorage::singleton
77         https://bugs.webkit.org/show_bug.cgi?id=156882
78
79         Reviewed by Tim Horton.
80
81         * loader/appcache/ApplicationCacheStorage.cpp:
82         (WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
83         (WebCore::ApplicationCacheStorage::singleton): Deleted.
84         * loader/appcache/ApplicationCacheStorage.h:
85         * page/Page.cpp:
86         (WebCore::Page::Page):
87
88 2016-04-21  Simon Fraser  <simon.fraser@apple.com>
89
90         ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
91         https://bugs.webkit.org/show_bug.cgi?id=155362
92
93         Reviewed by Zalan Bujtas.
94
95         A particular configuration of composited RenderLayers with preserve-3d and clipping
96         caused assertions because an ancestor clipping layer had masksToBounds() set, but
97         a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
98         Make two changes to address this:
99
100         First, CSS clip: and clip-path: should force flattening and override preserve-3d in
101         the RenderStyle.
102
103         Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().
104
105         Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
106                compositing/clipping/preserve3d-flatten-assertion.html
107
108         * css/StyleResolver.cpp:
109         (WebCore::StyleResolver::adjustRenderStyle):
110         * platform/graphics/ca/GraphicsLayerCA.cpp:
111         (WebCore::accumulatesTransform):
112
113 2016-04-21  Chris Dumez  <cdumez@apple.com>
114
115         Element::idForStyleResolution() is a foot-gun
116         https://bugs.webkit.org/show_bug.cgi?id=156852
117
118         Reviewed by Darin Adler.
119
120         Element::idForStyleResolution() is a foot-gun. It requires the caller to check
121         Element::hasID() first or it may end up crashing when dereferencing elementData()
122         (e.g. see Bug 156806).
123
124         This patch updates Element::idForStyleResolution() to return nullAtom is the
125         Element does not have an ID. I did not see a performance impact on Speedometer,
126         Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.
127
128         * css/ElementRuleCollector.cpp:
129         (WebCore::ElementRuleCollector::collectMatchingRules):
130         * css/SelectorChecker.cpp:
131         (WebCore::SelectorChecker::checkOne):
132         * css/SelectorFilter.cpp:
133         (WebCore::collectElementIdentifierHashes):
134         * dom/Element.h:
135         (WebCore::Element::idForStyleResolution):
136         * rendering/RenderBlockFlow.cpp:
137         (WebCore::needsAppleMailPaginationQuirk):
138         * rendering/RenderTreeAsText.cpp:
139         (WebCore::writeRenderRegionList):
140         * style/StyleSharingResolver.cpp:
141         (WebCore::Style::SharingResolver::canShareStyleWithElement):
142
143 2016-04-21  Brady Eidson  <beidson@apple.com>
144
145         Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
146         https://bugs.webkit.org/show_bug.cgi?id=156868
147
148         Reviewed by Tim Horton.
149
150         No new tests (No behavior change).
151
152         * Modules/indexeddb/IDBDatabase.cpp:
153         (WebCore::IDBDatabase::create):
154         (WebCore::IDBDatabase::IDBDatabase):
155         (WebCore::IDBDatabase::~IDBDatabase):
156         (WebCore::IDBDatabase::transaction):
157         (WebCore::IDBDatabase::maybeCloseInServer):
158         * Modules/indexeddb/IDBDatabase.h:
159         (WebCore::IDBDatabase::connectionProxy):
160         (WebCore::IDBDatabase::serverConnection):
161
162         * Modules/indexeddb/IDBOpenDBRequest.cpp:
163         (WebCore::IDBOpenDBRequest::createDeleteRequest):
164         (WebCore::IDBOpenDBRequest::createOpenRequest):
165         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
166         (WebCore::IDBOpenDBRequest::onSuccess):
167         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
168         (WebCore::IDBOpenDBRequest::requestCompleted):
169         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
170         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
171         * Modules/indexeddb/IDBOpenDBRequest.h:
172
173         * Modules/indexeddb/IDBRequest.cpp:
174         (WebCore::IDBRequest::IDBRequest):
175         (WebCore::IDBRequest::connectionToServer): Deleted.
176         * Modules/indexeddb/IDBRequest.h:
177         (WebCore::IDBRequest::connectionProxy):
178
179         * Modules/indexeddb/IDBTransaction.h:
180
181         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
182         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
183         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
184
185 2016-04-21  Jiewen Tan  <jiewen_tan@apple.com>
186
187         [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
188         https://bugs.webkit.org/show_bug.cgi?id=156829
189         <rdar://problem/23348217>
190
191         Reviewed by Daniel Bates.
192
193         Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.
194
195         Covered by existing tests.
196
197         * loader/ResourceLoadNotifier.cpp:
198         (WebCore::ResourceLoadNotifier::didFailToLoad):
199         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
200         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
201         (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
202         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
203         (WebCore::ResourceLoadNotifier::dispatchDidFailLoading):
204
205 2016-04-21  Brady Eidson  <beidson@apple.com>
206
207         Modern IDB (Workers): More IDBConnectionProxy refactoring.
208         https://bugs.webkit.org/show_bug.cgi?id=156855
209
210         Reviewed by Darin Adler.
211
212         No new tests (Covered by changes to existing tests).
213
214         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
215         (WebCore::DOMWindowIndexedDatabase::indexedDB):
216
217         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
218         * Modules/indexeddb/IDBFactory.cpp:
219         (WebCore::IDBFactory::create):
220         (WebCore::IDBFactory::IDBFactory):
221         (WebCore::IDBFactory::openInternal):
222         (WebCore::IDBFactory::deleteDatabase):
223         * Modules/indexeddb/IDBFactory.h:
224
225         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
226         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
227         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
228         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
229         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
230         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
231
232         Make IDBConnectionProxy ThreadSafeRefCounted:
233         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
234         (WebCore::IDBClient::IDBConnectionProxy::create):
235         * Modules/indexeddb/client/IDBConnectionProxy.h:
236
237         * dom/Document.cpp:
238         (WebCore::Document::idbConnectionProxy):
239         * dom/Document.h:
240
241 2016-04-21  Keith Miller  <keith_miller@apple.com>
242
243         WebScriptObject description swizzler should work in a multi-threaded world
244         https://bugs.webkit.org/show_bug.cgi?id=156808
245
246         Reviewed by Geoffrey Garen.
247
248         A WebKit legacy API user might be running Objective-C code on another thread.
249         Since we don't want to corrupt other thread's NSObject description method
250         we use TLS to record if we are in the stringValue function. As an attempt to
251         preserve any user swizzling we update the non-stringValue NSObject description
252         method on each call to stringValue if it has changed. Additionally, the TLS
253         needs to be a int because the user might call into stringValue, back into JS,
254         then back into stringValue. If the TLS was a boolean then it would be unset
255         at that point so when we return into the first stringValue call we would call
256         the original NSObject description method rather than our override.
257
258         Test added to API tests: WebKit1.WebScriptObjectDescription
259
260         * bridge/objc/objc_instance.mm:
261         (-[NSObject _web_description]):
262         (ObjcInstance::stringValue):
263         (swizzleNSObjectDescription): Deleted.
264
265 2016-04-21  Beth Dakin  <bdakin@apple.com>
266
267         Build fix.
268
269         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
270         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
271         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
272         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
273
274 2016-04-21  Beth Dakin  <bdakin@apple.com>
275
276         32 bit build fix.
277
278         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
279
280 2016-04-21  Konstantin Tokarev  <annulen@yandex.ru>
281
282         Fixed compilation with !ENABLE(SVG_FONTS).
283         https://bugs.webkit.org/show_bug.cgi?id=156850
284
285         Reviewed by Michael Catanzaro.
286
287         No new tests needed.
288
289         * css/CSSFontFaceSource.cpp:
290         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
291         Added missing ENABLE(SVG_FONTS) guards.
292         * css/CSSFontFaceSource.h: Ditto.
293         * platform/graphics/FontCascade.cpp: Ditto.
294         * svg/SVGToOTFFontConversion.cpp:
295         (WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
296         !ENABLE(SVG_FONTS) guard.
297
298 2016-04-21  Beth Dakin  <bdakin@apple.com>
299
300         Remove reliance on WebAVMediaSelectionOptionMac for the 
301         WebPlaybackControlsManager
302         https://bugs.webkit.org/show_bug.cgi?id=156811
303         -and corresponding-
304         rdar://problem/25760523
305
306         Reviewed by Jer Noble.
307
308         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
309         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
310         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
311         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
312         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
313         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
314         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
315         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
316         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
317         (-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
318         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
319         (-[WebPlaybackControlsManager isSeeking]): Deleted.
320         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
321         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
322         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
323         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
324         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
325         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
326         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
327         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
328         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
329         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
330         (WebCore::mediaSelectionOptions): Deleted.
331
332 2016-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
333
334         REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
335         https://bugs.webkit.org/show_bug.cgi?id=156766
336
337         Reviewed by Darin Adler.
338
339         Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
340         only once and is cached for subsequent uses. 
341         
342         The image subsampling is on by default only for iOS. So the and this
343         patch currently affects the iOS port.
344
345         * platform/graphics/ImageSource.cpp:
346         (WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
347         Use m_frameCount as a flag for having_the_cache_done.
348         (WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
349         before using m_maximumSubsamplingLevel.
350         (WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
351         m_frameCount.
352         * platform/graphics/ImageSource.h:
353
354 2016-04-21  Antoine Quint  <graouts@apple.com>
355
356         Creating a large number of WebGL contexts should recycle older contexts
357         https://bugs.webkit.org/show_bug.cgi?id=156689
358         <rdar://problem/19535330>
359
360         Reviewed by Dean Jackson.
361
362         We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
363         created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
364         and they lose older contexts when the developer creates a new context, logging a warning
365         to the console. We now follow the same approach.
366
367         Tests: webgl/max-active-contexts-console-warning.html
368                webgl/max-active-contexts-gc.html
369                webgl/max-active-contexts-oldest-context-lost.html
370                webgl/max-active-contexts-webglcontextlost-prevent-default.html
371
372         * html/canvas/WebGLRenderingContextBase.cpp:
373         (WebCore::WebGLRenderingContextBase::recycleContext):
374
375         Prints a warning message to the console indicating that an older WebGL context
376         will be lost to accomodate for the active contexts limit being reached and loses
377         the provided context in a way that it may not be recovered by calling `event.preventDefault()`
378         in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
379         since it will no longer be useful and it may hold large Open GL resources.
380
381         * html/canvas/WebGLRenderingContextBase.h:
382         * platform/graphics/GraphicsContext3D.h:
383
384         Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.
385
386         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
387         (WebCore::GraphicsContext3D::create):
388         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
389         (WebCore::GraphicsContext3D::create):
390         * platform/graphics/mac/GraphicsContext3DMac.mm:
391         (WebCore::activeContexts):
392         (WebCore::GraphicsContext3D::create):
393
394         Check if we are at the active contexts limit (16) and recycle the oldest context
395         in our active contexts list. Calling recycleContext() on a context will call the
396         GraphicsContext3D destructor and remove it from the active contexts list there.
397
398         (WebCore::GraphicsContext3D::~GraphicsContext3D):
399
400         Remove the deconstructed context from the active contexts list.
401
402         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
403         (WebCore::GraphicsContext3D::recycleContext):
404         * platform/graphics/win/GraphicsContext3DWin.cpp:
405         (WebCore::GraphicsContext3D::create):
406
407 2016-04-21  Dave Hyatt  <hyatt@apple.com>
408
409         Don't hyphenate the last word in a paragraph of text.
410         https://bugs.webkit.org/show_bug.cgi?id=156803
411
412         Reviewed by Simon Fraser.
413
414         Added fast/text/hyphenate-avoid-orphaned-word.html
415
416         * rendering/RenderText.h:
417         * rendering/line/BreakingContext.h:
418         (WebCore::BreakingContext::handleText):
419
420 2016-04-21  Chris Dumez  <cdumez@apple.com>
421
422         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
423         https://bugs.webkit.org/show_bug.cgi?id=156805
424
425         Reviewed by Youenn Fablet.
426
427         No new tests, no web-exposed behavior change.
428
429         * accessibility/AXObjectCache.cpp:
430         (WebCore::AXObjectCache::rangeForNodeContents):
431         (WebCore::characterOffsetsInOrder):
432         (WebCore::setRangeStartOrEndWithCharacterOffset):
433         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
434         (WebCore::AXObjectCache::previousBoundary):
435         * accessibility/AccessibilityObject.cpp:
436         (WebCore::AccessibilityObject::selectText):
437         * accessibility/AccessibilityRenderObject.cpp:
438         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
439         * dom/Node.cpp:
440         (WebCore::Node::textRects):
441         * dom/Range.cpp:
442         (WebCore::Range::Range):
443         (WebCore::Range::setDocument):
444         (WebCore::Range::setStart):
445         (WebCore::Range::setEnd):
446         (WebCore::Range::isPointInRange):
447         (WebCore::Range::comparePoint):
448         (WebCore::Range::compareNode):
449         (WebCore::Range::compareBoundaryPoints):
450         (WebCore::Range::compareBoundaryPointsForBindings):
451         (WebCore::Range::intersectsNode):
452         (WebCore::Range::processContents):
453         (WebCore::Range::insertNode):
454         (WebCore::Range::checkNodeWOffset):
455         (WebCore::Range::setStartAfter):
456         (WebCore::Range::setEndBefore):
457         (WebCore::Range::setEndAfter):
458         (WebCore::Range::selectNode):
459         (WebCore::Range::selectNodeContents):
460         (WebCore::Range::surroundContents):
461         (WebCore::Range::setStartBefore):
462         (WebCore::Range::contains):
463         (WebCore::rangesOverlap):
464         (WebCore::rangeOfContents):
465         (WebCore::boundaryNodeChildrenWillBeRemoved):
466         (WebCore::boundaryTextNodesMerged):
467         (WebCore::boundaryTextNodesSplit):
468         (WebCore::Range::expand):
469         (WebCore::checkForDifferentRootContainer): Deleted.
470         (WebCore::highestAncestorUnderCommonRoot): Deleted.
471         (WebCore::childOfCommonRootBeforeOffset): Deleted.
472         (WebCore::deleteCharacterData): Deleted.
473         (WebCore::Range::toString): Deleted.
474         (WebCore::Range::toHTML): Deleted.
475         (WebCore::Range::text): Deleted.
476         (WebCore::Range::cloneRange): Deleted.
477         (WebCore::Range::absoluteTextRects): Deleted.
478         (WebCore::Range::absoluteTextQuads): Deleted.
479         (WebCore::boundaryNodeChildrenChanged): Deleted.
480         (WebCore::boundaryNodeWillBeRemoved): Deleted.
481         (WebCore::Range::nodeWillBeRemoved): Deleted.
482         (WebCore::boundaryTextRemoved): Deleted.
483         (WebCore::Range::getBoundingClientRect): Deleted.
484         (WebCore::Range::getBorderAndTextQuads): Deleted.
485         * dom/Range.h:
486         * dom/Range.idl:
487         * dom/RangeBoundaryPoint.h:
488         (WebCore::RangeBoundaryPoint::set):
489         (WebCore::RangeBoundaryPoint::setToStartOfNode):
490         (WebCore::RangeBoundaryPoint::setToEndOfNode):
491         * editing/AlternativeTextController.cpp:
492         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
493         * editing/ApplyStyleCommand.cpp:
494         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
495         * editing/Editor.cpp:
496         (WebCore::Editor::advanceToNextMisspelling):
497         (WebCore::Editor::rangeOfString):
498         (WebCore::isFrameInRange):
499         (WebCore::Editor::countMatchesForText):
500         * editing/EditorCommand.cpp:
501         (WebCore::unionDOMRanges):
502         (WebCore::executeDeleteToMark):
503         (WebCore::executeSelectToMark):
504         * editing/FormatBlockCommand.cpp:
505         (WebCore::FormatBlockCommand::formatRange):
506         * editing/FrameSelection.cpp:
507         (WebCore::FrameSelection::respondToNodeModification):
508         * editing/InsertListCommand.cpp:
509         (WebCore::InsertListCommand::doApplyForSingleParagraph):
510         * editing/TextCheckingHelper.cpp:
511         (WebCore::TextCheckingParagraph::offsetTo):
512         * editing/TextIterator.cpp:
513         (WebCore::CharacterIterator::range):
514         (WebCore::BackwardsCharacterIterator::range):
515         (WebCore::TextIterator::rangeFromLocationAndLength):
516         (WebCore::TextIterator::getLocationAndLengthFromRange):
517         (WebCore::findPlainText):
518         * editing/VisiblePosition.cpp:
519         (WebCore::setStart):
520         (WebCore::setEnd):
521         * editing/VisibleSelection.cpp:
522         (WebCore::makeSearchRange):
523         * editing/VisibleUnits.cpp:
524         (WebCore::previousBoundary):
525         (WebCore::nextBoundary):
526         * editing/htmlediting.cpp:
527         (WebCore::visiblePositionForIndexUsingCharacterIterator):
528         (WebCore::isNodeVisiblyContainedWithin):
529         * editing/htmlediting.h:
530         * editing/mac/EditorMac.mm:
531         (WebCore::Editor::adjustedSelectionRange):
532         * page/ContextMenuController.cpp:
533         (WebCore::ContextMenuController::contextMenuItemSelected):
534         * page/DOMSelection.cpp:
535         (WebCore::DOMSelection::addRange):
536         * page/DragController.cpp:
537         (WebCore::selectElement):
538         * page/EventHandler.cpp:
539         (WebCore::EventHandler::dispatchMouseEvent):
540         * page/Page.cpp:
541         (WebCore::Page::findStringMatchingRanges):
542         * page/TextIndicator.cpp:
543         (WebCore::hasNonInlineOrReplacedElements):
544         * rendering/RenderNamedFlowThread.cpp:
545         (WebCore::RenderNamedFlowThread::getRanges):
546
547 2016-04-21  Chris Dumez  <cdumez@apple.com>
548
549         Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
550         https://bugs.webkit.org/show_bug.cgi?id=156797
551
552         Reviewed by Youenn Fablet.
553
554         * html/DOMURL.cpp:
555         (WebCore::DOMURL::create):
556         * html/DOMURL.h:
557         * html/DOMURL.idl:
558
559 2016-04-21  Claudio Saavedra  <csaavedra@igalia.com>
560
561         [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
562         https://bugs.webkit.org/show_bug.cgi?id=156847
563
564         Reviewed by Carlos Garcia Campos.
565
566         The Language and Logging implementation don't really need glib, so
567         rework them and move them to a new platform/unix directory so that
568         they can be shared among Unix ports.
569
570         * PlatformEfl.cmake: Use the unix version.
571         * PlatformGTK.cmake: Same.
572         * platform/efl/LanguageEfl.cpp: Removed.
573         * platform/efl/LoggingEfl.cpp: Removed.
574         * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
575         (WebCore::platformLanguage):
576         (WebCore::platformUserPreferredLanguages):
577         * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
578         (WebCore::logLevelString):
579
580 2016-04-21  Nan Wang  <n_wang@apple.com>
581
582         AX: stringForTextMarkerRange returning empty string for document range
583         https://bugs.webkit.org/show_bug.cgi?id=156819
584
585         Reviewed by Chris Fleizach.
586
587         Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
588         or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
589         node.
590
591         Test: accessibility/mac/text-marker-string-for-document-range.html
592
593         * accessibility/AXObjectCache.cpp:
594         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
595
596 2016-04-20  Chris Dumez  <cdumez@apple.com>
597
598         Crash under WebCore::TextIterator::subrange()
599         https://bugs.webkit.org/show_bug.cgi?id=156809
600         <rdar://problem/21102730>
601
602         Reviewed by Ryosuke Niwa.
603
604         TextIterator::rangeFromLocationAndLength() may return null. However, we
605         failed to do a null check before calling TextIterator::subrange() with
606         that range.
607
608         No new tests, do not know how to reproduce.
609
610         * editing/AlternativeTextController.cpp:
611         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
612
613 2016-04-20  Brady Eidson  <beidson@apple.com>
614
615         Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
616         https://bugs.webkit.org/show_bug.cgi?id=156826
617
618         Reviewed by Alex Christensen.
619
620         No new tests (No behavior change, existing tests pass).
621
622         This doesn't appear to do much but make things a little more complicated, but it's the first of a few 
623         small pushes in the right direction.
624         
625         * Modules/indexeddb/IDBOpenDBRequest.cpp:
626         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
627         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
628         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
629         (WebCore::IDBOpenDBRequest::onSuccess):
630         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
631         (WebCore::IDBOpenDBRequest::requestCompleted):
632         (WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
633         (WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
634         * Modules/indexeddb/IDBOpenDBRequest.h:
635         
636         * Modules/indexeddb/IDBRequest.cpp:
637         (WebCore::IDBRequest::IDBRequest):
638         (WebCore::IDBRequest::connectionToServer):
639         * Modules/indexeddb/IDBRequest.h:
640         (WebCore::IDBRequest::connection): Deleted.
641         
642         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
643         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
644         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
645         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
646         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
647         * Modules/indexeddb/client/IDBConnectionProxy.h:
648         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):
649         
650         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
651         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
652         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
653
654 2016-04-20  John Wilander  <wilander@apple.com>
655
656         Add Subresource Integrity as "Under consideration".
657         https://bugs.webkit.org/show_bug.cgi?id=156800
658
659         Reviewed by Alexey Proskuryakov.
660
661         No new tests needed.
662
663         * features.json:
664             Added an entry for Subresource Integrity.
665
666 2016-04-20  Anders Carlsson  <andersca@apple.com>
667
668         Get rid of a couple of uses of ApplicationCacheStorage::singleton()
669         https://bugs.webkit.org/show_bug.cgi?id=156818
670
671         Reviewed by Geoffrey Garen.
672
673         * loader/appcache/ApplicationCache.cpp:
674         (WebCore::ApplicationCache::addResource):
675         * loader/appcache/ApplicationCacheGroup.h:
676         (WebCore::ApplicationCacheGroup::storage):
677         * testing/Internals.cpp:
678         (WebCore::Internals::resetToConsistentState):
679         (WebCore::Internals::setApplicationCacheOriginQuota):
680
681 2016-04-20  Brady Eidson  <beidson@apple.com>
682
683         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
684         https://bugs.webkit.org/show_bug.cgi?id=156810
685
686         Reviewed by Alex Christensen.
687
688         No new tests (Covered by changes to existing tests).
689
690         Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
691         * Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
692         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
693         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
694         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
695         * Modules/indexeddb/client/IDBConnectionProxy.h: 
696         
697         Add pure virtual IDBConnectionProxy accessor:
698         * dom/ScriptExecutionContext.h: 
699
700         Implement it:
701         * dom/Document.cpp:
702         (WebCore::Document::idbConnectionProxy):
703         * dom/Document.h:
704         
705         Implement it:
706         * workers/WorkerGlobalScope.cpp:
707         (WebCore::WorkerGlobalScope::idbConnectionProxy):
708         * workers/WorkerGlobalScope.h:
709         
710         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
711         (WebCore::DOMWindowIndexedDatabase::indexedDB):
712
713
714         Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
715         * Modules/indexeddb/IDBFactory.cpp:
716         (WebCore::IDBFactory::create):
717         (WebCore::IDBFactory::IDBFactory):
718         (WebCore::IDBFactory::open):
719         (WebCore::IDBFactory::openInternal):
720         (WebCore::IDBFactory::deleteDatabase):
721         * Modules/indexeddb/IDBFactory.h:
722         * Modules/indexeddb/IDBFactory.idl:
723
724         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
725         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
726
727         * Modules/indexeddb/client/IDBConnectionToServer.h:
728
729         * inspector/InspectorIndexedDBAgent.cpp:
730
731         * CMakeLists.txt:
732         * WebCore.xcodeproj/project.pbxproj:
733
734 2016-04-20  Chris Dumez  <cdumez@apple.com>
735
736         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
737         https://bugs.webkit.org/show_bug.cgi?id=156796
738
739         Reviewed by Anders Carlsson.
740
741         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
742         (with invalid value of -1). m_orderIndex a vector index and therefore
743         is in the range of an unsigned (type used internally by Vector, even
744         though the index is exposed as size_t). Therefore, assigning it to an
745         int is unsafe as it may overflow.
746
747         This may fix <rdar://problem/23410338> which is a top crasher.
748
749         * rendering/OrderIterator.cpp:
750         (WebCore::OrderIterator::next):
751         (WebCore::OrderIterator::reset):
752         * rendering/OrderIterator.h:
753
754 2016-04-20  Chris Dumez  <cdumez@apple.com>
755
756         Crash under needsAppleMailPaginationQuirk()
757         https://bugs.webkit.org/show_bug.cgi?id=156806
758         <rdar://problem/23323479>
759
760         Reviewed by Simon Fraser.
761
762         Add check for element()->hasID() before calling element()->idForStyleResolution()
763         so that we don't dereference a potentially null element()->elementData().
764         Also stop repeatedly atomizing "messageContentContainer" and leverage
765         the operator==(const AtomicString&, const char*) instead for performance.
766
767         * rendering/RenderBlockFlow.cpp:
768         (WebCore::needsAppleMailPaginationQuirk):
769
770 2016-04-20  Brady Eidson  <beidson@apple.com>
771
772         Attempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779
773
774         * testing/InternalSettings.cpp:
775         (WebCore::InternalSettings::Backup::Backup):
776         (WebCore::InternalSettings::Backup::restoreTo):
777         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
778         * testing/InternalSettings.h:
779
780 2016-04-20  Chris Dumez  <cdumez@apple.com>
781
782         Potential overflow in RenderLayer::hitTestList()
783         https://bugs.webkit.org/show_bug.cgi?id=156804
784
785         Reviewed by Simon Fraser.
786
787         Use size_t type instead of int to iterate over the Vector to make sure
788         we don't overflow. This is a speculative fix for <rdar://problem/23249479>.
789
790         * rendering/RenderLayer.cpp:
791         (WebCore::RenderLayer::hitTestList):
792
793 2016-04-20  Brady Eidson  <beidson@apple.com>
794
795         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
796         https://bugs.webkit.org/show_bug.cgi?id=156782
797
798         Reviewed by Alex Christensen.
799
800         Test: storage/indexeddb/modern/workers-disabled.html
801               storage/indexeddb/modern/workers-enable.html
802
803         * Configurations/FeatureDefines.xcconfig:
804
805         ScriptExecutionContext shouldn't really be supplementable:
806         * dom/ScriptExecutionContext.h:
807
808         WorkerGlobalScope should be supplementable.
809         Also modernize this archaic header (pragma once, and re-indent):
810         * workers/WorkerGlobalScope.h:
811         
812         Update for WorkerGlobalScope now being directly supplementable:
813         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
814         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
815         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
816         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
817         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
818         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
819         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
820         (WebCore::WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications):
821         (WebCore::WorkerGlobalScopeNotifications::from):
822         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
823         * Modules/notifications/WorkerGlobalScopeNotifications.h:
824         
825         Expose IndexedDBWorkers to RuntimeEnabledFeatures:
826         * bindings/generic/RuntimeEnabledFeatures.cpp:
827         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
828         * bindings/generic/RuntimeEnabledFeatures.h:
829         (WebCore::RuntimeEnabledFeatures::setIndexedDBWorkersEnabled):
830         (WebCore::RuntimeEnabledFeatures::indexedDBWorkersEnabled):
831
832         Expose IndexedDBWorkers to InternalSettings:
833         * testing/InternalSettings.cpp:
834         (WebCore::InternalSettings::Backup::Backup):
835         (WebCore::InternalSettings::Backup::restoreTo):
836         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
837         * testing/InternalSettings.h:
838         * testing/InternalSettings.idl:
839
840 2016-04-20  Dave Hyatt  <hyatt@apple.com>
841
842         Hangable punctuation measurement using the wrong indices.
843         https://bugs.webkit.org/show_bug.cgi?id=155899
844
845         Reviewed by Simon Fraser.
846
847         New tests in fast/text.
848
849         * rendering/RenderBlockFlow.cpp:
850         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
851         * rendering/RenderText.cpp:
852         (WebCore::RenderText::hangablePunctuationStartWidth):
853         (WebCore::RenderText::hangablePunctuationEndWidth):
854         (WebCore::RenderText::isHangableStopOrComma):
855
856 2016-04-20  Chris Dumez  <cdumez@apple.com>
857
858         Drop [UsePointersEvenForNonNullableObjectArguments] from several Canvas interfaces
859         https://bugs.webkit.org/show_bug.cgi?id=156781
860
861         Reviewed by Darin Adler.
862
863         * html/canvas/CanvasRenderingContext2D.cpp:
864         (WebCore::CanvasRenderingContext2D::fill):
865         (WebCore::CanvasRenderingContext2D::stroke):
866         (WebCore::CanvasRenderingContext2D::clip):
867         (WebCore::CanvasRenderingContext2D::isPointInPath):
868         (WebCore::CanvasRenderingContext2D::isPointInStroke):
869         (WebCore::size):
870         (WebCore::CanvasRenderingContext2D::drawImage):
871         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
872         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
873         * html/canvas/CanvasRenderingContext2D.h:
874         * html/canvas/CanvasRenderingContext2D.idl:
875         * html/canvas/DOMPath.h:
876         * html/canvas/DOMPath.idl:
877         * html/canvas/WebGLDebugShaders.cpp:
878         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
879         * html/canvas/WebGLDebugShaders.h:
880         * html/canvas/WebGLDebugShaders.idl:
881
882 2016-04-20  Chris Dumez  <cdumez@apple.com>
883
884         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio
885         https://bugs.webkit.org/show_bug.cgi?id=156777
886
887         Reviewed by Darin Adler.
888
889         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio and
890         modernize the interface a bit.
891
892         There is no major Web-exposed behavioral change except for
893         the exception type thrown when passing null (now always TypeError).
894         Tests were updated to add coverage for this.
895
896         * Modules/webaudio/AsyncAudioDecoder.cpp:
897         (WebCore::AsyncAudioDecoder::decodeAsync):
898         (WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask):
899         (WebCore::AsyncAudioDecoder::DecodingTask::decode): Deleted.
900         * Modules/webaudio/AsyncAudioDecoder.h:
901         (WebCore::AsyncAudioDecoder::DecodingTask::audioData):
902         * Modules/webaudio/AudioContext.cpp:
903         (WebCore::AudioContext::lazyInitialize):
904         (WebCore::AudioContext::createBuffer):
905         (WebCore::AudioContext::decodeAudioData):
906         (WebCore::AudioContext::createBufferSource):
907         (WebCore::AudioContext::createMediaElementSource):
908         (WebCore::AudioContext::createMediaStreamSource):
909         (WebCore::AudioContext::createMediaStreamDestination):
910         (WebCore::AudioContext::createScriptProcessor):
911         (WebCore::AudioContext::createBiquadFilter):
912         (WebCore::AudioContext::createWaveShaper):
913         (WebCore::AudioContext::createPanner):
914         (WebCore::AudioContext::createConvolver):
915         (WebCore::AudioContext::createDynamicsCompressor):
916         (WebCore::AudioContext::createAnalyser):
917         (WebCore::AudioContext::createGain):
918         (WebCore::AudioContext::createDelay):
919         (WebCore::AudioContext::createChannelSplitter):
920         (WebCore::AudioContext::createChannelMerger):
921         (WebCore::AudioContext::createOscillator):
922         (WebCore::AudioContext::createPeriodicWave):
923         (WebCore::AudioContext::derefFinishedSourceNodes):
924         (WebCore::AudioContext::refNode):
925         (WebCore::AudioContext::derefNode):
926         (WebCore::AudioContext::notifyNodeFinishedProcessing): Deleted.
927         (WebCore::AudioContext::derefUnfinishedSourceNodes): Deleted.
928         (WebCore::AudioContext::lock): Deleted.
929         * Modules/webaudio/AudioContext.h:
930         * Modules/webaudio/AudioContext.idl:
931         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
932         (WebCore::MediaElementAudioSourceNode::create):
933         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
934         (WebCore::MediaElementAudioSourceNode::process):
935         * Modules/webaudio/MediaElementAudioSourceNode.h:
936         (WebCore::MediaElementAudioSourceNode::mediaElement):
937         * Modules/webaudio/OscillatorNode.idl:
938
939 2016-04-20  Brady Eidson  <beidson@apple.com>
940
941         Addressing additional review feedback for:
942         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
943         https://bugs.webkit.org/show_bug.cgi?id=156760
944
945         * Modules/indexeddb/IDBVersionChangeEvent.h:
946
947 2016-04-20  Frederic Wang  <fwang@igalia.com>
948
949         Use OpenType MATH fonts by default
950         https://bugs.webkit.org/show_bug.cgi?id=133603
951
952         Reviewed by Alejandro G. Castro.
953
954         No new tests. This is already tested by pixel tests like roots.xhtml.
955         However, new math fonts are not used during test execution.
956
957         * css/mathml.css:
958         (math): We use only a list of known OpenType fonts with a MATH table but keep some pre-installed fallback fonts for OS X and iOS.
959
960 2016-04-20  Claudio Saavedra  <csaavedra@igalia.com>
961
962         [GTK] Move GTK+-independent platform code to platform/glib
963         https://bugs.webkit.org/show_bug.cgi?id=156787
964
965         Reviewed by Carlos Garcia Campos.
966
967         There is plenty of code in platform/gtk that is independent from the GTK+ library.
968         Move those files to platform/glib so that they can be reused by other GLib-based ports.
969
970         Also clean some style warnings in those files.
971
972         * PlatformGTK.cmake: Move the files.
973         * platform/glib/EventLoopGlib.cpp: Renamed from Source/WebCore/platform/gtk/EventLoopGtk.cpp.
974         (WebCore::EventLoop::cycle):
975         * platform/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/gtk/FileSystemGtk.cpp.
976         (WebCore::filenameToString):
977         (WebCore::unescapedFilename):
978         (WebCore::fileSystemRepresentation):
979         (WebCore::filenameForDisplay):
980         (WebCore::fileExists):
981         (WebCore::deleteFile):
982         (WebCore::deleteEmptyDirectory):
983         (WebCore::getFileStat):
984         (WebCore::getFileSize):
985         (WebCore::getFileCreationTime):
986         (WebCore::getFileModificationTime):
987         (WebCore::getFileMetadata):
988         (WebCore::pathByAppendingComponent):
989         (WebCore::makeAllDirectories):
990         (WebCore::homeDirectoryPath):
991         (WebCore::pathGetFileName):
992         (WebCore::applicationDirectoryPath):
993         (WebCore::sharedResourcesPath):
994         (WebCore::getVolumeFreeSizeForPath):
995         (WebCore::directoryName):
996         (WebCore::listDirectory):
997         (WebCore::openTemporaryFile):
998         (WebCore::openFile):
999         (WebCore::closeFile):
1000         (WebCore::seekFile):
1001         (WebCore::writeToFile):
1002         (WebCore::readFromFile):
1003         (WebCore::unloadModule):
1004         (WebCore::hardLinkOrCopyFile):
1005         * platform/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/gtk/GamepadsGtk.cpp.
1006         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
1007         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
1008         (WebCore::GamepadDeviceGlib::readCallback):
1009         (WebCore::GamepadsGlib::GamepadsGlib):
1010         (WebCore::GamepadsGlib::~GamepadsGlib):
1011         (WebCore::GamepadsGlib::registerDevice):
1012         (WebCore::GamepadsGlib::unregisterDevice):
1013         (WebCore::GamepadsGlib::updateGamepadList):
1014         (WebCore::GamepadsGlib::onUEventCallback):
1015         (WebCore::GamepadsGlib::isGamepadDevice):
1016         (WebCore::sampleGamepads):
1017         * platform/glib/SharedBufferGlib.cpp: Renamed from Source/WebCore/platform/gtk/SharedBufferGtk.cpp.
1018         (WebCore::SharedBuffer::createFromReadingFile):
1019
1020 2016-04-20  Frederic Wang  <fwang@igalia.com>
1021
1022         Refactor RenderMathMLSpace to avoid using flexbox
1023         https://bugs.webkit.org/show_bug.cgi?id=155168
1024
1025         Reviewed by Martin Robinson.
1026
1027         No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.
1028
1029         * rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.
1030         (WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
1031         (WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
1032         (WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
1033         (WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
1034         (WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.
1035         * rendering/mathml/RenderMathMLSpace.h: Update function declarations.
1036
1037 2016-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1038
1039         [Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
1040         https://bugs.webkit.org/show_bug.cgi?id=156785
1041
1042         Reviewed by Žan Doberšek.
1043
1044         This happens for example when view state changes to focus and paint is called from
1045         FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test
1046         fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this.
1047
1048         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1049         (WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled.
1050
1051 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1052
1053         REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782
1054         https://bugs.webkit.org/show_bug.cgi?id=156690
1055
1056         Reviewed by Michael Catanzaro.
1057
1058         The assertion is wrong, because it assumes that ImageDecoder::create() always returns a valid pointer, which is
1059         only true for the CG implementation. The non CG implementation can return nullptr if there isn't enough data to
1060         figure out the image format or if the image format is not supported. This is causing several crashes in the
1061         debug bots.
1062
1063         * platform/graphics/ImageSource.cpp:
1064         (WebCore::ImageSource::setData): Remove the invalid ASSERT and return early if we fail to create the decoder.
1065         (WebCore::ImageSource::ensureDecoderIsCreated): Deleted.
1066         * platform/graphics/ImageSource.h:
1067
1068 2016-04-19  Brent Fulgham  <bfulgham@apple.com>
1069
1070         Remove remaining bits of dynamic <link> rel='icon' loading
1071         https://bugs.webkit.org/show_bug.cgi?id=156727
1072
1073         Reviewed by Darin Adler.
1074
1075         Don't call 'shouldLoadLink' for 'icon' link types. It performs no
1076         useful checks for 'icon' types, and emits the non-standard
1077         'onbeforeload' event.
1078
1079         This work finishes up https://webkit.org/b/153151, where we removed
1080         FrameLoaderClient::dispatchDidChangeIcons() and related code.
1081
1082         Test: webarchive/test-link-rel-subresource-beforeload.html
1083
1084         * loader/LinkLoader.cpp:
1085         (WebCore::LinkLoader::loadLink): Remove unneeded call to 'shouldLoadLink'.
1086
1087 2016-04-19  Chris Dumez  <cdumez@apple.com>
1088
1089         AudioBufferSourceNode.buffer should be nullable
1090         https://bugs.webkit.org/show_bug.cgi?id=156769
1091
1092         Reviewed by Darin Adler.
1093
1094         AudioBufferSourceNode.buffer should be nullable as per the
1095         specification:
1096         https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
1097
1098         Our implementation was initially returning null when getting
1099         AudioBufferSourceNode.buffer, which is correct. However, it would
1100         throw a TypeError when trying to set the attribute to null. Our
1101         implementation setter actually supported setting the buffer to
1102         null but the custom bindings for the setter would not.
1103
1104         This patch does the following:
1105         - Get rid of the custom bindings for the AudioBufferSourceNode.buffer
1106           setter. We can have the bindings generator generate the same code
1107           by using [StrictTypeChecking]. The custom bindinds were also throwing
1108           a TypeError if the input AudioBuffer had too many channels but this
1109           does not seem to be possible.
1110         - Mark AudioBufferSourceNode.buffer as nullable in the IDL so that
1111           we no longer throw when the JS tries to assign null, but instead
1112           calls AudioBufferSourceNode::setBuffer(nullptr)
1113
1114         No new test, updated webaudio/audiobuffersource-channels.html
1115
1116         * CMakeLists.txt:
1117         * Modules/webaudio/AudioBufferSourceNode.cpp:
1118         (WebCore::AudioBufferSourceNode::setBuffer):
1119         * Modules/webaudio/AudioBufferSourceNode.h:
1120         * Modules/webaudio/AudioBufferSourceNode.idl:
1121         * Modules/webaudio/AudioContext.h:
1122         * WebCore.xcodeproj/project.pbxproj:
1123         * bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed.
1124
1125 2016-04-19  Brady Eidson  <beidson@apple.com>
1126
1127         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
1128         https://bugs.webkit.org/show_bug.cgi?id=156760
1129
1130         Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).
1131
1132         Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html
1133
1134         Add WorkerGlobalScopeConstructors to the xcodeproj:
1135         * WebCore.xcodeproj/project.pbxproj:
1136
1137         Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
1138         * page/DOMWindow.idl:
1139
1140         Remove the poor way most objects were exposed on the WorkerGlobalScope:
1141         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
1142
1143         Expose most of the objects on the WorkerGlobalScope the correct way:
1144         * Modules/indexeddb/IDBCursor.idl:
1145         * Modules/indexeddb/IDBCursorWithValue.idl:
1146         * Modules/indexeddb/IDBDatabase.idl:
1147         * Modules/indexeddb/IDBFactory.idl:
1148         * Modules/indexeddb/IDBIndex.idl:
1149         * Modules/indexeddb/IDBKeyRange.idl:
1150         * Modules/indexeddb/IDBObjectStore.idl:
1151         * Modules/indexeddb/IDBOpenDBRequest.idl:
1152         * Modules/indexeddb/IDBRequest.idl:
1153         * Modules/indexeddb/IDBTransaction.idl:
1154
1155         Make IDBVersionChangeEvent constructible:        
1156         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1157         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
1158         (WebCore::IDBVersionChangeEvent::newVersion): Deleted.
1159         * Modules/indexeddb/IDBVersionChangeEvent.h:
1160         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1161
1162         * bindings/js/JSDictionary.h:
1163         (WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
1164           handles Optional<>s.
1165
1166 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1167
1168         Build fix after r199738
1169
1170         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1171         (WebCore::GraphicsContext3D::GraphicsContext3D):
1172         * platform/graphics/win/GraphicsContext3DWin.cpp:
1173         (WebCore::GraphicsContext3D::GraphicsContext3D):
1174
1175 2016-04-19  Keith Miller  <keith_miller@apple.com>
1176
1177         ObjcInstance::stringValue should not call NSObject's description method
1178         https://bugs.webkit.org/show_bug.cgi?id=156758
1179
1180         Reviewed by Geoffrey Garen.
1181
1182         This patch makes it so that we no longer call NSObject's description method without first
1183         swizzling the implementation for WebScriptObjects. We restore the incomming NSObject's
1184         description method once we have finished generating the string.
1185
1186         Test: platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html
1187
1188         * bridge/objc/objc_instance.mm:
1189         (swizzleNSObjectDescription):
1190         (ObjcInstance::stringValue):
1191
1192 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1193
1194         Update ANGLE
1195         https://bugs.webkit.org/show_bug.cgi?id=156755
1196
1197         Reviewed by Dean Jackson.
1198
1199         * CMakeLists.txt:
1200         * platform/graphics/ANGLEWebKitBridge.h:
1201         (WebCore::ANGLEWebKitBridge::getResources):
1202         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1203         (WebCore::GraphicsContext3D::GraphicsContext3D):
1204         Continue to compile successfully with new ANGLE.
1205
1206 2016-04-19  Chris Dumez  <cdumez@apple.com>
1207
1208         Mark more classes as WTF_MAKE_FAST_ALLOCATED
1209         https://bugs.webkit.org/show_bug.cgi?id=156732
1210
1211         Reviewed by Darin Adler.
1212
1213         * css/CSSImageGeneratorValue.h:
1214         * css/DocumentRuleSets.h:
1215         * css/MediaQueryMatcher.h:
1216         * css/RuleFeature.h:
1217         * css/StyleResolver.h:
1218         * dom/ActiveDOMCallbackMicrotask.h:
1219         * dom/DocumentSharedObjectPool.h:
1220         * dom/MutationObserver.cpp:
1221         * dom/MutationObserverInterestGroup.h:
1222         * dom/MutationObserverRegistration.h:
1223         * dom/ScriptExecutionContext.cpp:
1224         * dom/SlotAssignment.h:
1225         * html/HTMLCollection.h:
1226         * html/canvas/CanvasRenderingContext2D.cpp:
1227         * html/parser/HTMLToken.h:
1228         * html/parser/XSSAuditorDelegate.h:
1229         * loader/FrameLoader.cpp:
1230         * loader/SubframeLoader.h:
1231         * page/AutoscrollController.h:
1232         * page/csp/ContentSecurityPolicySource.h:
1233         * platform/cf/RunLoopObserver.h:
1234         * platform/graphics/FloatQuad.h:
1235         * platform/graphics/FloatRoundedRect.h:
1236         * platform/graphics/IntSize.h:
1237         * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
1238         * platform/graphics/cg/ImageDecoderCG.h:
1239         * platform/graphics/cocoa/IOSurface.h:
1240         * platform/graphics/displaylists/DisplayList.h:
1241         * platform/graphics/mac/ComplexTextController.h:
1242         * platform/graphics/mac/FontCustomPlatformData.h:
1243         * platform/mac/PowerObserverMac.h:
1244         * platform/network/DataURLDecoder.cpp:
1245         * platform/text/PlatformLocale.h:
1246         * rendering/TextAutosizer.h:
1247         * style/StyleUpdate.h:
1248         * xml/XMLHttpRequestUpload.h:
1249
1250 2016-04-18  Ada Chan  <adachan@apple.com>
1251
1252         Context menu items related to fullscreen should be specific to standard fullscreen
1253         https://bugs.webkit.org/show_bug.cgi?id=156723
1254         <rdar://problem/25452632>
1255
1256         Reviewed by Darin Adler.
1257
1258         Introduce HTMLMediaElement::isStandardFullscreen() that the HitTestResult code can use
1259         when handling the validation and selection of fullscreen-related context menu items.
1260
1261         * html/HTMLMediaElement.cpp:
1262         (WebCore::HTMLMediaElement::isStandardFullscreen):
1263         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
1264         Renamed to make it clear that it's for toggling standard fullscreen. Call the new
1265         HTMLMediaElement::isStandardFullscreen().
1266         * html/HTMLMediaElement.h:
1267         * rendering/HitTestResult.cpp:
1268         (WebCore::HitTestResult::mediaIsInFullscreen):
1269         Use HTMLMediaElement::isStandardFullscreen().
1270         (WebCore::HitTestResult::toggleMediaFullscreenState):
1271         Call the renamed HTMLMediaElement::toggleStandardFullscreenState().
1272
1273 2016-04-19  Brady Eidson  <beidson@apple.com>
1274
1275         Modern IDB: ObjectStore Blob Support.
1276         https://bugs.webkit.org/show_bug.cgi?id=143193
1277
1278         Reviewed by Alex Christensen.
1279
1280         Tests: imported/blink/storage/indexeddb/blob-basics-metadata.html
1281                imported/blink/storage/indexeddb/blob-delete-objectstore-db.html
1282                imported/blink/storage/indexeddb/blob-valid-after-deletion.html
1283                imported/blink/storage/indexeddb/blob-valid-before-commit.html
1284                imported/blink/storage/indexeddb/empty-blob-file.html
1285                storage/indexeddb/modern/blob-simple.html
1286
1287         Most of the work has been done already.
1288         
1289         Besides a handful of tweaks to that work, all this really does is remove the clause
1290         that prevents blob URLs from going into the database.
1291
1292         * Modules/indexeddb/IDBObjectStore.cpp:
1293         (WebCore::IDBObjectStore::putOrAdd): Only disallow blobs if private browsing is enabled
1294           (Making that work is already covered by another bug)
1295           
1296         * Modules/indexeddb/IDBTransaction.cpp:
1297         (WebCore::IDBTransaction::putOrAddOnServer):
1298
1299         * Modules/indexeddb/IDBValue.cpp:
1300         (WebCore::IDBValue::IDBValue):
1301
1302         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1303         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
1304         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1305
1306         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1307         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
1308
1309         * platform/network/BlobRegistryImpl.cpp:
1310         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
1311
1312         * platform/sql/SQLiteFileSystem.cpp:
1313         (WebCore::SQLiteFileSystem::deleteDatabaseFile): Delete all database-related files 
1314           now that we use WAL mode.
1315
1316 2016-04-19  Sergio Villar Senin  <svillar@igalia.com>
1317
1318         [css-grid] Use the margin box for non-auto minimum sizes
1319         https://bugs.webkit.org/show_bug.cgi?id=156711
1320
1321         Reviewed by Darin Adler.
1322
1323         When computing the min-size of items with non-auto minimum height/width we are incorrectly
1324         returning the size of the border box, and thus incorrectly ignoring the margins of the item.
1325
1326         This is a follow up patch of r199153 were we added the missing border and paddings for
1327         heights. Contrary to that, we were not including margins for both axis.
1328
1329         This CL requires 3 different interrelated changes:
1330         - Add the margins to the min-size returned by minSizeForChild (might require a layout).
1331         - Refactor and extract width computations from logicalHeightForChild(); not totally
1332         mandatory but pretty logical and helpful.
1333         - Use a new update function to isolate the computation of the override width.
1334
1335         Test: fast/css-grid-layout/min-width-margin-box.html
1336
1337         * rendering/RenderBox.cpp:
1338         (WebCore::RenderBox::computeInlineDirectionMargins): Added const to a parameter.
1339         * rendering/RenderBox.h:
1340         * rendering/RenderGrid.cpp:
1341         (WebCore::RenderGrid::computeTrackSizesForDirection): Initialize the sizingOperation.
1342         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Ditto.
1343         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
1344         (WebCore::RenderGrid::logicalHeightForChild): Renamed from logicalContentHeightForChild as
1345         it no longer returns the content size but the outer size.
1346         (WebCore::RenderGrid::minSizeForChild):
1347         (WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild): Extracted
1348         from logicalHeightForChild().
1349         (WebCore::RenderGrid::minContentForChild): Update override width if needed.
1350         (WebCore::RenderGrid::maxContentForChild): Ditto.
1351         (WebCore::RenderGrid::computeMarginLogicalSizeForChild): Generalized from
1352         computeMarginLogicalHeightForChild(), it can now compute also margins for the inline
1353         direction.
1354         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
1355         (WebCore::RenderGrid::logicalContentHeightForChild): Deleted.
1356         (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
1357         * rendering/RenderGrid.h:
1358
1359 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1360
1361         [Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
1362         https://bugs.webkit.org/show_bug.cgi?id=156742
1363
1364         Reviewed by Martin Robinson.
1365
1366         We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This
1367         is causing that some reftests fail because they assume we always render the focus ring the same way. For example
1368         fast/images/image-map-outline-in-positioned-container.html, when rendering the test
1369         GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector
1370         of rectangles, producing different results.
1371
1372         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1373         (WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given
1374         rectangles and call drawFocusRing() with the built path to ensure consistency.
1375
1376 2016-04-19  Antti Koivisto  <antti@apple.com>
1377
1378         Move FontSelectorClient to a file of its own
1379         https://bugs.webkit.org/show_bug.cgi?id=156738
1380
1381         Reviewed by Carlos Garcia Campos.
1382
1383         So modifying FontSelector does not trigger world rebuild via Document.h.
1384
1385         * WebCore.xcodeproj/project.pbxproj:
1386         * css/CSSFontSelector.cpp:
1387         * dom/Document.h:
1388         * html/canvas/CanvasRenderingContext2D.h:
1389         * platform/graphics/FontSelector.h:
1390         (WebCore::FontSelectorClient::~FontSelectorClient): Deleted.
1391         * platform/graphics/FontSelectorClient.h: Added.
1392         (WebCore::FontSelectorClient::~FontSelectorClient):
1393
1394 2016-04-19  Joanmarie Diggs  <jdiggs@igalia.com>
1395
1396         [GTK] accessibility/gtk/entry-and-password.html is failing since r194847
1397         https://bugs.webkit.org/show_bug.cgi?id=153062
1398
1399         Reviewed by Carlos Garcia Campos.
1400
1401         The changes in r194847 include using WebCore's rendering for the CapsLock indicator.
1402         As a side effect, password inputs gained a TextControlInnerTextElement child from
1403         the Shadow DOM. If we include that child in the accessibility tree, the child will
1404         emit focus and text notifications that suggest the user is no longer in the control.
1405         This can be especially problematic for screen reader users with key echo enabled
1406         when typing in a password input. To fix this, prune TextControlInnerTextElement
1407         children from the accessibility tree for ATK.
1408
1409         No new tests as existing coverage caught this regression. Also modified the
1410         auto-fill-crash.html test whose expectations include the children count for
1411         a text input.
1412
1413         * accessibility/atk/AccessibilityObjectAtk.cpp:
1414         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1415
1416 2016-04-18  Brady Eidson  <beidson@apple.com>
1417
1418         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
1419         https://bugs.webkit.org/show_bug.cgi?id=156640
1420
1421         Reviewed by Alex Christensen.
1422
1423         No new tests (No change in behavior, as blobs in IDB are not yet enabled,
1424                       but when they are enabled testing will cover this).
1425
1426         * Modules/indexeddb/shared/IDBResultData.h: Export some stuff
1427         
1428         * fileapi/ThreadableBlobRegistry.cpp:
1429         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Account for 
1430           BlobRegistry change described below.
1431         
1432         * platform/network/BlobRegistry.h: Change registerBlobURLOptionallyFileBacked to take a 
1433           BlobDataFileReference instead of a raw path, to allow WK2 to include a sandbox extension.
1434         
1435         * platform/network/BlobRegistryImpl.cpp:
1436         (WebCore::BlobRegistryImpl::registerBlobURL): Account for BlobRegistry change described above.
1437         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): Use the passed in 
1438           BlobDataFileHandle, and also register the BlobResourceHandle constructor.
1439         * platform/network/BlobRegistryImpl.h:
1440
1441 2016-04-18  Alex Christensen  <achristensen@webkit.org>
1442
1443         Fix iOS build after r199701
1444
1445         * platform/ios/WebAVPlayerController.mm:
1446
1447 2016-04-18  Darin Adler  <darin@apple.com>
1448
1449         Updated binding test result to reflect the change to not use Deprecated::ScriptValue.
1450
1451         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated with new script.
1452
1453 2016-04-18  Darin Adler  <darin@apple.com>
1454
1455         Remove all use of Deprecated::ScriptValue in generated bindings
1456         https://bugs.webkit.org/show_bug.cgi?id=156706
1457
1458         Reviewed by Brady Eidson.
1459
1460         * Modules/indexeddb/IDBCursor.idl: Removed unneeded [ImplementationReturnType=JSValue].
1461         * Modules/indexeddb/IDBCursorWithValue.idl: Ditto.
1462
1463         * Modules/indexeddb/IDBKeyRange.cpp:
1464         (WebCore::IDBKeyRange::lowerValue): Deleted.
1465         (WebCore::IDBKeyRange::upperValue): Deleted.
1466         (WebCore::IDBKeyRange::only): Changed to take ExecState since the old code just used
1467         the ScriptExecutionContext to get back to the (potentially wrong) ExecState. Also kept
1468         one overload that takes ScriptExecutionContext because I could not change all callers.
1469         (WebCore::IDBKeyRange::lowerBound): Ditto.
1470         (WebCore::IDBKeyRange::upperBound): Ditto.
1471         (WebCore::IDBKeyRange::bound): Ditto.
1472
1473         * Modules/indexeddb/IDBKeyRange.h: Updated for above.
1474
1475         * Modules/indexeddb/IDBKeyRange.idl: Use [ImplementationReturnType=IDBKey].
1476         Use ScriptState instead of ScriptExecutionContext.
1477
1478         * Modules/streams/ReadableStreamSource.h: Take JSValue instead of Deprecated::ScriptValue
1479         for the ignored argument to the cancel function.
1480
1481         * bindings/js/IDBBindingUtilities.cpp:
1482         (WebCore::toJS): Renamed idbKeyToJSValue to this, the traditional name used in the
1483         bindings generator for all these functions. Also changed to take references.
1484         (WebCore::injectIDBKeyIntoScriptValue): Updated to call with the new name and types.
1485         (WebCore::idbKeyDataToScriptValue): Ditto.
1486
1487         * bindings/js/IDBBindingUtilities.h: Added declaration of toJS for IDBKey.
1488
1489         * bindings/scripts/CodeGeneratorJS.pm: Use JSC::JSValue instead of Deprecated::ScriptValue
1490         for the "any" type.
1491         (JSValueToNative): Just return the value with no transformation when type is "any".
1492         (NativeToJSValue): Changed default behavior for "any" to just pass the value as is with
1493         no transfomration. Removed unused ImplementationReturnType case for inside Document.
1494         Removed JSValue case since it's the default now. Added IDBKey case that matches the
1495         IDBKeyPath case (still wondering if we can do those without an attribute). Removed bogus
1496         second check for type "any".
1497
1498 2016-04-18  Martin Robinson  <mrobinson@igalia.com>
1499
1500         [GTK] Possible off-by-one in hyphenation code
1501         https://bugs.webkit.org/show_bug.cgi?id=156661
1502
1503         Reviewed by Michael Catanzaro.
1504
1505         No new tests. This is covered by older tests.
1506
1507         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1508         (WebCore::lastHyphenLocation): Fix an off by one error in hyphen location.
1509
1510 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
1511
1512         [OSX] AVKit is not available on all systems
1513         https://bugs.webkit.org/show_bug.cgi?id=156724
1514         <rdar://problem/25501587>
1515
1516         Reviewed by Dean Jackson.
1517
1518         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Add _OPTIONAL to all
1519           AVKit softlink macros.
1520         * platform/ios/WebAVPlayerController.mm: Ditto.
1521         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Ditto.
1522         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
1523         * platform/mac/WebPlaybackSessionInterfaceMac.mm: Ditto.
1524         * platform/mac/WebVideoFullscreenInterfaceMac.mm: Ditto.
1525
1526 2016-04-18  Gavin Barraclough  <barraclough@apple.com>
1527
1528         WebKit should adopt journal_mode=wal for all SQLite databases.
1529         https://bugs.webkit.org/show_bug.cgi?id=133496
1530
1531         Reviewed by Brady Eidson.
1532
1533         Enabling sqlite3 WAL mode on iOS causes a test failure, but appears just be something that should fail still failing, only in a different way.
1534         Enabling & marking test as failing for now. Tracking test failure here:
1535             https://bugs.webkit.org/show_bug.cgi?id=156718
1536
1537         * platform/sql/SQLiteDatabase.cpp:
1538         (WebCore::SQLiteDatabase::open):
1539             - enable on iOS.
1540
1541 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
1542
1543         Remove support for X-Frame-Options in `<meta>`
1544         https://bugs.webkit.org/show_bug.cgi?id=156625
1545         <rdar://problem/25748714>
1546
1547         Rubberstamped by Darin Adler.
1548
1549         * dom/Document.cpp:
1550         (WebCore::Document::processHttpEquiv): Revise messaging based on Darin's comments.
1551
1552 2016-04-18  Chris Dumez  <cdumez@apple.com>
1553
1554         Crash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack.last()
1555         https://bugs.webkit.org/show_bug.cgi?id=156715
1556         <rdar://problem/25750864>
1557
1558         Reviewed by Antti Koivisto.
1559
1560         Fix correctness of ElementDescendantIterator::operator--(). The last element
1561         in the m_ancestorSiblingStack stack is nullptr. However, if our parent does
1562         not have a sibling, m_current->nextSibling() == m_ancestorSiblingStack.last()
1563         would be true and we would end up removing the nullptr element from
1564         m_ancestorSiblingStack. We would crash on a follow-up call to operator--()
1565         because m_ancestorSiblingStack.last() would do an out-of-bound access, given
1566         that m_ancestorSiblingStack is empty.
1567
1568         Test: fast/dom/collection-backward-traversal-crash.html
1569
1570         * dom/ElementDescendantIterator.h:
1571         (WebCore::ElementDescendantIterator::operator--):
1572
1573 2016-04-18  Anders Carlsson  <andersca@apple.com>
1574
1575         Fix build with newer versions of clang.
1576         rdar://problem/25749769
1577
1578         Forward declare performClose:.
1579
1580         * platform/mac/WebCoreFullScreenWindow.mm:
1581
1582 2016-04-18  Tina Liu  <iting_liu@apple.com>
1583
1584         Declare a virtual function in PluginStrategy to be implemented by subclasses.
1585         https://bugs.webkit.org/show_bug.cgi?id=156540
1586
1587         Reviewed by Anders Carlsson.
1588
1589         * plugins/PluginStrategy.h:
1590
1591 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
1592
1593         [iOS] don't toggle playback when media engine rate changes
1594         https://bugs.webkit.org/show_bug.cgi?id=156705
1595         <rdar://problem/25779175>
1596
1597         Reviewed by Jer Noble.
1598
1599         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1600         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Don't send the play/pause command
1601           unless the player item state is >= MediaPlayerAVPlayerItemStatusPlaybackBufferFull and
1602           the rate change is unexpected.
1603
1604 2016-04-18  Chris Dumez  <cdumez@apple.com>
1605
1606         Unreviewed, fix iOS9 build after r199682.
1607
1608         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1609         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1610
1611 2016-04-18  Chris Dumez  <cdumez@apple.com>
1612
1613         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
1614         https://bugs.webkit.org/show_bug.cgi?id=156639
1615         <rdar://problem/25765848>
1616
1617         Reviewed by Alex Christensen.
1618
1619         Only adjust network responses' MIME type for QuickLook in the context of a main
1620         resource load since we can only preview main resources with QuickLook. This
1621         avoids doing unnecessary work during page load. Also, this makes it a lot less
1622         likely to dlopen() the QuickLook library during page load since we now only
1623         adjust MIME type for QuickLook for main resources, and main resources usually
1624         have the well-known 'text/html' MIME type for which we know we will not use
1625         QuickLook.
1626
1627         After this change, we no longer need to dlopen() the QuickLook library in the
1628         NetworkProcess in the context of the PLT. We would previously dlopen() the
1629         library during the first page load, thus significantly slowing it down. As a
1630         result, we see a ~22% speed up in the PLT's first page load and a 0.9-1% overall
1631         PLT progression.
1632
1633         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1634         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1635         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
1636
1637         * platform/network/ios/WebCoreURLResponseIOS.mm:
1638         (WebCore::adjustMIMETypeIfNecessary):
1639         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
1640
1641         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1642         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1643         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1644         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1645         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
1646
1647         * platform/network/mac/WebCoreURLResponse.h:
1648         * platform/network/mac/WebCoreURLResponse.mm:
1649         (WebCore::adjustMIMETypeIfNecessary):
1650
1651 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
1652
1653         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
1654         https://bugs.webkit.org/show_bug.cgi?id=153151
1655         <rdar://problem/24383176>
1656
1657         Reviewed by Darin Adler.
1658
1659         Remove the unused dynamic favicon code and tests.
1660
1661         * loader/EmptyClients.h:
1662         * loader/FrameLoaderClient.h:
1663         * loader/LinkLoader.cpp:
1664         (WebCore::LinkLoader::loadLink):
1665
1666 2016-04-15  Jer Noble  <jer.noble@apple.com>
1667
1668         [Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
1669         https://bugs.webkit.org/show_bug.cgi?id=156633
1670
1671         Reviewed by Eric Carlson.
1672
1673         Pass through the existing "outputObscuredDueToInsufficientExternalProtection" status as an
1674         error, similarly to what we do for CDMSessionMediaSourceAVFObjC.
1675
1676         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1677         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
1678         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1679         (SOFT_LINK_CLASS):
1680         (-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]):
1681         (-[WebCDMSessionAVFoundationObjCListener invalidate]):
1682         (-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
1683         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
1684         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
1685         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1686         (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
1687         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1688         (WebCore::MediaPlayerPrivateAVFoundationObjC::avPlayer):
1689
1690 2016-04-18  Chris Dumez  <cdumez@apple.com>
1691
1692         Unreviewed, rolling out r199644.
1693
1694         Seems to have caused a 1-2% regression on warm PLT
1695
1696         Reverted changeset:
1697
1698         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
1699         https://bugs.webkit.org/show_bug.cgi?id=156639
1700         http://trac.webkit.org/changeset/199644
1701
1702 2016-04-17  Darin Adler  <darin@apple.com>
1703
1704         Get rid of IDBAny
1705         https://bugs.webkit.org/show_bug.cgi?id=156681
1706
1707         Reviewed by Brady Eidson.
1708
1709         IDBAny is not part of the public interface of Indexed Database.
1710         It was an implementation technique used to help create language bindings for
1711         functions that have to deal with types that aren't easly expressed with the
1712         normal IDL and C++ type system.
1713
1714         What was particularly dangerous about IDBAny is that it can be used to store
1715         arbitrary JavaScript objects and it's not easy to handle garbage collection and
1716         reference cycles when they are hidden behind this class's abstraction. It's also
1717         a needless extra layer, a reference counted object just to carry the types from
1718         the bindings to the C++ DOM implementation.
1719
1720         Ths patch also does many small style tweaks.
1721
1722         * CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
1723         * DerivedSources.cpp: Ditto.
1724         * DerivedSources.make: Ditto.
1725         * WebCore.xcodeproj/project.pbxproj: Ditto.
1726
1727         * Modules/indexeddb/IDBAny.cpp: Removed.
1728         * Modules/indexeddb/IDBAny.h: Removed.
1729         * Modules/indexeddb/IDBAny.idl: Removed.
1730
1731         * Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
1732         include as much.
1733         (WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
1734         (WebCore::IDBCursor::directionToString): Ditto.
1735         (WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
1736         (WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
1737         (WebCore::IDBCursor::key): Moved this function to the header.
1738         (WebCore::IDBCursor::primaryKey): Ditto.
1739         (WebCore::IDBCursor::value): Ditto.
1740         (WebCore::IDBCursor::source): Deleted this function; replaced with multiple
1741         type-specific functions; all but one will return null.
1742         (WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
1743         (WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
1744         Fell prey to the confusion because "unsigned long" in IDL means "unsigned" in C++.
1745         (WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
1746         (WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
1747         (WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
1748         ScriptExecutionContext here instead of inside the binding utilities functions.
1749
1750         * Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
1751         Changed key, primaryKey, and value to no longer take an unneeded ExecState.
1752         Made more functions private.
1753
1754         * Modules/indexeddb/IDBCursor.idl: Changed type of "source" to "any", which matches
1755         the IDB specification, rather than "IDBAny". Added [CustomGetter] so we can write the
1756         getter that understands the multiple possible values. Removed unneeded
1757         [CallWith=ScriptState] from key and primaryKey attributes.
1758
1759         * Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
1760         * Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
1761         from the value attribute.
1762
1763         * Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
1764         * Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!
1765
1766         * Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
1767         (WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
1768         (WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
1769         (WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
1770         (WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
1771         Also removed unneeded typecast.
1772
1773         * Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
1774         Removed the getDatabaseNames function. We still need a solution here, but there is
1775         no reason to keep the placeholder function that returns nullptr here.
1776
1777         * Modules/indexeddb/IDBIndex.cpp:
1778         (WebCore::IDBIndex::keyPathAny): Removed.
1779         (WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
1780         (WebCore::IDBIndex::count): Ditto.
1781         (WebCore::IDBIndex::openKeyCursor): Ditto.
1782         (WebCore::IDBIndex::get): Ditto.
1783         (WebCore::IDBIndex::getKey): Ditto.
1784
1785         * Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
1786         including itself. Marked class final. Updated for above changes.
1787
1788         * Modules/indexeddb/IDBIndex.idl: Changed type of "keyPath" to "any", which matches
1789         the IDB specification, rather than "IDBAny". Specified [ImplementationReturnType=IDBKeyPath]
1790         so the code generator creates the appropriate code to convert from an IDBKeyPath.
1791         In the future, we may find a way to do this without an explicit attribute in the IDL
1792         file but this is fine for now.
1793
1794         * Modules/indexeddb/IDBKeyRange.cpp:
1795         (WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
1796         of enums because all the call sites outside this class are using booleans.
1797         (WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
1798         (WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
1799         (WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
1800         (WebCore::IDBKeyRange::upperValue): Ditto.
1801         (WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
1802         (WebCore::IDBKeyRange::lowerBound): Updated for above changes.
1803         (WebCore::IDBKeyRange::upperBound): Ditto.
1804         (WebCore::IDBKeyRange::bound): Ditto.
1805         (WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
1806         there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.
1807
1808         * Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
1809         instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.
1810
1811         * Modules/indexeddb/IDBKeyRangeData.cpp:
1812         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.
1813
1814         * Modules/indexeddb/IDBObjectStore.cpp:
1815         (WebCore::IDBObjectStore::name): Changed return type to const String& to cut down on
1816         reference count churn.
1817         (WebCore::IDBObjectStore::keyPathAny): Deleted.
1818         (WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath& to cut down on
1819         unnecessary copies.
1820         (WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
1821         (WebCore::IDBObjectStore::get): Ditto.
1822         (WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
1823         (WebCore::IDBObjectStore::deleteFunction): Ditto.
1824         (WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
1825         (WebCore::IDBObjectStore::count): Ditto.
1826
1827         * Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
1828         above in the cpp file function descriptions.
1829
1830         * Modules/indexeddb/IDBObjectStore.idl: Changed type of "keyPath" to "any" and
1831         specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.
1832
1833         * Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
1834         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
1835         that depend on how m_result is implemented, which changed.
1836         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
1837         instead of setting m_result directly.
1838         (WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
1839         m_readyState directly.
1840         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
1841         m_transaction instead of peculiar adoptRef/leakRef.
1842         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
1843         instead of setting m_result directly.
1844
1845         * Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
1846         and made more things private.
1847
1848         * Modules/indexeddb/IDBRequest.cpp:
1849         (WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
1850         m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
1851         even when passed an IDBCursor.
1852         (WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
1853         if it's a cursor. The logic is now simply a null check.
1854         (WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
1855         (WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
1856         (WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
1857         (WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
1858         instead of setting m_source.
1859         (WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
1860         (WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
1861         m_indexSource instead of using m_source. To preserve current behavior, this this does not
1862         use m_cursorSource since the old code did not handle IDBCursor.
1863         (WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
1864         current behavior.
1865         (WebCore::IDBRequest::requestedIndexRecordType): Ditto.
1866         (WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
1867         (WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
1868         have to repeat the code to clear result pointers. Also take a reference.
1869         (WebCore::IDBRequest::setResultToStructuredClone): Ditto.
1870         (WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
1871         instead of m_result.
1872         (WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
1873         (WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
1874         (WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
1875         Also call setResultToUndefined instead of setting m_result.
1876         (WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
1877         instead of setting m_result.
1878         (WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
1879         (WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.
1880
1881         * Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
1882         since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
1883         objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
1884         Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
1885         Removed unused modernResult function. Made more things private.
1886
1887         * Modules/indexeddb/IDBRequest.idl: Use "any" instead of "IDBAny" for "result" and "source".
1888
1889         * Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
1890         (WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
1891         a reference.
1892         (WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
1893         * Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
1894         Removed some unneeded WebCore prefixes.
1895
1896         * Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.
1897
1898         * Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
1899         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
1900         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.
1901
1902         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
1903         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
1904         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.
1905
1906         * Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.
1907
1908         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
1909         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.
1910
1911         * Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.
1912
1913         * bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
1914         (WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong<Unknown>.
1915         (WebCore::deserializeIDBValueDataToJSValue): Ditto.
1916         (WebCore::idbKeyDataToScriptValue): Ditto.
1917         (WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.
1918
1919         * bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
1920         Added the toJS function for IDBKeyPath.
1921
1922         * bindings/js/JSIDBAnyCustom.cpp: Removed.
1923
1924         * bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
1925         (WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
1926         (WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
1927         a JSValue.
1928
1929         * bindings/js/JSIDBRequestCustom.cpp: Added.
1930         (WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
1931         cursor result, database result, or script result into a JSValue.
1932         (WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
1933         source into a JSValue.
1934
1935         * bindings/scripts/CodeGeneratorJS.pm:
1936         (NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
1937         for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
1938         arguments, so at some point we may be able to do this with C++ overloading and not require a
1939         special case in the code generator.
1940
1941         * inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
1942         dormant and not working.
1943         (WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
1944         instead of calling the result function checking for an exception and then doing type checking.
1945         (WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
1946         (WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
1947         Also use simpler interface to key, primaryKey, and value.
1948         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
1949         code, which was dormant and not working. Needs to be re-implemented.
1950
1951 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
1952
1953         Media element "user gesture for fullscreen" restriction is never lifted
1954         https://bugs.webkit.org/show_bug.cgi?id=156547
1955         <rdar://problem/25707814>
1956
1957         Reviewed by Jer Noble.
1958
1959         Test: media/video-fullscreen-restriction-removed.html
1960
1961         * html/MediaElementSession.cpp:
1962         (WebCore::MediaElementSession::playbackPermitted): Check fullscreenPermitted rather than
1963           checking for a user gesture because the restriction can be removed.
1964
1965 2016-04-18  Frederic Wang  <fwang@igalia.com>
1966
1967         Refactor RenderMathMLScripts layout to avoid using flexbox
1968         https://bugs.webkit.org/show_bug.cgi?id=153917
1969
1970         Reviewed by Martin Robinson.
1971
1972         Tests: mathml/mathml-in-html5/subsup-parameters-1.html
1973                mathml/opentype/large-operators-italic-correction.html
1974
1975         Reimplement RenderMathMLScripts without any flexbox or anonymous.
1976         We also rely on parameters from the MATH table to improve rendering.
1977
1978         * css/mathml.css:
1979         (msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ *): Deleted.
1980         Invalid markup for scripts is now just hidden.
1981         * rendering/mathml/RenderMathMLOperator.h: ditto.
1982         * rendering/mathml/RenderMathMLScripts.cpp:
1983         (WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
1984         (WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
1985         child list is valid and retrieve pointers on important children.
1986         (WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
1987         space after a script.
1988         (WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
1989         italic correction of a largeop base.
1990         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
1991         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
1992         the maximum ascent/descent of all the scripts and determine the minimal
1993         sub/sup shifts to apply.
1994         (WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
1995         offset depending on the directionality.
1996         (WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
1997         (WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
1998         (WebCore::RenderMathMLScripts::paintChildren): Implement this function.
1999         (WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
2000         (WebCore::RenderMathMLScripts::base): Deleted.
2001         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.
2002         (WebCore::RenderMathMLScripts::fixAnonymousStyles): Deleted.
2003         (WebCore::RenderMathMLScripts::addChildInternal): Deleted.
2004         (WebCore::RenderMathMLScripts::removeChildInternal): Deleted.
2005         (WebCore::RenderMathMLScripts::addChild): Deleted.
2006         (WebCore::RenderMathMLScripts::removeChild): Deleted.
2007         (WebCore::RenderMathMLScripts::styleDidChange): Deleted.
2008         (WebCore::RenderMathMLScripts::layout): Deleted.
2009         (WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): Deleted.
2010         (WebCore::RenderMathMLScriptsWrapper::addChildInternal): Deleted.
2011         (WebCore::RenderMathMLScriptsWrapper::addChild): Deleted.
2012         (WebCore::RenderMathMLScriptsWrapper::removeChildInternal): Deleted.
2013         (WebCore::RenderMathMLScriptsWrapper::removeChild): Deleted.
2014         * rendering/mathml/RenderMathMLScripts.h: Update definitions and remove classes
2015         for anonymous wrappers.
2016
2017 2016-04-18  Manuel Rego Casasnovas  <rego@igalia.com>
2018
2019         [css-grid] Use grid-template-areas to determine the explicit grid
2020         https://bugs.webkit.org/show_bug.cgi?id=156575
2021
2022         Reviewed by Darin Adler.
2023
2024         From the spec (https://drafts.csswg.org/css-grid/#grid-definition):
2025         "The size of the explicit grid is determined by the larger of the number
2026         of rows/columns defined by grid-template-areas and the number
2027         of rows/columns sized by grid-template-rows/grid-template-columns."
2028
2029         So we need to take into account the rows/columns defined by
2030         grid-template-areas to determine the size of the explicit grid.
2031
2032         Test: fast/css-grid-layout/explicit-grid-size.html
2033
2034         * rendering/style/GridPositionsResolver.cpp:
2035         (WebCore::GridPositionsResolver::explicitGridColumnCount):
2036         (WebCore::GridPositionsResolver::explicitGridRowCount):
2037
2038 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2039
2040         [GTK] Menu list button doesn't use the text color from the theme
2041         https://bugs.webkit.org/show_bug.cgi?id=118234
2042
2043         Reviewed by Darin Adler.
2044
2045         Set the combo box color accroding to the theme when adjusting the menu list style like Mac port does.
2046
2047         * rendering/RenderThemeGtk.cpp:
2048         (WebCore::menuListColor):
2049         (WebCore::RenderThemeGtk::adjustMenuListStyle):
2050
2051 2016-04-18  Manuel Rego Casasnovas  <rego@igalia.com>
2052
2053         [css-grid] Fix positioned items with content alignment
2054         https://bugs.webkit.org/show_bug.cgi?id=156597
2055
2056         Reviewed by Darin Adler.
2057
2058         Like for the case of gaps we need to take into account
2059         the content alignment in order to properly place and size
2060         the positioned items.
2061
2062         Regarding content alignment we need to care about 2 values:
2063         the position offset and the distribution offset.
2064         The position offset can be extracted from m_column|rowPositions,
2065         but the distribution offset is stored in 2 new variables called
2066         m_offsetBetweenColumns|Rows.
2067
2068         Tests: fast/css-grid-layout/grid-positioned-items-content-alignment.html
2069                fast/css-grid-layout/grid-positioned-items-content-alignment-rtl.html
2070
2071         * rendering/RenderGrid.cpp:
2072         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2073         (WebCore::RenderGrid::populateGridPositions):
2074         (WebCore::RenderGrid::columnAxisOffsetForChild):
2075         (WebCore::RenderGrid::rowAxisOffsetForChild):
2076         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
2077         * rendering/RenderGrid.h:
2078
2079 2016-04-18  Manuel Rego Casasnovas  <rego@igalia.com>
2080
2081         [css-grid] Add method to translate RTL coordinates
2082         https://bugs.webkit.org/show_bug.cgi?id=156589
2083
2084         Reviewed by Antonio Gomes.
2085
2086         This is just a small refactoring adding a new function
2087         LayoutGrid::translateRTLCoordinate().
2088         This method translates to physical coordinates the information
2089         stored in m_columnPositions when you're using RTL direction.
2090
2091         No new tests, no change of behavior.
2092
2093         * rendering/RenderGrid.cpp:
2094         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the new
2095         method translateRTLCoordinate().
2096         (WebCore::RenderGrid::translateRTLCoordinate): New method that converts
2097         a coordinate from m_columnPositions in RTL into a physical coordinate.
2098         (WebCore::RenderGrid::findChildLogicalPosition): Use the new method
2099         translateRTLCoordinate().
2100         * rendering/RenderGrid.h: Add method signature.
2101
2102 2016-04-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2103
2104         [Fetch] Use @isArray instead of `instanceof @Array`
2105         https://bugs.webkit.org/show_bug.cgi?id=156682
2106
2107         Reviewed by Alex Christensen.
2108
2109         Currently, we query whether the given value is Array by using `instanceof @Array`.
2110         But it is not enough; Array from the other realm should be accepted. And Array
2111         not inheriting @Array should be also accepted.
2112
2113         Test: fetch/header-constructor-is-array.html
2114
2115         * Modules/fetch/FetchHeaders.js:
2116         (initializeFetchHeaders):
2117
2118 2016-04-17  Yoav Weiss  <yoav@yoav.ws>
2119
2120         Initial Link preload support
2121         https://bugs.webkit.org/show_bug.cgi?id=156334
2122
2123         Added basic `<link rel=preload>` functionality that enables preloading
2124         of resources according to their type.
2125
2126         Reviewed by Darin Adler.
2127
2128         Tests: http/tests/preload/download_resources.html
2129                http/tests/preload/dynamic_adding_preload.html
2130                http/tests/preload/dynamic_remove_preload_href.html
2131                http/tests/preload/dynamic_removing_preload.html
2132
2133         * bindings/generic/RuntimeEnabledFeatures.cpp: Added a runtime flag for the feature.
2134         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2135         * bindings/generic/RuntimeEnabledFeatures.h: Added a runtime flag for the feature.
2136         (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
2137         (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
2138         * html/HTMLAttributeNames.in: Added an `as` attribute.
2139         * html/HTMLLinkElement.cpp:
2140         (WebCore::HTMLLinkElement::process): Added `as` and `crossorigin` attribute values to the loadLink() call.
2141         (WebCore::HTMLLinkElement::setCrossOrigin): Setter for crossOrigin.
2142         (WebCore::HTMLLinkElement::crossOrigin): Getter for crossOrigin.
2143         * html/HTMLLinkElement.idl: Added `as` and `crossorigin` to HTMLLinkElement.
2144         * html/HTMLLinkElement.h: Added getter and setter for crossorigin.
2145         * html/LinkRelAttribute.cpp:
2146         (WebCore::LinkRelAttribute::LinkRelAttribute): Added "preload" as a potential value.
2147         * html/LinkRelAttribute.h: Added isLinkPreload.
2148         * loader/LinkLoader.cpp:
2149         (WebCore::LinkLoader::resourceTypeFromAsAttribute): Translates an `as` value into a resource type.
2150         (WebCore::preloadIfNeeded): Triggers a resource preload when link element is a preload one.
2151         (WebCore::LinkLoader::loadLink): Added a call to preloadIfNeeded.
2152         * loader/LinkLoader.h: Added signatures.
2153         * loader/ResourceLoadInfo.cpp:
2154         (WebCore::toResourceType): Added LinkPreload as a possible CachedResource::type.
2155         * loader/SubresourceLoader.cpp:
2156         (WebCore::logResourceLoaded): Added LinkPreload as a possible CachedResource::type.
2157         * loader/cache/CachedResource.cpp: Turned defaultPriorityForResourceType into a static member, as it's now also called from LinkLoader.
2158         (WebCore::CachedResource::defaultPriorityForResourceType): Added LinkPreload as a possible CachedResource::type, giving it low priority.
2159         (WebCore::defaultPriorityForResourceType): Deleted.
2160         * loader/cache/CachedResource.h: Added LinkPreload as a possible CachedResource::type. Added defaultPriorityForResourceType as static.
2161         * loader/cache/CachedResourceLoader.cpp:
2162         (WebCore::contentTypeFromResourceType): Added LinkPreload as a possible CachedResource::type.
2163         (WebCore::createResource): Added creation of a LinkPreload resource if needed.
2164         (WebCore::CachedResourceLoader::checkInsecureContent): Added LinkPreload as a possible CachedResource::type.
2165         (WebCore::CachedResourceLoader::canRequest): Added LinkPreload as a possible CachedResource::type.
2166         * testing/Internals.cpp: Added function to turn on the link preload feature.
2167         (WebCore::setLinkPreloadSupport):
2168         * testing/Internals.idl: Added function to turn on the link preload feature.
2169         * testing/Internals.h: Added function signature to turn on the link preload feature.
2170
2171 2016-04-17  Conrad Shultz  <conrad_shultz@apple.com>
2172
2173         Try (again) to fix debug builds after r199643.
2174
2175         Unreviewed.
2176
2177         * dom/ScriptExecutionContext.cpp:
2178         Add another missing include.
2179
2180 2016-04-17  Conrad Shultz  <conrad_shultz@apple.com>
2181
2182         Try to fix debug builds after r199643.
2183
2184         Unreviewed.
2185
2186         * Modules/indexeddb/IDBObjectStore.cpp:
2187         Add a missing include.
2188
2189 2016-04-17  Chris Dumez  <cdumez@apple.com>
2190
2191         [WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
2192         https://bugs.webkit.org/show_bug.cgi?id=156639
2193
2194         Reviewed by Darin Adler.
2195
2196         Do not unnecessarily dlopen() QuickLook in the NetworkProcess on iOS, as
2197         we already dlopen() this library in the WebContent process. This patch
2198         moves the resource response MIME type adjusting code for QuickLook from
2199         adjustMIMETypeIfNecessary() to a new adjustMIMETypeForQuickLook() function.
2200         adjustMIMETypeIfNecessary() is called in didReceiveResponse() in the Network
2201         process side, for *every* resource response, even though QuickLook can only
2202         be used to preview main resources. The new adjustMIMETypeForQuickLook()
2203         function is called in the QuickLookHandle::createIfNecessary() factory
2204         function, right before checking the MIME type to determine if we need to
2205         use QuickLook, and after checking that the load is for a main resource.
2206         In the WebKit2 case, the factory function is called from
2207         WebResourceLoader::didReceiveResponse(), on the WebContent process side.
2208
2209         This patch speeds up the first page load during PLT by ~22%, because the
2210         first load no longer triggers a dlopen() to QuickLook in the NetworkProcess.
2211         The overall PLT score seems to be progressed by 0.9-1% as well. The change
2212         should also be memory-positive as we no longer need to dlopen() the
2213         QuickLook library in the NetworkProcess at all (and we would already dlopen()
2214         it on the WebContent process side anyway). Sadly, PLUM benchmark does not
2215         show the memory benefit because it does not measure the memory used by the
2216         Network process.
2217
2218         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2219         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2220         Refactor the code a bit for clarity, so that we only
2221         ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
2222         returns a non-null pointer.
2223
2224         * platform/network/ios/QuickLook.h:
2225         - Rename the factories from create() to createIfNecessary() given that they
2226           return nullptr when it is unnecessary to create such handle (i.e. this is not
2227           a main resource loader, or it is unecessary given the response's MIME type.
2228         - Make shouldCreateForMIMEType() private now that this is always called inside
2229           the factory functions.
2230
2231         * platform/network/ios/QuickLook.mm:
2232         (adjustMIMETypeForQuickLook):
2233         Extracted code for adjusting the MIME type for QuickLook from the generic
2234         adjustMIMETypeIfNecessary() in WebCoreURLResponseIOS.mm to its own function
2235         here.
2236
2237         (WebCore::QuickLookHandle::createIfNecessary):
2238         Call adjustMIMETypeForQuickLook() before checking the MIME type.
2239
2240         * platform/network/ios/WebCoreURLResponseIOS.mm:
2241         (WebCore::adjustMIMETypeIfNecessary):
2242         Extracted QuickLook-specific code to QuickLook.mm.
2243
2244         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2245         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2246         Refactor the code a bit for clarity, so that we only
2247         ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
2248         returns a non-null pointer.
2249
2250 2016-04-17  Brady Eidson  <beidson@apple.com>
2251
2252         Clean up IDBBindingUtilities.
2253         https://bugs.webkit.org/show_bug.cgi?id=156472
2254
2255         Reviewed by Alex Christensen.
2256
2257         No new tests (No change in behavior).
2258
2259         - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
2260         - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
2261         - Make more functions deal in JSValue (as JSC::Strong<JSC::Unknown>) instead of Deprecated::ScriptValue.
2262
2263         * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
2264           JSValues instead of Deprecated::ScriptState
2265         * bindings/scripts/CodeGeneratorJS.pm:
2266         (NativeToJSValue): Use that new attribute.
2267         
2268         * Modules/indexeddb/IDBAny.cpp:
2269         (WebCore::IDBAny::IDBAny):
2270         (WebCore::IDBAny::scriptValue):
2271         * Modules/indexeddb/IDBAny.h:
2272         (WebCore::IDBAny::create):
2273         
2274         * Modules/indexeddb/IDBCursor.cpp:
2275         (WebCore::IDBCursor::key):
2276         (WebCore::IDBCursor::primaryKey):
2277         (WebCore::IDBCursor::value):
2278         (WebCore::IDBCursor::update):
2279         (WebCore::IDBCursor::continueFunction):
2280         (WebCore::IDBCursor::deleteFunction):
2281         (WebCore::IDBCursor::setGetResult):
2282         * Modules/indexeddb/IDBCursor.h:
2283         * Modules/indexeddb/IDBCursor.idl:
2284         * Modules/indexeddb/IDBCursorWithValue.idl:
2285         
2286         * Modules/indexeddb/IDBFactory.cpp:
2287         (WebCore::IDBFactory::cmp):
2288         
2289         * Modules/indexeddb/IDBIndex.cpp:
2290         (WebCore::IDBIndex::count):
2291         (WebCore::IDBIndex::get):
2292         (WebCore::IDBIndex::getKey):
2293         
2294         * Modules/indexeddb/IDBKeyRange.cpp:
2295         (WebCore::IDBKeyRange::lowerValue):
2296         (WebCore::IDBKeyRange::upperValue):
2297         (WebCore::IDBKeyRange::only):
2298         (WebCore::IDBKeyRange::lowerBound):
2299         (WebCore::IDBKeyRange::upperBound):
2300         (WebCore::IDBKeyRange::bound):
2301         * Modules/indexeddb/IDBKeyRange.h:
2302         * Modules/indexeddb/IDBKeyRange.idl:
2303         
2304         * Modules/indexeddb/IDBObjectStore.cpp:
2305         (WebCore::IDBObjectStore::get):
2306         (WebCore::IDBObjectStore::modernDelete):
2307         (WebCore::IDBObjectStore::count):
2308         
2309         * Modules/indexeddb/IDBRequest.cpp:
2310         (WebCore::IDBRequest::setResult):
2311         (WebCore::IDBRequest::setResultToStructuredClone):
2312         
2313         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2314         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2315         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2316         
2317         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2318         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
2319         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2320         
2321         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2322         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2323         
2324         * bindings/js/IDBBindingUtilities.cpp:
2325         (WebCore::idbKeyPathFromValue):
2326         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
2327         (WebCore::injectIDBKeyIntoScriptValue):
2328         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
2329         (WebCore::canInjectIDBKeyIntoScriptValue):
2330         (WebCore::deserializeIDBValueToJSValue):
2331         (WebCore::deserializeIDBValueDataToJSValue):
2332         (WebCore::scriptValueToIDBKey):
2333         (WebCore::idbKeyDataToScriptValue):
2334         (WebCore::idbKeyDataToJSValue): Deleted.
2335         (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
2336         (WebCore::deserializeIDBValue): Deleted.
2337         (WebCore::deserializeIDBValueData): Deleted.
2338         (WebCore::deserializeIDBValueBuffer): Deleted.
2339         (WebCore::idbValueDataToJSValue): Deleted.
2340         (WebCore::idbKeyToScriptValue): Deleted.
2341         * bindings/js/IDBBindingUtilities.h:
2342
2343         * bindings/js/JSIDBAnyCustom.cpp:
2344         (WebCore::toJS):
2345
2346         * bindings/js/JSIDBDatabaseCustom.cpp:
2347         (WebCore::JSIDBDatabase::createObjectStore):
2348
2349         * bindings/js/JSIDBObjectStoreCustom.cpp:
2350         (WebCore::JSIDBObjectStore::createIndex):
2351
2352         * dom/ScriptExecutionContext.cpp:
2353         (WebCore::ScriptExecutionContext::execState):
2354         * dom/ScriptExecutionContext.h:
2355
2356         * inspector/InspectorIndexedDBAgent.cpp:
2357
2358 2016-04-17  Darin Adler  <darin@apple.com>
2359
2360         Remove more uses of Deprecated::ScriptXXX
2361         https://bugs.webkit.org/show_bug.cgi?id=156660
2362
2363         Reviewed by Antti Koivisto.
2364
2365         * Modules/mediacontrols/MediaControlsHost.h: Removed unneeded include.
2366
2367         * Modules/plugins/PluginReplacement.h: Removed unneeded include.
2368         Changed argument to installReplacement into a reference. Changed return
2369         value for creation function from PassRefPtr to Ref.
2370
2371         * Modules/plugins/QuickTimePluginReplacement.h: Removed unneeded includes and
2372         forward declarations. Marked class final. Made almost everything private.
2373
2374         * Modules/plugins/QuickTimePluginReplacement.mm:
2375         (WebCore::QuickTimePluginReplacement::create): Changed to return Ref.
2376         (WebCore::QuickTimePluginReplacement::installReplacement): Changed to take
2377         a reference.
2378
2379         * Modules/plugins/YouTubePluginReplacement.cpp:
2380         (WebCore::YouTubePluginReplacement::create): Changed to return Ref.
2381         (WebCore::YouTubePluginReplacement::installReplacement): Changed to take
2382         a reference.
2383
2384         * Modules/plugins/YouTubePluginReplacement.h: Removed unneeded includes and
2385         forward declarations. Marked class final. Changed return type of create.
2386
2387         * Modules/websockets/WebSocket.cpp:
2388         (WebCore::WebSocket::didReceiveBinaryData): Removed local variable so the
2389         MessageEvent::create function gets a Ref&& instead of a RefPtr without having
2390         to add explicit WTFMove.
2391
2392         * bindings/js/DOMRequestState.h: Removed code that set m_exec twice.
2393
2394         * bindings/js/Dictionary.h: Reformatted function templates to use a single
2395         line so they are easier to look at.
2396         (WebCore::Dictionary::getEventListener): Rewrote this so it no longer uses
2397         a Deprecated::ScriptValue and also make it a little more compact and terse.
2398
2399         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2400         (WebCore::JSCommandLineAPIHost::inspect): Rewrote to use JSValue instead of
2401         Deprecated::ScriptValue. Considerably more efficient.
2402
2403         * bindings/js/JSMessageEventCustom.cpp:
2404         (WebCore::JSMessageEvent::data): Streamlined to use Deprecated::ScriptValue
2405         a little bit less.
2406
2407         * bindings/js/JSNodeCustom.cpp: Moved include here from header.
2408         * bindings/js/JSNodeCustom.h: Moved include from here to cpp file.
2409
2410         * bindings/js/JSPopStateEventCustom.cpp:
2411         (WebCore::JSPopStateEvent::state): Updated for changes to return value of the
2412         state() and serializedState functions.
2413
2414         * bindings/js/ScriptState.h: Removed the ScriptState typedef.
2415
2416         * bindings/js/SerializedScriptValue.cpp: Moved include here from header.
2417         * bindings/js/SerializedScriptValue.h: Moved include from here to cpp file.
2418
2419         * css/FontFace.cpp:
2420         (WebCore::FontFace::create): Changed argument to JSValue instead of ScriptValue.
2421         * css/FontFace.h: Ditto.
2422
2423         * dom/MessageEvent.cpp: Moved create functions in here from header file.
2424         Removed some unused ones including one that took a Deprecated::ScriptValue.
2425         * dom/MessageEvent.h: Streamlined create functions, removing unused functions,
2426         unused arguments, and unused default values for arguments. Also moved them all
2427         into the cpp file instead of inlining them. Also changed the return type of
2428         dataAsScriptValue to JSValue.
2429
2430         * dom/NodeFilterCondition.h: Removed unneeded include. Tweaked formatting.
2431
2432         * dom/PopStateEvent.h: Changed return value of state to be a JSValue and of
2433         serializedState to be a raw pointer, not a PassRefPtr.
2434
2435         * dom/Traversal.h: Removed unneeded include. Removed unnecessary use of
2436         unsigned long instead of unsigned. Fixed indentation.
2437
2438         * html/HTMLPlugInElement.cpp:
2439         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Pass reference.
2440
2441         * inspector/InspectorDOMAgent.cpp:
2442         (WebCore::InspectorDOMAgent::buildObjectForEventListener): Pass JSValue instead
2443         of constructing a Deprecated::ScriptValue.
2444
2445         * inspector/InspectorFrontendHost.cpp:
2446         (WebCore::FrontendMenuProvider::disconnect): Initialize without explicitly
2447         mentioning the Deprecated::ScriptObject type.
2448
2449         * inspector/InspectorIndexedDBAgent.cpp: Removed unneeded include.
2450
2451         * inspector/InspectorInstrumentation.h: Removed unneeded include and also
2452         declaration of two non-existent functions.
2453
2454         * page/DOMWindow.cpp:
2455         (WebCore::PostMessageTimer::PostMessageTimer): Tweaked types a little bit to
2456         match what is used in MessageEvent now.
2457         (WebCore::PostMessageTimer::event): Streamlined a bit and changed type to
2458         reference.
2459         (WebCore::DOMWindow::postMessage): Updated for changes above.
2460         (WebCore::DOMWindow::postMessageTimerFired): Ditto.
2461
2462         * page/EventSource.cpp:
2463         (WebCore::EventSource::createMessageEvent): Removed now-unneeded
2464         "false, false" from MessageEvent::create function call.
2465
2466         * page/csp/ContentSecurityPolicy.h: Removed unneeded include.
2467
2468         * page/csp/ContentSecurityPolicyDirectiveList.h: Removed unneeded
2469         include and also unneeded non-copyable, since the class has a reference as
2470         a data member and so is automatically non-copyable.
2471
2472         * testing/Internals.cpp:
2473         (WebCore::Internals::description): Changed to take JSValue.
2474         (WebCore::Internals::parserMetaData): Ditto.
2475         (WebCore::Internals::serializeObject): Removed unnecessary copying of vector.
2476         (WebCore::Internals::isFromCurrentWorld): Changed to take JSValue.
2477         (WebCore::Internals::isReadableStreamDisturbed): Changed to not rely on the
2478         ScriptState typedef and call it JSC::ExecState.
2479
2480         * testing/Internals.h: Removed unneeded includes. Removed unneeded and
2481         inappropriate use of ASSERT_NO_EXCEPTION.
2482
2483 2016-04-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2484
2485         [Fetch API] Consume HTTP data as a ReadableStream
2486         https://bugs.webkit.org/show_bug.cgi?id=138968
2487
2488         Reviewed by Alex Christensen.
2489
2490         This patch introduces ReadableStreamSource and ReadableStreamController which allow feeding a ReadableStream from DOM classes.
2491         ReadableStreamSource is a base class for all DOM ReadableStream sources.
2492         ReadableStreamController is a wrapper around JSReadableStreamController that can be invoked by DOM code to enqueue/close/error a ReadableStream.
2493         A createReadableStream function is introduced to allow DOM classes creating ReadableStream.
2494
2495         Added support for a FetchResponse ReadableStream source.
2496         Both synthetic FetchResponse and loading FetchResponse are supported.
2497         A new "Stream" FetchLoader::Type is introduced to allow receiving data as chunks and feeding them to a ReadableStream through ReadableStreamSource.
2498
2499         Currently, FetchResponse is consumed and marked as disturbed as soon as a ReadableStreamSource is created.
2500         This should be changed so that consumption happens on the first read call to the ReadableStreamReader, i.e. when stream gets disturbed.
2501
2502         FetchResponseSource never fulfills the start promise, which allows to enqueue, error or close the stream at any time.
2503         FetchResponseSource must therefore always ensure to close or error the stream.
2504         Added support for locked check in FetchResponse.
2505
2506         Tests: imported/w3c/web-platform-tests/fetch/api/response/response-cancel-stream.html
2507                imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream.html
2508                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-1.html
2509                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-2.html
2510                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-3.html
2511                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-4.html
2512                imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-5.html
2513         Also covered by rebased tests.
2514
2515         * CMakeLists.txt:
2516         * DerivedSources.make:
2517         * Modules/fetch/FetchBody.cpp:
2518         (WebCore::FetchBody::consumeAsStream): Fill stream with body data.
2519         * Modules/fetch/FetchBody.h:
2520         (WebCore::FetchBody::type): Added accessor to body type, used for assertions.
2521         * Modules/fetch/FetchBodyOwner.cpp:
2522         (WebCore::FetchBodyOwner::isDisturbed): Adding stream isLocked check.
2523         (WebCore::FetchBodyOwner::blobLoadingSucceeded): Added assertion that body type is blob. Closing stream if created.
2524         (WebCore::FetchBodyOwner::blobLoadingFailed): Erroring the stream if created and not cancelled.
2525         (WebCore::FetchBodyOwner::blobChunk): Filling stream with chunk.
2526         (WebCore::FetchBodyOwner::stop): Rmoved call to finishBlobLoading as it should be called as part of FetchLoaderCLient::didFail callbacki.
2527         * Modules/fetch/FetchBodyOwner.h:
2528         * Modules/fetch/FetchLoader.cpp: Fixing the case of cancel being called when creating the ThreadableLoader by introducing FetchLoader::m_isStarted.
2529         (WebCore::FetchLoader::start): Setting m_isStarted at the end of the start method.
2530         (WebCore::FetchLoader::stop): Fixing the case that FetchLoader can be destroyed when cancelling its loader.
2531         (WebCore::FetchLoader::startStreaming): Introduced to switch the loading type from ArayBuffer to Stream. Already buffered data is returned.
2532         (WebCore::FetchLoader::didReceiveData): Handling of the new Stream type.
2533         (WebCore::FetchLoader::didFinishLoading):
2534         * Modules/fetch/FetchLoader.h:
2535         * Modules/fetch/FetchLoaderClient.h:
2536         (WebCore::FetchLoaderClient::didReceiveData): Callback to get data as chunks if loader is of type Stream.
2537         * Modules/fetch/FetchResponse.cpp:
2538         (WebCore::FetchResponse::clone): Removed m_isLocked as it is handled within isDisturbed().
2539         (WebCore::FetchResponse::isDisturbed): Checking whether related ReadableStream is locked.
2540         (WebCore::FetchResponse::BodyLoader::didSucceed): Introduced to handle ReadableStream case.
2541         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
2542         (WebCore::FetchResponse::BodyLoader::didReceiveData): Ditto.
2543         (WebCore::FetchResponse::BodyLoader::startStreaming): Ditto.
2544         (WebCore::FetchResponse::consumeBodyAsStream): Start filling the ReadableStream with data. Changing loader to Stream if there is one.
2545         (WebCore::FetchResponse::createReadableStreamSource): Called by custom binding to create the source.
2546         (WebCore::FetchResponse::stop): Fixing potential crash in case of cancelling the ibody stream.
2547         (WebCore::FetchResponse::startFetching):
2548         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer):
2549         * Modules/fetch/FetchResponse.h:
2550         * Modules/fetch/FetchResponse.idl:
2551         * Modules/fetch/FetchResponseSource.cpp: Specialization of ReadableStreamSource for FetchResponse. It is a push source that never resolves the start promise.
2552         (WebCore::FetchResponseSource::FetchResponseSource):
2553         (WebCore::FetchResponseSource::isReadableStreamLocked):
2554         (WebCore::FetchResponseSource::setActive):
2555         (WebCore::FetchResponseSource::setInactive):
2556         (WebCore::FetchResponseSource::doStart):
2557         (WebCore::FetchResponseSource::doCancel):
2558         (WebCore::FetchResponseSource::close):
2559         (WebCore::FetchResponseSource::error):
2560         * Modules/fetch/FetchResponseSource.h: Added.
2561         * Modules/streams/ReadableStreamController.js:
2562         (error):
2563         * Modules/streams/ReadableStreamSource.h: Added (base class for ReadableStream DOM sources).
2564         (WebCore::ReadableStreamSource::~ReadableStreamSource):
2565         (WebCore::ReadableStreamSource::isStarting):
2566         (WebCore::ReadableStreamSource::isPulling):
2567         (WebCore::ReadableStreamSource::isCancelling):
2568         (WebCore::ReadableStreamSource::controller):
2569         (WebCore::ReadableStreamSource::doStart):
2570         (WebCore::ReadableStreamSource::doCancel):
2571         (WebCore::ReadableStreamSource::start):
2572         (WebCore::ReadableStreamSource::cancel):
2573         (WebCore::ReadableStreamSource::startFinished):
2574         (WebCore::ReadableStreamSource::clean):
2575         * Modules/streams/ReadableStreamSource.idl: Added.
2576         * WebCore.xcodeproj/project.pbxproj:
2577         * bindings/js/JSDOMGlobalObject.h:
2578         * bindings/js/JSFetchResponseCustom.cpp: In case body is not created, call createReadableStreamSource.
2579         (WebCore::JSFetchResponse::body):
2580         * bindings/js/JSReadableStreamSourceCustom.cpp: Added.
2581         (WebCore::JSReadableStreamSource::start):
2582         (WebCore::JSReadableStreamSource::pull):
2583         (WebCore::JSReadableStreamSource::controller):
2584         * bindings/js/ReadableStreamController.cpp: Added.
2585         (WebCore::callFunction):
2586         (WebCore::ReadableStreamController::invoke):
2587         (WebCore::ReadableStreamController::isControlledReadableStreamLocked):
2588         (WebCore::createReadableStream):
2589         * bindings/js/ReadableStreamController.h: The DOM wrapper for JSReadableStreamController.
2590         (WebCore::ReadableStreamController::ReadableStreamController):
2591         (WebCore::ReadableStreamController::close):
2592         (WebCore::ReadableStreamController::error):
2593         (WebCore::ReadableStreamController::enqueue):
2594         (WebCore::ReadableStreamController::globalObject):
2595         (WebCore::ReadableStreamController::enqueue<RefPtr<JSC::ArrayBuffer>>):
2596         (WebCore::ReadableStreamController::error<String>):
2597
2598 2016-04-16  Antti Koivisto  <antti@apple.com>
2599
2600         Element should be const in StyleResolver
2601         https://bugs.webkit.org/show_bug.cgi?id=156672
2602
2603         Reviewed by Darin Adler.
2604
2605         Resolving element style shouldn't mutate it.
2606
2607         This patch just does Element* -> const Element*, all the groundwork has been done already.
2608
2609         * css/StyleResolver.cpp:
2610         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
2611         (WebCore::StyleResolver::State::State):
2612         (WebCore::StyleResolver::State::setStyle):
2613         (WebCore::isAtShadowBoundary):
2614         (WebCore::StyleResolver::styleForElement):
2615         (WebCore::doesNotInheritTextDecoration):
2616         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
2617         (WebCore::StyleResolver::adjustRenderStyle):
2618         (WebCore::StyleResolver::checkRegionStyle):
2619         (WebCore::StyleResolver::updateFont):
2620         (WebCore::StyleResolver::styleRulesForElement):
2621         (WebCore::StyleResolver::pseudoStyleRulesForElement):
2622         (WebCore::StyleResolver::applyMatchedProperties):
2623         * css/StyleResolver.h:
2624         (WebCore::StyleResolver::style):
2625         (WebCore::StyleResolver::parentStyle):
2626         (WebCore::StyleResolver::rootElementStyle):
2627         (WebCore::StyleResolver::element):
2628         (WebCore::StyleResolver::document):
2629         (WebCore::StyleResolver::documentSettings):
2630         (WebCore::StyleResolver::usesFirstLineRules):
2631         (WebCore::StyleResolver::usesFirstLetterRules):
2632         (WebCore::StyleResolver::State::State):
2633         (WebCore::StyleResolver::State::document):
2634         (WebCore::StyleResolver::State::element):
2635         (WebCore::StyleResolver::State::style):
2636         (WebCore::StyleResolver::hasSelectorForId):
2637         (WebCore::checkRegionSelector):
2638         * rendering/RenderTheme.cpp:
2639         (WebCore::RenderTheme::RenderTheme):
2640         (WebCore::RenderTheme::adjustStyle):
2641         (WebCore::RenderTheme::adjustCheckboxStyle):
2642         (WebCore::RenderTheme::adjustRadioStyle):
2643         (WebCore::RenderTheme::adjustButtonStyle):
2644         (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
2645         (WebCore::RenderTheme::adjustTextFieldStyle):
2646         (WebCore::RenderTheme::adjustTextAreaStyle):
2647         (WebCore::RenderTheme::adjustMenuListStyle):
2648         (WebCore::RenderTheme::adjustMeterStyle):
2649         (WebCore::RenderTheme::paintMeter):
2650         (WebCore::RenderTheme::adjustCapsLockIndicatorStyle):
2651         (WebCore::RenderTheme::paintCapsLockIndicator):
2652         (WebCore::RenderTheme::adjustAttachmentStyle):
2653         (WebCore::RenderTheme::animationDurationForProgressBar):
2654         (WebCore::RenderTheme::adjustProgressBarStyle):
2655         (WebCore::RenderTheme::shouldHaveCapsLockIndicator):
2656         (WebCore::RenderTheme::adjustMenuListButtonStyle):
2657         (WebCore::RenderTheme::adjustMediaControlStyle):
2658         (WebCore::RenderTheme::adjustSliderTrackStyle):
2659         (WebCore::RenderTheme::adjustSliderThumbStyle):
2660         (WebCore::RenderTheme::adjustSliderThumbSize):
2661         (WebCore::RenderTheme::adjustSearchFieldStyle):
2662         (WebCore::RenderTheme::adjustSearchFieldCancelButtonStyle):
2663         (WebCore::RenderTheme::adjustSearchFieldDecorationPartStyle):
2664         (WebCore::RenderTheme::adjustSearchFieldResultsDecorationPartStyle):
2665         (WebCore::RenderTheme::adjustSearchFieldResultsButtonStyle):
2666         * rendering/RenderTheme.h:
2667         (WebCore::RenderTheme::minimumMenuListSize):
2668         (WebCore::RenderTheme::popupInternalPaddingBox):
2669         (WebCore::RenderTheme::popupOptionSupportsTextIndent):
2670         (WebCore::RenderTheme::paintRadioDecorations):
2671         (WebCore::RenderTheme::paintButtonDecorations):
2672         (WebCore::RenderTheme::paintTextField):
2673         (WebCore::RenderTheme::paintTextFieldDecorations):
2674         (WebCore::RenderTheme::paintTextArea):
2675         (WebCore::RenderTheme::paintTextAreaDecorations):
2676         (WebCore::RenderTheme::paintMenuList):
2677         (WebCore::RenderTheme::paintMenuListDecorations):
2678         (WebCore::RenderTheme::paintMenuListButtonDecorations):
2679         (WebCore::RenderTheme::paintPushButtonDecorations):
2680         (WebCore::RenderTheme::paintSquareButtonDecorations):
2681         (WebCore::RenderTheme::paintProgressBar):
2682         (WebCore::RenderTheme::paintSliderTrack):
2683         (WebCore::RenderTheme::paintSliderThumb):
2684         (WebCore::RenderTheme::paintSliderThumbDecorations):
2685         (WebCore::RenderTheme::paintSearchField):
2686         (WebCore::RenderTheme::paintSearchFieldDecorations):
2687         (WebCore::RenderTheme::paintSearchFieldCancelButton):
2688         (WebCore::RenderTheme::paintSearchFieldDecorationPart):
2689         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
2690         (WebCore::RenderTheme::paintSearchFieldResultsButton):
2691         (WebCore::RenderTheme::paintMediaFullscreenButton):
2692         (WebCore::RenderTheme::paintMediaPlayButton):
2693         (WebCore::RenderTheme::paintMediaOverlayPlayButton):
2694         * rendering/RenderThemeEfl.cpp:
2695         (WebCore::RenderThemeEfl::paintSliderTrack):
2696         (WebCore::RenderThemeEfl::adjustSliderTrackStyle):
2697         (WebCore::RenderThemeEfl::adjustSliderThumbStyle):
2698         (WebCore::RenderThemeEfl::adjustSliderThumbSize):
2699         (WebCore::RenderThemeEfl::paintSliderThumb):
2700         (WebCore::RenderThemeEfl::adjustCheckboxStyle):
2701         (WebCore::RenderThemeEfl::paintCheckbox):
2702         (WebCore::RenderThemeEfl::adjustRadioStyle):
2703         (WebCore::RenderThemeEfl::paintRadio):
2704         (WebCore::RenderThemeEfl::adjustButtonStyle):
2705         (WebCore::RenderThemeEfl::paintButton):
2706         (WebCore::RenderThemeEfl::adjustMenuListStyle):
2707         (WebCore::RenderThemeEfl::paintMenuList):
2708         (WebCore::RenderThemeEfl::adjustMenuListButtonStyle):
2709         (WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
2710         (WebCore::RenderThemeEfl::adjustTextFieldStyle):
2711         (WebCore::RenderThemeEfl::paintTextField):
2712         (WebCore::RenderThemeEfl::adjustTextAreaStyle):
2713         (WebCore::RenderThemeEfl::paintTextArea):
2714         (WebCore::RenderThemeEfl::adjustSearchFieldResultsButtonStyle):
2715         (WebCore::RenderThemeEfl::paintSearchFieldResultsButton):
2716         (WebCore::RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle):
2717         (WebCore::RenderThemeEfl::paintSearchFieldResultsDecorationPart):
2718         (WebCore::RenderThemeEfl::adjustSearchFieldCancelButtonStyle):
2719         (WebCore::RenderThemeEfl::paintSearchFieldCancelButton):
2720         (WebCore::RenderThemeEfl::adjustSearchFieldStyle):
2721         (WebCore::RenderThemeEfl::paintSearchField):
2722         (WebCore::RenderThemeEfl::adjustInnerSpinButtonStyle):
2723         (WebCore::RenderThemeEfl::updateCachedSystemFontDescription):
2724         (WebCore::RenderThemeEfl::adjustProgressBarStyle):
2725         * rendering/RenderThemeEfl.h:
2726         * rendering/RenderThemeGtk.cpp:
2727         (WebCore::RenderThemeGtk::adjustRepaintRect):
2728         (WebCore::RenderThemeGtk::adjustButtonStyle):
2729         (WebCore::RenderThemeGtk::paintButton):
2730         (WebCore::RenderThemeGtk::adjustMenuListStyle):
2731         (WebCore::RenderThemeGtk::adjustMenuListButtonStyle):
2732         (WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
2733         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
2734         (WebCore::RenderThemeGtk::paintTextField):
2735         (WebCore::RenderThemeGtk::paintTextArea):
2736         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
2737         (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
2738         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
2739         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
2740         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2741         (WebCore::RenderThemeGtk::adjustSearchFieldStyle):
2742         (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
2743         (WebCore::RenderThemeGtk::adjustSliderTrackStyle):
2744         (WebCore::RenderThemeGtk::adjustSliderThumbStyle):
2745         (WebCore::RenderThemeGtk::paintSliderTrack):
2746         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2747         (WebCore::RenderThemeGtk::innerSpinButtonLayout):
2748         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2749         (WebCore::spinButtonArrowSize):
2750         (WebCore::RenderThemeGtk::paintMediaCurrentTime):
2751         (WebCore::RenderThemeGtk::adjustProgressBarStyle):
2752         * rendering/RenderThemeGtk.h:
2753         * rendering/RenderThemeIOS.h:
2754         * rendering/RenderThemeIOS.mm:
2755         (WebCore::RenderThemeIOS::addRoundedBorderClip):
2756         (WebCore::RenderThemeIOS::adjustCheckboxStyle):
2757         (WebCore::RenderThemeIOS::isControlStyled):
2758         (WebCore::RenderThemeIOS::adjustRadioStyle):
2759         (WebCore::adjustInputElementButtonStyle):
2760         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
2761         (WebCore::RenderThemeIOS::adjustSliderTrackStyle):
2762         (WebCore::RenderThemeIOS::paintSliderTrack):
2763         (WebCore::RenderThemeIOS::adjustSliderThumbSize):
2764         (WebCore::RenderThemeIOS::sliderTickOffsetFromTrackCenter):
2765         (WebCore::RenderThemeIOS::adjustSearchFieldStyle):
2766         (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
2767         (WebCore::RenderThemeIOS::adjustButtonStyle):
2768         * rendering/RenderThemeMac.h:
2769         * rendering/RenderThemeMac.mm:
2770         (WebCore::RenderThemeMac::paintTextField):
2771         (WebCore::RenderThemeMac::adjustTextFieldStyle):
2772         (WebCore::RenderThemeMac::paintTextArea):
2773         (WebCore::RenderThemeMac::adjustTextAreaStyle):
2774         (WebCore::RenderThemeMac::animationDurationForProgressBar):
2775         (WebCore::RenderThemeMac::adjustProgressBarStyle):
2776         (WebCore::menuListButtonSizes):
2777         (WebCore::RenderThemeMac::adjustMenuListStyle):
2778         (WebCore::RenderThemeMac::popupMenuSize):
2779         (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
2780         (WebCore::RenderThemeMac::adjustSliderTrackStyle):
2781         (WebCore::RenderThemeMac::paintSliderTrack):
2782         (WebCore::RenderThemeMac::adjustSliderThumbStyle):
2783         (WebCore::RenderThemeMac::setSearchFieldSize):
2784         (WebCore::RenderThemeMac::adjustSearchFieldStyle):
2785         (WebCore::RenderThemeMac::cancelButtonSizes):
2786         (WebCore::RenderThemeMac::adjustSearchFieldCancelButtonStyle):
2787         (WebCore::RenderThemeMac::resultsButtonSizes):
2788         (WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle):
2789         (WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
2790         (WebCore::RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle):
2791         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
2792         (WebCore::RenderThemeMac::adjustSearchFieldResultsButtonStyle):
2793         (WebCore::RenderThemeMac::adjustSliderThumbSize):
2794         * rendering/RenderThemeWin.cpp:
2795         (WebCore::RenderThemeWin::paintButton):
2796         (WebCore::RenderThemeWin::adjustInnerSpinButtonStyle):
2797         (WebCore::RenderThemeWin::paintMenuList):
2798         (WebCore::RenderThemeWin::adjustMenuListStyle):
2799         (WebCore::RenderThemeWin::adjustMenuListButtonStyle):
2800         (WebCore::RenderThemeWin::adjustSliderThumbSize):
2801         (WebCore::RenderThemeWin::paintSearchField):
2802         (WebCore::RenderThemeWin::adjustSearchFieldStyle):
2803         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2804         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
2805         (WebCore::RenderThemeWin::adjustSearchFieldDecorationPartStyle):
2806         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
2807         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2808         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
2809         (WebCore::RenderThemeWin::adjustMeterStyle):
2810         * rendering/RenderThemeWin.h:
2811
2812 2016-04-16  Antti Koivisto  <antti@apple.com>
2813
2814         CSSCursorImageValue shouldn't mutate element during style resolution
2815         https://bugs.webkit.org/show_bug.cgi?id=156659
2816
2817         Reviewed by Darin Adler.
2818
2819         CSSCursorImageValue::updateIfSVGCursorIsUsed may mutate the argument element.
2820
2821         This patch removes the code that caches cursor element and image to SVGElement rare data.
2822         The whole things is basically unused. CSSCursorImageValue now maintains a weak map to
2823         SVGCursorElements directly instead of indirectly via the using SVGElements.
2824
2825         * css/CSSCursorImageValue.cpp:
2826         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
2827         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
2828         (WebCore::CSSCursorImageValue::customCSSText):
2829         (WebCore::CSSCursorImageValue::updateCursorElement):
2830
2831             We no longer rely on SVGElement rare data so no need to test for SVGElement.
2832
2833         (WebCore::CSSCursorImageValue::cursorElementRemoved):
2834         (WebCore::CSSCursorImageValue::cursorElementChanged):
2835
2836             Factor to a function.
2837
2838         (WebCore::CSSCursorImageValue::cachedImage):
2839         (WebCore::CSSCursorImageValue::clearCachedImage):
2840         (WebCore::CSSCursorImageValue::equals):
2841         (WebCore::CSSCursorImageValue::removeReferencedElement): Deleted.
2842
2843             Don't track client elements anymore. Just track referenced SVGCursorElements.
2844
2845         * css/CSSCursorImageValue.h:
2846         * css/StyleBuilderCustom.h:
2847         (WebCore::StyleBuilderCustom::applyValueCursor):
2848
2849             No need to make style unique. Initialization is now done in updateSVGCursorElement.
2850
2851         * svg/SVGCursorElement.cpp:
2852         (WebCore::SVGCursorElement::~SVGCursorElement):
2853         (WebCore::SVGCursorElement::isSupportedAttribute):
2854         (WebCore::SVGCursorElement::parseAttribute):
2855         (WebCore::SVGCursorElement::addClient):
2856         (WebCore::SVGCursorElement::removeClient):
2857
2858             Client is now an CSSCursorImageValue rather than SVGElement.
2859
2860         (WebCore::SVGCursorElement::svgAttributeChanged):
2861
2862             Instead of invalidating element style just invalidate the CSSCursorImageValue directly.
2863
2864         (WebCore::SVGCursorElement::addSubresourceAttributeURLs):
2865         (WebCore::SVGCursorElement::removeReferencedElement): Deleted.
2866         * svg/SVGCursorElement.h:
2867         * svg/SVGElement.cpp:
2868         (WebCore::SVGElement::~SVGElement):
2869         (WebCore::SVGElement::getBoundingBox):
2870         (WebCore::SVGElement::correspondingElement):
2871         (WebCore::SVGElement::setCursorElement): Deleted.
2872         (WebCore::SVGElement::cursorElementRemoved): Deleted.
2873         (WebCore::SVGElement::setCursorImageValue): Deleted.
2874         (WebCore::SVGElement::cursorImageValueRemoved): Deleted.
2875
2876             SVGElements no longer need to know about their cursors.
2877
2878         * svg/SVGElement.h:
2879         * svg/SVGElementRareData.h:
2880         (WebCore::SVGElementRareData::instanceUpdatesBlocked):
2881         (WebCore::SVGElementRareData::setInstanceUpdatesBlocked):
2882         (WebCore::SVGElementRareData::correspondingElement):
2883         (WebCore::SVGElementRareData::setCorrespondingElement):
2884         (WebCore::SVGElementRareData::animatedSMILStyleProperties):
2885         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
2886         (WebCore::SVGElementRareData::cursorElement): Deleted.
2887         (WebCore::SVGElementRareData::setCursorElement): Deleted.
2888         (WebCore::SVGElementRareData::cursorImageValue): Deleted.
2889         (WebCore::SVGElementRareData::setCursorImageValue): Deleted.
2890
2891 2016-04-15  Darin Adler  <darin@apple.com>
2892
2893         Reduce use of Deprecated::ScriptXXX classes
2894         https://bugs.webkit.org/show_bug.cgi?id=156632
2895
2896         Reviewed by Alex Christensen.
2897
2898         * Modules/mediastream/SDPProcessor.cpp: Removed unneeded include.
2899
2900         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2901         (WebCore::JSCommandLineAPIHost::inspectedObject): Use JSValue.
2902         * bindings/js/JSCustomEventCustom.cpp:
2903         (WebCore::JSCustomEvent::detail): Ditto.
2904         * bindings/js/ScriptController.cpp:
2905         (WebCore::ScriptController::evaluateInWorld): Ditto.
2906         (WebCore::ScriptController::evaluate): Ditto.
2907         (WebCore::ScriptController::executeScriptInWorld): Ditto.
2908         (WebCore::ScriptController::executeScript): Ditto.
2909         (WebCore::ScriptController::executeIfJavaScriptURL): Ditto.
2910         * bindings/js/ScriptController.h: Ditto.
2911
2912         * bindings/js/ScriptGlobalObject.cpp: Removed unused overload of set,
2913         and unused remove and folded handleException function into its one call site.
2914         (WebCore::ScriptGlobalObject::set): Take references instead of pointers.
2915         (WebCore::ScriptGlobalObject::get): Use JSObject instead of Deprecated::ScriptObject.
2916         * bindings/js/ScriptGlobalObject.h: Updated for the above.
2917
2918         * dom/CustomEvent.cpp:
2919         (WebCore::CustomEvent::initCustomEvent): Take JSValue and ExecState instead of
2920         Deprecated::ScriptValue.
2921         (WebCore::CustomEvent::trySerializeDetail): Take a reference instead of a pointer.
2922         Also removed an unneeded null check.
2923         * dom/CustomEvent.h: Use JSValue.
2924         * dom/CustomEvent.idl: Updated for the above.
2925
2926         * html/HTMLMediaElement.cpp: Remove unneeded include.
2927
2928         * inspector/CommandLineAPIHost.cpp:
2929         (WebCore::CommandLineAPIHost::InspectableObject::get): Take reference instead of
2930         pointer and return JSValue.
2931         * inspector/CommandLineAPIHost.h: Updated for the above.
2932
2933         * inspector/InspectorDOMAgent.cpp:
2934         (WebCore::InspectorDOMAgent::setDocument): Use "document" instead of "doc".
2935         (WebCore::InspectorDOMAgent::setAttributesAsText): Omit redundant class name.
2936         (WebCore::InspectorDOMAgent::focusNode): Ditto. Pass reference instead of pointer.
2937         (WebCore::InspectorDOMAgent::undo): Ditto.
2938         (WebCore::InspectorDOMAgent::redo): Ditto.
2939         (WebCore::InspectorDOMAgent::nodeForObjectId): Stop using Deprecated::ScriptValue.
2940         (WebCore::InspectorDOMAgent::resolveNode): Ditto.
2941         (WebCore::InspectorDOMAgent::scriptValueAsNode): Removed unneeded isObject check,
2942         which is already done by JSNode::toWrapped. Use JSValue.
2943         (WebCore::InspectorDOMAgent::nodeAsScriptValue): Use JSValue.
2944         * inspector/InspectorDOMAgent.h: Updated for the above.
2945
2946         * inspector/InspectorFrontendClientLocal.cpp:
2947         (WebCore::InspectorFrontendClientLocal::windowObjectCleared): Use references instead of
2948         pointers and removed unneeded local.
2949         (WebCore::InspectorFrontendClientLocal::evaluateAsBoolean): More of the same.
2950         * inspector/InspectorFrontendHost.cpp:
2951         (WebCore::InspectorFrontendHost::showContextMenu): Ditto.
2952
2953         * inspector/InspectorTimelineAgent.cpp:
2954         (WebCore::InspectorTimelineAgent::breakpointActionProbe): Updated to take
2955         reference instead of pointer and JSValue instead of ScriptValue.
2956         * inspector/InspectorTimelineAgent.h: Ditto.
2957         * inspector/PageConsoleAgent.cpp: Ditto.
2958         * inspector/PageDebuggerAgent.cpp:
2959         (WebCore::PageDebuggerAgent::breakpointActionLog): Ditto.
2960         * inspector/PageDebuggerAgent.h: Ditto.
2961
2962 2016-04-15  Daniel Bates  <dabates@apple.com>
2963
2964         CSP: Ignore paths in CSP matching after redirects
2965         https://bugs.webkit.org/show_bug.cgi?id=153154
2966         <rdar://problem/24383215>
2967
2968         Reviewed by Brent Fulgham.
2969
2970         For sub-resources that redirect, match the URL that is the result of the redirect against
2971         the source expressions in Content Security Policy ignoring any paths in those source
2972         expressions as per section Paths and Redirects of the Content Security Policy Level 2 spec.,
2973         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).
2974
2975         Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
2976                http/tests/security/contentSecurityPolicy/embed-redirect-allowed.html
2977                http/tests/security/contentSecurityPolicy/embed-redirect-allowed2.html
2978                http/tests/security/contentSecurityPolicy/embed-redirect-blocked.html
2979                http/tests/security/contentSecurityPolicy/embed-redirect-blocked2.html
2980                http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.html
2981                http/tests/security/contentSecurityPolicy/font-redirect-allowed2.html
2982                http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed.html
2983                http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed2.html
2984                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src.html
2985                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2.html
2986                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src.html
2987                http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2.html
2988                http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-child-src.html
2989                http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-frame-src.html
2990                http/tests/security/contentSecurityPolicy/image-redirect-allowed2.html
2991                http/tests/security/contentSecurityPolicy/object-redirect-allowed.html
2992                http/tests/security/contentSecurityPolicy/object-redirect-allowed2.html
2993                http/tests/security/contentSecurityPolicy/object-redirect-blocked.html
2994                http/tests/security/contentSecurityPolicy/object-redirect-blocked2.html
2995                http/tests/security/contentSecurityPolicy/object-redirect-blocked3.html
2996                http/tests/security/contentSecurityPolicy/script-redirect-allowed2.html
2997                http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed2.html
2998                http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed2.html
2999                http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed2.html
3000                http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html
3001                http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
3002                http/tests/security/contentSecurityPolicy/xsl-redirect-allowed2.html
3003
3004         * loader/DocumentLoader.cpp:
3005         (WebCore::DocumentLoader::willSendRequest): Define a local variable didReceiveRedirectResponse as
3006         to whether this request follows from having received a redirect response from the server. Pass this
3007         information to FrameLoader::checkIfFormActionAllowedByCSP() and PolicyChecker::checkNavigationPolicy()
3008         for its consideration.
3009         * loader/DocumentThreadableLoader.cpp:
3010         (WebCore::DocumentThreadableLoader::redirectReceived): Pass whether we have a non-null redirect
3011         response (i.e. received a redirect response from the server) to DocumentThreadableLoader::isAllowedByContentSecurityPolicy()
3012         for its consideration.
3013         (WebCore::DocumentThreadableLoader::loadRequest): Pass whether we performed a redirect to
3014         DocumentThreadableLoader::isAllowedByContentSecurityPolicy() for its consideration.
3015         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Modified to take a boolean
3016         argument as to whether a redirect was performed. We pass this information to the appropriate
3017         ContentSecurityPolicy method.
3018         * loader/DocumentThreadableLoader.h:
3019         * loader/FrameLoader.cpp:
3020         (WebCore::FrameLoader::checkIfFormActionAllowedByCSP): Modified to take a boolean argument as to whether
3021         a redirect response was received and passes this information to ContentSecurityPolicy::allowFormAction()
3022         for its consideration.
3023         (WebCore::FrameLoader::loadURL): Modified to tell PolicyChecker::checkNavigationPolicy() that the navigation
3024         is not in response to having received a redirect response from the server.
3025         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
3026         * loader/FrameLoader.h:
3027         * loader/PolicyChecker.cpp:
3028         (WebCore::isAllowedByContentSecurityPolicy): Modified to take a boolean argument as to whether
3029         a redirect response was received and passes this information to the appropriate ContentSecurityPolicy member
3030         function for consideration.
3031         (WebCore::PolicyChecker::checkNavigationPolicy): Modified to take a boolean argument as to whether a redirect
3032         response was received and passes this information through to WebCore::isAllowedByContentSecurityPolicy().
3033         * loader/PolicyChecker.h:
3034         * loader/SubresourceLoader.cpp:
3035         (WebCore::SubresourceLoader::willSendRequestInternal): Modified to tell CachedResourceLoader::canRequest() that
3036         the request is in response to having received a redirect response from the server.
3037         * loader/cache/CachedResourceLoader.cpp:
3038         (WebCore::CachedResourceLoader::canRequest): Modified to take a boolean argument as to whether a redirect
3039         response was received and passes this information through to the appropriate ContentSecurityPolicy member
3040         function for consideration.
3041         * loader/cache/CachedResourceLoader.h:
3042         * page/csp/ContentSecurityPolicy.cpp:
3043         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Modified to take an argument as to whether a
3044         redirect response was received and passes this information through to ContentSecurityPolicyDirectiveList.
3045         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
3046         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
3047         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
3048         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
3049         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
3050         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
3051         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
3052         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
3053         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
3054         * page/csp/ContentSecurityPolicy.h:
3055         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3056         (WebCore::checkSource):
3057         (WebCore::checkFrameAncestors):
3058         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext): Modified to take an argument
3059         as to whether a redirect response was received and passes this information through to the CSP directive.
3060         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource): Ditto.
3061         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFont): Ditto.
3062         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFormAction): Ditto.
3063         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame): Ditto.
3064         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForImage): Ditto.
3065         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia): Ditto.
3066         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource): Ditto.
3067         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript): Ditto.
3068         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle): Ditto.
3069         * page/csp/ContentSecurityPolicyDirectiveList.h:
3070         * page/csp/ContentSecurityPolicySource.cpp:
3071         (WebCore::ContentSecurityPolicySource::matches): Modified to take an argument as to whether a redirect response
3072         was received. When the specified URL follows from having received a redirect response then ignore the path
3073         component of the source expression when checking for a match. Otherwise, consider the path component of the
3074         source expression when performing the match.
3075         * page/csp/ContentSecurityPolicySource.h:
3076         * page/csp/ContentSecurityPolicySourceList.cpp:
3077         (WebCore::ContentSecurityPolicySourceList::matches): Modified to take an argument as to whether a redirect
3078         response was received and pass this information through to ContentSecurityPolicySource::matches().
3079         * page/csp/ContentSecurityPolicySourceList.h:
3080         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
3081         (WebCore::ContentSecurityPolicySourceListDirective::allows): Modified to take an argument as to whether a
3082         redirect response was received and pass this information through to ContentSecurityPolicySourceList::matches().
3083         * page/csp/ContentSecurityPolicySourceListDirective.h:
3084
3085 2016-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
3086
3087         [CSS Font Loading] FontFace's promise may never be resolved/rejected if Content Security Policy blocks all the URLs
3088         https://bugs.webkit.org/show_bug.cgi?id=156605
3089
3090         Reviewed by Daniel Bates.
3091
3092         If all the fonts are blocked, we will create a FontFace with no FontFaceSources.
3093         Loading such a FontFace should reject the promise.
3094
3095         Test: fast/text/font-loading-csp-block-all.html
3096
3097         * css/CSSFontFace.cpp:
3098         (WebCore::CSSFontFace::pump):
3099
3100 2016-04-15  Alex Christensen  <achristensen@webkit.org>
3101
3102         [WinCairo] Another unreviewed build fix.
3103
3104         * platform/network/curl/MultipartHandle.cpp:
3105         (WebCore::MultipartHandle::parseHeadersIfPossible):
3106
3107 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
3108
3109         [WinCairo] Unreviewed build fix.,
3110
3111         * platform/network/curl/MultipartHandle.cpp:
3112         (WebCore::MultipartHandle::parseHeadersIfPossible): Correct for new method signature.
3113
3114 2016-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
3115
3116         ASSERT when loading github.com
3117         https://bugs.webkit.org/show_bug.cgi?id=156604
3118         <rdar://problem/19890634>
3119
3120         Reviewed by Darin Adler.
3121
3122         HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
3123         When cloning the node, we were preserving each individual item, but not the state
3124         of the cache. Therefore, the cache and the attributes didn't agree with each other.
3125
3126         Test: fast/forms/checkValidity-cloneNode-crash.html
3127
3128         * html/HTMLInputElement.cpp:
3129         (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
3130
3131 2016-04-15  Brent Fulgham  <bfulgham@apple.com>
3132
3133         Remove support for X-Frame-Options in `<meta>`
3134         https://bugs.webkit.org/show_bug.cgi?id=156625
3135         <rdar://problem/25748714>
3136
3137         Reviewed by Darin Adler.
3138
3139         Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of
3140         a '<meta http-equiv="...">' tag. This brings us in line with Firefox, Edge, and Blink.
3141
3142         Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html
3143                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html
3144                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html
3145                http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html
3146                http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html
3147
3148         * dom/Document.cpp:
3149         (WebCore::Document::processHttpEquiv): Log error message instead of blocking the load.
3150
3151 2016-04-15  Jer Noble  <jer.noble@apple.com>
3152
3153         Audio elements should be able to have a controls manager.
3154         https://bugs.webkit.org/show_bug.cgi?id=156630
3155
3156         Reviewed by Beth Dakin.
3157
3158         Now that there is no longer a architectural restriction about what kind of media elements
3159         can be used with WebPlaybackSessionManager, allow audio elements to create a controls
3160         manager.
3161
3162         Drive-by fix: clear the controls manager when destroying the media player due to entering
3163         the page cache, and when destroying the media element.
3164
3165         * html/HTMLMediaElement.cpp:
3166         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3167         (WebCore::HTMLMediaElement::updatePlayState):
3168         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
3169         * html/MediaElementSession.cpp:
3170         (WebCore::MediaElementSession::canControlControlsManager):
3171
3172 2016-04-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
3173
3174         Calling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property is not animating
3175         https://bugs.webkit.org/show_bug.cgi?id=156549
3176
3177         Reviewed by Darin Adler.
3178
3179         A speculative fix for a crash which may happen when calling animationEnded()
3180         of any SVGAnimatedProperty while it is not animating.
3181
3182         * svg/SVGAnimatedTypeAnimator.h:
3183         (WebCore::SVGAnimatedTypeAnimator::executeAction):
3184
3185 2016-04-15  Jer Noble  <jer.noble@apple.com>
3186
3187         Unreviewed build fix for iOS simulator. Assert the correct variable.
3188
3189         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3190         (-[WebAVPlayerLayer layoutSublayers]):
3191         (-[WebAVPlayerLayer resolveBounds]):
3192         (-[WebAVPlayerLayer setVideoGravity:]):
3193
3194 2016-04-14  Jer Noble  <jer.noble@apple.com>
3195
3196         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
3197         https://bugs.webkit.org/show_bug.cgi?id=156564
3198
3199         Reviewed by Beth Dakin.
3200
3201         No new tests; this refactors existing functionality into new classes.
3202
3203         Tease apart the various WebVideoFullscreen{Interface,Model}{AVKit,Mac,VideoElement} into new
3204         WebPlaybackSession… classes dealing exclusively with playback state and commands, leaving
3205         fullscreen state and commands in the WebVideoFullscreen… classes. Specifically, create the
3206         following new classes:
3207
3208         - WebPlaybackSessionInterface (copied from WebVideoFullscreenInterface)
3209         - WebPlaybackSessionModelMediaElement (copied from WebVideoFullscreenModelMediaElement)
3210         - WebPlaybackSessionModel (copied from WebVideoFullscreenModel)
3211         - WebPlaybackSessionInterfaceAVKit (copied from WebVideoFullscreenInterfaceAVKit)
3212         - WebPlaybackSessionInterfaceMac (copied from WebVideoFullscreenInterfaceMac)
3213
3214         WebVideoFullscreenInterface and WebVideoFullscreenModel now inherit from
3215         WebPlaybackSessionInterface and WebPlaybackSessionModel, respectively. The concrete
3216         WebVideoFullscreen… subclasses each take their respective WebPlaybackSession… subclasses and
3217         fulfill their WebPlaybackSession interfaces through composition.
3218
3219         As part of this big tease-apart, the WebAVPlayerController class needs to be exposed in a
3220         header (as it's accessed by two different classes now), so that class is moved into its own
3221         implementation and header files.
3222
3223         The one case where a change in a WebPlaybackSession… class needs to be reflected in a
3224         WebVideoFullscreen… class is in WebPlaybackSessionInterfaceAVKit, where
3225         WebVideoFullscreenInterfaceAVKit needs to be notified when external playback becomes dis/en-
3226         abled, so a new WebPlaybackSessionInterfaceAVKitClient interface has been added to allow the
3227         WebPlaybackSession… to notify the WebVideoFullscreen….
3228
3229         The responsibility for the "controls manager" has moved from the WebVideoFullscreen… classes
3230         to the WebPlaybackSession… classes, so the ChromeClient interface for creating and destroying
3231         those controls is similarly renamed from setUpVideoControlsManager() to
3232         setUpPlaybackControlsManager().
3233
3234         * WebCore.xcodeproj/project.pbxproj:
3235         * html/HTMLMediaElement.cpp:
3236         (WebCore::HTMLMediaElement::updatePlayState):
3237         * page/ChromeClient.h:
3238         * platform/cocoa/WebPlaybackSessionInterface.h: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h.
3239         (WebCore::WebPlaybackSessionInterface::~WebPlaybackSessionInterface):
3240         * platform/cocoa/WebPlaybackSessionModel.h: Added.
3241         (WebCore::WebPlaybackSessionModel::~WebPlaybackSessionModel):
3242         * platform/cocoa/WebPlaybackSessionModelMediaElement.h: Added.
3243         (WebCore::WebPlaybackSessionModelMediaElement::create):
3244         (WebCore::WebPlaybackSessionModelMediaElement::mediaElement):
3245         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Added.
3246         (WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement):
3247         (WebPlaybackSessionModelMediaElement::~WebPlaybackSessionModelMediaElement):
3248         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
3249         (WebPlaybackSessionModelMediaElement::setMediaElement):
3250         (WebPlaybackSessionModelMediaElement::handleEvent):
3251         (WebPlaybackSessionModelMediaElement::updateForEventName):
3252         (WebPlaybackSessionModelMediaElement::play):
3253         (WebPlaybackSessionModelMediaElement::pause):
3254         (WebPlaybackSessionModelMediaElement::togglePlayState):
3255         (WebPlaybackSessionModelMediaElement::beginScrubbing):
3256         (WebPlaybackSessionModelMediaElement::endScrubbing):
3257         (WebPlaybackSessionModelMediaElement::seekToTime):
3258         (WebPlaybackSessionModelMediaElement::fastSeek):
3259         (WebPlaybackSessionModelMediaElement::beginScanningForward):
3260         (WebPlaybackSessionModelMediaElement::beginScanningBackward):
3261         (WebPlaybackSessionModelMediaElement::endScanning):
3262         (WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
3263         (WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
3264         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
3265         (WebPlaybackSessionModelMediaElement::observedEventNames):
3266         (WebPlaybackSessionModelMediaElement::eventNameAll):
3267         * platform/cocoa/WebPlaybackSessionModelVideoElement.cpp: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
3268         (WebPlaybackSessionModelVideoElement::WebPlaybackSessionModelVideoElement):
3269         (WebPlaybackSessionModelVideoElement::~WebPlaybackSessionModelVideoElement):
3270         (WebPlaybackSessionModelVideoElement::setWebVideoFullscreenInterface):
3271         (WebPlaybackSessionModelVideoElement::setVideoElement):
3272         (WebPlaybackSessionModelVideoElement::handleEvent):
3273         (WebPlaybackSessionModelVideoElement::updateForEventName):
3274         (WebPlaybackSessionModelVideoElement::play):
3275         (WebPlaybackSessionModelVideoElement::pause):
3276         (WebPlaybackSessionModelVideoElement::togglePlayState):
3277         (WebPlaybackSessionModelVideoElement::beginScrubbing):
3278         (WebPlaybackSessionModelVideoElement::endScrubbing):
3279         (WebPlaybackSessionModelVideoElement::seekToTime):
3280         (WebPlaybackSessionModelVideoElement::fastSeek):
3281         (WebPlaybackSessionModelVideoElement::beginScanningForward):
3282         (WebPlaybackSessionModelVideoElement::beginScanningBackward):
3283         (WebPlaybackSessionModelVideoElement::endScanning):
3284         (WebPlaybackSessionModelVideoElement::selectAudioMediaOption):
3285         (WebPlaybackSessionModelVideoElement::selectLegibleMediaOption):
3286         (WebPlaybackSessionModelVideoElement::updateLegibleOptions):
3287         (WebPlaybackSessionModelVideoElement::observedEventNames):
3288         (WebPlaybackSessionModelVideoElement::eventNameAll):
3289         * platform/cocoa/WebVideoFullscreenInterface.h:
3290         * platform/cocoa/WebVideoFullscreenModel.h:
3291         (WebCore::WebVideoFullscreenModel::~WebVideoFullscreenModel): Deleted.
3292         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
3293         (WebCore::WebVideoFullscreenModelVideoElement::create):
3294         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3295         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
3296         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
3297         (WebVideoFullscreenModelVideoElement::setVideoElement):
3298         (WebVideoFullscreenModelVideoElement::play):
3299         (WebVideoFullscreenModelVideoElement::pause):
3300         (WebVideoFullscreenModelVideoElement::togglePlayState):
3301         (WebVideoFullscreenModelVideoElement::beginScrubbing):
3302         (WebVideoFullscreenModelVideoElement::endScrubbing):
3303         (WebVideoFullscreenModelVideoElement::seekToTime):
3304         (WebVideoFullscreenModelVideoElement::fastSeek):
3305         (WebVideoFullscreenModelVideoElement::beginScanningForward):
3306         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
3307         (WebVideoFullscreenModelVideoElement::endScanning):
3308         (WebVideoFullscreenModelVideoElement::selectAudioMediaOption):
3309         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
3310         (WebVideoFullscreenModelVideoElement::handleEvent): Deleted.
3311         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
3312         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
3313         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
3314         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
3315         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
3316         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
3317         (WebVideoFullscreenModelVideoElement::isVisible): Deleted.
3318         * platform/ios/WebAVPlayerController.h: Added.
3319         * platform/ios/WebAVPlayerController.mm: Added.
3320         (-[WebAVPlayerController dealloc]):
3321         (-[WebAVPlayerController resetState]):
3322         (-[WebAVPlayerController player]):
3323         (-[WebAVPlayerController forwardingTargetForSelector:]):
3324         (-[WebAVPlayerController play:]):
3325         (-[WebAVPlayerController pause:]):
3326         (-[WebAVPlayerController togglePlayback:]):
3327         (-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]):
3328         (-[WebAVPlayerController isPlaying]):
3329         (-[WebAVPlayerController setPlaying:]):
3330         (+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
3331         (-[WebAVPlayerController beginScrubbing:]):
3332         (-[WebAVPlayerController endScrubbing:]):
3333         (-[WebAVPlayerController seekToTime:]):
3334         (-[WebAVPlayerController currentTimeWithinEndTimes]):
3335         (-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
3336         (+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
3337         (-[WebAVPlayerController hasLiveStreamingContent]):
3338         (+[WebAVPlayerController keyPathsForValuesAffectingHasLiveStreamingContent]):
3339         (-[WebAVPlayerController skipBackwardThirtySeconds:]):
3340         (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
3341         (-[WebAVPlayerController canScanForward]):
3342         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]):
3343         (-[WebAVPlayerController beginScanningForward:]):
3344         (-[WebAVPlayerController endScanningForward:]):
3345         (-[WebAVPlayerController beginScanningBackward:]):
3346         (-[WebAVPlayerController endScanningBackward:]):
3347         (-[WebAVPlayerController canSeekToBeginning]):
3348         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
3349         (-[WebAVPlayerController seekToBeginning:]):
3350         (-[WebAVPlayerController seekChapterBackward:]):
3351         (-[WebAVPlayerController canSeekToEnd]):
3352         (+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
3353         (-[WebAVPlayerController seekToEnd:]):
3354         (-[WebAVPlayerController seekChapterForward:]):
3355         (-[WebAVPlayerController hasMediaSelectionOptions]):
3356         (+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
3357         (-[WebAVPlayerController hasAudioMediaSelectionOptions]):
3358         (+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
3359         (-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
3360         (+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
3361         (-[WebAVPlayerController currentAudioMediaSelectionOption]):
3362         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
3363         (-[WebAVPlayerController currentLegibleMediaSelectionOption]):
3364         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
3365         (-[WebAVPlayerController isPlayingOnExternalScreen]):
3366         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
3367         (-[WebAVPlayerController isPictureInPictureInterrupted]):
3368         (-[WebAVPlayerController setPictureInPictureInterrupted:]):
3369         * platform/ios/WebPlaybackSessionInterfaceAVKit.h: Added.