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