4811df7cbf259367d6a299b7e70e524906035e13
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Seeking video doesn't update seek position
4         https://bugs.webkit.org/show_bug.cgi?id=162575
5         <rdar://problem/28457219>
6
7         Reviewed by Jer Noble.
8
9         On ToT, seeking in a video causes the playhead to stutter, and does not actually update media remote's seek
10         position. This is partly due to how we do not update media remote with new information when beginning to respond
11         to remote seek commands, so media remote continues to think that a playing video is still playing despite the
12         user attempting to seek through it.
13
14         To fix this, we introduce timer-based guards around remote seek commands, such that a seek "gesture" begins when
15         we receive the first seek command and ends when no seek command has been received in a set amount of time (this
16         is 0.5 seconds, which is approximately what other clients around the platform use).
17
18         Also, when responding to a remote seek, perform the seek with no tolerance. This prevents the playhead from
19         stuttering at the end of a seek from the final requested destination of the seek to the last actually seeked
20         time in the video.
21
22         When beginning to seek, we must pause the media. Through existing mechanisms, this causes the media session
23         manager to update its Now Playing information, which informs media remote that we are no longer playing and
24         prevents us from stuttering. However, when ending a seek, we must also trigger an additional update to again
25         refresh media remote's view of the current time. This prevents a flicker when playing media after seeking.
26
27         Unit tests to be added in a follow-up due to time constraints.
28
29         * html/HTMLMediaElement.cpp:
30         (WebCore::HTMLMediaElement::HTMLMediaElement):
31         (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
32         (WebCore::HTMLMediaElement::seekToPlaybackPositionEndedTimerFired):
33         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
34         * html/HTMLMediaElement.h:
35         * platform/audio/PlatformMediaSessionManager.h:
36         (WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo):
37         (WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
38         (WebCore::PlatformMediaSessionManager::sessions): Deleted.
39         * platform/audio/mac/MediaSessionManagerMac.h:
40         * platform/audio/mac/MediaSessionManagerMac.mm:
41         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
42         (WebCore::MediaSessionManagerMac::scheduleUpdateNowPlayingInfo):
43         (WebCore::MediaSessionManagerMac::sessionDidEndRemoteScrubbing):
44         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
45
46 2016-09-26  Chris Dumez  <cdumez@apple.com>
47
48         [WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
49         https://bugs.webkit.org/show_bug.cgi?id=162568
50
51         Reviewed by Alex Christensen.
52
53         Update BlobResourceHandle to wait for continueDidReceiveResponse() to be
54         called after it calls the client's didReceiveResponseAsync(), before
55         actually reading the Blob Data.
56
57         No new tests, covered by existing tests.
58
59         * platform/network/BlobResourceHandle.cpp:
60         (WebCore::BlobResourceHandle::continueDidReceiveResponse):
61         (WebCore::BlobResourceHandle::getSizeForNext):
62         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
63         (WebCore::BlobResourceHandle::notifyResponseOnError):
64
65 2016-09-26  Daniel Bates  <dabates@apple.com>
66
67         Mark Ping{Handle, Load} as final
68         https://bugs.webkit.org/show_bug.cgi?id=162576
69
70         Reviewed by Alex Christensen.
71
72         We should not support subclassing of a ping handle or overriding its ResourceHandleClient
73         callbacks because there are security/privacy implications with a ping request. We should
74         not encourage subclassing without careful consideration.
75
76         * platform/network/PingHandle.h:
77
78 2016-09-26  Daniel Bates  <dabates@apple.com>
79
80         Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
81         https://bugs.webkit.org/show_bug.cgi?id=162365
82
83         Reviewed by Simon Fraser.
84
85         Repurpose the feature name TEXT_AUTOSIZING for the ENABLE(IOS_TEXT_AUTOSIZING)-guarded code
86         as this code represents WebKit's automatic text size adjustment machinery and is compiled
87         on both macOS and iOS.
88
89         * Configurations/FeatureDefines.xcconfig:
90         * css/CSSComputedStyleDeclaration.cpp:
91         (WebCore::ComputedStyleExtractor::propertyValue):
92         * css/CSSPropertyNames.in:
93         * css/StyleBuilderCustom.h:
94         * css/StyleResolver.cpp:
95         (WebCore::StyleResolver::updateFont):
96         * css/StyleResolver.h:
97         * css/parser/CSSParser.cpp:
98         (WebCore::CSSParserContext::CSSParserContext):
99         (WebCore::CSSParser::parseValue):
100         * css/parser/CSSParser.h:
101         * css/parser/CSSParserMode.h:
102         * dom/Document.cpp:
103         (WebCore::Document::destroyRenderTree):
104         * dom/Document.h:
105         * editing/EditingStyle.cpp:
106         * page/FrameView.cpp:
107         (WebCore::FrameView::layout):
108         * page/Page.cpp:
109         (WebCore::Page::Page):
110         * page/Page.h:
111         * page/Settings.in:
112         * platform/graphics/FontCascade.h:
113         * platform/graphics/FontDescription.cpp:
114         * platform/graphics/FontDescription.h:
115         * rendering/RenderBlockFlow.cpp:
116         (WebCore::RenderBlockFlow::RenderBlockFlow):
117         * rendering/RenderBlockFlow.h:
118         * rendering/RenderElement.cpp:
119         * rendering/RenderElement.h:
120         * rendering/RenderObject.cpp:
121         * rendering/RenderObject.h:
122         * rendering/RenderText.cpp:
123         (WebCore::RenderText::RenderText):
124         * rendering/RenderText.h:
125         * rendering/TextAutoSizing.cpp:
126         * rendering/TextAutoSizing.h:
127         * rendering/style/RenderStyle.cpp:
128         (WebCore::RenderStyle::changeRequiresLayout):
129         * rendering/style/RenderStyle.h:
130         * rendering/style/StyleInheritedData.cpp:
131         (WebCore::StyleInheritedData::StyleInheritedData):
132         (WebCore::StyleInheritedData::operator==):
133         * rendering/style/StyleInheritedData.h:
134         * rendering/style/StyleRareInheritedData.cpp:
135         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
136         (WebCore::StyleRareInheritedData::operator==):
137         * rendering/style/StyleRareInheritedData.h:
138         * rendering/style/TextSizeAdjustment.h:
139         * testing/InternalSettings.cpp:
140         (WebCore::InternalSettings::Backup::Backup):
141         (WebCore::InternalSettings::Backup::restoreTo):
142         (WebCore::InternalSettings::setTextAutosizingEnabled):
143         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
144         * testing/InternalSettings.h:
145
146 2016-09-26  Nan Wang  <n_wang@apple.com>
147
148         AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
149         https://bugs.webkit.org/show_bug.cgi?id=162573
150
151         Reviewed by Chris Fleizach.
152
153         Exposed the label element's text as the AXTitle of the progress indicator.
154
155         Test: accessibility/mac/progress-with-label-element.html
156
157         * accessibility/AccessibilityNodeObject.cpp:
158         (WebCore::AccessibilityNodeObject::titleElementText):
159         (WebCore::AccessibilityNodeObject::title):
160
161 2016-09-26  Ryan Haddad  <ryanhaddad@apple.com>
162
163         Rebaseline bindings tests after r206386.
164
165         Unreviewed test gardening.
166
167         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
168         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
169         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
170         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
171         * bindings/scripts/test/JS/JSTestInterface.cpp:
172         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
173         * bindings/scripts/test/JS/JSTestNode.cpp:
174         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
175         * bindings/scripts/test/JS/JSTestObj.cpp:
176         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
177         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
178         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
179         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
180         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
181
182 2016-09-26  Youenn Fablet  <youenn@apple.com>
183
184         ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
185         https://bugs.webkit.org/show_bug.cgi?id=162472
186         <rdar://problem/28431522>
187
188         Reviewed by Chris Dumez.
189
190         Covered by existing tests.
191
192         * loader/cache/CachedImage.cpp:
193         (WebCore::CachedImage::CachedImage): Fixing the last CachedImage constructor.
194         Using CachedResource protected constructor.
195         * loader/cache/CachedResource.h: Small clean-up.
196
197 2016-09-26  Youenn Fablet  <youenn@apple.com>
198
199         [GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
200         https://bugs.webkit.org/show_bug.cgi?id=162547
201
202         Reviewed by Carlos Garcia Campos.
203
204         Covered by LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html now passing.
205
206         * platform/network/soup/SoupNetworkSession.cpp:
207         (WebCore::SoupNetworkSession::createTestingSession): Setting a default Accept-Language value.
208
209 2016-09-26  Mark Lam  <mark.lam@apple.com>
210
211         Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
212         https://bugs.webkit.org/show_bug.cgi?id=162521
213
214         Reviewed by Saam Barati.
215
216         No new tests because this patch is mostly refactoring.  The only change in
217         behavior is that functions that have a JSValue return type will now return the
218         empty JSValue when an exception is thrown.  I tested this behavior by running
219         the existing JSC and layout tests.
220
221         * bindings/js/ArrayValue.cpp:
222         (WebCore::ArrayValue::get):
223         * bindings/js/IDBBindingUtilities.cpp:
224         (WebCore::toJS):
225         * bindings/js/JSApplePaySessionCustom.cpp:
226         (WebCore::JSApplePaySession::completeShippingMethodSelection):
227         (WebCore::JSApplePaySession::completeShippingContactSelection):
228         (WebCore::JSApplePaySession::completePaymentMethodSelection):
229         * bindings/js/JSAudioTrackCustom.cpp:
230         (WebCore::JSAudioTrack::setKind):
231         (WebCore::JSAudioTrack::setLanguage):
232         * bindings/js/JSBlobCustom.cpp:
233         (WebCore::constructJSBlob):
234         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
235         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
236         * bindings/js/JSCommandLineAPIHostCustom.cpp:
237         (WebCore::getJSListenerFunctions):
238         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
239         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
240         (WebCore::getHashAlgorithm):
241         (WebCore::createAesCbcParams):
242         (WebCore::createAesKeyGenParams):
243         (WebCore::createHmacKeyParams):
244         (WebCore::createRsaKeyGenParams):
245         (WebCore::createRsaOaepParams):
246         * bindings/js/JSCryptoKeySerializationJWK.cpp:
247         (WebCore::getStringFromJSON):
248         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
249         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
250         (WebCore::buildJSONForRSAComponents):
251         (WebCore::addUsagesToJSON):
252         (WebCore::JSCryptoKeySerializationJWK::serialize):
253         * bindings/js/JSCustomElementInterface.cpp:
254         (WebCore::constructCustomElementSynchronously):
255         (WebCore::JSCustomElementInterface::upgradeElement):
256         * bindings/js/JSCustomElementRegistryCustom.cpp:
257         (WebCore::getCustomElementCallback):
258         (WebCore::JSCustomElementRegistry::define):
259         (WebCore::whenDefinedPromise):
260         * bindings/js/JSDOMBinding.cpp:
261         (WebCore::valueToUSVString):
262         (WebCore::hasIteratorMethod):
263         (WebCore::toSmallerInt):
264         (WebCore::toSmallerUInt):
265         (WebCore::toInt32EnforceRange):
266         (WebCore::toUInt32EnforceRange):
267         (WebCore::toInt64EnforceRange):
268         (WebCore::toUInt64EnforceRange):
269         * bindings/js/JSDOMBinding.h:
270         (WebCore::toJSSequence):
271         (WebCore::toJS):
272         (WebCore::jsFrozenArray):
273         * bindings/js/JSDOMPromise.cpp:
274         (WebCore::rejectPromiseWithExceptionIfAny):
275         * bindings/js/JSDOMStringMapCustom.cpp:
276         (WebCore::JSDOMStringMap::putDelegate):
277         * bindings/js/JSDOMWindowCustom.cpp:
278         (WebCore::JSDOMWindow::setLocation):
279         (WebCore::JSDOMWindow::open):
280         (WebCore::JSDOMWindow::showModalDialog):
281         (WebCore::handlePostMessage):
282         (WebCore::JSDOMWindow::setTimeout):
283         (WebCore::JSDOMWindow::setInterval):
284         * bindings/js/JSDataCueCustom.cpp:
285         (WebCore::constructJSDataCue):
286         * bindings/js/JSDeviceMotionEventCustom.cpp:
287         (WebCore::readAccelerationArgument):
288         (WebCore::readRotationRateArgument):
289         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
290         * bindings/js/JSDictionary.cpp:
291         (WebCore::JSDictionary::tryGetProperty):
292         (WebCore::JSDictionary::convertValue):
293         * bindings/js/JSDictionary.h:
294         (WebCore::JSDictionary::tryGetPropertyAndResult):
295         * bindings/js/JSDocumentCustom.cpp:
296         (WebCore::JSDocument::getCSSCanvasContext):
297         * bindings/js/JSFileCustom.cpp:
298         (WebCore::constructJSFile):
299         * bindings/js/JSGeolocationCustom.cpp:
300         (WebCore::JSGeolocation::getCurrentPosition):
301         (WebCore::JSGeolocation::watchPosition):
302         * bindings/js/JSHTMLAllCollectionCustom.cpp:
303         (WebCore::callHTMLAllCollection):
304         * bindings/js/JSHTMLCanvasElementCustom.cpp:
305         (WebCore::JSHTMLCanvasElement::getContext):
306         * bindings/js/JSHTMLElementCustom.cpp:
307         (WebCore::constructJSHTMLElement):
308         * bindings/js/JSHistoryCustom.cpp:
309         (WebCore::JSHistory::pushState):
310         (WebCore::JSHistory::replaceState):
311         * bindings/js/JSIDBDatabaseCustom.cpp:
312         (WebCore::JSIDBDatabase::createObjectStore):
313         * bindings/js/JSMessageEventCustom.cpp:
314         (WebCore::handleInitMessageEvent):
315         * bindings/js/JSMessagePortCustom.cpp:
316         (WebCore::fillMessagePortArray):
317         * bindings/js/JSMessagePortCustom.h:
318         (WebCore::handlePostMessage):
319         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
320         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
321         (WebCore::toDecision):
322         (WebCore::JSMockContentFilterSettings::setDecision):
323         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
324         * bindings/js/JSNodeFilterCustom.cpp:
325         (WebCore::JSNodeFilter::acceptNode):
326         * bindings/js/JSNodeOrString.cpp:
327         (WebCore::toNodeOrStringVector):
328         * bindings/js/JSSQLTransactionCustom.cpp:
329         (WebCore::JSSQLTransaction::executeSql):
330         * bindings/js/JSSVGLengthCustom.cpp:
331         (WebCore::JSSVGLength::convertToSpecifiedUnits):
332         * bindings/js/JSStorageCustom.cpp:
333         (WebCore::JSStorage::getOwnPropertyNames):
334         * bindings/js/JSTextTrackCustom.cpp:
335         (WebCore::JSTextTrack::setLanguage):
336         * bindings/js/JSVideoTrackCustom.cpp:
337         (WebCore::JSVideoTrack::setKind):
338         (WebCore::JSVideoTrack::setLanguage):
339         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
340         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
341         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
342         (WebCore::getObjectParameter):
343         (WebCore::JSWebGLRenderingContextBase::getExtension):
344         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
345         (WebCore::JSWebGLRenderingContextBase::getParameter):
346         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
347         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
348         (WebCore::toVector):
349         (WebCore::dataFunctionf):
350         (WebCore::dataFunctionMatrix):
351         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
352         (WebCore::cryptoKeyFormatFromJSValue):
353         (WebCore::cryptoKeyUsagesFromJSValue):
354         (WebCore::JSWebKitSubtleCrypto::generateKey):
355         (WebCore::importKey):
356         (WebCore::JSWebKitSubtleCrypto::importKey):
357         (WebCore::exportKey):
358         (WebCore::JSWebKitSubtleCrypto::exportKey):
359         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
360         * bindings/js/JSWorkerCustom.cpp:
361         (WebCore::constructJSWorker):
362         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
363         (WebCore::JSWorkerGlobalScope::importScripts):
364         (WebCore::JSWorkerGlobalScope::setTimeout):
365         (WebCore::JSWorkerGlobalScope::setInterval):
366         * bindings/js/ReadableStreamDefaultController.cpp:
367         (WebCore::ReadableStreamDefaultController::invoke):
368         * bindings/js/ScheduledAction.cpp:
369         (WebCore::ScheduledAction::create):
370         * bindings/scripts/CodeGeneratorJS.pm:
371         (GenerateDictionaryImplementationContent):
372         (GenerateImplementation):
373         (GenerateParametersCheck):
374         (GenerateImplementationFunctionCall):
375         (GenerateConstructorDefinition):
376         * html/HTMLMediaElement.cpp:
377         (WebCore::controllerJSValue):
378         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
379         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
380
381 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
382
383         -Wtautological-compare triggered in URLParser::internalValuesConsistent
384         https://bugs.webkit.org/show_bug.cgi?id=162551
385
386         Reviewed by Alex Christensen.
387
388         Fix logic error.
389
390         * platform/URLParser.cpp:
391         (WebCore::URLParser::internalValuesConsistent):
392
393 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
394
395         Add CairoUniquePtr and use it in FontPlatformDataFreetype.cpp
396         https://bugs.webkit.org/show_bug.cgi?id=162557
397
398         Reviewed by Alex Christensen.
399
400         * platform/graphics/cairo/CairoUniquePtr.h: Added.
401         (WebCore::CairoPtrDeleter<cairo_font_options_t>::operator()):
402         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
403         (WebCore::getDefaultCairoFontOptions): Return a smart pointer.
404         (WebCore::FontPlatformData::buildScaledFont): Use smart pointer.
405
406 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
407
408         Silence unused parameter warnings from Geoclue2Interface.c
409         https://bugs.webkit.org/show_bug.cgi?id=162545
410
411         Reviewed by Carlos Garcia Campos.
412
413         * PlatformGTK.cmake:
414
415 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
416
417         std::unique_ptr deleter functions should not check if pointer is null
418         https://bugs.webkit.org/show_bug.cgi?id=162558
419
420         Reviewed by Alex Christensen.
421
422         std::unique_ptr already does this before calling the deleter.
423
424         * platform/graphics/x11/XUniquePtr.h:
425         (WebCore::XPtrDeleter::operator()):
426         (WebCore::XPtrDeleter<XImage>::operator()):
427         (WebCore::XPtrDeleter<_XGC>::operator()):
428         (WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
429
430 2016-09-26  Per Arne Vollan  <pvollan@apple.com>
431
432         [Win][Debug] Compile fix.
433         https://bugs.webkit.org/show_bug.cgi?id=162550
434
435         Reviewed by Alex Christensen.
436
437         Windows headers need the FragmentForwardIterator '==' operator in debug mode.
438
439         * rendering/SimpleLineLayout.cpp:
440         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator==):
441
442 2016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
443
444         [GTK] Unnecessary extern functions in FontPlatformDataFreeType.cpp
445         https://bugs.webkit.org/show_bug.cgi?id=162555
446
447         Reviewed by Carlos Garcia Campos.
448
449         These functions should be file-static.
450
451         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
452         (WebCore::convertFontConfigSubpixelOrder):
453         (WebCore::convertFontConfigHintStyle):
454         (WebCore::setCairoFontOptionsFromFontConfigPattern):
455
456 == Rolled over to ChangeLog-2016-09-26 ==