background-repeat-x doesn't work
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-01-18  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         background-repeat-x doesn't work
4         https://bugs.webkit.org/show_bug.cgi?id=166997
5
6         Reviewed by Simon Fraser.
7
8         During the creation of the new CSS parser, we accidentally forgot
9         to hook up background-repeat-x and background-repeat-y.
10
11         Tests: fast/backgrounds/background-repeat-x-y-parse.html
12                fast/backgrounds/background-repeat-x-y.html
13
14         * css/parser/CSSParserFastPaths.cpp:
15         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
16
17 2017-01-18  Andy Estes  <aestes@apple.com>
18
19         [QuickLook] Support password-protected documents
20         https://bugs.webkit.org/show_bug.cgi?id=167153
21         <rdar://problem/28544527>
22
23         Reviewed by Alex Christensen.
24
25         Added support for previewing password-protected documents. If a document is
26         password-protected, QLPreviewConverter will call -connection:didFailWithError: with an error
27         code of kQLReturnPasswordProtected. When this happens, QuickLookHandle will ask the client
28         for a password, create a new QLPreviewConverter with the password specified in an options
29         dictionary, and replay the buffered input data into the converter. QLPreviewConverter will
30         then send the converted document data to its delegate as usual.
31         
32         Password entry UI will be added later; this patch implements the necessary QuickLookHandle
33         logic and adds support for testing.
34
35         Test: quicklook/password-protected.html
36
37         * PlatformMac.cmake:
38         * WebCore.xcodeproj/project.pbxproj:
39         * loader/ios/QuickLook.h: Declared setClientForTesting().
40         * loader/ios/QuickLook.mm: 
41         (testingClient): Created a static RefPtr to hold the testing client.
42         (testingOrEmptyClient): Returns the testing client if it's set, otherwise returns the empty client.
43         (-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
44         Initialized _client to testingOrEmptyClient(), stored the ResourceResponse's nsURLResponse()
45         in _originalResponse, and initialized _bufferedDataArray.
46         (-[WebPreviewConverter setClient:]): Ignore the new client if there is already a testing client.
47         (-[WebPreviewConverter appendDataArray:]): Stored the data array in _bufferedDataArray.
48         (-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Cleared _bufferedDataArray.
49         (-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Changed the
50         UNUSED_PARAM() to an ASSERT_UNUSED().
51         (-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
52         (-[WebPreviewConverter connection:didFailWithError:]): If the error code is
53         kQLReturnPasswordProtected and the domain is QuickLookErrorDomain, request a password from
54         the client then create a new QLPreviewConverter with the password specified in the options dictionary.
55         (WebCore::QuickLookHandle::setClientForTesting): Set testingClient() to the specified client.
56         * platform/ios/QuickLookSoftLink.h: Soft-linked kQLPreviewOptionPasswordKey.
57         * platform/ios/QuickLookSoftLink.mm: Ditto.
58         * platform/network/ios/QuickLookHandleClient.h:
59         (WebCore::QuickLookHandleClient::supportsPasswordEntry): Added. Tells QuickLookHandle
60         whether the client supports password entry.
61         (WebCore::QuickLookHandleClient::didRequestPassword): Added. Asks the client to specify a
62         password in the completionHandler lambda.
63         * platform/spi/ios/QuickLookSPI.h: Declared kQLReturnPasswordProtected for the public SDK
64         and asserted that its value is 4.
65         * testing/Internals.cpp:
66         (WebCore::Internals::resetToConsistentState): Reset the MockQuickLookHandleClient password
67         to the empty string and uninstalled the testing client.
68         (WebCore::Internals::setQuickLookPassword): Installed the testing client and set a password
69         on the MockQuickLookHandleClient.
70         * testing/Internals.h: 
71         * testing/Internals.idl: Defined Internals.setQuickLookPassword().
72         * testing/MockQuickLookHandleClient.cpp: Added.
73         (WebCore::MockQuickLookHandleClient::singleton): Returned a shared MockQuickLookHandleClient.
74         (WebCore::MockQuickLookHandleClient::didRequestPassword): Dispatched a lambda on the
75         main-or-Web-thread run loop to call the completionHandler with the specified password.
76         This simulates the delay that would happen when prompting the user for a password.
77         * testing/MockQuickLookHandleClient.h: Added.
78
79 2017-01-18  Youenn Fablet  <youenn@apple.com>
80
81         [Streams API] ReadableStream generic reader constructor does not need to call ReadableStream getReader
82         https://bugs.webkit.org/show_bug.cgi?id=167137
83
84         Reviewed by Xabier Rodriguez-Calvar.
85
86         Test: streams/shadowing-getReader.html
87
88         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
89         (WebCore::constructJSReadableStreamDefaultReader): Using private constructor instead of getReader.
90
91 2017-01-18  Youenn Fablet  <youenn@apple.com>
92
93         Reject fetch promise in case of ReadableStream upload
94         https://bugs.webkit.org/show_bug.cgi?id=167145
95
96         Reviewed by Alex Christensen.
97
98         Covered by rebased tests.
99
100         * Modules/fetch/FetchBody.cpp:
101         (WebCore::FetchBody::extract): Storing the fact that body data is represented as a ReadableStream.
102         * Modules/fetch/FetchBody.h:
103         (WebCore::FetchBody::isReadableStream):
104         * Modules/fetch/FetchRequest.h:
105         * Modules/fetch/FetchResponse.cpp:
106         (WebCore::FetchResponse::fetch): Rejecting if request body data is a ReadableStream.
107
108 2017-01-18  Andreas Kling  <akling@apple.com>
109
110         Document::securityOrigin() should return a reference.
111         <https://webkit.org/b/167124>
112
113         Reviewed by Sam Weinig.
114
115         The security origin is always initialized by the Document constructor
116         through Document::initSecurityContext(), so it's effectively always present.
117         Make it return a reference and remove unnecessary null checks exposed by this.
118
119         * Modules/applepay/ApplePaySession.cpp:
120         (WebCore::canCallApplePaySessionAPIs):
121         * Modules/encryptedmedia/CDM.cpp:
122         (WebCore::CDM::getSupportedConfiguration):
123         (WebCore::CDM::getConsentStatus):
124         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
125         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
126         * Modules/mediastream/UserMediaRequest.cpp:
127         (WebCore::canCallGetUserMedia):
128         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
129         (WebCore::DOMWindowWebDatabase::openDatabase):
130         * Modules/webdatabase/DatabaseContext.cpp:
131         (WebCore::DatabaseContext::allowDatabaseAccess):
132         * Modules/websockets/WebSocketHandshake.cpp:
133         (WebCore::WebSocketHandshake::clientOrigin):
134         * bindings/js/JSDOMBinding.cpp:
135         (WebCore::canAccessDocument):
136         * bindings/js/ScriptController.cpp:
137         (WebCore::ScriptController::collectIsolatedContexts):
138         * css/CSSStyleSheet.cpp:
139         (WebCore::CSSStyleSheet::canAccessRules):
140         * css/RuleSet.cpp:
141         (WebCore::RuleSet::addRulesFromSheet):
142         * css/StyleRuleImport.cpp:
143         (WebCore::StyleRuleImport::setCSSStyleSheet):
144         * dom/Document.cpp:
145         (WebCore::canAccessAncestor):
146         (WebCore::Document::findUnsafeParentScrollPropagationBoundary):
147         (WebCore::Document::cookie):
148         (WebCore::Document::setCookie):
149         (WebCore::Document::origin):
150         (WebCore::Document::domain):
151         (WebCore::Document::setDomain):
152         (WebCore::Document::storageBlockingStateDidChange):
153         (WebCore::Document::initSecurityContext):
154         (WebCore::Document::initDNSPrefetch):
155         (WebCore::Document::topOrigin):
156         * dom/Document.h:
157         (WebCore::Document::securityOrigin):
158         * dom/SecurityContext.cpp:
159         (WebCore::SecurityContext::isSecureTransitionTo):
160         * html/HTMLAnchorElement.cpp:
161         (WebCore::HTMLAnchorElement::handleClick):
162         * html/HTMLAppletElement.cpp:
163         (WebCore::HTMLAppletElement::canEmbedJava):
164         * html/HTMLCanvasElement.cpp:
165         (WebCore::HTMLCanvasElement::securityOrigin):
166         * html/HTMLLinkElement.cpp:
167         (WebCore::HTMLLinkElement::setCSSStyleSheet):
168         * html/HTMLMediaElement.cpp:
169         (WebCore::HTMLMediaElement::isSafeToLoadURL):
170         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
171         * html/HTMLPlugInImageElement.cpp:
172         (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
173         * inspector/InspectorDOMStorageAgent.cpp:
174         (WebCore::InspectorDOMStorageAgent::storageId):
175         (WebCore::InspectorDOMStorageAgent::findStorageArea):
176         * inspector/InspectorIndexedDBAgent.cpp:
177         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
178         (WebCore::InspectorIndexedDBAgent::requestDatabase):
179         (WebCore::InspectorIndexedDBAgent::requestData):
180         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
181         * inspector/InspectorPageAgent.cpp:
182         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
183         (WebCore::InspectorPageAgent::buildObjectForFrame):
184         * loader/DocumentLoader.cpp:
185         (WebCore::DocumentLoader::commitData):
186         * loader/DocumentThreadableLoader.cpp:
187         (WebCore::DocumentThreadableLoader::loadRequest):
188         (WebCore::DocumentThreadableLoader::securityOrigin):
189         * loader/DocumentWriter.cpp:
190         (WebCore::canReferToParentFrameEncoding):
191         * loader/EmptyClients.cpp:
192         * loader/FrameLoadRequest.cpp:
193         (WebCore::FrameLoadRequest::FrameLoadRequest):
194         * loader/FrameLoadRequest.h:
195         (WebCore::FrameLoadRequest::FrameLoadRequest):
196         * loader/FrameLoader.cpp:
197         (WebCore::shouldClearWindowName):
198         (WebCore::FrameLoader::outgoingOrigin):
199         (WebCore::FrameLoader::loadURL):
200         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
201         * loader/FrameLoaderClient.h:
202         * loader/MixedContentChecker.cpp:
203         (WebCore::MixedContentChecker::isMixedContent):
204         (WebCore::MixedContentChecker::canDisplayInsecureContent):
205         (WebCore::MixedContentChecker::canRunInsecureContent):
206         (WebCore::MixedContentChecker::checkFormForMixedContent):
207         * loader/MixedContentChecker.h:
208         * loader/NavigationScheduler.cpp:
209         (WebCore::NavigationScheduler::scheduleRedirect):
210         (WebCore::NavigationScheduler::scheduleLocationChange):
211         (WebCore::NavigationScheduler::scheduleRefresh):
212         * loader/NavigationScheduler.h:
213         * loader/PingLoader.cpp:
214         (WebCore::PingLoader::loadImage):
215         (WebCore::PingLoader::sendPing):
216         (WebCore::PingLoader::sendViolationReport):
217         * loader/ResourceLoadInfo.cpp:
218         (WebCore::ResourceLoadInfo::isThirdParty):
219         * loader/ResourceLoader.cpp:
220         (WebCore::ResourceLoader::init):
221         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials):
222         * loader/SubframeLoader.cpp:
223         (WebCore::SubframeLoader::pluginIsLoadable):
224         (WebCore::SubframeLoader::createJavaAppletWidget):
225         (WebCore::SubframeLoader::loadSubframe):
226         * loader/appcache/ApplicationCacheGroup.cpp:
227         (WebCore::ApplicationCacheGroup::selectCache):
228         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
229         (WebCore::ApplicationCacheGroup::update):
230         * loader/cache/CachedResourceLoader.cpp:
231         (WebCore::CachedResourceLoader::canRequest):
232         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
233         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
234         * loader/cache/CachedResourceRequest.cpp:
235         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
236         (WebCore::CachedResourceRequest::updateForAccessControl):
237         * loader/cache/CachedResourceRequest.h:
238         (WebCore::CachedResourceRequest::setOrigin):
239         * page/DOMWindow.cpp:
240         (WebCore::DOMWindow::sessionStorage):
241         (WebCore::DOMWindow::localStorage):
242         (WebCore::DOMWindow::postMessage):
243         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
244         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame):
245         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
246         (WebCore::DOMWindow::isInsecureScriptAccess):
247         * page/DragController.cpp:
248         (WebCore::DragController::dragExited):
249         (WebCore::DragController::tryDocumentDrag):
250         (WebCore::DragController::tryDHTMLDrag):
251         (WebCore::DragController::startDrag):
252         * page/History.cpp:
253         (WebCore::History::stateObjectAdded):
254         * page/Location.cpp:
255         (WebCore::Location::ancestorOrigins):
256         (WebCore::Location::reload):
257         * page/Navigator.cpp:
258         (WebCore::Navigator::javaEnabled):
259         * page/Page.cpp:
260         (WebCore::Page::showAllPlugins):
261         * page/PerformanceResourceTiming.cpp:
262         (WebCore::passesTimingAllowCheck):
263         * page/SecurityOrigin.cpp:
264         (WebCore::SecurityOrigin::canAccess):
265         (WebCore::SecurityOrigin::canRequest):
266         (WebCore::SecurityOrigin::canReceiveDragData):
267         (WebCore::SecurityOrigin::canAccessStorage):
268         (WebCore::SecurityOrigin::isSameOriginAs):
269         (WebCore::SecurityOrigin::equal):
270         (WebCore::SecurityOrigin::isSameSchemeHostPort):
271         * page/SecurityOrigin.h:
272         * page/SecurityOriginData.cpp:
273         (WebCore::SecurityOriginData::fromFrame):
274         * page/SecurityOriginHash.h:
275         (WebCore::SecurityOriginHash::equal):
276         * page/csp/ContentSecurityPolicy.cpp:
277         (WebCore::stripURLForUseInReport):
278         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
279         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
280         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
281         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
282         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
283         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin):
284         * rendering/shapes/ShapeOutsideInfo.cpp:
285         (WebCore::checkShapeImageOrigin):
286         * replay/ReplayInputCreationMethods.cpp:
287         (WebCore::InitialNavigation::createFromPage):
288         * replay/ReplayInputDispatchMethods.cpp:
289         (WebCore::InitialNavigation::dispatch):
290         * storage/Storage.cpp:
291         (WebCore::Storage::isDisabledByPrivateBrowsing):
292         * storage/StorageEventDispatcher.cpp:
293         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
294         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
295         * storage/StorageNamespaceProvider.cpp:
296         (WebCore::StorageNamespaceProvider::localStorageArea):
297         * testing/Internals.cpp:
298         (WebCore::Internals::setApplicationCacheOriginQuota):
299         * xml/XSLTProcessorLibxslt.cpp:
300         (WebCore::docLoaderFunc):
301         * xml/parser/XMLDocumentParserLibxml2.cpp:
302         (WebCore::shouldAllowExternalLoad):
303
304 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
305
306         Remove WEBCORE_EXPORT from newly inlined functions after r210845.
307
308         Unreviewed build fix.
309
310         * loader/DocumentLoader.h:
311
312 2017-01-18  Per Arne Vollan  <pvollan@apple.com>
313
314         Crash when changing video subtitles.
315         https://bugs.webkit.org/show_bug.cgi?id=167159
316
317         Reviewed by Xabier Rodriguez-Calvar.
318
319         Add null pointer check.
320
321         * html/track/VTTCue.cpp:
322         (WebCore::VTTCue::removeDisplayTree):
323
324 2017-01-18  Youenn Fablet  <youenn@apple.com>
325
326         [Fetch API] Update content-type in case of form data
327         https://bugs.webkit.org/show_bug.cgi?id=167143
328
329         Reviewed by Alex Christensen.
330
331         Covered by rebased test.
332
333         * Modules/fetch/FetchBody.cpp:
334         (WebCore::FetchBody::extract): Adding a space to the content-type in case of form data.
335
336 2017-01-18  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
337
338         [GStreamer] media source tests crashing
339         https://bugs.webkit.org/show_bug.cgi?id=167158
340
341         Reviewed by Carlos Garcia Campos.
342
343         This fixes several media source tests which are asserting on debug builds,
344         such as:
345
346         - fast/history/page-cache-removed-source-buffer.html
347         - imported/w3c/web-platform-tests/media-source/
348
349         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
350         (WebCore::AppendPipeline::AppendPipeline): do not adopt the GStPipeline
351         upon creation. A regular assignment will do the right thing, sinking the
352         floating ref.
353
354 2017-01-18  Antoine Quint  <graouts@apple.com>
355
356         [Modern Media Controls] Turn modern media controls on by default
357         https://bugs.webkit.org/show_bug.cgi?id=165668
358
359         Reviewed by Dean Jackson.
360
361         Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
362                media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
363                media/modern-media-controls/pip-support/ipad/pip-support-tap.html
364                media/modern-media-controls/placard-support/ipad/placard-support-pip.html
365                media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
366
367         Fix an error which may be triggered prior to Sierra where we would assume the presentation
368         mode API was avaiable when it might not be, which caused a few tests to fail.
369
370         * Modules/modern-media-controls/media/pip-support.js:
371         (PiPSupport.prototype.syncControl):
372         (PiPSupport):
373
374 2017-01-18  Miguel Gomez  <magomez@igalia.com>
375
376         [GTK] [TextureMapper] [GLES2] Draw repeated patterns for NPOT textures manually
377         https://bugs.webkit.org/show_bug.cgi?id=167118
378
379         Reviewed by Žan Doberšek.
380
381         When using GLES2 without the GL_OES_texture_npot extension, some implementations fail to properly
382         draw repeated patters from a texture (using GL_REPEAT). For those cases, perform the repetition
383         manually using the shader.
384
385         Covered by existent tests.
386
387         * platform/graphics/texmap/TextureMapperGL.cpp:
388         (WebCore::driverSupportsNPOTTextures):
389         (WebCore::TextureMapperGL::drawTexture):
390         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
391         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
392         (WebCore::TextureMapperShaderProgram::create):
393         * platform/graphics/texmap/TextureMapperShaderProgram.h:
394
395 2017-01-15  Darin Adler  <darin@apple.com>
396
397         Remove PassRefPtr from "loader" directory of WebCore
398         https://bugs.webkit.org/show_bug.cgi?id=167055
399
400         Reviewed by Alex Christensen.
401
402         * dom/Document.cpp:
403         (WebCore::Document::processHttpEquiv): Pass a reference.
404         * editing/CompositeEditCommand.cpp:
405         (WebCore::EditCommandComposition::unapply): Ditto.
406         (WebCore::EditCommandComposition::reapply): Ditto.
407         (WebCore::CompositeEditCommand::ensureComposition): Return a reference.
408         (WebCore::CompositeEditCommand::applyCommandToComposite): Use a reference.
409         * editing/CompositeEditCommand.h: Updated for above changes.
410
411         * editing/Editor.cpp:
412         (WebCore::Editor::unappliedEditing): Take a reference instead of a PassRefPtr.
413         (WebCore::Editor::reappliedEditing): Ditto.
414         * editing/Editor.h: Updated for above changes. Also changed the
415         FragmentAndResources resources vector to hold Ref instead of RefPtr.
416
417         * editing/cocoa/EditorCocoa.mm:
418         (WebCore::Editor::createFragmentAndAddResources): Updated for change to
419         FragmentAndResources.
420
421         * editing/ios/EditorIOS.mm:
422         (WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
423
424         * editing/mac/EditorMac.mm:
425         (WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
426
427         * history/PageCache.cpp:
428         (WebCore::canCacheFrame): Use a reference.
429
430         * html/FileInputType.cpp:
431         (WebCore::FileInputType::handleDOMActivateEvent): Pass references.
432
433         * html/HTMLFormControlElement.cpp:
434         (WebCore::HTMLFormControlElement::formMethod): Use auto.
435
436         * html/HTMLFormElement.cpp:
437         (WebCore::HTMLFormElement::prepareForSubmission): Updated to use a return
438         values for textFieldValues intsead of an out argument with getTextFieldValues.
439         (WebCore::HTMLFormElement::textFieldValues): Renamed from getTextFieldValues
440         and changed to use a return value instead of an out argument.
441         (WebCore::HTMLFormElement::submit): Pass a reference.
442         (WebCore::HTMLFormElement::requestAutocomplete): Pass a Ref&&.
443         * html/HTMLFormElement.h: Updated for above changes.
444
445         * html/HTMLHtmlElement.cpp:
446         (WebCore::HTMLHtmlElement::insertedByParser): Use a reference.
447
448         * html/HTMLLinkElement.cpp:
449         (WebCore::HTMLLinkElement::process): Pass a reference.
450         (WebCore::HTMLLinkElement::setCSSStyleSheet): Use auto.
451
452         * html/HTMLMediaElement.cpp:
453         (WebCore::HTMLMediaElement::loadResource): Use a reference.
454
455         * inspector/InspectorApplicationCacheAgent.cpp:
456         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus): Use a reference,
457         also update for struct-style member names withou m_ prefix.
458         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests): Ditto.
459         (WebCore::InspectorApplicationCacheAgent::getManifestForFrame): Ditto.
460         (WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame): Ditto.
461         (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache): Ditto.
462         (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources): Ditto.
463         (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Ditto.
464         * inspector/InspectorApplicationCacheAgent.h: Updated for above changes.
465
466         * inspector/InspectorInstrumentation.cpp:
467         (WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl): Take a reference.
468         * inspector/InspectorInstrumentation.h: Updated for the above.
469
470         * loader/DocumentLoader.cpp:
471         (WebCore::DocumentLoader::DocumentLoader): Move much initialization to class definition.
472         (WebCore::DocumentLoader::originalRequest): Moved to header to make it inline.
473         (WebCore::DocumentLoader::originalRequestCopy): Ditto.
474         (WebCore::DocumentLoader::request): Ditto.
475         (WebCore::DocumentLoader::url): Ditto.
476         (WebCore::DocumentLoader::stopLoading): Pass a reference.
477         (WebCore::DocumentLoader::willSendRequest): Updated to take a raw pointer instead of a
478         PassRefPtr.
479         (WebCore::DocumentLoader::commitData): Call shouldUseMainResourceEncoding instead of
480         special casing WebArchive.
481         (WebCore::DocumentLoader::maybeCreateArchive): Pass references.
482         (WebCore::DocumentLoader::setArchive): Take Ref&& instead of PassRefPtr.
483         (WebCore::DocumentLoader::addAllArchiveResources): Take a reference instead
484         of a pointer.
485         (WebCore::DocumentLoader::popArchiveForSubframe): Return RefPtr instead of
486         PassRefPtr.
487         (WebCore::DocumentLoader::subresource): Ditto.
488         (WebCore::DocumentLoader::subresources): Return a Vector<Ref> instead of a
489         Vector<RefPtr>.
490         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): Use move
491         instead of swap.
492         (WebCore::DocumentLoader::scheduleArchiveLoad): Use shouldLoadFromArchiveOnly
493         instead of a special case for each type of archive.
494         (WebCore::DocumentLoader::originalURL): Moved to header to make it inline.
495         (WebCore::DocumentLoader::responseURL): Ditto.
496         (WebCore::DocumentLoader::documentURL): Call shouldUseMainResourceURL instead of
497         special casing WebArchive.
498         (WebCore::DocumentLoader::responseMIMEType): Moved to header to make it inline.
499         (WebCore::DocumentLoader::currentContentType): Ditto.
500         (WebCore::DocumentLoader::contentFilter): Ditto.
501         (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Pass a reference.
502         (WebCore::DocumentLoader::getIconDataForIconURL): Ditto.
503         (WebCore::DocumentLoader::dispatchOnloadEvents): Use a reference.
504         (WebCore::DocumentLoader::unreachableURL): Moved to header to make it inline.
505         * loader/DocumentLoader.h: Updated for the above.
506
507         * loader/EmptyClients.cpp: Updated for changes to client interfaces.
508         * loader/EmptyClients.h: Ditto.
509
510         * loader/FormState.cpp:
511         (WebCore::FormState::FormState): Take references instead of PassRefPtr, also
512         take Vector&& instead of Vector& when we want to take ownership and use move
513         instead of swap to do that.
514         (WebCore::FormState::create): Ditto.
515         * loader/FormState.h: Updated for the above. Also changed return values to be
516         references instead of pointers and members to be Ref instead of RefPtr.
517
518         * loader/FormSubmission.cpp:
519         (WebCore::FormSubmission::Attributes::parseMethodType): Updated for change
520         to the Method enumeration.
521         (WebCore::FormSubmission::Attributes::copyFrom): Deleted.
522         (WebCore::FormSubmission::FormSubmission): Use Ref&& instead of PassRefPtr.
523         (WebCore::FormSubmission::create): Use reference instead of pointer and
524         raw pointer instead of PassRefPtr. Also copy attributes using copy constructor
525         instead of an explicit copyFrom function.
526         (WebCore::FormSubmission::requestURL): Updated for change to the Method
527         enumeration.
528         (WebCore::FormSubmission::populateFrameLoadRequest): Ditto.
529         * loader/FormSubmission.h: Updated for the above changes. Made the Attributes
530         class copyable, since we copy it. Changed some functions to return references
531         instead of pointers and use Ref instead of RefPtr for data members.
532
533         * loader/FrameLoader.cpp:
534         (WebCore::FrameLoader::submitForm): Updated for changes to FormSubmission
535         and FormState.
536         (WebCore::FrameLoader::receivedFirstData): Ditto.
537         (WebCore::FrameLoader::loadFrameRequest): Ditto.
538         (WebCore::FrameLoader::loadResourceSynchronously): Ditto.
539         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
540
541         * loader/FrameLoaderClient.h: Use references, pointers, RefPtr, and Ref
542         instead of PassRefPtr. Removed unused empty dispatchDidFailToStartPlugin.
543
544         * loader/HistoryController.cpp:
545         (WebCore::HistoryController::pushState): Take RefPtr&& instead of PassRefPtr.
546         (WebCore::HistoryController::replaceState): Ditto.
547         * loader/HistoryController.h: Updated for the above.
548
549         * loader/ImageLoader.cpp:
550         (WebCore::ImageLoader::updateFromElement): Pass a reference.
551
552         * loader/NavigationScheduler.cpp: Use refernces and Ref&& instead of
553         pointers and PassRefPtr.
554         (WebCore::ScheduledNavigation::ScheduledNavigation): Added an overload
555         that sests m_shouldOpenExternalURLsPolicy.
556         * loader/NavigationScheduler.h: Updated for the above.
557
558         * loader/ResourceLoader.cpp:
559         (WebCore::ResourceLoader::start): Use and pass references.
560         (WebCore::ResourceLoader::willSendRequest): Ditto.
561         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
562         (WebCore::ResourceLoader::didFail): Ditto.
563
564         * loader/SubframeLoader.cpp:
565         (WebCore::SubframeLoader::createJavaAppletWidget): Return RefPtr instead
566         of PassRefPtr. Pass references instead of pointers.
567         (WebCore::SubframeLoader::loadOrRedirectSubframe): Ditto.
568         (WebCore::SubframeLoader::loadSubframe): Ditto.
569         (WebCore::SubframeLoader::document): Deleted. This was never really the
570         correct idiom for getting the appropriate document; hiding the dependency
571         on m_frame wasn't paing off.
572         (WebCore::SubframeLoader::loadPlugin): Pass reference instead of pointer.
573         (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank): Eliminated
574         unneeded null checking and complexity due to going through the document
575         instead of the frame for this check.
576         * loader/SubframeLoader.h: Updated for the above.
577
578         * loader/appcache/ApplicationCache.cpp:
579         (WebCore::ApplicationCache::ApplicationCache): Moved data member
580         initialization to the class definition.
581         (WebCore::ApplicationCache::~ApplicationCache): Pass a reference instead
582         of a pointer.
583         (WebCore::ApplicationCache::isComplete): Ditto.
584         (WebCore::ApplicationCache::setManifestResource): Take Ref&& instead of
585         PassRefPtr.
586         (WebCore::ApplicationCache::addResource): Ditto.
587         (WebCore::ApplicationCache::removeResource): Deleted. Was unused.
588         * loader/appcache/ApplicationCache.h: Updated for above changes.
589
590         * loader/appcache/ApplicationCacheGroup.cpp:
591         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup): Moved most
592         member initialization to the class definition.
593         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup): Pass a reference.
594         (WebCore::ApplicationCacheGroup::cacheForMainRequest): Removed
595         unnecessary preflight for removeFragmentIdentifier, which efficiently
596         does nothing if there is no identifier. Use early return.
597         (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest): More of
598         the same.
599         (WebCore::ApplicationCacheGroup::selectCache): Ditto, also take a reference,
600         and use event names instead of a special enumeration to poast events.
601         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL): Ditto.
602         (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
603         (WebCore::ApplicationCacheGroup::failedLoadingMainResource): Ditto.
604         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Ditto.
605         (WebCore::ApplicationCacheGroup::cacheDestroyed): Ditto.
606         (WebCore::ApplicationCacheGroup::stopLoadingInFrame): Ditto.
607         (WebCore::ApplicationCacheGroup::setNewestCache): Use Ref&& instead of
608         PassRefPtr.
609         (WebCore::ApplicationCacheGroup::makeObsolete): More of the same.
610         (WebCore::ApplicationCacheGroup::update): Ditto.
611         (WebCore::ApplicationCacheGroup::abort): Ditto.
612         (WebCore::ApplicationCacheGroup::didReceiveResponse): Ditto.
613         (WebCore::ApplicationCacheGroup::didFinishLoading): Ditto.
614         (WebCore::ApplicationCacheGroup::didFail): Ditto.
615         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Ditto.
616         (WebCore::ApplicationCacheGroup::manifestNotFound): Ditto.
617         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Ditto.
618         (WebCore::ApplicationCacheGroup::startLoadingEntry): Ditto.
619         (WebCore::ApplicationCacheGroup::deliverDelayedMainResources): Use a modern
620         for loop.
621         (WebCore::ApplicationCacheGroup::addEntry): Use auto and simplify logic
622         for adding.
623         (WebCore::ApplicationCacheGroup::associateDocumentLoaderWithCache): Update since
624         function result is a reference.
625         (WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
626         Use auto.
627         (WebCore::ApplicationCacheGroup::postListenerTask): Take event type instead of
628         taking a special enumeration.
629         * loader/appcache/ApplicationCacheGroup.h: Updated for the above.
630
631         * loader/appcache/ApplicationCacheHost.cpp:
632         (WebCore::ApplicationCacheHost::ApplicationCacheHost): Move most member
633         initialization to the class definition.
634         (WebCore::ApplicationCacheHost::~ApplicationCacheHost): Use reference.
635         (WebCore::ApplicationCacheHost::selectCacheWithoutManifest): Ditto.
636         (WebCore::ApplicationCacheHost::selectCacheWithManifest): Ditto.
637         (WebCore::ApplicationCacheHost::mainResourceDataReceived): Ditto.
638         (WebCore::ApplicationCacheHost::failedLoadingMainResource): Ditto.
639         (WebCore::ApplicationCacheHost::finishedLoadingMainResource): Ditto.
640         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect): Ditto.
641         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse): Ditto.
642         (WebCore::ApplicationCacheHost::createFileURL): Ditto.
643         (WebCore::ApplicationCacheHost::maybeLoadSynchronously): Ditto.
644         (WebCore::ApplicationCacheHost::notifyDOMApplicationCache): Take event
645         type instead of special enumeration.
646         (WebCore::ApplicationCacheHost::stopLoadingInFrame): Use reference.
647         (WebCore::ApplicationCacheHost::stopDeferringEvents): Updated to use
648         event types instead of special enumeration and also repaired possible
649         edge case where code in event handler somehow triggers additional events.
650         (WebCore::ApplicationCacheHost::resourceList): Renamed from fillResourceList
651         and changed to return a vector instead of populating one.
652         (WebCore::ApplicationCacheHost::applicationCacheInfo): Tweak coding style a bit.
653         (WebCore::createApplicationCacheEvent): Factored this helper out of
654         dispatchDOMEvent so we can use Ref instead of RefPtr.
655         (WebCore::ApplicationCacheHost::dispatchDOMEvent): Updated to recent event type
656         rather than receiving an event id and mapping it to a type.
657         (WebCore::ApplicationCacheHost::setApplicationCache): Take RefPtr&& instead of
658         PassRefPtr.
659         (WebCore::ApplicationCacheHost::update): Pass a reference.
660         (WebCore::ApplicationCacheHost::swapCache): Ditto.
661         (WebCore::ApplicationCacheHost::abort): Ditto.
662         * loader/appcache/ApplicationCacheHost.h: Updated for the above.
663
664         * loader/appcache/ApplicationCacheStorage.cpp:
665         (WebCore::ApplicationCacheStorage::loadCacheGroup): Pass a Ref instead of RefPtr.
666         (WebCore::ApplicationCacheStorage::cacheGroupForURL): Ditto.
667         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): Ditto.
668         (WebCore::ApplicationCacheStorage::cacheGroupDestroyed): Take a reference.
669         (WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete): Ditto.
670         (WebCore::ApplicationCacheStorage::storeNewestCache): Ditto.
671         (WebCore::ApplicationCacheStorage::loadCache): Return RefPtr instead of PassRefPtr.
672         (WebCore::ApplicationCacheStorage::deleteCacheGroup): Pass a reference.
673         * loader/appcache/ApplicationCacheStorage.h: Updated for the above.
674
675         * loader/appcache/DOMApplicationCache.cpp:
676         (WebCore::DOMApplicationCache::DOMApplicationCache): Take a reference.
677         (WebCore::DOMApplicationCache::toEventType): Deleted.
678         * loader/appcache/DOMApplicationCache.h: Updated for the above. Made most
679         members private.
680
681         * loader/archive/Archive.cpp:
682         (WebCore::Archive::clearAllSubframeArchives): Use a set for the logic that
683         prevents us from walking the same archive more than once, rather than using
684         a vector. Left it recursive, though.
685         * loader/archive/Archive.h: Git rid of the type function, replacing it with
686         three functions for the four different policies we currently have about the
687         different archive types. Changed functions to take Ref&& instead of PassRefPtr
688         and return const Vector<Ref>& instead of const Vector<RefPtr>&, changing the
689         data members to match.
690
691         * loader/archive/ArchiveFactory.cpp:
692         (WebCore::createArchiveMIMETypesMap): Factored this out of the archiveMIMETypes
693         function so we don't need a boolean. Also use ASCIILiteral.
694         (WebCore::archiveMIMETypes): Updated to se the above.
695
696         * loader/archive/ArchiveResourceCollection.cpp:
697         (WebCore::ArchiveResourceCollection::addAllResources): Take a reference.
698         (WebCore::ArchiveResourceCollection::popSubframeArchive): Return RefPtr instead
699         of PassRefPtr.
700         * loader/archive/ArchiveResourceCollection.h: Updated for the above.
701
702         * loader/archive/cf/LegacyWebArchive.cpp:
703         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Use auto and
704         fewer local variables, more references for argument types and return values.
705         (WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
706         (WebCore::LegacyWebArchive::createResource): Ditto.
707         (WebCore::LegacyWebArchive::create): Ditto.
708         (WebCore::LegacyWebArchive::extract): Ditto.
709         (WebCore::LegacyWebArchive::type): Deleted.
710         (WebCore::LegacyWebArchive::rawDataRepresentation): More of the same.
711         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
712         * loader/archive/cf/LegacyWebArchive.h: Updated for the above. Also marked the
713         class final and added overrides for the four new policy member functions.
714
715         * loader/archive/mhtml/MHTMLArchive.cpp:
716         (WebCore::MHTMLArchive::create): Pass references.
717         (WebCore::MHTMLArchive::generateMHTMLData): Return RefPtr instead of
718         PassRefPtr.
719         * loader/archive/mhtml/MHTMLArchive.h: Updated for the above. Also marked the
720         class final and added overrides for the four new policy member functions.
721
722         * loader/archive/mhtml/MHTMLParser.cpp:
723         (WebCore::MHTMLParser::parseArchiveWithHeader): Pass Ref instead of RefPtr
724         to setMainResource and addSubframeArchive.
725         (WebCore::MHTMLParser::addResourceToArchive): Ditto.
726
727         * loader/cache/CachedCSSStyleSheet.cpp:
728         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet): Return RefPtr instead
729         of PassRefPtr.
730         * loader/cache/CachedCSSStyleSheet.h: Updated for the above.
731
732         * loader/cache/CachedResourceRequest.cpp:
733         (WebCore::CachedResourceRequest::setInitiator): Take a reference instead of a
734         PassRefPtr.
735         * loader/cache/CachedResourceRequest.h: Updated for the above.
736
737         * loader/cocoa/DiskCacheMonitor.h: Removed. This is a duplicate, unused copy
738         of DiskCacheMonitorCocoa.h.
739
740         * loader/cocoa/DiskCacheMonitorCocoa.h: Removed unneeded exporting and virtual
741         member functions, made more things private, and changed return type to RefPtr
742         instead of PassRefPtr.
743         * loader/cocoa/DiskCacheMonitorCocoa.mm:
744         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
745         Changed return type to RefPtr instead of PassRefPtr.
746
747         * loader/icon/IconDatabase.cpp:
748         (WebCore::IconDatabase::setIconDataForIconURL): Take raw pointer instead of
749         PassRefPtr.
750         (WebCore::IconDatabase::getOrCreateIconRecord): Return Ref instead of PassRefPtr.
751         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase): Return RefPtr
752         instead of PassRefPtr.
753         * loader/icon/IconDatabase.h: Updated for the above. Also marked functions final
754         instead of override.
755         * loader/icon/IconDatabaseBase.h: Ditto.
756
757         * loader/icon/PageURLRecord.cpp:
758         (WebCore::PageURLRecord::PageURLRecord): Moved initialization to the header.
759         (WebCore::PageURLRecord::~PageURLRecord): Wrote code here instead of calling
760         setIconRecord(nullptr).
761         (WebCore::PageURLRecord::setIconRecord): Take RefPtr&& instead of PassRefPtr.
762         * loader/icon/PageURLRecord.h: Updatd for the above.
763
764         * page/Chrome.cpp:
765         (WebCore::Chrome::runOpenPanel): Updated to take two references.
766         * page/Chrome.h: Ditto.
767         * page/ChromeClient.h: ditto.
768
769         * page/DOMWindow.cpp:
770         (WebCore::DOMWindow::applicationCache): Pass a reference.
771         (WebCore::DOMWindow::setLocation): Ditto.
772         (WebCore::DOMWindow::createWindow): Ditto.
773         (WebCore::DOMWindow::open): Ditto.
774
775         * page/EditorClient.h: Changed arguments to references instead of PassRefPtr.
776
777         * page/History.cpp:
778         (WebCore::History::stateObjectAdded): Pass an rvalue reference.
779
780         * page/Location.cpp:
781         (WebCore::Location::reload): Pass reference instead of pointer.
782         (WebCore::Location::setLocation): Ditto.
783
784         * platform/URL.cpp:
785         (WebCore::URL::setFragmentIdentifier): Take a StringView rather than
786         a String, which is more flexible for callers. Also eliminated an unneeded
787         string allocation when the old string had a fragment that is being replaced.
788         * platform/URL.h: Updated for the above.
789
790         * replay/ReplayInputDispatchMethods.cpp:
791         (WebCore::InitialNavigation::dispatch): Pass reference.
792         * svg/SVGFEImageElement.cpp:
793         (WebCore::SVGFEImageElement::requestImageResource): Ditto.
794         * svg/SVGFontFaceUriElement.cpp:
795         (WebCore::SVGFontFaceUriElement::loadFont): Ditto.
796         * svg/SVGUseElement.cpp:
797         (WebCore::SVGUseElement::updateExternalDocument): Ditto.
798
799 2017-01-16  Filip Pizlo  <fpizlo@apple.com>
800
801         Make opaque root scanning truly constraint-based
802         https://bugs.webkit.org/show_bug.cgi?id=165760
803
804         Reviewed by Geoffrey Garen.
805
806         No new tests yet. I think that writing tests for this is a big investigation:
807         https://bugs.webkit.org/show_bug.cgi?id=165808
808         
809         Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
810         very well. It's super confusing.
811         
812         This change makes it so that visitAdditionalChildren can become a GC constraint that
813         executes as part of the fixpoint. This changes all WebCore visitAdditionalChildren into
814         output constraints by using new JSC API for Subspaces and MarkingConstraints.
815
816         * ForwardingHeaders/heap/MarkedAllocatorInlines.h: Added.
817         * ForwardingHeaders/heap/MarkedBlockInlines.h: Added.
818         * ForwardingHeaders/heap/MarkingConstraint.h: Added.
819         * ForwardingHeaders/heap/SubspaceInlines.h: Added.
820         * ForwardingHeaders/heap/VisitingTimeout.h: Added.
821         * WebCore.xcodeproj/project.pbxproj:
822         * bindings/js/CommonVM.cpp:
823         (WebCore::commonVMSlow):
824         (WebCore::writeBarrierOpaqueRootSlow): Deleted.
825         * bindings/js/CommonVM.h:
826         (WebCore::writeBarrierOpaqueRoot): Deleted.
827         * bindings/js/JSDOMGlobalObject.cpp:
828         (WebCore::JSDOMGlobalObject::finishCreation):
829         (WebCore::JSDOMGlobalObject::scriptExecutionContext):
830         * bindings/js/JSDOMWrapper.cpp:
831         (WebCore::outputConstraintSubspaceFor):
832         (WebCore::globalObjectOutputConstraintSubspaceFor):
833         * bindings/js/JSDOMWrapper.h:
834         * bindings/js/WebCoreJSClientData.cpp: Added.
835         (WebCore::JSVMClientData::JSVMClientData):
836         (WebCore::JSVMClientData::~JSVMClientData):
837         (WebCore::JSVMClientData::getAllWorlds):
838         (WebCore::initNormalWorldClientData):
839         * bindings/js/WebCoreJSClientData.h:
840         (WebCore::JSVMClientData::outputConstraintSpace):
841         (WebCore::JSVMClientData::globalObjectOutputConstraintSpace):
842         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
843         (WebCore::JSVMClientData::JSVMClientData): Deleted.
844         (WebCore::JSVMClientData::~JSVMClientData): Deleted.
845         (WebCore::JSVMClientData::getAllWorlds): Deleted.
846         (WebCore::initNormalWorldClientData): Deleted.
847         * bindings/scripts/CodeGeneratorJS.pm:
848         (GenerateHeader):
849         (GenerateImplementation):
850         * dom/ContainerNodeAlgorithms.cpp:
851         (WebCore::notifyChildNodeInserted):
852         (WebCore::notifyChildNodeRemoved):
853
854 2017-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
855
856         Unreviewed, rolling out r210834
857         https://bugs.webkit.org/show_bug.cgi?id=165668
858
859         It introduced dozens of test timeouts.
860
861         Reverted changeset:
862         "[Modern Media Controls] Turn modern media controls on by default"
863         https://bugs.webkit.org/show_bug.cgi?id=165668
864         http://trac.webkit.org/changeset/210834
865
866 2017-01-17  Zalan Bujtas  <zalan@apple.com>
867
868         Remove positionOutsideContainingSpecialElement
869         https://bugs.webkit.org/show_bug.cgi?id=167150
870
871         Reviewed by Antti Koivisto.
872
873         It is not used anymore.
874
875         No change in functionality.
876
877         * editing/htmlediting.cpp:
878         (WebCore::isFirstVisiblePositionInSpecialElement): Deleted.
879         (WebCore::isLastVisiblePositionInSpecialElement): Deleted.
880         (WebCore::positionOutsideContainingSpecialElement): Deleted.
881         * editing/htmlediting.h:
882
883 2017-01-17  Chris Dumez  <cdumez@apple.com>
884
885         Unreviewed, fix nits found after landing r210833.
886         https://bugs.webkit.org/show_bug.cgi?id=167065
887
888         * dom/ContainerNode.cpp:
889         (WebCore::ContainerNode::replaceAllChildren):
890         * dom/ContainerNode.h:
891
892 2017-01-17  Andreas Kling  <akling@apple.com>
893
894         WidthCache should be off while under memory pressure.
895         <https://webkit.org/b/167141>
896
897         Reviewed by Antti Koivisto.
898
899         Since we empty all the WidthCaches when we come under memory pressure, we shouldn't
900         repopulate them until the pressure has gone away.
901
902         * platform/graphics/WidthCache.h:
903         (WebCore::WidthCache::add):
904
905 2017-01-17  Antti Koivisto  <antti@apple.com>
906
907         Persist derived data
908         https://bugs.webkit.org/show_bug.cgi?id=167136
909
910         Reviewed by Andreas Kling.
911
912         * loader/LoaderStrategy.h:
913         * loader/ResourceLoader.cpp:
914         (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache):
915         * loader/ResourceLoader.h:
916         (WebCore::ResourceLoader::options):
917         * loader/ResourceLoaderOptions.h:
918         * loader/SubresourceLoader.cpp:
919         (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache):
920         * loader/SubresourceLoader.h:
921         * loader/cache/CachedResource.h:
922         (WebCore::CachedResource::didRetrieveDerivedDataFromCache):
923         * loader/cache/CachedResourceLoader.cpp:
924         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
925         * platform/network/ResourceResponseBase.h:
926         (WebCore::ResourceResponseBase::cacheBodyKey):
927         (WebCore::ResourceResponseBase::setCacheBodyKey):
928         (WebCore::ResourceResponseBase::encode):
929         (WebCore::ResourceResponseBase::decode):
930
931 2017-01-17  Antoine Quint  <graouts@apple.com>
932
933         [Modern Media Controls] Turn modern media controls on by default
934         https://bugs.webkit.org/show_bug.cgi?id=165668
935
936         Reviewed by Dean Jackson.
937
938         Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
939                media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
940                media/modern-media-controls/pip-support/ipad/pip-support-tap.html
941                media/modern-media-controls/placard-support/ipad/placard-support-pip.html
942                media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
943
944         Fix an error which may be triggered prior to Sierra where we would assume the presentation
945         mode API was avaiable when it might not be, which caused a few tests to fail.
946
947         * Modules/modern-media-controls/media/pip-support.js:
948         (PiPSupport.prototype.syncControl):
949         (PiPSupport):
950
951 2017-01-17  Chris Dumez  <cdumez@apple.com>
952
953         Document title changed twice when setting document.title
954         https://bugs.webkit.org/show_bug.cgi?id=167065
955
956         Reviewed by Darin Adler.
957
958         Setting document.title would call the document title to be set twice
959         first to the empty string and then to the new title. This is because
960         setting document.title is equivalent to setting title.textContent [1],
961         which first removes all children and then inserts the new one [2], and
962         we call updateTitle() for each step. This is because
963         HTMLTitleElement::childrenChanged() is called twice (once for the
964         removal of the existing children, and a second time when the new child
965         is inserted), and childrenChanged() calls document::titleElementTextChanged().
966
967         Since no JS event is fired between those 2 mutations, it is safe (i.e. non
968         observable from JS) to update the title only once after both mutations have
969         taken place. To achieve this, add a new replaceAllChildren() function
970         which implements [3]. This replaceAllChildren() has the benefit of
971         calling ContainerNode::childrenChanged() only once, after both mutations
972         have taken place, thus avoiding unnecessary work. This fixes the issue
973         when setting the title and should be performance-positive in general.
974
975         [1] https://html.spec.whatwg.org/#document.title
976         [2] https://dom.spec.whatwg.org/#dom-node-textcontent
977         [3] https://dom.spec.whatwg.org/#concept-node-replace-all
978
979         Test: fast/dom/Node/textContent-mutationEvents.html
980
981         * dom/ContainerNode.cpp:
982         (WebCore::ContainerNode::notifyChildInserted):
983         (WebCore::ContainerNode::removeChild):
984         (WebCore::ContainerNode::replaceAllChildren):
985         (WebCore::ContainerNode::rebuildSVGExtensionsElementsIfNecessary):
986         (WebCore::ContainerNode::removeChildren):
987         (WebCore::ContainerNode::updateTreeAfterInsertion):
988         * dom/ContainerNode.h:
989         Add new replaceAllChildrenWith() function which implements [3]
990         in a way that calls ContainerNode::childrenChanged() only once.
991
992         * dom/Element.cpp:
993         (WebCore::Element::childrenChanged):
994         Deal with new AllChildrenReplaced ChildChange type.
995
996         * dom/Node.cpp:
997         (WebCore::Node::setTextContent):
998         Call replaceAllChildrenWith() as per the specification:
999         - https://dom.spec.whatwg.org/#dom-node-textcontent
1000
1001         * dom/Range.cpp:
1002         (WebCore::Range::surroundContents):
1003         Call replaceAllChildrenWith(nullptr) as per the specification:
1004         - https://dom.spec.whatwg.org/#dom-range-surroundcontents
1005
1006 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1007
1008         ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
1009         https://bugs.webkit.org/show_bug.cgi?id=116551
1010         <rdar://problem/13949830>
1011
1012         Reviewed by Alex Christensen.
1013
1014         * Configurations/FeatureDefines.xcconfig:
1015
1016 2017-01-17  Zalan Bujtas  <zalan@apple.com>
1017
1018         Editing nested RTL-LTR content makes the process unresponsive.
1019         https://bugs.webkit.org/show_bug.cgi?id=167140
1020         rdar://problem/29057611
1021
1022         Reviewed by Ryosuke Niwa.
1023
1024         Break out of the loop if we keep coming back to the same position.
1025         This is a workaround for the underlying editing/position bug -> webkit.org/b/167138.
1026
1027         Test: editing/rtl-to-ltr-editing-word-move-spin.html
1028
1029         * editing/VisibleUnits.cpp:
1030         (WebCore::visualWordPosition):
1031
1032 2017-01-16  Filip Pizlo  <fpizlo@apple.com>
1033
1034         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
1035         https://bugs.webkit.org/show_bug.cgi?id=167066
1036
1037         Reviewed by Keith Miller and Michael Saboff.
1038
1039         No new tests because no new behavior.
1040         
1041         It's now necessary to avoid jsCast in destructors and finalizers. This was an easy
1042         rule to introduce because this used to always be the rule.
1043
1044         * bindings/js/JSCSSValueCustom.cpp:
1045         (WebCore::JSDeprecatedCSSOMValueOwner::finalize):
1046         * bindings/js/JSDOMIterator.h:
1047         (WebCore::IteratorTraits>::destroy):
1048         * bindings/scripts/CodeGeneratorJS.pm:
1049         (GenerateImplementation):
1050
1051 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1052
1053         Remove unnecessary includes
1054         https://bugs.webkit.org/show_bug.cgi?id=167114
1055
1056         Reviewed by Alex Christensen.
1057
1058 2017-01-17  Andreas Kling  <akling@apple.com>
1059
1060         Kill the presentation attribute cache.
1061         <https://webkit.org/b/119542>
1062
1063         Reviewed by Antti Koivisto.
1064
1065         This cache was added to placate some old page cycler test that was measuring load times
1066         on pages captured in 2000. That content is not super relevant anymore, and I think
1067         we can live without this cache.
1068
1069         * dom/StyledElement.cpp:
1070         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
1071         (WebCore::presentationAttributeCache): Deleted.
1072         (WebCore::PresentationAttributeCacheCleaner::PresentationAttributeCacheCleaner): Deleted.
1073         (WebCore::PresentationAttributeCacheCleaner::didHitPresentationAttributeCache): Deleted.
1074         (WebCore::PresentationAttributeCacheCleaner::cleanCache): Deleted.
1075         (WebCore::presentationAttributeCacheCleaner): Deleted.
1076         (WebCore::StyledElement::clearPresentationAttributeCache): Deleted.
1077         (WebCore::attributeNameSort): Deleted.
1078         (WebCore::StyledElement::makePresentationAttributeCacheKey): Deleted.
1079         (WebCore::computePresentationAttributeCacheHash): Deleted.
1080         * dom/StyledElement.h:
1081         * page/MemoryRelease.cpp:
1082         (WebCore::releaseNoncriticalMemory):
1083
1084 2017-01-17  Filip Pizlo  <fpizlo@apple.com>
1085
1086         Unreviewed, roll out http://trac.webkit.org/changeset/210821
1087         It was causing crashes.
1088
1089         * bindings/js/JSCSSValueCustom.cpp:
1090         (WebCore::JSDeprecatedCSSOMValueOwner::finalize):
1091         * bindings/js/JSDOMIterator.h:
1092         (WebCore::IteratorTraits>::destroy):
1093         * bindings/scripts/CodeGeneratorJS.pm:
1094         (GenerateImplementation):
1095
1096 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1097
1098         Crash when closing tab with debugger paused
1099         https://bugs.webkit.org/show_bug.cgi?id=161746
1100         <rdar://problem/15607819>
1101
1102         Reviewed by Brian Burg and Brent Fulgham.
1103
1104         * page/Page.h:
1105         (WebCore::Page::incrementNestedRunLoopCount):
1106         (WebCore::Page::decrementNestedRunLoopCount):
1107         (WebCore::Page::insideNestedRunLoop):
1108         Keep track of whether or not this Page is inside of a nested run loop.
1109         Currently the only nested run loop we know about is EventLoop used
1110         by Web Inspector when debugging JavaScript.
1111
1112         (WebCore::Page::whenUnnested):
1113         Callback that can be called when we are no longer inside of a nested
1114         run loop.
1115
1116         (WebCore::Page::~Page):
1117         Ensure we are not in a known nested run loop when destructing, since
1118         that could be unsafe.
1119
1120         * inspector/PageScriptDebugServer.cpp:
1121         (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
1122         Increment and decrement as we go into or leave the nested runloop.
1123
1124         * inspector/InspectorController.cpp:
1125         (WebCore::InspectorController::inspectedPageDestroyed):
1126         (WebCore::InspectorController::disconnectAllFrontends):
1127         Rework destruction to allow disconnectAllFrontends to happen earlier
1128         if necessary. WebKit clients may use this to disconnect remote
1129         frontends when closing a Page.
1130
1131 2017-01-16  Filip Pizlo  <fpizlo@apple.com>
1132
1133         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
1134         https://bugs.webkit.org/show_bug.cgi?id=167066
1135
1136         Reviewed by Keith Miller and Michael Saboff.
1137
1138         No new tests because no new behavior.
1139         
1140         It's now necessary to avoid jsCast in destructors and finalizers. This was an easy
1141         rule to introduce because this used to always be the rule.
1142
1143         * bindings/js/JSCSSValueCustom.cpp:
1144         (WebCore::JSDeprecatedCSSOMValueOwner::finalize):
1145         * bindings/js/JSDOMIterator.h:
1146         (WebCore::IteratorTraits>::destroy):
1147         * bindings/scripts/CodeGeneratorJS.pm:
1148         (GenerateImplementation):
1149
1150 2017-01-17  Miguel Gomez  <magomez@igalia.com>
1151
1152         REGRESSION(r208997): [GLX] Google maps labels broken when using glXCreateContextAttribsARB
1153         https://bugs.webkit.org/show_bug.cgi?id=166489
1154
1155         Reviewed by Žan Doberšek.
1156
1157         The format GL_ALPHA that can be used in WebGL's texImage2D and texSubImage2D functions is deprecated
1158         in the OpenGL layer when using a core profile. Due to this, when using core, we need to transform
1159         that parameter into something supported by OpenGL.
1160
1161         What we do is to use a texture with just GL_RED format (that allows a single color component) to
1162         store the alpha values, and then configure the texture to swizzle red and alpha when accessing the
1163         pixel components.
1164
1165         No new tests added.
1166
1167         * platform/graphics/GraphicsContext3D.h:
1168         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1169         (WebCore::GraphicsContext3D::GraphicsContext3D):
1170         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1171         (WebCore::GraphicsContext3D::texImage2D):
1172         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1173         (WebCore::GraphicsContext3D::texSubImage2D):
1174
1175 2017-01-17  Tomas Popela  <tpopela@redhat.com>
1176
1177         Unreviewed build fix for the Release build with enabled logging
1178
1179         * html/MediaElementSession.cpp:
1180         * html/track/InbandGenericTextTrack.cpp:
1181
1182 2017-01-17  Zan Dobersek  <zdobersek@igalia.com>
1183
1184         MediaKeySession: use existing 'message' event name
1185         https://bugs.webkit.org/show_bug.cgi?id=167095
1186
1187         Reviewed by Sam Weinig.
1188
1189         When dispatching the 'message' event in MediaKeySession::enqueueMessage(),
1190         use the messageEvent member that's provided by the EventNames object. This
1191         removes the need for a custom static AtomicString object.
1192
1193         * Modules/encryptedmedia/MediaKeySession.cpp:
1194         (WebCore::MediaKeySession::enqueueMessage):
1195         (WebCore::messageEventName): Deleted.
1196
1197 2017-01-16  Joseph Pecoraro  <pecoraro@apple.com>
1198
1199         Remove the REQUEST_ANIMATION_FRAME flag
1200         https://bugs.webkit.org/show_bug.cgi?id=156980
1201         <rdar://problem/25906849>
1202
1203         Reviewed by Simon Fraser.
1204
1205         * Configurations/FeatureDefines.xcconfig:
1206         * dom/Document.cpp:
1207         * dom/Document.h:
1208         * dom/RequestAnimationFrameCallback.idl:
1209         * dom/ScriptedAnimationController.cpp:
1210         * dom/ScriptedAnimationController.h:
1211         * loader/EmptyClients.h:
1212         * page/Chrome.cpp:
1213         * page/Chrome.h:
1214         * page/ChromeClient.h:
1215         * page/DOMWindow.cpp:
1216         * page/DOMWindow.h:
1217         * page/DOMWindow.idl:
1218         * page/FrameView.cpp:
1219         * page/FrameView.h:
1220         * page/animation/AnimationController.cpp:
1221         * page/animation/AnimationController.h:
1222         * page/animation/AnimationControllerPrivate.h:
1223         * platform/HostWindow.h:
1224         * platform/ScrollAnimationSmooth.h:
1225         * testing/Internals.cpp:
1226
1227 2017-01-16  Andy Estes  <aestes@apple.com>
1228
1229         [QuickLook] QLPreviewConverter should be owned by its delegate
1230         https://bugs.webkit.org/show_bug.cgi?id=167104
1231
1232         Reviewed by Andreas Kling.
1233         
1234         Instead of having QuickLookHandle own both the QLPreviewConverter and its delegate, have it
1235         just own the delegate and have the delegate own the QLPreviewConverter.
1236
1237         No change in behavior. Covered by existing tests.
1238
1239         * loader/ios/QuickLook.h:
1240         (WebCore::QuickLookHandle::converter): Moved out-of-line.
1241         * loader/ios/QuickLook.mm: Renamed WebPreviewConverterDelegate to WebPreviewConverter, and
1242         gave it ownership of the QLPreviewConverter, QuickLookHandleClient, and preview response.
1243         (-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
1244         Added a ResourceResponse parameter.
1245         (-[WebPreviewConverter setClient:]): Moved from QuickLookHandle::setClient().
1246         (-[WebPreviewConverter appendDataArray:]): Moved from QuickLookHandle::didReceiveDataArray().
1247         (-[WebPreviewConverter finishedAppending]): Moved from QuickLookHandle::didFinishLoading().
1248         (-[WebPreviewConverter failed]): Moved from QuickLookHandle::didFail().
1249         (-[WebPreviewConverter platformConverter]): Added to return the QLPreviewConverter.
1250         (-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Used _previewResponse directly.
1251         (WebCore::QuickLookHandle::~QuickLookHandle): Removed unneeded logging.
1252         (WebCore::QuickLookHandle::didReceiveData): Called -[WebPreviewConverter appendDataArray:].
1253         (WebCore::QuickLookHandle::didReceiveBuffer): Ditto.
1254         (WebCore::QuickLookHandle::didFinishLoading): Called -[WebPreviewConverter finishedAppending].
1255         (WebCore::QuickLookHandle::didFail): Called -[WebPreviewConverter failed].
1256         (WebCore::QuickLookHandle::setClient): Called -[WebPreviewConverter setClient:].
1257         (WebCore::QuickLookHandle::previewFileName): Retrieved the QLPreviewConverter via
1258         -[WebPreviewConverter platformConverter].
1259         (WebCore::QuickLookHandle::previewUTI): Ditto.
1260         (WebCore::QuickLookHandle::previewRequestURL): Ditto.
1261         (WebCore::QuickLookHandle::converter): Ditto.
1262         (WebCore::QuickLookHandle::didReceiveDataArray): Deleted.
1263         (WebCore::QuickLookHandle::previewResponse): Deleted.
1264
1265 2017-01-16  Antti Koivisto  <antti@apple.com>
1266
1267         CrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: WTF::StringImpl::containsOnlyWhitespace
1268         https://bugs.webkit.org/show_bug.cgi?id=167106
1269         <rdar://problem/24457632>
1270
1271         Reviewed by Tim Horton.
1272
1273         Speculative fix.
1274
1275         * editing/cocoa/DataDetection.mm:
1276         (WebCore::DataDetection::detectContentInRange):
1277
1278             Test before casting to Text.
1279
1280 2017-01-16  Javier Fernandez  <jfernandez@igalia.com>
1281
1282         [css-grid] Implementing baseline positioning for grid containers
1283         https://bugs.webkit.org/show_bug.cgi?id=165063
1284
1285         Reviewed by Darin Adler and Sergio Villar Senin.
1286
1287         Implementation of the 'first-line' baseline for Grid containers,
1288         according to the CSS Grid Layout spec.
1289         https://drafts.csswg.org/css-grid/#grid-baselines
1290
1291         The self-baseline and content-baseline alignment logic is still
1292         not implemented, hence some cases will be implemented in
1293         future patches.
1294
1295         Tests: fast/css-grid-layout/grid-baseline-margins.html
1296                fast/css-grid-layout/grid-baseline-must-respect-grid-order.html
1297                fast/css-grid-layout/grid-baseline.html
1298
1299         * rendering/RenderGrid.cpp:
1300         (WebCore::synthesizedBaselineFromBorderBox):
1301         (WebCore::RenderGrid::isInlineBaselineAlignedChild):
1302         (WebCore::RenderGrid::baselinePosition):
1303         (WebCore::RenderGrid::firstLineBaseline):
1304         (WebCore::RenderGrid::inlineBlockBaseline):
1305         * rendering/RenderGrid.h:
1306
1307 2017-01-16  Andy Estes  <aestes@apple.com>
1308
1309         [QuickLook] Do some cleanup in QuickLookHandle
1310         https://bugs.webkit.org/show_bug.cgi?id=166864
1311
1312         Reviewed by Darin Adler.
1313
1314         * loader/ios/QuickLook.h: Stopped including QuickLookHandleClient.h and forward-declared
1315         instead; changed setClient() to take a Ref<QuickLookHandleClient>&&; renamed nsResponse() to
1316         previewResponse(); changed QuickLookHandle() to take a ResourceLoader& and const
1317         ResourceResponse&; gave m_delegate a stronger type; removed unused m_quicklookFileHandle;
1318         initialized m_finishedLoadingDataIntoConverter to false.
1319         (WebCore::QuickLookHandle::firstRequestURL): Stopped exporting.
1320         (WebCore::QuickLookHandle::setClient): Moved definition out-of-line.
1321         * loader/ios/QuickLook.mm: Renamed WebResourceLoaderQuickLookDelegate to
1322         WebPreviewConverterDelegate and stopped conforming to NSURLConnectionDelegate and
1323         WebCoreResourceLoaderDelegate; removed @property quickLookHandle and initialized
1324         _quickLookHandle in the initializer instead.
1325         (-[WebPreviewConverter initWithResourceLoader:quickLookHandle:]): Changed to take references
1326         to resourceLoader and quickLookHandle.
1327         (-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Stopped checking for a nil
1328         _quickLookHandle, since it is never nil.
1329         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Deleted.
1330         QLPreviewConverter never calls this method.
1331         (-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Stopped checking for a
1332         nil _resourceLoader, since it is never nil.
1333         (-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
1334         (-[WebPreviewConverter connection:didFailWithError:]): Ditto.
1335         (WebCore::emptyClient): Changed to return a reference.
1336         (WebCore::QuickLookHandle::QuickLookHandle): Moved creation of the delegate,
1337         firstRequestURL, and response to here from QuickLookHandle::create(). Called
1338         ResourceLoader::didCreateQuickLookHandle() here instead of in QuickLookHandle::create().
1339         (WebCore::QuickLookHandle::create): Used std::make_unique to create the QuickLookHandle.
1340         (WebCore::QuickLookHandle::didFinishLoading): Set m_finishedLoadingDataIntoConverter to true
1341         instead of YES.
1342         (WebCore::QuickLookHandle::setClient): Moved the client rvalue reference into m_client.
1343         (WebCore::QuickLookHandle::~QuickLookHandle): Stopped clearing m_converter and calling
1344         -detachHandle.
1345         (WebCore::QuickLookHandle::previewRequestURL): Used dot syntax.
1346         (WebCore::QuickLookHandle::previewResponse): Renamed from nsResponse().
1347
1348 2017-01-16  Simon Fraser  <simon.fraser@apple.com>
1349
1350         Remove CSSPropertyNames.in from the project. It's not used any more,
1351         now that we generate files from CSSProperties.json.
1352
1353         * WebCore.xcodeproj/project.pbxproj:
1354
1355 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1356
1357         [SOUP] Accept-language could be set twice in a row for the default context
1358         https://bugs.webkit.org/show_bug.cgi?id=167089
1359
1360         Reviewed by Žan Doberšek.
1361
1362         If NetworkStorageSession doesn't have a SoupNetworkSession yet, we are creating it only to set the
1363         languages. Since we already set the global value, the languages will be set when the SoupNetworkSession is
1364         created later. This is not a big deal for the language property, but it will be for proxies after bug #128674.
1365         Since NetworkStorageSession::soupNetworkSession() it's actually getting or creating the SoupNetworkSession, this
1366         patch renames it as NetworkStorageSession::getOrCreateSoupNetworkSession() and now
1367         NetworkStorageSession::soupNetworkSession() returns a pointer without creating the SoupNetworkSession, so it can
1368         be nullptr. This can now be used to only use the default SoupNetworkSession when it has already been created.
1369
1370         * platform/network/NetworkStorageSession.h:
1371         (WebCore::NetworkStorageSession::soupNetworkSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1372         * platform/network/soup/DNSSoup.cpp:
1373         (WebCore::DNSResolveQueue::updateIsUsingProxy): Ditto.
1374         (WebCore::DNSResolveQueue::platformResolve): Ditto.
1375         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1376         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): This is the old soupNetworkSession(), now renamed.
1377         (WebCore::NetworkStorageSession::soupNetworkSession): Return a pointer with the current value of m_session that
1378         now can be nullptr.
1379         * platform/network/soup/ResourceHandleSoup.cpp:
1380         (WebCore::sessionFromContext): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1381
1382 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1383
1384         [SOUP] Fix handling of accept language property
1385         https://bugs.webkit.org/show_bug.cgi?id=166969
1386
1387         Reviewed by Michael Catanzaro.
1388
1389         Add SoupNetworkSession::setInitialAcceptLanguages() static method and update setAcceptLanguages to receive the
1390         string already built from the languages vector. Now the SoupNetworkSession saves that value globally that
1391         is always used when creating new sessions.
1392
1393         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1394         (WebCore::NetworkStorageSession::switchToNewTestingSession): Remove workaround.
1395         * platform/network/soup/SoupNetworkSession.cpp:
1396         (WebCore::SoupNetworkSession::SoupNetworkSession): If initial accept languages were set, apply them to the newly created context.
1397         (WebCore::SoupNetworkSession::setInitialAcceptLanguages): Just save the given value globally.
1398         (WebCore::SoupNetworkSession::setAcceptLanguages): It receives now the string, so just set it to the session.
1399         * platform/network/soup/SoupNetworkSession.h:
1400
1401 2017-01-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1402
1403         [SOUP] SoupNetworkSession constructor should be explicit
1404         https://bugs.webkit.org/show_bug.cgi?id=167069
1405
1406         Reviewed by Darin Adler.
1407
1408         * platform/network/soup/SoupNetworkSession.h:
1409
1410 2017-01-15  Sam Weinig  <sam@webkit.org>
1411
1412         [WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection
1413         https://bugs.webkit.org/show_bug.cgi?id=167039
1414
1415         Reviewed by Darin Adler.
1416
1417         * CMakeLists.txt:
1418         * WebCore.xcodeproj/project.pbxproj:
1419         * bindings/js/JSBindingsAllInOne.cpp:
1420         * bindings/js/JSHTMLFrameElementCustom.cpp: Removed.
1421         * bindings/js/JSHTMLInputElementCustom.cpp: Removed.
1422         * bindings/js/JSHTMLMediaElementCustom.cpp: Removed.
1423         Remove files.
1424
1425         * html/HTMLOptionsCollection.idl:
1426         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1427         (WebCore::JSHTMLOptionsCollection::setLength): Deleted.
1428         Remove custom setLength. The bindings generator can handle this now.
1429
1430         * html/HTMLFrameElement.idl:
1431         Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState.
1432
1433         * html/HTMLFrameElementBase.cpp:
1434         (WebCore::HTMLFrameElementBase::setLocation):
1435         * html/HTMLFrameElementBase.h:
1436         Add implementation of setLocation.
1437
1438         * html/HTMLInputElement.cpp:
1439         (WebCore::HTMLInputElement::selectionStartForBindings):
1440         (WebCore::HTMLInputElement::setSelectionStartForBindings):
1441         (WebCore::HTMLInputElement::selectionEndForBindings):
1442         (WebCore::HTMLInputElement::setSelectionEndForBindings):
1443         (WebCore::HTMLInputElement::selectionDirectionForBindings):
1444         (WebCore::HTMLInputElement::setSelectionDirectionForBindings):
1445         (WebCore::HTMLInputElement::setSelectionRangeForBindings):
1446         * html/HTMLInputElement.h:
1447         * html/HTMLInputElement.idl:
1448         Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate.
1449
1450         * html/HTMLMediaElement.cpp:
1451         (WebCore::HTMLMediaElement::setControllerForBindings):
1452         * html/HTMLMediaElement.h:
1453         (WebCore::HTMLMediaElement::controllerForBindings):
1454         * html/HTMLMediaElement.idl:
1455         Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate.
1456
1457         * html/HTMLSelectElement.cpp:
1458         (WebCore::HTMLSelectElement::setLength):
1459         Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping.
1460
1461 2017-01-15  Tim Horton  <timothy_horton@apple.com>
1462
1463         De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm
1464         https://bugs.webkit.org/show_bug.cgi?id=167063
1465
1466         Reviewed by Dan Bernstein.
1467
1468         No new tests, just refactoring.
1469
1470         * editing/Editor.h:
1471         Adjust to fontAttributesForSelectionStart returning a RetainPtr.
1472
1473         * editing/cocoa/EditorCocoa.mm:
1474         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
1475         Make use of more Obj-C literals (for NSNumber).
1476
1477         (WebCore::Editor::fontAttributesForSelectionStart):
1478         Merge this from EditorMac and EditorIOS. There are a number of attributes
1479         that are currently only extracted on Mac, and it's not clear why (and
1480         probably should be shared).
1481
1482         (WebCore::Editor::stringSelectionForPasteboard):
1483         (WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
1484         Merge these functions from EditorMac and EditorIOS. The iOS implementation
1485         was missing a reasonable bug fix from r161925.
1486
1487         (WebCore::Editor::createFragmentAndAddResources):
1488         Merge this from EditorMac and EditorIOS. The Mac implementation was missing
1489         a reasonable bug fix from r203482.
1490
1491         * editing/ios/EditorIOS.mm:
1492         (WebCore::Editor::fontAttributesForSelectionStart): Deleted.
1493         (WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
1494         (WebCore::Editor::createFragmentAndAddResources): Deleted.
1495         * editing/mac/EditorMac.mm:
1496         (WebCore::Editor::fontAttributesForSelectionStart): Deleted.
1497         (WebCore::Editor::stringSelectionForPasteboard): Deleted.
1498         (WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
1499         (WebCore::Editor::createFragmentAndAddResources): Deleted.
1500
1501 2017-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1502
1503         [Cocoa] Unify FontPlatformData's hashing and equality operators
1504         https://bugs.webkit.org/show_bug.cgi?id=167061
1505
1506         Reviewed by Darin Adler.
1507
1508         On iOS, we were using CFEqual() and CFHash(), while on macOS
1509         we were using pointer hashing and pointer equality. Instead,
1510         we should be consistent about these operators.
1511
1512         Right now, FontPlatformData holds two internal CTFontRefs, and
1513         switching to these higher-level CFEqual() and CFHash()
1514         functions is required for eliminating one of these two
1515         internal font objects.
1516
1517         No new tests because there is no behavior change.
1518
1519         * platform/graphics/FontPlatformData.h:
1520         (WebCore::FontPlatformData::hash): Deleted.
1521         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1522         (WebCore::FontPlatformData::hash):
1523         (WebCore::FontPlatformData::platformIsEqual):
1524         (WebCore::cascadeToLastResortAttributesDictionary):
1525         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1526         (WebCore::FontPlatformData::hash):
1527         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1528         (WebCore::FontPlatformData::hash):
1529         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1530         (WebCore::FontPlatformData::hash):
1531         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
1532         (WebCore::FontPlatformData::hash):
1533
1534 2017-01-15  Andreas Kling  <akling@apple.com>
1535
1536         FrameView shouldn't keep dangling pointers into dead render trees.
1537         <https://webkit.org/b/167011>
1538
1539         Reviewed by Antti Koivisto.
1540
1541         Added some pretty paranoid assertions to FrameView that verify all of its raw pointers
1542         into the render tree are gone after the render tree has been destroyed.
1543         They immediately caught two bugs, also fixed in this patch.
1544
1545         * page/FrameView.h:
1546         * page/FrameView.cpp:
1547         (WebCore::FrameView::willDestroyRenderTree):
1548         (WebCore::FrameView::didDestroyRenderTree): Added these two callbacks for before/after
1549         Document tears down its render tree. The former clears the layout root, and detaches
1550         custom scrollbars. The latter contains a bunch of sanity assertions that pointers into
1551         the now-destroyed render tree are gone.
1552
1553         * dom/Document.cpp:
1554         (WebCore::Document::destroyRenderTree): Notify FrameView before/after teardown.
1555
1556         * page/animation/AnimationController.h:
1557         * page/animation/AnimationController.cpp:
1558         (WebCore::AnimationController::hasAnimations): Added a helper to check if there are
1559         any composite animations around, as these contain raw pointers to renderers.
1560
1561         * rendering/RenderElement.cpp:
1562         (WebCore::RenderElement::willBeRemovedFromTree):
1563         (WebCore::RenderElement::willBeDestroyed): Moved slow repaint object unregistration
1564         from willBeRemovedFromTree() to willBeDestroyed(). The willBeRemovedFromTree() callback
1565         is skipped as an optimization during full tree teardown, but willBeDestroyed() always
1566         gets called. This fixes a bug where we'd fail to remove dangling pointers.
1567
1568 2017-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1569
1570         [Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted
1571         https://bugs.webkit.org/show_bug.cgi?id=167056
1572
1573         Reviewed by Darin Adler.
1574
1575         When performing font fallback, each item in the font-family list is examined.
1576         If no appropriate fonts are found, WebKit asks the system for an appropriate
1577         font. As of a few years ago, both macOS and iOS used platform calls to
1578         produce a font; however, each platform used a different platform call. This
1579         patch migrates both platforms to use a shared function which uses only
1580         one of the platform calls (which means the other platform call is never used). 
1581
1582         There are still some behavior differences between macOS and iOS (which are now
1583         hidden behind a PLATFORM() guard), but I'd like to minimize and eliminate these
1584         in the future. Using a shared function is a step toward this goal. 
1585
1586         No new tests because there is no behavior change.
1587
1588         * platform/graphics/FontCache.h:
1589         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1590         (WebCore::lookupFallbackFont):
1591         (WebCore::FontCache::systemFallbackForCharacters):
1592         * platform/graphics/ios/FontCacheIOS.mm:
1593         (WebCore::getSystemFontFallbackForCharacters): Deleted.
1594         (WebCore::platformLookupFallbackFont): Deleted.
1595         * platform/graphics/mac/FontCacheMac.mm:
1596         (WebCore::platformLookupFallbackFont): Deleted.
1597
1598 2017-01-14  Chris Dumez  <cdumez@apple.com>
1599
1600         Report CPU usage of tabs after they become non-visible using diagnostic logging
1601         https://bugs.webkit.org/show_bug.cgi?id=167019
1602         <rdar://problem/30019773>
1603
1604         Reviewed by Darin Adler.
1605
1606         Report CPU usage of tabs after they become non-visible using diagnostic logging.
1607         We start measure CPU usage 5 seconds after a tab goes to the background, for 5
1608         minutes and report how much CPU the tab used during those 5 minutes. We will
1609         not log if the tab gets closed or moved to the foreground during those 5
1610         minutes.
1611
1612         * page/DiagnosticLoggingKeys.cpp:
1613         (WebCore::DiagnosticLoggingKeys::postPageBackgroundingKey):
1614         * page/DiagnosticLoggingKeys.h:
1615         * page/Page.cpp:
1616         (WebCore::Page::Page):
1617         (WebCore::Page::didStartProvisionalLoad):
1618         (WebCore::Page::didFinishLoad):
1619         (WebCore::foregroundCPUUsageToDiagnosticLogginKey):
1620         (WebCore::Page::measurePostLoadCPUUsage):
1621         (WebCore::backgroundCPUUsageToDiagnosticLogginKey):
1622         (WebCore::Page::measurePostBackgroundingCPUUsage):
1623         (WebCore::Page::setIsVisibleInternal):
1624         * page/Page.h:
1625         * page/Settings.cpp:
1626         (WebCore::Settings::isPostBackgroundingCPUUsageMeasurementEnabled):
1627         * page/Settings.h:
1628
1629 2017-01-14  Tim Horton  <timothy_horton@apple.com>
1630
1631         De-duplicate some (nearly) identical code in Editor(Mac|IOS).mm
1632         https://bugs.webkit.org/show_bug.cgi?id=167062
1633
1634         Reviewed by Dan Bernstein.
1635
1636         No new tests, just refactoring.
1637
1638         * editing/Editor.cpp:
1639         (WebCore::Editor::fontForSelection):
1640         (WebCore::Editor::styleForSelectionStart):
1641         (WebCore::Editor::adjustedSelectionRange):
1642         * editing/Editor.h:
1643         Move these three functions to Editor and unguard them, because they're
1644         not Cocoa specific.
1645
1646         * platform/spi/cocoa/NSAttributedStringSPI.h:
1647         Move some iOS-only NSAttributedString IPI (so no Internal SDK switch)
1648         to NSAttributedStringSPI.h.
1649
1650         * editing/cocoa/EditorCocoa.mm:
1651         (WebCore::Editor::writeSelectionToPasteboard):
1652         (WebCore::Editor::selectionInWebArchiveFormat):
1653         (WebCore::Editor::replaceSelectionWithAttributedString):
1654         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
1655         (WebCore::Editor::dataInRTFDFormat):
1656         (WebCore::Editor::dataInRTFFormat):
1657         Move these six functions here.
1658         selectionInWebArchiveFormat and replaceSelectionWithAttributedString are
1659         entirely identical; writeSelectionToPasteboard and createFragment...
1660         both have slightly suspicious-looking differences that I left intact
1661         and wrote comments about (especially createFragment..., the other one
1662         is somewhat explicable). The two dataInRTF(D)Format functions used to
1663         be static functions, but for now are required from both EditorCocoa
1664         and Editor(Mac|IOS), so we'll make them static member functions.
1665
1666         * editing/ios/EditorIOS.mm:
1667         (WebCore::Editor::fontForSelection): Deleted.
1668         (WebCore::Editor::selectionInWebArchiveFormat): Deleted.
1669         (WebCore::dataInRTFDFormat): Deleted.
1670         (WebCore::dataInRTFFormat): Deleted.
1671         (WebCore::Editor::writeSelectionToPasteboard): Deleted.
1672         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
1673         (WebCore::Editor::replaceSelectionWithAttributedString): Deleted.
1674         * editing/mac/EditorMac.mm:
1675         (WebCore::Editor::fontForSelection): Deleted.
1676         (WebCore::Editor::selectionInWebArchiveFormat): Deleted.
1677         (WebCore::dataInRTFDFormat): Deleted.
1678         (WebCore::dataInRTFFormat): Deleted.
1679         (WebCore::Editor::writeSelectionToPasteboard): Deleted.
1680         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
1681         (WebCore::Editor::replaceSelectionWithAttributedString): Deleted.
1682
1683 2017-01-14  Zalan Bujtas  <zalan@apple.com>
1684
1685         Small code cleanup after r210760
1686         https://bugs.webkit.org/show_bug.cgi?id=167047
1687
1688         Reviewed by Sam Weinig.
1689
1690         No change in functionality.
1691
1692         * rendering/RenderLayer.cpp:
1693         (WebCore::RenderLayer::updateLayerPosition):
1694
1695 2017-01-14  Zalan Bujtas  <zalan@apple.com>
1696
1697         Renderers should have a simple way to access Settings.
1698         https://bugs.webkit.org/show_bug.cgi?id=167048
1699
1700         Now that RenderObjects can never outlive the Page, we can just access the Settings
1701         through Page instead of Document::settings/Frame::settings.  
1702
1703         Reviewed by Andreas Kling.
1704
1705         No change in functionality.
1706
1707         * rendering/RenderBlock.cpp:
1708         (WebCore::RenderBlock::paintCaret):
1709         (WebCore::RenderBlock::shouldPaintSelectionGaps):
1710         * rendering/RenderBlockFlow.cpp:
1711         (WebCore::needsAppleMailPaginationQuirk):
1712         * rendering/RenderBlockLineLayout.cpp:
1713         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1714         * rendering/RenderBox.cpp:
1715         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1716         * rendering/RenderBoxModelObject.cpp:
1717         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1718         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1719         * rendering/RenderElement.cpp:
1720         (WebCore::RenderElement::styleWillChange):
1721         (WebCore::RenderElement::willBeRemovedFromTree):
1722         (WebCore::RenderElement::shouldRespectImageOrientation):
1723         * rendering/RenderEmbeddedObject.cpp:
1724         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
1725         * rendering/RenderFrameSet.cpp:
1726         (WebCore::RenderFrameSet::flattenFrameSet):
1727         * rendering/RenderIFrame.cpp:
1728         (WebCore::RenderIFrame::flattenFrame):
1729         * rendering/RenderImage.cpp:
1730         (WebCore::RenderImage::paintIntoRect):
1731         * rendering/RenderInline.cpp:
1732         (WebCore::RenderInline::addChildIgnoringContinuation):
1733         * rendering/RenderLayer.cpp:
1734         (WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled):
1735         (WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1736         (WebCore::RenderLayer::hasAcceleratedTouchScrolling):
1737         (WebCore::RenderLayer::getRectToExpose):
1738         (WebCore::RenderLayer::overhangAmount):
1739         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1740         (WebCore::RenderLayer::setHasVerticalScrollbar):
1741         (WebCore::RenderLayer::calculateClipRects):
1742         * rendering/RenderLayerBacking.cpp:
1743         (WebCore::RenderLayerBacking::RenderLayerBacking):
1744         (WebCore::RenderLayerBacking::shouldAggressivelyRetainTiles):
1745         (WebCore::RenderLayerBacking::shouldTemporarilyRetainTileCohorts):
1746         (WebCore::RenderLayerBacking::useGiantTiles):
1747         (WebCore::RenderLayerBacking::startAnimation):
1748         * rendering/RenderLayerCompositor.cpp:
1749         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1750         (WebCore::RenderLayerCompositor::updateBacking):
1751         (WebCore::RenderLayerCompositor::addToOverlapMap):
1752         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1753         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):
1754         (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
1755         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1756         * rendering/RenderLayerModelObject.cpp:
1757         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
1758         * rendering/RenderListBox.cpp:
1759         (WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1760         * rendering/RenderObject.h:
1761         (WebCore::RenderObject::settings):
1762         * rendering/RenderText.cpp:
1763         (WebCore::SecureTextTimer::restart):
1764         * rendering/RenderView.cpp:
1765         (WebCore::RenderView::clientLogicalWidthForFixedPosition):
1766         (WebCore::RenderView::clientLogicalHeightForFixedPosition):
1767         (WebCore::RenderView::paintBoxDecorations):
1768         * rendering/SimpleLineLayout.cpp:
1769         (WebCore::SimpleLineLayout::canUseForWithReason):
1770         * rendering/SimpleLineLayoutFunctions.cpp:
1771         (WebCore::SimpleLineLayout::paintFlow):
1772         * rendering/svg/RenderSVGResourceFilter.cpp:
1773         (WebCore::RenderSVGResourceFilter::applyResource):
1774
1775 2017-01-14  Chris Dumez  <cdumez@apple.com>
1776
1777         Align the innerText setter with the HTML spec and Gecko
1778         https://bugs.webkit.org/show_bug.cgi?id=160971
1779
1780         Reviewed by Alex Christensen.
1781
1782         Align the innerText setter and createContextualFragment() with the
1783         HTML specification and Gecko. In particular, they no longer throw
1784         when the context element is a void element. This behavior was there
1785         to match an old IE behavior but Edge dropped this behavior.
1786
1787         Test: fast/dom/br-set-outerText.html
1788
1789         * dom/Element.cpp:
1790         * dom/Element.h:
1791         * editing/markup.cpp:
1792         (WebCore::createContextualFragment):
1793         * html/HTMLElement.cpp:
1794         (WebCore::HTMLElement::setInnerText):
1795         (WebCore::HTMLElement::setOuterText):
1796
1797 2017-01-13  Joseph Pecoraro  <pecoraro@apple.com>
1798
1799         Remove ENABLE(DETAILS_ELEMENT) guards
1800         https://bugs.webkit.org/show_bug.cgi?id=167042
1801
1802         Reviewed by Alex Christensen.
1803
1804         * Configurations/FeatureDefines.xcconfig:
1805         * DerivedSources.make:
1806         * accessibility/AccessibilityNodeObject.cpp:
1807         (WebCore::AccessibilityNodeObject::setIsExpanded):
1808         * html/HTMLDetailsElement.cpp:
1809         * html/HTMLDetailsElement.idl:
1810         * html/HTMLSummaryElement.cpp:
1811         * html/HTMLTagNames.in:
1812         * html/shadow/DetailsMarkerControl.cpp:
1813         * rendering/RenderDetailsMarker.cpp:
1814         * rendering/RenderDetailsMarker.h:
1815         * rendering/RenderObject.h:
1816         (WebCore::RenderObject::isDetailsMarker):
1817         * rendering/RenderTreeAsText.cpp:
1818         (WebCore::RenderTreeAsText::writeRenderObject):
1819
1820 2017-01-13  Alex Christensen  <achristensen@webkit.org>
1821
1822         Fix WinCairo build after r210753.
1823         https://bugs.webkit.org/show_bug.cgi?id=166730
1824
1825         * platform/WebGLStateTracker.h:
1826         WTF::Function apparently needs to explicitly be differentiated from JSC::Attribute Function in PropertySlot.h.
1827
1828 2017-01-13  Brent Fulgham  <bfulgham@apple.com>
1829
1830         Potential nullptr dereference in RenderLayer::updateLayerPosition()
1831         https://bugs.webkit.org/show_bug.cgi?id=167036
1832         <rdar://problem/30023019>
1833
1834         Reviewed by Dean Jackson.
1835
1836         A value was being used without nullptr checking, even though it had been checked for null a
1837         few lines prior.
1838
1839         * rendering/RenderLayer.cpp:
1840         (WebCore::RenderLayer::updateLayerPosition): Add missing nullptr check.
1841
1842 2017-01-11  Darin Adler  <darin@apple.com>
1843
1844         Remove PassRefPtr from more of "platform"
1845         https://bugs.webkit.org/show_bug.cgi?id=166809
1846
1847         Reviewed by Sam Weinig.
1848
1849         * CMakeLists.txt: Removed DeviceMotionClientMock.cpp.
1850
1851         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
1852         Added now-needed include.
1853
1854         * Modules/speech/SpeechSynthesisUtterance.cpp:
1855         (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
1856         Pass a reference instead of a pointer.
1857
1858         * Modules/speech/SpeechSynthesisUtterance.h: Tweaks, msade a few things
1859         more private and final.
1860
1861         * bindings/js/JSDOMConvert.h:
1862         (WebCore::Detail::getPtrOrRef): Removed no-longer-needed const_cast.
1863         * bindings/js/JSDOMWrapper.h:
1864         (WebCore::JSDOMWrapper::wrapped): Ditto.
1865         * bindings/js/ScriptModuleLoader.cpp:
1866         (WebCore::ScriptModuleLoader::~ScriptModuleLoader): Ditto.
1867
1868         * css/BasicShapeFunctions.cpp:
1869         (WebCore::convertToLengthSize): Updated for LengthSize struct.
1870         (WebCore::convertToCenterCoordinate): Ditto.
1871
1872         * css/CSSComputedStyleDeclaration.cpp:
1873         (WebCore::createPositionListForLayer): Take a reference.
1874         (WebCore::getBorderRadiusCornerValues): Updated for LengthSize struct.
1875         (WebCore::getBorderRadiusCornerValue): Ditto.
1876         (WebCore::getBorderRadiusShorthandValue): Ditto.
1877         (WebCore::fillSizeToCSSValue): Ditto.
1878         (WebCore::ComputedStyleExtractor::propertyValue): Updated many properties
1879         since the layer properties now return references rather than pointers.
1880
1881         * css/CSSImageGeneratorValue.cpp:
1882         (WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image): Removed
1883         no-longer-needed const_cast.
1884         * css/CSSKeyframesRule.cpp:
1885         (WebCore::CSSKeyframesRule::item): Ditto.
1886
1887         * css/CSSPrimitiveValue.cpp:
1888         (WebCore::CSSPrimitiveValue::init): Updated for LengthSize struct.
1889
1890         * css/CSSStyleRule.h: Removed no-longer-needed const_cast.
1891
1892         * css/CSSToStyleMap.cpp:
1893         (WebCore::convertToLengthSize): Updated for LengthSize struct.
1894
1895         * css/FontFace.cpp:
1896         (WebCore::FontFace::family): Removed no-longer-needed const_cast.
1897         (WebCore::FontFace::style): Ditto.
1898         (WebCore::FontFace::weight): Ditto.
1899         (WebCore::FontFace::unicodeRange): Ditto.
1900         (WebCore::FontFace::variant): Ditto.
1901         (WebCore::FontFace::featureSettings): Ditto.
1902
1903         * css/LengthFunctions.cpp:
1904         (WebCore::sizeForLengthSize): Added.
1905         (WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
1906         * css/LengthFunctions.h: Added sizeForLengthSize.
1907
1908         * css/SVGCSSComputedStyleDeclaration.cpp:
1909         (WebCore::paintOrder): Cut down on creation of unused objects.
1910         We now create only what we actually use.
1911
1912         * css/StyleBuilderConverter.h:
1913         (WebCore::StyleBuilderConverter::convertRadius): Updated for
1914         LengthSize struct.
1915         (WebCore::StyleBuilderConverter::convertShapeValue): Pass references
1916         when creating ShapeValue.
1917
1918         * css/StyleBuilderCustom.h:
1919         (WebCore::forwardInheritedValue): Added. This set of overloaded
1920         functions allows us to use move semantics for some types, but copy
1921         them when inheriting. Doing it with special cases here allows us to
1922         resolve this without adding overloads someone might be tempted to
1923         call outside the style builder, and without adding special cases to
1924         the JSON file for each property.
1925         (WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion):
1926         Add WTFMove as needed to work with rvalue references.
1927         (WebCore::StyleBuilderCustom::applyValueSize): Ditto.
1928         (WebCore::StyleBuilderCustom::applyInheritTextIndent): Ditto.
1929         (WebCore::StyleBuilderCustom::applyValueTextIndent): Ditto.
1930         (WebCore::StyleBuilderCustom::applyInheritLineHeight): Ditto.
1931         (WebCore::StyleBuilderCustom::applyValueLineHeight): Ditto.
1932         (WebCore::StyleBuilderCustom::applyInheritClip): Ditto.
1933         (WebCore::StyleBuilderCustom::applyValueClip): Ditto.
1934
1935         * css/StyleResolver.cpp:
1936         (WebCore::StyleResolver::State::cacheBorderAndBackground): Use
1937         references instead of pointers.
1938         (WebCore::StyleResolver::applyMatchedProperties): Ditto.
1939         (WebCore::StyleResolver::applyProperty): Update for changes to the
1940         custom property data in RenderStyle.
1941
1942         * css/makeprop.pl: Use auto quite a bit more in the generated code.
1943         Updated special cases for layers to expect references. Added a WTFMove
1944         so we can get move semantics for converted values that come out in
1945         an optional. Added call to forwardInheritedValue (see above).
1946
1947         * dom/Document.cpp:
1948         (WebCore::Document::pageSizeAndMarginsInPixels): Use auto and update
1949         since LengthSize is a struct.
1950
1951         * dom/EventPath.cpp:
1952         (WebCore::EventPath::computePathUnclosedToTarget): Use auto.
1953
1954         * dom/LiveNodeList.h:
1955         (WebCore::LiveNodeList::ownerNode): Removed no-longer-needed const_cast.
1956
1957         * dom/MessageEvent.cpp:
1958         (WebCore::MessageEvent::source): Removed unneeded static_cast.
1959
1960         * dom/Node.cpp:
1961         (WebCore::nodeSetPreTransformedFromNodeOrStringVector): Tweaked formatting.
1962
1963         * dom/Range.h:
1964         (WebCore::Range::ownerDocument): Removed no-longer-needed const_cast.
1965         * dom/RegisteredEventListener.h:
1966         (WebCore::RegisteredEventListener::callback): Ditto.
1967         * dom/ScriptRunner.cpp:
1968         (WebCore::ScriptRunner::~ScriptRunner): Ditto.
1969         * html/HTMLCollection.h:
1970         (WebCore::HTMLCollection::ownerNode): Ditto.
1971         * html/parser/HTMLStackItem.h:
1972         (WebCore::HTMLStackItem::node): Ditto.
1973
1974         * inspector/PageScriptDebugServer.cpp:
1975         (WebCore::PageScriptDebugServer::setJavaScriptPaused): Cut down on the number
1976         of different functions here. Also use reference rather than pointer.
1977         * inspector/PageScriptDebugServer.h: Updated for above change.
1978
1979         * loader/HistoryController.cpp:
1980         (WebCore::HistoryController::recursiveSetProvisionalItem): Removed
1981         no-longer-needed const_cast.
1982         (WebCore::HistoryController::recursiveGoToItem): Ditto.
1983
1984         * page/Frame.cpp:
1985         (WebCore::Frame::ownerRenderer): Use auto. Let the is<> function do null
1986         checking for us.
1987         (WebCore::Frame::frameForWidget): Take a reference rather than a pointer.
1988         * page/Frame.h: Updated for the above.
1989
1990         * page/FrameView.cpp:
1991         (WebCore::FrameView::invalidateRect): Use Chrome directly instead of using
1992         HostWindow. HostWindow is an abstraction for the platform layer, and there
1993         is no good reason to use it here.
1994         (WebCore::FrameView::scheduleAnimation): Ditto.
1995         (WebCore::FrameView::graphicsLayerForPlatformWidget): Updated to use reference
1996         when calling RenderWidget::find.
1997         (WebCore::FrameView::scrollContentsFastPath): Use Chrome instead of HostWindow.
1998         (WebCore::FrameView::hostWindow): Use early return.
1999         (WebCore::FrameView::updateScrollCorner): Removed unneeded call through to base
2000         class function, which was empty.
2001         (WebCore::FrameView::hasCustomScrollbars): Updated since the children set now
2002         contains Ref rather than RefPtr.
2003         (WebCore::FrameView::parentFrameView): Use early return.
2004         (WebCore::FrameView::updateWidgetPositions): Use reference instead of pointer.
2005         * page/FrameView.h: Use final instead of override. Remove now-unneeded const_cast.
2006
2007         * page/Page.cpp:
2008         (WebCore::Page::pluginViews): Updated since the children set now contains
2009         Ref rather than RefPtr.
2010
2011         * page/PrintContext.cpp:
2012         (WebCore::PrintContext::pageProperty): Updated for LengthSize struct.
2013
2014         * page/animation/AnimationBase.cpp:
2015         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Updated for changes to
2016         the types in animation function members.
2017         (WebCore::AnimationBase::timeToNextService): Ditto.
2018         (WebCore::AnimationBase::progress): Ditto.
2019         (WebCore::AnimationBase::getElapsedTime): Ditto.
2020
2021         * page/animation/CSSPropertyAnimation.cpp:
2022         (WebCore::blendFunc): Updated for LengthSize struct.
2023         (WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Updated since we now
2024         use rvalue references and move semantics when setting length properties.
2025
2026         * page/scrolling/ScrollingCoordinator.cpp:
2027         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame): Tweaked to
2028         use auto, pass references.
2029
2030         * platform/KeyedCoding.h: Return RefPtr instead of PassRefPtr.
2031
2032         * platform/LengthBox.h: Added a constructor that moves the lengths in, rather
2033         than always copying them.
2034
2035         * platform/LengthSize.cpp:
2036         (WebCore::operator<<): Updated since LengthSize is a struct.
2037         * platform/LengthSize.h: Turned LengthSize into a struct and removed all the
2038         getter and setter code.
2039
2040         * platform/PlatformSpeechSynthesis.h: Removed. Unused.
2041
2042         * platform/PlatformSpeechSynthesisUtterance.cpp:
2043         (WebCore::PlatformSpeechSynthesisUtterance::create): Return Ref rather than PassRefPtr.
2044         (WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance): Take
2045         a reference. Initialize data members in class definition.
2046         * platform/PlatformSpeechSynthesisUtterance.h: Updated for the above.
2047
2048         * platform/PlatformSpeechSynthesisVoice.cpp:
2049         (WebCore::PlatformSpeechSynthesisVoice::create): Return Ref rather than PassRefPtr.
2050         * platform/PlatformSpeechSynthesisVoice.h: Updated for the above.
2051
2052         * platform/ScrollView.cpp:
2053         (WebCore::ScrollView::addChild): Take a reference rather than a PassRefPtr.
2054         (WebCore::ScrollView::setHasScrollbarInternal): Updated for change to addChild
2055         (WebCore::ScrollView::scrollContentsFastPath): Deleted. This was never called,
2056         so made it pure virtual.
2057         (WebCore::ScrollView::frameRectsChanged): Use a modern for loop.
2058         (WebCore::ScrollView::clipRectChanged): Ditto.
2059         (WebCore::ScrollView::updateScrollCorner): Deleted. This was empty so made it pure
2060         virtual and changed FrameView to not call it.
2061         (WebCore::ScrollView::setParentVisible): Use a modern for loop.
2062         (WebCore::ScrollView::show): Ditto.
2063         (WebCore::ScrollView::hide): Ditto.
2064         * platform/ScrollView.h: Changed the children set to contain Ref instead of RefPtr.
2065         Changed functions that were never overridden to either be final or non-virtual,
2066         Changed functions that were never called to be pure virtual.
2067
2068         * platform/Theme.h:
2069         (WebCore::Theme::minimumControlSize): Updated for LengthSize struct.
2070
2071         * platform/animation/Animation.h: Changed timingFunction and trigger to return
2072         raw pointers instead of PassRefPtr. Changed setTimingFunction and setTrigger to
2073         take RefPtr&& and Ref&& instead of PassRefPtr. CHanged initialTimingfunction and
2074         initialTrigger to return Ref.
2075
2076         * platform/animation/AnimationList.cpp: Removed redundant check in FILL_UNSET_PROPERTY.
2077         (WebCore::AnimationList::AnimationList): Use modern for loop, reserveInitialCapacity,
2078         and uncheckedAppend.
2079         * platform/animation/AnimationList.h: Changed append to take Ref&& instead of PassRefPtr.
2080         changed vecto to contain Ref instead of RefPtr. Added move constructor and assignment
2081         operator.
2082
2083         * platform/animation/AnimationTrigger.h:
2084         (WebCore::AutoAnimationTrigger::clone): Return Ref instead of PassRefPtr.
2085         (WebCore::AutoAnimationTrigger::create): Ditto.
2086         (WebCore::AutoAnimationTrigger::clone): Ditto.
2087         (WebCore::ScrollAnimationTrigger::create): Ditto.
2088         (WebCore::ScrollAnimationTrigger::clone): Ditto.
2089
2090         * platform/animation/TimingFunction.h:
2091         (WebCore::LinearTimingFunction::create): Return Ref instead of PassRefPtr.
2092         (WebCore::CubicBezierTimingFunction::create): Ditto.
2093         (WebCore::CubicBezierTimingFunction::defaultTimingFunction): Return a reference
2094         instead of a pointer.
2095         (WebCore::CubicBezierTimingFunction::createReversed): Return Ref instead of PassRefPtr.
2096         (WebCore::CubicBezierTimingFunction::clone): Ditto.
2097         (WebCore::StepsTimingFunction::create): Ditto.
2098         (WebCore::StepsTimingFunction::clone): Ditto.
2099         (WebCore::SpringTimingFunction::create): Ditto.
2100         (WebCore::SpringTimingFunction::clone): Ditto.
2101
2102         * platform/audio/AudioBus.h:
2103         (WebCore::AudioBus::channel): Removed no-longer-needed const_cast.
2104
2105         * platform/cf/KeyedEncoderCF.cpp:
2106         (WebCore::KeyedEncoderCF::finishEncoding): Return RefPtr instead of PassRefPtr.
2107         * platform/cf/KeyedEncoderCF.h: Use final instead of override. Made even more
2108         private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
2109
2110         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed include of PassRefPtr.h.
2111
2112         * platform/glib/KeyedEncoderGlib.cpp:
2113         (WebCore::KeyedEncoderGlib::finishEncoding): Return RefPtr instead of PassRefPtr.
2114         * platform/glib/KeyedEncoderGlib.h: Use final instead of override. Made even more
2115         private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
2116
2117         * platform/graphics/filters/FilterOperations.cpp:
2118         (WebCore::outsetSizeForBlur): Simplified, removing unnecessary floating point math.
2119         (WebCore::FilterOperations::FilterOperations): Deleted. Let the compiler generate this.
2120         (WebCore::FilterOperations::operator=): Deleted. Let the compiler generate this.
2121         (WebCore::FilterOperations::operator==): Streamlined.
2122         (WebCore::FilterOperations::operationsMatch): Ditto.
2123         (WebCore::FilterOperations::hasReferenceFilter): Ditto.
2124         (WebCore::FilterOperations::hasOutsets): Ditto.
2125         (WebCore::FilterOperations::outsets): Ditto.
2126         (WebCore::FilterOperations::hasFilterThatAffectsOpacity): Ditto.
2127         (WebCore::FilterOperations::hasFilterThatMovesPixels): Ditto.
2128         * platform/graphics/filters/FilterOperations.h: Updated for above changes.
2129
2130         * platform/graphics/FontCache.h: Removed included of PassRefPtr.h.
2131
2132         * platform/graphics/FontPlatformData.h: Tweaked formatting. Removed nesting
2133         from #if since our formatting makes it hard to see nesting. Let the compiler
2134         generate the default move and copy constructors and assignemnt operators except
2135         in the USE(FREETYPE) case.
2136
2137         * platform/graphics/GraphicsLayer.h:
2138         (WebCore::AnimationValue::AnimationValue): Updated since clone now returns a Ref
2139         rather than a RefPtr.
2140         (WebCore::FloatAnimationValue::FloatAnimationValue): Deleted. Let the compiler
2141         generate the copy constructor without defining it explicitly.
2142         (WebCore::TransformAnimationValue::TransformAnimationValue): Use a modern for
2143         loop, reserveInitialCapacity, and unchecked append. Also tell the compiler to
2144         generate the move constructor, since the special work is only needed for the
2145         copy constructor.
2146         (WebCore::FilterAnimationValue::FilterAnimationValue): Ditto.
2147         (WebCore::KeyframeValueList::KeyframeValueList): Ditto.
2148
2149         * platform/graphics/LegacyCDMSession.h: Removed include of PassRefPtr.h.
2150
2151         * platform/graphics/PathUtilities.cpp:
2152         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): Updated
2153         for LengthSize struct.
2154
2155         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2156         (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): Take a reference.
2157         Don't bother setting m_client since we never use it.
2158         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Clean up code a bit
2159         by using auto a lot more.
2160         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Added include
2161         that is now needed since it was removed from the base class. Tidied the class
2162         up a bit, marking it final, making everything private, taking a reference, and
2163         removing an unused data member, m_client.
2164
2165         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2166         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession): Pass a reference.
2167
2168         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2169         added include of WTFString.h, now needed because of removing an unneeded
2170         include from another header file.
2171
2172         * platform/graphics/ca/GraphicsLayerCA.cpp:
2173         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): Updated since trigger
2174         is a raw pointer now.
2175         (WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Updated to
2176         return a reference rather than a pointer.
2177         (WebCore::GraphicsLayerCA::setAnimationEndpoints): Updated for the above change.
2178         (WebCore::GraphicsLayerCA::setAnimationKeyframes): Ditto.
2179         (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Ditto.
2180         (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Ditto.
2181         (WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): Ditto.
2182         (WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): Ditto.
2183         * platform/graphics/ca/GraphicsLayerCA.h: Ditto.
2184
2185         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2186         (-[WebSpeechSynthesisWrapper speakUtterance:]): CHanged argument to be a
2187         RefPtr&& instead of a PassRefPtr.
2188
2189         * platform/mac/ThemeMac.mm:
2190         (WebCore::sizeFromNSControlSize): Updated for LenghtSize struct.
2191         (WebCore::checkboxSize): Ditto.
2192         (WebCore::radioSize): Ditto.
2193         (WebCore::ThemeMac::controlSize): Ditto.
2194         (WebCore::ThemeMac::minimumControlSize): Ditto.
2195
2196         * platform/mac/WidgetMac.mm:
2197         (WebCore::Widget::setFocus): Updated to pass a reference.
2198
2199         * platform/mock/DeviceMotionClientMock.cpp: Removed. Unused.
2200         * platform/mock/DeviceMotionClientMock.h: Removed. Unused.
2201
2202         * platform/win/CursorWin.cpp:
2203         (WebCore::createSharedCursor): Return a Ref instead of a PassRefPtr.
2204         (WebCore::loadSharedCursor): Ditto.
2205         (WebCore::loadCursorByName): Ditto.
2206
2207         * rendering/FilterEffectRenderer.cpp:
2208         (WebCore::FilterEffectRenderer::output): Removed a no-longer-needed const_cast.
2209         (WebCore::FilterEffectRenderer::outputRect): Ditto.
2210
2211         * rendering/ImageQualityController.cpp:
2212         (WebCore::ImageQualityController::chooseInterpolationQuality): Tweaked formatting.
2213
2214         * rendering/InlineFlowBox.cpp:
2215         (WebCore::InlineFlowBox::paintFillLayers): Updated to take a reference. Also
2216         used a vector to iterate the linked list in reverse order instead of recursion.
2217         (WebCore::InlineFlowBox::paintFillLayer): Take a reference.
2218         (WebCore::InlineFlowBox::paintMask):
2219         * rendering/InlineFlowBox.h: Updated for the above.
2220
2221         * rendering/RenderBox.cpp:
2222         (WebCore::RenderBox::paintRootBoxFillLayers): Use auto a bit.
2223         (WebCore::RenderBox::getBackgroundPaintedExtent): Use reference for the layers.
2224         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): Ditto.
2225         (WebCore::RenderBox::backgroundHasOpaqueTopLayer): Ditto.
2226         (WebCore::RenderBox::paintMaskImages): Ditto.
2227         (WebCore::RenderBox::maskClipRect): Ditto.
2228         (WebCore::RenderBox::paintFillLayers): Ditto.
2229         (WebCore::RenderBox::paintFillLayer): Ditto.
2230         (WebCore::layersUseImage): Ditto.
2231         (WebCore::RenderBox::repaintLayerRectsForImage): Ditto.
2232         * rendering/RenderBox.h: Updated for the above.
2233
2234         * rendering/RenderBoxModelObject.cpp:
2235         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Use reference for
2236         the layers.
2237         (WebCore::RenderBoxModelObject::calculateFillTileSize): Ditto.
2238         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ditto.
2239         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage): Ditto.
2240         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Ditto.
2241         * rendering/RenderBoxModelObject.h: Updated for the above.
2242
2243         * rendering/RenderElement.cpp:
2244         (WebCore::RenderElement::~RenderElement): Use references for the layers.
2245         (WebCore::RenderElement::adjustStyleDifference): Ditto.
2246         (WebCore::RenderElement::updateFillImages): Ditto.
2247         (WebCore::RenderElement::setStyle): Use RenderStyle::replace to replace the
2248         old style with the new style, and get the old one out at the same time.
2249         (WebCore::RenderElement::styleDidChange): Use references for the layers.
2250         (WebCore::mustRepaintFillLayers): Ditto.
2251         (WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto.
2252         * rendering/RenderElement.h: Updated for the above.
2253
2254         * rendering/RenderGrid.cpp:
2255         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
2256         Refactor so we don't need so many functions in RenderStyle.
2257         * rendering/RenderMenuList.cpp:
2258         (WebCore::RenderMenuList::adjustInnerStyle): Ditto.
2259
2260         * rendering/RenderLayer.cpp:
2261         (WebCore::RenderLayer::createScrollbar): Pass widget as reference to addChild.
2262         Also did a few other tweaks and used more specific types.
2263
2264         * rendering/RenderLayerBacking.cpp:
2265         (WebCore::canCreateTiledImage): Updated since layers are references.
2266         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
2267
2268         * rendering/RenderListBox.cpp:
2269         (WebCore::RenderListBox::createScrollbar): Pass widget as reference to addChild.
2270
2271         * rendering/RenderTableCell.cpp:
2272         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Updated to use
2273         references for layers.
2274
2275         * rendering/RenderTheme.cpp:
2276         (WebCore::RenderTheme::adjustStyle): Use WTFMove to pass a LengthBox.
2277         (WebCore::RenderTheme::isControlStyled): Updated since LengthSize is a struct,
2278         more WTFMove, change since layers are ferences.
2279
2280         * rendering/RenderThemeEfl.cpp:
2281         (WebCore::RenderThemeEfl::adjustSizeConstraints): Update for Length and
2282         LengthSize changes.
2283         (WebCore::RenderThemeEfl::paintThemePart): Use reference instead of pointer.
2284         (WebCore::RenderThemeEfl::applyPartDescriptionFallback): Update for Length and
2285         LengthSize changes.
2286         (WebCore::RenderThemeEfl::applyPartDescription): Ditto.
2287         (WebCore::RenderThemeEfl::adjustCheckboxStyle): Ditto.
2288         (WebCore::RenderThemeEfl::adjustRadioStyle): Ditto.
2289
2290         * rendering/RenderThemeGtk.cpp:
2291         (WebCore::borderRadiiFromStyle): Update for Length and LengthSize changes.
2292
2293         * rendering/RenderThemeIOS.mm:
2294         (WebCore::RenderThemeIOS::adjustCheckboxStyle): Update for Length and
2295         LengthSize changes.
2296         (WebCore::RenderThemeIOS::isControlStyled): Ditto.
2297         (WebCore::RenderThemeIOS::adjustRadioStyle): Ditto.
2298         (WebCore::RenderThemeIOS::adjustRoundBorderRadius): Ditto.
2299         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Ditto.
2300         (WebCore::RenderThemeIOS::adjustSliderTrackStyle): Ditto.
2301         (WebCore::RenderThemeIOS::adjustSliderThumbSize): Ditto.
2302
2303         * rendering/RenderWidget.cpp:
2304         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): Use move
2305         insteead of swap and modern for loop instead of iterators.
2306         (WebCore::moveWidgetToParentSoon): Take a reference instead of a pointer.
2307         (WebCore::RenderWidget::setWidget): Update for above change.
2308         (WebCore::RenderWidget::find): Take a reference instead of a pointer.
2309         * rendering/RenderWidget.h: Updated for above changes.
2310
2311         * rendering/TextAutoSizing.cpp:
2312         (WebCore::TextAutoSizingValue::reset): Updated since Length is passed as
2313         rvalue reference now.
2314
2315         * rendering/mathml/MathMLStyle.cpp:
2316         (WebCore::MathMLStyle::getMathMLStyle): Updated since mathMLStyle returns
2317         a reference.
2318         (WebCore::MathMLStyle::resolveMathMLStyleTree): Ditto.
2319
2320         * rendering/mathml/RenderMathMLBlock.h:
2321         (WebCore::RenderMathMLBlock::mathMLStyle): Removed no-longer needed const_cast,
2322         changed to return a reference rather than a pointer.
2323         (WebCore::RenderMathMLTable::mathMLStyle): Ditto.
2324
2325         * rendering/mathml/RenderMathMLFraction.cpp:
2326         (WebCore::RenderMathMLFraction::fractionParameters): Updated since mathMLStyle
2327         returns a reference.
2328         (WebCore::RenderMathMLFraction::stackParameters): Ditto.
2329         * rendering/mathml/RenderMathMLOperator.h:
2330         (WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Ditto.
2331         (WebCore::RenderMathMLOperator::shouldMoveLimits): Ditto.
2332         * rendering/mathml/RenderMathMLRoot.cpp:
2333         (WebCore::RenderMathMLRoot::verticalParameters): Ditto.
2334         * rendering/mathml/RenderMathMLToken.cpp:
2335         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
2336
2337         * rendering/style/BasicShapes.cpp:
2338         (WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
2339         * rendering/style/BorderData.h:
2340         (WebCore::BorderData::BorderData): Ditto.
2341         (WebCore::BorderData::hasBorderRadius): Ditto.
2342
2343         * rendering/style/ContentData.cpp:
2344         (WebCore::ContentData::clone): Updated member names.
2345         * rendering/style/ContentData.h: Ditto.
2346
2347         * rendering/style/NinePieceImage.cpp:
2348         (WebCore::NinePieceImage::computeSlices): Use initializer lists so we get
2349         move optimization without requiring explicit WTFMove.
2350
2351         * rendering/style/DataRef.h:
2352         (WebCore::DataRef::DataRef): Removed no-longer needed const_cast.
2353         (WebCore::DataRef::replace): Added. This function is like Ref::replace, and
2354         can be used to put a new value in and get an old value out without running into
2355         the rule Ref has about not being reused once it becomes null because of being
2356         moved out of. This function is a lot like std::exchange.
2357         (WebCore::DataRef::operator const T&): Added operator so we can use these
2358         as references without any function call in read-only contexts.
2359         (WebCore::DataRef::get): Changed to return a reference rather than pointer.
2360         (WebCore::DataRef::access): Ditto.
2361
2362         * rendering/style/KeyframeList.cpp:
2363         (WebCore::KeyframeValue::timingFunction): Updated since timingFunction
2364         returns a raw pointer.
2365         (WebCore::KeyframeList::~KeyframeList): Removed unneeded call to clear,
2366         which does things that are redundant since we are about to destroy all the
2367         data members.
2368         (WebCore::KeyframeList::operator==): Tweaked codign style a bit.
2369
2370         * rendering/style/NinePieceImage.h: Updated most functions in this class
2371         for the changes to DataRef.
2372
2373         * rendering/style/RenderStyle.cpp: Updated nearly every function in this
2374         class for the changes to DataRef, to eliminate the peculiar naming and use
2375         our standard data member naming, m_memberName in a class, and memberName in a
2376         struct or struct-like class for publicly accessible members, to pass, take,
2377         and return more references and rvalue references, and to use modern for loops.
2378         Other changes listed below function by function.
2379         (WebCore::RenderStyle::defaultStyle): Use NeverDestroyed instead of allocating
2380         on the heap.
2381         (WebCore::RenderStyle::RenderStyle): Added a new constructor that performs
2382         the replace operation, using a combination of DataRef::replace and std::exchange.
2383         (WebCore::RenderStyle::replace): Added. Calls the above constructor.
2384         (WebCore::RenderStyle::setScrollSnapType): Use SET_NESTED_VAR so we get equality
2385         checks on this property, for the normal efficiency benefit.
2386         (WebCore::RenderStyle::setDashboardRegion): Moved this here from the header.
2387         (WebCore::RenderStyle::appendContent): Deleted.
2388         (WebCore::RenderStyle::setContent): Refactored this set of functions to simplify.
2389
2390         * rendering/style/RenderStyle.h: Updated most functions as mentioned above.
2391         Also updated macros to use the do/while(0) technique. Removed the long list of
2392         friend classes with the elaborate comments; turned out none needed friendship
2393         despite the comments. Made more things private. Moved large functions out of the
2394         class definition.
2395         (WebCore::RenderStyle::getTextShadowExtent): Deleted.
2396         (WebCore::RenderStyle::getTextShadowHorizontalExtent): Deleted.
2397         (WebCore::RenderStyle::getTextShadowVerticalExtent): Deleted.
2398         (WebCore::RenderStyle::aspectRatio): Deleted.
2399         (WebCore::RenderStyle::alignContentPosition): Deleted.
2400         (WebCore::RenderStyle::alignContentDistribution): Deleted.
2401         (WebCore::RenderStyle::alignContentOverflowAlignment): Deleted.
2402         (WebCore::RenderStyle::alignItemsPosition): Deleted.
2403         (WebCore::RenderStyle::alignItemsOverflowAlignment): Deleted.
2404         (WebCore::RenderStyle::alignSelfPosition): Deleted.
2405         (WebCore::RenderStyle::alignSelfOverflowAlignment): Deleted.
2406         (WebCore::RenderStyle::justifyContentPosition): Deleted.
2407         (WebCore::RenderStyle::justifyContentDistribution): Deleted.
2408         (WebCore::RenderStyle::justifyContentOverflowAlignment): Deleted.
2409         (WebCore::RenderStyle::justifyItemsPosition): Deleted.
2410         (WebCore::RenderStyle::justifyItemsOverflowAlignment): Deleted.
2411         (WebCore::RenderStyle::justifyItemsPositionType): Deleted.
2412         (WebCore::RenderStyle::justifySelfPosition): Deleted.
2413         (WebCore::RenderStyle::justifySelfOverflowAlignment): Deleted.
2414         (WebCore::RenderStyle::setAlignContentPosition): Deleted.
2415         (WebCore::RenderStyle::setAlignContentOverflow): Deleted.
2416         (WebCore::RenderStyle::setAlignContentDistribution): Deleted.
2417         (WebCore::RenderStyle::setAlignItemsOverflow): Deleted.
2418         (WebCore::RenderStyle::setAlignSelfOverflow): Deleted.
2419         (WebCore::RenderStyle::setJustifyContentOverflow): Deleted.
2420         (WebCore::RenderStyle::setJustifyContentDistribution): Deleted.
2421         (WebCore::RenderStyle::setJustifyItemsPosition): Deleted.
2422         (WebCore::RenderStyle::setJustifyItemsOverflow): Deleted.
2423         (WebCore::RenderStyle::setJustifyItemsPositionType): Deleted.
2424         (WebCore::RenderStyle::setJustifySelfPosition): Deleted.
2425         (WebCore::RenderStyle::setJustifySelfOverflow): Deleted.
2426         (WebCore::RenderStyle::noninheritedFlagsMemoryOffset): Deleted.
2427
2428         * rendering/style/SVGRenderStyle.cpp: Similar changes to RenderStyle.cpp above.
2429         * rendering/style/SVGRenderStyle.h: Ditto.
2430
2431         * rendering/style/ShapeValue.h:
2432         (WebCore::ShapeValue::create): Take a Ref&& instead of a RefPtr.
2433         (WebCore::ShapeValue::ShapeValue): Ditto.
2434
2435         * rendering/style/StyleBackgroundData.cpp: Update data member names.
2436         * rendering/style/StyleBackgroundData.h: Ditto; make them public and remove the
2437         getter functions.
2438
2439         * rendering/style/StyleCachedImage.cpp:
2440         (WebCore::StyleCachedImage::cssValue): Removed no-longer-needed const_cast.
2441
2442         * rendering/style/StyleCustomPropertyData.h: Update data member names.
2443         (WebCore::StyleCustomPropertyData::operator==): Removed unnecessary reference
2444         count churn.
2445         (WebCore::StyleCustomPropertyData::setCustomPropertyValue): Take an rvalue
2446         reference.
2447         (WebCore::StyleCustomPropertyData::getCustomPropertyValue): Deleted.
2448         (WebCore::StyleCustomPropertyData::values): Deleted.
2449         (WebCore::StyleCustomPropertyData::hasCustomProperty): Deleted.
2450         (WebCore::StyleCustomPropertyData::containsVariables): Deleted.
2451         (WebCore::StyleCustomPropertyData::setContainsVariables): Deleted.
2452
2453         * rendering/style/StyleFilterData.cpp: Update data member names.
2454         * rendering/style/StyleFilterData.h: Ditto.
2455         * rendering/style/StyleFlexibleBoxData.cpp: Ditto.
2456         * rendering/style/StyleFlexibleBoxData.h: Ditto.
2457         * rendering/style/StyleGridData.cpp: Ditto.
2458         * rendering/style/StyleGridData.h: Ditto.
2459         * rendering/style/StyleGridItemData.cpp: Ditto.
2460         * rendering/style/StyleGridItemData.h: Ditto.
2461
2462         * rendering/style/StyleGeneratedImage.cpp:
2463         (WebCore::StyleGeneratedImage::cssValue): Removed no-longer-needed const_cast.
2464         (WebCore::StyleGeneratedImage::imageSize): Ditto.
2465         (WebCore::StyleGeneratedImage::image): Ditto.
2466
2467         * rendering/style/StyleInheritedData.cpp: Update data member names.
2468         * rendering/style/StyleInheritedData.h: Ditto.
2469         * rendering/style/StyleRareInheritedData.cpp: Ditto.
2470         * rendering/style/StyleRareInheritedData.h: Ditto.
2471         * rendering/style/StyleMultiColData.cpp: Ditto.
2472         * rendering/style/StyleMultiColData.h: Ditto.
2473         * rendering/style/StyleRareNonInheritedData.cpp: Ditto.
2474         * rendering/style/StyleRareNonInheritedData.h: Ditto.
2475         * rendering/style/StyleTransformData.cpp: Ditto.
2476         * rendering/style/StyleTransformData.h: Ditto.
2477         * rendering/style/StyleVisualData.cpp: Ditto.
2478         * rendering/style/StyleVisualData.h: Ditto.
2479
2480         * style/StylePendingResources.cpp:
2481         (WebCore::Style::loadPendingResources): Update since layers are references.
2482
2483
2484 2017-01-13  Chris Dumez  <cdumez@apple.com>
2485
2486         [WK2] Add diagnostic logging to measure WebGL usage
2487         https://bugs.webkit.org/show_bug.cgi?id=166730
2488         <rdar://problem/29883469>
2489
2490         Reviewed by Alex Christensen.
2491
2492         Add diagnostic logging to measure high performance WebGL usage. We report
2493         at regular intervals in which WebGL state Safari is:
2494         - Inactive
2495         - ActiveInForegroundTab
2496         - ActiveInBackgroundTabOnly
2497
2498         This should give us an estimate of:
2499         - What % of the time is Safari using high performance graphics
2500         - What % of this time is only due to background tabs
2501
2502         No new tests, no Web-facing behavior change.
2503
2504         * WebCore.xcodeproj/project.pbxproj:
2505         * html/canvas/WebGLRenderingContextBase.cpp:
2506         (WebCore::WebGLRenderingContextBase::create):
2507         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2508         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
2509         * html/canvas/WebGLRenderingContextBase.h:
2510         * page/DiagnosticLoggingKeys.cpp:
2511         (WebCore::DiagnosticLoggingKeys::inactiveKey):
2512         (WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey):
2513         (WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey):
2514         (WebCore::DiagnosticLoggingKeys::stateKey):
2515         (WebCore::WebCore::DiagnosticLoggingKeys::webGLKey):
2516         * page/DiagnosticLoggingKeys.h:
2517         * page/Page.cpp:
2518         (WebCore::Page::Page):
2519         * page/Page.h:
2520         (WebCore::Page::webGLStateTracker):
2521         * page/PageConfiguration.cpp:
2522         * page/PageConfiguration.h:
2523         * platform/WebGLStateTracker.cpp: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
2524         (WebCore::WebGLStateTracker::WebGLStateTracker):
2525         (WebCore::m_stateChangeHandler):
2526         (WebCore::WebGLStateTracker::updateWebGLState):
2527         * platform/WebGLStateTracker.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
2528         * platform/graphics/GraphicsContext3DAttributes.h:
2529
2530 2017-01-13  Brent Fulgham  <bfulgham@apple.com>
2531
2532         Avoid nullptr frame dereference when scrollTo is called on a disconnected DOMWindow
2533         https://bugs.webkit.org/show_bug.cgi?id=167030
2534         <rdar://problem/29995070>
2535
2536         Reviewed by Dean Jackson.
2537
2538         Correct DOMWindow::scrollTo to match all other functions in the class so that the it
2539         checks that the current frame is valid before attempting to use it.
2540
2541         * page/DOMWindow.cpp:
2542         (WebCore::DOMWindow::scrollTo):
2543
2544 2017-01-13  Jer Noble  <jer.noble@apple.com>
2545
2546         Use a strong reference when calling callOnMainThread to schedule events in AudioScheduledSourceNode.
2547         https://bugs.webkit.org/show_bug.cgi?id=166983
2548
2549         Reviewed by Brent Fulgham.
2550
2551         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2552         (WebCore::AudioScheduledSourceNode::finish):
2553         * Modules/webaudio/AudioScheduledSourceNode.h:
2554
2555 2017-01-12  Jer Noble  <jer.noble@apple.com>
2556
2557         Protect MediaPlayer from being destroyed mid-load()
2558         https://bugs.webkit.org/show_bug.cgi?id=166976
2559
2560         Reviewed by Eric Carlson.
2561
2562         It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
2563         MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
2564         previously protected against this same problem in HTMLMediaElement::loadResource()
2565         by ref'ing at the beginning of the function and deref'ing on exit. To do the
2566         same in MediaPlayer, it must become RefCounted.
2567
2568         To keep the same semantics about m_client in MediaPlayer (always available without
2569         requiring a null-check), make a new static MediaPlayerClient object which can
2570         replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.
2571
2572         * html/HTMLMediaElement.cpp:
2573         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2574         (WebCore::HTMLMediaElement::clearMediaPlayer):
2575         (WebCore::HTMLMediaElement::createMediaPlayer):
2576         * html/HTMLMediaElement.h:
2577         * platform/graphics/MediaPlayer.cpp:
2578         (WebCore::nullMediaPlayerClient):
2579         (WebCore::MediaPlayer::create):
2580         (WebCore::MediaPlayer::MediaPlayer):
2581         (WebCore::MediaPlayer::invalidate):
2582         (WebCore::MediaPlayer::load):
2583         (WebCore::MediaPlayer::loadWithNextMediaEngine):
2584         (WebCore::MediaPlayer::inMediaDocument):
2585         (WebCore::MediaPlayer::fullscreenMode):
2586         (WebCore::MediaPlayer::requestedRate):
2587         (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
2588         (WebCore::MediaPlayer::networkStateChanged):
2589         (WebCore::MediaPlayer::readyStateChanged):
2590         (WebCore::MediaPlayer::volumeChanged):
2591         (WebCore::MediaPlayer::muteChanged):
2592         (WebCore::MediaPlayer::timeChanged):
2593         (WebCore::MediaPlayer::sizeChanged):
2594         (WebCore::MediaPlayer::repaint):
2595         (WebCore::MediaPlayer::durationChanged):
2596         (WebCore::MediaPlayer::rateChanged):
2597         (WebCore::MediaPlayer::playbackStateChanged):
2598         (WebCore::MediaPlayer::firstVideoFrameAvailable):
2599         (WebCore::MediaPlayer::characteristicChanged):
2600         (WebCore::MediaPlayer::cachedKeyForKeyId):
2601         (WebCore::MediaPlayer::keyNeeded):
2602         (WebCore::MediaPlayer::mediaKeysStorageDirectory):
2603         (WebCore::MediaPlayer::referrer):
2604         (WebCore::MediaPlayer::userAgent):
2605         (WebCore::MediaPlayer::graphicsDeviceAdapter):
2606         (WebCore::MediaPlayer::cachedResourceLoader):
2607         (WebCore::MediaPlayer::createResourceLoader):
2608         (WebCore::MediaPlayer::addAudioTrack):
2609         (WebCore::MediaPlayer::removeAudioTrack):
2610         (WebCore::MediaPlayer::addTextTrack):
2611         (WebCore::MediaPlayer::removeTextTrack):
2612         (WebCore::MediaPlayer::addVideoTrack):
2613         (WebCore::MediaPlayer::removeVideoTrack):
2614         (WebCore::MediaPlayer::outOfBandTrackSources):
2615         (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
2616         (WebCore::MediaPlayer::handlePlaybackCommand):
2617         (WebCore::MediaPlayer::sourceApplicationIdentifier):
2618         (WebCore::MediaPlayer::preferredAudioCharacteristics):
2619         (WebCore::MediaPlayer::doesHaveAttribute):
2620         (WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
2621         (WebCore::MediaPlayer::getRawCookies):
2622         (WebCore::MediaPlayer::shouldDisableSleep):
2623         * platform/graphics/MediaPlayer.h:
2624         (WebCore::MediaPlayer::platformVolumeConfigurationRequired):
2625         (WebCore::MediaPlayer::client):
2626
2627 2017-01-13  Eric Carlson  <eric.carlson@apple.com>
2628
2629         [MediaStream, Mac] Add mock audio source
2630         https://bugs.webkit.org/show_bug.cgi?id=166974
2631
2632         Reviewed by Jer Noble.
2633         
2634         Add a mock audio source for testing media streams.
2635
2636         No new tests, updated webaudio/mediastreamaudiosourcenode.html.
2637
2638         * WebCore.xcodeproj/project.pbxproj:
2639         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2640         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample):
2641         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2642
2643         * platform/mediastream/mac/AVAudioCaptureSource.h:
2644         (WebCore::AVAudioCaptureSource::Observer::~Observer): Deleted.
2645
2646         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2647         (WebCore::AVAudioCaptureSource::addObserver):
2648         (WebCore::AVAudioCaptureSource::removeObserver):
2649         (WebCore::AVAudioCaptureSource::start):
2650
2651         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: Added.
2652         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: Added.
2653         (WebCore::MockRealtimeAudioSource::create):
2654         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
2655         (WebCore::MockRealtimeAudioSource::createMuted):
2656         (WebCore::MockRealtimeAudioSourceMac::addObserver):
2657         (WebCore::MockRealtimeAudioSourceMac::removeObserver):
2658         (WebCore::MockRealtimeAudioSourceMac::start):
2659         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
2660         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
2661         (WebCore::MockRealtimeAudioSourceMac::render):
2662         (WebCore::MockRealtimeAudioSourceMac::applySampleRate):
2663         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
2664
2665         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2666         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2667         (WebCore::WebAudioSourceProviderAVFObjC::create):
2668         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
2669         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
2670         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2671         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
2672         (WebCore::WebAudioSourceProviderAVFObjC::startProducingData): Deleted.
2673         (WebCore::WebAudioSourceProviderAVFObjC::stopProducingData): Deleted.
2674
2675         * platform/mock/MockRealtimeAudioSource.cpp:
2676         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
2677         (WebCore::MockRealtimeAudioSource::startProducingData):
2678         (WebCore::MockRealtimeAudioSource::stopProducingData):
2679         (WebCore::MockRealtimeAudioSource::elapsedTime):
2680         (WebCore::MockRealtimeAudioSource::tick):
2681
2682         * platform/mock/MockRealtimeAudioSource.h:
2683         (WebCore::MockRealtimeAudioSource::render):
2684         (WebCore::MockRealtimeAudioSource::renderInterval):
2685         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): Deleted.
2686
2687 2017-01-13  Sam Weinig  <sam@webkit.org>
2688
2689         [WebIDL] Remove custom bindings for DeviceMotionEvent and DeviceOrientationEvent
2690         https://bugs.webkit.org/show_bug.cgi?id=167006
2691
2692         Reviewed by Geoffrey Garen.
2693
2694         * CMakeLists.txt:
2695         * WebCore.xcodeproj/project.pbxproj:
2696         * bindings/js/JSBindingsAllInOne.cpp:
2697         * bindings/js/JSDeviceMotionEventCustom.cpp: Removed.
2698         * bindings/js/JSDeviceOrientationEventCustom.cpp: Removed.
2699         Remove Custom bindings files.
2700
2701         * dom/DeviceMotionData.cpp:
2702         (WebCore::DeviceMotionData::create):
2703         (WebCore::DeviceMotionData::DeviceMotionData):
2704         (WebCore::DeviceMotionData::Acceleration::create): Deleted.
2705         (WebCore::DeviceMotionData::Acceleration::Acceleration): Deleted.
2706         (WebCore::DeviceMotionData::RotationRate::create): Deleted.
2707         (WebCore::DeviceMotionData::RotationRate::RotationRate): Deleted.
2708         * dom/DeviceMotionData.h:
2709         (WebCore::DeviceMotionData::Acceleration::create):
2710         (WebCore::DeviceMotionData::Acceleration::x):
2711         (WebCore::DeviceMotionData::Acceleration::y):
2712         (WebCore::DeviceMotionData::Acceleration::z):
2713         (WebCore::DeviceMotionData::Acceleration::Acceleration):
2714         (WebCore::DeviceMotionData::RotationRate::create):
2715         (WebCore::DeviceMotionData::RotationRate::alpha):
2716         (WebCore::DeviceMotionData::RotationRate::beta):
2717         (WebCore::DeviceMotionData::RotationRate::gamma):
2718         (WebCore::DeviceMotionData::RotationRate::RotationRate):
2719         (WebCore::DeviceMotionData::interval):
2720         (WebCore::DeviceMotionData::Acceleration::canProvideX): Deleted.
2721         (WebCore::DeviceMotionData::Acceleration::canProvideY): Deleted.
2722         (WebCore::DeviceMotionData::Acceleration::canProvideZ): Deleted.
2723         (WebCore::DeviceMotionData::RotationRate::canProvideAlpha): Deleted.
2724         (WebCore::DeviceMotionData::RotationRate::canProvideBeta): Deleted.
2725         (WebCore::DeviceMotionData::RotationRate::canProvideGamma): Deleted.
2726         (WebCore::DeviceMotionData::canProvideInterval): Deleted.
2727         Re-work using std::optional rather than an explicit bool/value pair.
2728
2729         * dom/DeviceMotionEvent.cpp:
2730         (WebCore::convert):
2731         (WebCore::DeviceMotionEvent::acceleration):
2732         (WebCore::DeviceMotionEvent::accelerationIncludingGravity):
2733         (WebCore::DeviceMotionEvent::rotationRate):
2734         (WebCore::DeviceMotionEvent::interval):
2735         (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
2736         * dom/DeviceMotionEvent.h:
2737         Implement IDL interface. For now, we have duplicate structs for
2738         Acceleration and RotationRate (one here, one in DeviceMotionData)
2739         which can be consolidated in the future.
2740
2741         * dom/DeviceMotionEvent.idl:
2742         Add dictionaries for Acceleration and RotationRate, and update IDL to
2743         specify the correct nullability of attributes and arguments.
2744
2745         * dom/DeviceOrientationData.cpp:
2746         (WebCore::DeviceOrientationData::create):
2747         (WebCore::DeviceOrientationData::DeviceOrientationData):
2748         (WebCore::DeviceOrientationData::alpha): Deleted.
2749         (WebCore::DeviceOrientationData::beta): Deleted.
2750         (WebCore::DeviceOrientationData::gamma): Deleted.
2751         (WebCore::DeviceOrientationData::absolute): Deleted.
2752         (WebCore::DeviceOrientationData::canProvideAlpha): Deleted.
2753         (WebCore::DeviceOrientationData::canProvideBeta): Deleted.
2754         (WebCore::DeviceOrientationData::canProvideGamma): Deleted.
2755         (WebCore::DeviceOrientationData::compassHeading): Deleted.
2756         (WebCore::DeviceOrientationData::compassAccuracy): Deleted.
2757         (WebCore::DeviceOrientationData::canProvideCompassHeading): Deleted.
2758         (WebCore::DeviceOrientationData::canProvideCompassAccuracy): Deleted.
2759         (WebCore::DeviceOrientationData::canProvideAbsolute): Deleted.
2760         * dom/DeviceOrientationData.h:
2761         (WebCore::DeviceOrientationData::create):
2762         (WebCore::DeviceOrientationData::alpha):
2763         (WebCore::DeviceOrientationData::beta):
2764         (WebCore::DeviceOrientationData::gamma):
2765         (WebCore::DeviceOrientationData::compassHeading):
2766         (WebCore::DeviceOrientationData::compassAccuracy):
2767         (WebCore::DeviceOrientationData::absolute):
2768         Re-work using std::optional rather than an explicit bool/value pair.
2769
2770         * dom/DeviceOrientationEvent.cpp:
2771         (WebCore::DeviceOrientationEvent::alpha):
2772         (WebCore::DeviceOrientationEvent::beta):
2773         (WebCore::DeviceOrientationEvent::gamma):
2774         (WebCore::DeviceOrientationEvent::compassHeading):
2775         (WebCore::DeviceOrientationEvent::compassAccuracy):
2776         (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
2777         (WebCore::DeviceOrientationEvent::absolute):
2778         * dom/DeviceOrientationEvent.h:
2779         Implement IDL interface.
2780
2781         * dom/DeviceOrientationEvent.idl:
2782         Update IDL to specify the correct nullability of attributes and arguments.
2783
2784         * platform/ios/DeviceMotionClientIOS.mm:
2785         (WebCore::DeviceMotionClientIOS::motionChanged):
2786         * platform/ios/DeviceOrientationClientIOS.mm:
2787         (WebCore::DeviceOrientationClientIOS::orientationChanged):
2788         Update for use of std:optional.
2789
2790 2017-01-13  Zan Dobersek  <zdobersek@igalia.com>
2791
2792         [GStreamer] Cache the accelerated capability of MediaPlayerClient in MediaPlayerPrivateGStreamerBase
2793         https://bugs.webkit.org/show_bug.cgi?id=167015
2794
2795         Reviewed by Jer Noble.
2796
2797         In MediaPlayerPrivateGStreamerBase, avoid continuously querying the MediaPlayerClient
2798         object about the accelerated compositing capabilities. Instead, cache this information
2799         when creating the video sink (which is most affected by this information anyway), storing
2800         it in a new protected boolean member variable in the MediaPlayerPrivateGStreamerBase class.
2801
2802         All calls to MediaPlayerClient::mediaPlayerRenderingCanBeAccelerated() and
2803         MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled() are replaced by tests
2804         on the value of this new member variable.
2805
2806         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2807         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2808         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2809         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
2810         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2811         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2812         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2813         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2814         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2815
2816 2017-01-13  Chris Dumez  <cdumez@apple.com>
2817
2818         Report post-page load CPU usage using diagnostic logging
2819         https://bugs.webkit.org/show_bug.cgi?id=166950
2820         <rdar://problem/30014496>
2821
2822         Reviewed by Alex Christensen.
2823
2824         Shortly after page load (5 seconds), we measure the WebContent process'
2825         CPU usage over 10 seconds and report the percentage back via release
2826         logging. We also log the percentage using diagnostic logging using the
2827         following buckets:
2828         - Below 10%
2829         - 10 to 20%
2830         - 20 to 40%
2831         - 60 to 80%
2832         - Over 80%
2833
2834         The logging works on both Mac and iOS. I verified that I get results
2835         consistent with Activity Monitor or top.
2836
2837         No new tests, no Web-facing behavior change, only extra logging.
2838
2839         * CMakeLists.txt:
2840         * WebCore.xcodeproj/project.pbxproj:
2841         * loader/FrameLoader.cpp:
2842         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2843         * page/DiagnosticLoggingKeys.cpp:
2844         (WebCore::DiagnosticLoggingKeys::postPageLoadKey):
2845         (WebCore::DiagnosticLoggingKeys::cpuUsageKey):
2846         * page/DiagnosticLoggingKeys.h:
2847         * page/Page.cpp:
2848         (WebCore::Page::Page):
2849         (WebCore::Page::didFinishLoad):
2850         (WebCore::cpuUsageToDiagnosticLogginKey):
2851         (WebCore::Page::measurePostLoadCPUUsage):
2852         * page/Page.h:
2853         * page/Settings.cpp:
2854         (WebCore::Settings::isPostLoadCPUUsageMeasurementEnabled):
2855         * page/Settings.h:
2856         * platform/CPUTime.cpp: Added.
2857         (WebCore::getCPUTime):
2858         (WebCore::CPUTime::percentageCPUUsageSince):
2859         * platform/CPUTime.h: Added.
2860         * platform/cocoa/CPUTimeCocoa.mm: Added.
2861         (WebCore::timeValueToMicroseconds):
2862         (WebCore::getCPUTime):
2863
2864 2017-01-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2865
2866         Unreviewed, rolling out r210677.
2867         https://bugs.webkit.org/show_bug.cgi?id=167007
2868
2869         Caused many layout test timeouts on GTK+ bots
2870
2871         Reverted changeset:
2872
2873         "Protect MediaPlayer from being destroyed mid-load()"
2874         https://bugs.webkit.org/show_bug.cgi?id=166976
2875         http://trac.webkit.org/changeset/210677
2876
2877 2017-01-13  Konstantin Tokarev  <annulen@yandex.ru>
2878
2879         Added preprocessor guard for iOS-specific piece of code in GraphicsContext3DOpenGL
2880         https://bugs.webkit.org/show_bug.cgi?id=167005
2881
2882         Reviewed by Alex Christensen.
2883
2884         Variable "boundFrameBuffer" is used only in iOS-specific code
2885
2886         No new tests needed.
2887
2888         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2889         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2890
2891 2017-01-13  Eric Carlson  <eric.carlson@apple.com>
2892
2893         REGRESSION (r210621): [mac-wk2] LayoutTest fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html timing out
2894         https://bugs.webkit.org/show_bug.cgi?id=166980
2895
2896         Unreviewed, fix test broken by r210621.
2897
2898         No new tests, updated fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
2899         and results.
2900
2901         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2902         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
2903           Drive-by fix: null-check parent.
2904         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Do nothing if the layer
2905           has changed since the KVO notification.
2906
2907 2017-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2908
2909         [SOUP] Simplify cookie storage handling
2910         https://bugs.webkit.org/show_bug.cgi?id=166967
2911
2912         Reviewed by Sergio Villar Senin.
2913
2914         We currently have a global cookie storage, and several create() methods in SoupNetworkSession to create sessions
2915         with different cookie jars. This could be simplified by moving the cookie storage handling to
2916         NetworkStorageSession and removing all create() methods from SoupNetworkSession. This patch also removes the
2917         default SoupNetworkSession in favor of using the default NetworkStorageSession.
2918
2919         * platform/network/NetworkStorageSession.h: Add a default cookie storage to be used when the
2920         NetworkStorageSession doesn't have a platform soup session.
2921         * platform/network/soup/CookieJarSoup.cpp: Remove the global cookie storage handling.
2922         (WebCore::setCookiesFromDOM): Use NetworkStorageSession::cookieStorage() instead.
2923         (WebCore::cookiesForSession): Ditto.
2924         (WebCore::cookiesEnabled): Check the policy instead like all other ports do, since now we will always have a
2925         default shared cookie jar.
2926         (WebCore::getRawCookies): Use NetworkStorageSession::cookieStorage() instead.
2927         (WebCore::deleteCookie): Ditto.
2928         (WebCore::addCookie): Ditto.
2929         (WebCore::getHostnamesWithCookies): Ditto.
2930         (WebCore::deleteCookiesForHostnames): Ditto.
2931         (WebCore::deleteAllCookies): Ditto.
2932         * platform/network/soup/CookieJarSoup.h: Removed.
2933         * platform/network/soup/CookieStorageSoup.cpp:
2934         (WebCore::soupCookiesChanged): Use the cookie storage from the NetworkStorageSession::defaultStorageSession().
2935         (WebCore::startObservingCookieChanges): Ditto.
2936         (WebCore::stopObservingCookieChanges): Ditto.
2937         * platform/network/soup/DNSSoup.cpp:
2938         (WebCore::DNSResolveQueue::updateIsUsingProxy): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
2939         (WebCore::DNSResolveQueue::platformResolve): Ditto.
2940         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2941         (WebCore::NetworkStorageSession::NetworkStorageSession):
2942         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Create a new SoupNetworkSession without
2943         providing a cookie storage to ensure it creates its own private one.
2944         (WebCore::NetworkStorageSession::switchToNewTestingSession): Ditto.
2945         (WebCore::NetworkStorageSession::soupNetworkSession): Create the SoupNetworkSession on demand passing the global
2946         shared cookie storage.
2947         (WebCore::NetworkStorageSession::cookieStorage): Return the cookie storage from the SoupNetworkSession if we
2948         have one, otherwise create the global shared one and return it.
2949         * platform/network/soup/ResourceHandleSoup.cpp:
2950         (WebCore::sessionFromContext): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
2951         * platform/network/soup/SoupNetworkSession.cpp:
2952         (WebCore::SoupNetworkSession::SoupNetworkSession): Remove all create methods and the unused constructor that
2953         receives a SoupSession. Allow to pass a nullptr SoupCookieJar and create one in such case.
2954         * platform/network/soup/SoupNetworkSession.h:
2955
2956 2017-01-12  Tim Horton  <timothy_horton@apple.com>
2957
2958         Keyboard accessory bar can appear on top of full-screen video
2959         https://bugs.webkit.org/show_bug.cgi?id=166902
2960         <rdar://problem/29668223>
2961
2962         Reviewed by Darin Adler.
2963
2964         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2965         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
2966         Increase the full-screen video window level to one above the keyboard,
2967         to ensure that the video is never obscured by the keyboard or its
2968         accessory views.
2969
2970 2017-01-12  Joseph Pecoraro  <pecoraro@apple.com>
2971
2972         Remove unnecessary includes of Page.h
2973         https://bugs.webkit.org/show_bug.cgi?id=166996
2974
2975         Reviewed by Yusuke Suzuki.
2976
2977         * Modules/plugins/QuickTimePluginReplacement.mm:
2978         * Modules/plugins/YouTubePluginReplacement.cpp:
2979         * Modules/webdatabase/Database.cpp:
2980         * Modules/webdatabase/DatabaseTracker.cpp:
2981         * Modules/webdriver/NavigatorWebDriver.cpp:
2982         * accessibility/AccessibilityNodeObject.cpp:
2983         * dom/Range.cpp:
2984         * dom/ScriptElement.cpp:
2985         * dom/ViewportArguments.cpp:
2986         * html/HTMLBodyElement.cpp:
2987         * html/HTMLCanvasElement.cpp:
2988         * html/HTMLDocument.cpp:
2989         * html/HTMLFormControlElementWithState.cpp:
2990         * html/HTMLImageElement.cpp:
2991         * html/HTMLLinkElement.cpp:
2992         * html/PluginDocument.cpp:
2993         * inspector/InspectorApplicationCacheAgent.cpp:
2994         * loader/LoadTiming.cpp:
2995         * loader/cache/CachedImage.cpp:
2996         * loader/cache/CachedResource.cpp:
2997         * page/DeviceController.cpp:
2998         * page/TextIndicator.cpp:
2999         * page/efl/DragControllerEfl.cpp:
3000         * platform/audio/ios/AudioDestinationIOS.cpp:
3001         * platform/ios/PasteboardIOS.mm:
3002         * platform/ios/ScrollAnimatorIOS.mm:
3003         * platform/ios/WidgetIOS.mm:
3004         * platform/mac/PasteboardMac.mm:
3005         * platform/network/mac/ResourceHandleMac.mm:
3006         * platform/win/MainThreadSharedTimerWin.cpp:
3007         * platform/win/PasteboardWin.cpp:
3008         * platform/win/PlatformScreenWin.cpp:
3009         * platform/win/WidgetWin.cpp:
3010         * rendering/InlineBox.cpp:
3011         * rendering/RenderAttachment.cpp:
3012         * rendering/RenderBoxModelObject.cpp:
3013         * rendering/RenderIFrame.cpp:
3014         * rendering/RenderInline.cpp:
3015         * rendering/RenderReplaced.cpp:
3016         * rendering/RenderTextControlSingleLine.cpp:
3017         * rendering/RootInlineBox.cpp:
3018         * rendering/svg/RenderSVGResourceFilter.cpp:
3019         * rendering/svg/SVGRenderingContext.cpp:
3020         * style/StyleScope.cpp:
3021         * svg/SVGDocumentExtensions.cpp:
3022         * svg/graphics/SVGImageCache.cpp:
3023         * xml/XSLTProcessor.cpp:
3024         * xml/parser/XMLDocumentParserLibxml2.cpp:
3025
3026 2017-01-12  Chris Dumez  <cdumez@apple.com>
3027
3028         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
3029         https://bugs.webkit.org/show_bug.cgi?id=166995
3030
3031         Reviewed by Jer Noble.
3032
3033         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
3034         as some people are having trouble building without it.
3035
3036         * Configurations/FeatureDefines.xcconfig:
3037
3038 2017-01-12  Ryan Haddad  <ryanhaddad@apple.com>
3039
3040         Unreviewed, rolling out r210680.
3041
3042         This change caused LayoutTest timeouts and assertion failures.
3043
3044         Reverted changeset:
3045
3046         "Use GenericEventQueue rather than callOnMainThread to
3047         schedule events in AudioScheduledSourceNode."
3048         https://bugs.webkit.org/show_bug.cgi?id=166983
3049         http://trac.webkit.org/changeset/210680
3050
3051 2017-01-12  Chris Dumez  <cdumez@apple.com>
3052
3053         [iOS] HTML form validation popover sometimes does not go away
3054         https://bugs.webkit.org/show_bug.cgi?id=166990
3055         <rdar://problem/29985957>
3056
3057         Reviewed by Tim Horton.
3058
3059         The issue was that [UIViewController presentViewController:] is asynchronous
3060         and that we sometimes tried to call [m_popoverController dismissViewControllerAnimated:]
3061         before presentViewController had completed. This is something that UIKit does
3062         not handle nicely and the popover just stays visible even though we have
3063         asked for the controller to be dismissed and destroyed the ValidationBubble
3064         object.
3065
3066         To address the issue, I made ValidationBubble RefCounted and make sure the
3067         ValidationBubble object stays alive at least until the completion handler for
3068         [UIViewController presentViewController:] has been called. This is done via
3069         protecting the object using a RefPtr<> and capturing it in the lambda.
3070         Because dismissViewControllerAnimated is called in the destructor, it is no
3071         longer possible to call dismissViewControllerAnimated before the call to
3072         presentViewController has completed.
3073
3074         No new tests, no easily testable since the popover was staying visible
3075         after being destroyed (held on by UIKit).
3076
3077         * platform/ValidationBubble.h:
3078         (WebCore::ValidationBubble::create):
3079         * platform/ios/ValidationBubbleIOS.mm:
3080         (WebCore::ValidationBubble::show):
3081
3082 2017-01-12  Andreas Kling  <akling@apple.com>
3083
3084         [iOS] Purge GraphicsServices font cache on memory warning.
3085         <https://webkit.org/b/154343>
3086
3087         Reviewed by Antti Koivisto.
3088
3089         The GS font cache was retaining CSS fonts after we stopped using them.
3090         Call SPI to release them on memory pressure. This is one of multiple
3091         steps necessary to actually free the fonts.
3092
3093         * Configurations/WebCore.xcconfig:
3094         * page/cocoa/MemoryReleaseCocoa.mm:
3095         (WebCore::platformReleaseMemory):
3096         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3097         * platform/spi/ios/GraphicsServicesSPI.h:
3098
3099 2017-01-12  Chris Dumez  <cdumez@apple.com>
3100
3101         Unreviewed EFL/GTK build fix after r210684.
3102
3103         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3104         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
3105
3106 2017-01-12  Brady Eidson  <beidson@apple.com>
3107
3108         REGRESSION (r209977): Crash in UniqueIDBDatabase::executeNextDatabaseTask.
3109         https://bugs.webkit.org/show_bug.cgi?id=166984
3110
3111         Reviewed by Alex Christensen.
3112
3113         No new tests (Unable to reproduce, speculative fix).
3114
3115         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3116         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): If we're not already prefetching for this cursor,
3117           starting doing so after holding a protector ref.
3118         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): If we're now done prefetching for this cursor,
3119           schedule the protector ref to be destroyed on the main thread.
3120         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3121
3122 2017-01-12  Youenn Fablet  <youenn@apple.com>
3123
3124         Make ApplicationCacheHost::maybeLoadSynchronously more robust
3125         https://bugs.webkit.org/show_bug.cgi?id=165192
3126
3127         Reviewed by Alex Christensen.
3128
3129         No change of behavior.
3130         Currently, in case out parameter "data" is not null and shouldLoadResourceFromApplicationCache returns false and resource is null, we might dereference a null pointer when calling maybeLoadSynchronously.
3131         We refactor the code to ensure that this case cannot happen anymore.
3132
3133         * loader/appcache/ApplicationCacheHost.cpp:
3134         (WebCore::bufferFromResource):
3135         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
3136
3137 2017-01-12  Alex Christensen  <achristensen@webkit.org>
3138
3139         Update style of ResourceHandleInternal
3140         https://bugs.webkit.org/show_bug.cgi?id=166952
3141
3142         Reviewed by Andreas Kling.
3143
3144         No change in behavior.  Just un-indent and use initializer lists.
3145
3146         * platform/network/ResourceHandleInternal.h:
3147         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3148         (WebCore::ResourceHandleInternal::client):
3149
3150 2017-01-12  Jer Noble  <jer.noble@apple.com>
3151
3152         Use GenericEventQueue rather than callOnMainThread to schedule events in AudioScheduledSourceNode.
3153         https://bugs.webkit.org/show_bug.cgi?id=166983
3154
3155         Reviewed by Brent Fulgham.
3156
3157         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3158         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
3159         (WebCore::AudioScheduledSourceNode::finish):
3160         * Modules/webaudio/AudioScheduledSourceNode.h:
3161
3162 2017-01-12  Youenn Fablet  <youenn@apple.com>
3163
3164         OneDrive application crashes upon launch
3165         https://bugs.webkit.org/show_bug.cgi?id=166975
3166
3167         Reviewed by Brady Eidson.
3168
3169         Checking whether load is terminated just after calling ResourceLoader::willSendRequestInternal.
3170         The reason is that delegate call may actually cancel the load at that point.
3171
3172         * loader/SubresourceLoader.cpp:
3173         (WebCore::SubresourceLoader::willSendRequestInternal):
3174
3175 2017-01-12  Jer Noble  <jer.noble@apple.com>
3176
3177         Protect MediaPlayer from being destroyed mid-load()
3178         https://bugs.webkit.org/show_bug.cgi?id=166976
3179
3180         Reviewed by Eric Carlson.
3181
3182         It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
3183         MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
3184         previously protected against this same problem in HTMLMediaElement::loadResource()
3185         by ref'ing at the beginning of the function and deref'ing on exit. To do the
3186         same in MediaPlayer, it must become RefCounted.
3187
3188         To keep the same semantics about m_client in MediaPlayer (always available without
3189         requiring a null-check), make a new static MediaPlayerClient object which can
3190         replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.
3191
3192         * html/HTMLMediaElement.cpp:
3193         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3194         (WebCore::HTMLMediaElement::clearMediaPlayer):
3195         (WebCore::HTMLMediaElement::createMediaPlayer):
3196         * html/HTMLMediaElement.h:
3197         * platform/graphics/MediaPlayer.cpp:
3198         (WebCore::nullMediaPlayerClient):
3199         (WebCore::MediaPlayer::create):
3200         (WebCore::MediaPlayer::MediaPlayer):
3201         (WebCore::MediaPlayer::invalidate):
3202         (WebCore::MediaPlayer::load):
3203         (WebCore::MediaPlayer::loadWithNextMediaEngine):
3204         (WebCore::MediaPlayer::inMediaDocument):
3205         (WebCore::MediaPlayer::fullscreenMode):
3206         (WebCore::MediaPlayer::requestedRate):
3207         (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
3208         (WebCore::MediaPlayer::networkStateChanged):
3209         (WebCore::MediaPlayer::readyStateChanged):
3210         (WebCore::MediaPlayer::volumeChanged):
3211         (WebCore::MediaPlayer::muteChanged):
3212         (WebCore::MediaPlayer::timeChanged):
3213         (WebCore::MediaPlayer::sizeChanged):
3214         (WebCore::MediaPlayer::repaint):
3215         (WebCore::MediaPlayer::durationChanged):
3216         (WebCore::MediaPlayer::rateChanged):
3217         (WebCore::MediaPlayer::playbackStateChanged):
3218         (WebCore::MediaPlayer::firstVideoFrameAvailable):
3219         (WebCore::MediaPlayer::characteristicChanged):
3220         (WebCore::MediaPlayer::cachedKeyForKeyId):
3221         (WebCore::MediaPlayer::keyNeeded):
3222         (WebCore::MediaPlayer::mediaKeysStorageDirectory):
3223         (WebCore::MediaPlayer::referrer):
3224         (WebCore::MediaPlayer::userAgent):
3225         (WebCore::MediaPlayer::graphicsDeviceAdapter):
3226         (WebCore::MediaPlayer::cachedResourceLoader):
3227         (WebCore::MediaPlayer::createResourceLoader):
3228         (WebCore::MediaPlayer::addAudioTrack):
3229         (WebCore::MediaPlayer::removeAudioTrack):
3230         (WebCore::MediaPlayer::addTextTrack):
3231         (WebCore::MediaPlayer::removeTextTrack):
3232         (WebCore::MediaPlayer::addVideoTrack):
3233         (WebCore::MediaPlayer::removeVideoTrack):
3234         (WebCore::MediaPlayer::outOfBandTrackSources):
3235         (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
3236         (WebCore::MediaPlayer::handlePlaybackCommand):
3237         (WebCore::MediaPlayer::sourceApplicationIdentifier):
3238         (WebCore::MediaPlayer::preferredAudioCharacteristics):
3239         (WebCore::MediaPlayer::doesHaveAttribute):
3240         (WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
3241         (WebCore::MediaPlayer::getRawCookies):
3242         (WebCore::MediaPlayer::shouldDisableSleep):
3243         * platform/graphics/MediaPlayer.h:
3244         (WebCore::MediaPlayer::platformVolumeConfigurationRequired):
3245         (WebCore::MediaPlayer::client):
3246
3247 2017-01-12  Sam Weinig  <sam@webkit.org>
3248
3249         Update bindings test results.
3250
3251         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3252         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
3253         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
3254         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3255         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3256         (WebCore::JSTestEventTarget::getOwnPropertySlot):
3257         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
3258         (WebCore::JSTestEventTarget::getOwnPropertyNames):
3259         * bindings/scripts/test/JS/JSTestEventTarget.h:
3260         * bindings/scripts/test/JS/JSTestInterface.cpp:
3261         (WebCore::JSTestInterface::put):
3262         (WebCore::JSTestInterface::putByIndex):
3263         * bindings/scripts/test/JS/JSTestInterface.h:
3264         * bindings/scripts/test/JS/JSTestObj.cpp:
3265         (WebCore::JSTestObj::getOwnPropertySlot):
3266         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
3267         (WebCore::JSTestObj::getOwnPropertyNames):
3268         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3269         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
3270         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlotByIndex):
3271         (WebCore::JSTestOverrideBuiltins::getOwnPropertyNames):
3272         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3273
3274 2017-01-12  Zan Dobersek  <zdobersek@igalia.com>
3275
3276         [GTK] WebKitWebProcess at 100% CPU loading hyphenation dictionaries
3277         https://bugs.webkit.org/show_bug.cgi?id=165601
3278
3279         Reviewed by Carlos Garcia Campos.
3280
3281         In HyphenationLibHyphen, retrieve the canonicalized absolute pathname of the dictionary file
3282         in order to avoid storing symbolic links as the target files for specific locales. libhyphen
3283         distributes its dictionary files by linking a set of similar locales files to a single file.
3284         Not resolving those symbolic links means we'll be opening a single file via multiple
3285         HyphenationDictionary objects, which is far from optimal.
3286
3287         To add insult to injury, these HyphenationDictionary objects were stored in a TinyLRUCache
3288         with a slim capacity of 4. This meant that while already loading one single file through
3289         multiple symlinks, because of continuous eviciton from this LRU cache the same symlinks
3290         continued to be processed, in some cases resulting in opening the same dictionary file
3291         hundreds or thousands of times. The capacity of this TinyLRUCache is increased to 32
3292         to keep the amount of open libhyphen dictionaries capped at some reasonable number.
3293
3294         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3295         (WebCore::scanDirectoryForDicionaries):
3296
3297 2017-01-12  Javier Fernandez  <jfernandez@igalia.com>
3298
3299         [css-grid] Make the grid sizing data persistent through layouts
3300         https://bugs.webkit.org/show_bug.cgi?id=166883
3301
3302         Reviewed by Darin Adler and Manuel Rego Casasnovas.
3303
3304         We want to keep the grid sizing data structures through different
3305         layouts. This will allow to optimize some operations, reusing
3306         these data while still valid. Additionally, operations like
3307         determining the baseline position when the grid container is under
3308         an inline formatting context need these data once the grid has
3309         been laid out.
3310
3311         This patch controls the sizing data validity and make the data
3312         structures persistent after layout.
3313
3314         Tests: fast/css-grid-layout/grid-add-item-with-positioned-items.html
3315                fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html
3316                fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
3317                fast/css-grid-layout/grid-item-change-order-auto-flow.html
3318
3319         * rendering/RenderBox.cpp:
3320         (WebCore::RenderBox::styleDidChange): Evaluate if the style change made the grid data invalid.
3321         (WebCore::RenderBox::updateGridPositionAfterStyleChange): Evaluate if the style change made the grid data invalid.
3322         * rendering/RenderBox.h:
3323         * rendering/RenderGrid.cpp:
3324         (WebCore::RenderGrid::Grid::setNeedsItemsPlacement): The grid must execute the items placement logic before continue processing the layout.
3325         (WebCore::RenderGrid::addChild): Mark the grid data as dirty.
3326         (WebCore::RenderGrid::removeChild): Mark the grid data as dirty.
3327         (WebCore::RenderGrid::styleDidChange): Evaluate grid data validity.
3328         (WebCore::RenderGrid::explicitGridDidResize): Mark the grid data as dirty.
3329         (WebCore::RenderGrid::namedGridLinesDefinitionDidChange): Mark the grid data as dirty.
3330         (WebCore::RenderGrid::layoutBlock): We don't need to clear the grid data anymore.
3331         (WebCore::RenderGrid::dirtyGrid): Clearing the grid data and mark is as needing to execute the items placement logic.
3332         (WebCore::RenderGrid::trackSizesForComputedStyle): Assert we don't need to perform the items placement logic.
3333         (WebCore::RenderGrid::paintChildren): Assert we don't need to perform the items placement logic.
3334         * rendering/RenderGrid.h:
3335         (WebCore::RenderGrid::clear): Deleted.
3336
3337 2017-01-12  Chris Dumez  <cdumez@apple.com>
3338
3339         [iOS] Implement support for KeyboardEvent.code
3340         https://bugs.webkit.org/show_bug.cgi?id=166932
3341         <rdar://problem/29972518>
3342
3343         Reviewed by Darin Adler.
3344
3345         Implement support for KeyboardEvent.code on iOS.
3346
3347         No new tests, updated existing test.
3348
3349         * platform/ios/PlatformEventFactoryIOS.h:
3350         * platform/ios/PlatformEventFactoryIOS.mm:
3351         (WebCore::codeForKeyEvent):
3352         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3353
3354 2017-01-12  Sam Weinig  <sam@webkit.org>
3355
3356         [WebIDL] Autogenerate named getters
3357         https://bugs.webkit.org/show_bug.cgi?id=166835
3358
3359         Reviewed by Alex Christensen.
3360
3361         * Modules/mediastream/RTCStatsResponse.idl:
3362         Update type to be nullable, since generator expects that for now.
3363
3364         * WebCore.xcodeproj/project.pbxproj:
3365         * bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
3366         * bindings/js/JSDOMMimeTypeArrayCustom.cpp: Removed.
3367         * bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Removed.
3368         * bindings/js/JSDOMPluginArrayCustom.cpp: Removed.
3369         * bindings/js/JSDOMPluginCustom.cpp: Removed.
3370         * bindings/js/JSNamedNodeMapCustom.cpp: Removed.
3371         * bindings/js/JSRTCStatsResponseCustom.cpp: Removed.
3372         * bindings/js/JSStyleSheetListCustom.cpp: Removed.
3373         Remove deleted files.
3374
3375         * bindings/js/JSSQLStatementErrorCallbackCustom.cpp: 
3376         Renamed from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp for consistency.
3377
3378         * bindings/IDLTypes.h:
3379         (WebCore::IDLNullable::nullValue):
3380         (WebCore::IDLNullable::isNullValue):
3381         (WebCore::IDLNullable::extractValueFromNullable):
3382         Add Nullable traits for IDLNullable, that call down to the underlying type. This allows
3383         us to more easily tests for nullability without stripping the IDLNullable off.
3384