1 2017-10-24 Keith Miller <keith_miller@apple.com>
3 Move inspector and loader to unified sources.
4 https://bugs.webkit.org/show_bug.cgi?id=178760
6 Rubber-stamped by Tim Horton.
10 * WebCore.xcodeproj/project.pbxproj:
12 2017-10-24 Alex Christensen <achristensen@webkit.org>
14 Fix build after r223940
16 * inspector/WebConsoleAgent.cpp:
18 2017-10-24 Alex Christensen <achristensen@webkit.org>
20 Fix Windows build after r223929.
21 https://bugs.webkit.org/show_bug.cgi?id=177027
23 * inspector/WebConsoleAgent.cpp:
24 (WebCore::WebConsoleAgent::getLoggingChannels):
25 Always initialize the variable "level". Visual studio was complaining about the possibility of not initializing it
26 but this is only possible if logChannel->level is an invalid enum value.
28 2017-10-24 Alex Christensen <achristensen@webkit.org>
30 Fix Windows build after r223925
31 https://bugs.webkit.org/show_bug.cgi?id=178687
33 * html/ImageBitmap.cpp:
34 (WebCore::interpolationQualityForResizeQuality):
35 Visual Studio was complaining that not all control paths returned a value.
37 2017-10-24 Youenn Fablet <youenn@apple.com>
39 Enable service worker to use cache storage api
40 https://bugs.webkit.org/show_bug.cgi?id=178684
42 Reviewed by Brady Eidson.
44 Test: http/tests/workers/service/service-worker-cache-api.https.html
46 Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
47 Update WorkerCacheStorageConnection to take benefit of that.
48 This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
50 Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
51 It is in particular responsible to do proxy for loading tasks.
52 It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
54 * Modules/cache/WorkerCacheStorageConnection.cpp:
55 (WebCore::WorkerCacheStorageConnection::create):
56 (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
57 (WebCore::WorkerCacheStorageConnection::doOpen):
58 (WebCore::WorkerCacheStorageConnection::doRemove):
59 (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
60 (WebCore::WorkerCacheStorageConnection::reference):
61 (WebCore::WorkerCacheStorageConnection::dereference):
62 (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
63 (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
64 (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
65 * WebCore.xcodeproj/project.pbxproj:
66 * workers/WorkerLoaderProxy.h:
67 * workers/WorkerMessagingProxy.cpp:
68 (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
69 * workers/WorkerMessagingProxy.h:
70 * workers/service/context/ServiceWorkerThread.cpp:
71 (WebCore::ServiceWorkerThread::ServiceWorkerThread):
72 * workers/service/context/ServiceWorkerThread.h:
73 * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
74 (WebCore::ServiceWorkerThreadProxy::create):
75 (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
76 (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
77 (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
78 (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
79 * workers/service/context/ServiceWorkerThreadProxy.h: Added.
81 2017-10-24 Alex Christensen <achristensen@webkit.org>
83 Optionally store entire ResourceRequest for ping loads
84 https://bugs.webkit.org/show_bug.cgi?id=178756
86 Reviewed by Tim Horton.
88 No change in behavior.
89 This uses less memory in the common loading case.
90 This will be needed for moving appcache loading to the Networking Process.
91 See https://bugs.webkit.org/show_bug.cgi?id=178540
93 * loader/cache/CachedResource.cpp:
94 (WebCore::CachedResource::load):
95 * loader/cache/CachedResource.h:
96 (WebCore::CachedResource::setOriginalRequest):
97 (WebCore::CachedResource::originalRequest const):
98 (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
99 * loader/cache/CachedResourceLoader.cpp:
100 (WebCore::CachedResourceLoader::requestResource):
102 2017-10-24 Andy Estes <aestes@apple.com>
104 [WebIDL] Support the ExportMacro attribute for dictionaries
105 https://bugs.webkit.org/show_bug.cgi?id=178752
107 Reviewed by Sam Weinig.
109 * bindings/scripts/CodeGeneratorJS.pm:
110 (GenerateDictionaryHeaderContent):
111 * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
112 * bindings/scripts/test/TestStandaloneDictionary.idl:
114 2017-10-24 Eric Carlson <eric.carlson@apple.com>
116 Web Inspector: Enable WebKit logging configuration and display
117 https://bugs.webkit.org/show_bug.cgi?id=177027
118 <rdar://problem/33964767>
120 Reviewed by Joseph Pecoraro.
122 Test: inspector/console/webcore-logging.html
125 (WebCore::Document::~Document): Stop observing the logger.
126 (WebCore::Document::logger): Observe the logger.
127 (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
130 * inspector/WebConsoleAgent.cpp:
131 (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
132 (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
133 * inspector/WebConsoleAgent.h:
135 * platform/Logging.cpp:
136 (WebCore::getLogChannel): New, get a log channel by name.
137 * platform/Logging.h:
139 2017-10-24 Dean Jackson <dino@apple.com>
141 Attempted build fix for Sierra.
143 * html/ImageBitmap.cpp:
144 (WebCore::croppedSourceRectangleWithFormatting):
146 2017-10-24 Dean Jackson <dino@apple.com>
148 Implement resizing options for ImageBitmap rendering
149 https://bugs.webkit.org/show_bug.cgi?id=178687
150 <rdar://problem/35135417>
152 Reviewed by Sam Weinig.
154 Implement many of the sizing options for createImageBitmap.
156 Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
158 * html/ImageBitmap.cpp:
159 (WebCore::croppedSourceRectangleWithFormatting):
161 Implement the first bit of the algorithm from
162 the HTML specification.
164 (WebCore::outputSizeForSourceRectangle):
166 ... and then the second bit. Leave the rest in
169 (WebCore::interpolationQualityForResizeQuality):
171 Helper function to map ImageBitmapOptions to
174 (WebCore::ImageBitmap::createPromise):
176 Implement more of the sizing algorithm.
178 * html/ImageBitmap.h: Origin tainting is defined to be false by default.
180 2017-10-24 Chris Dumez <cdumez@apple.com>
182 Add initial implementation for serviceWorker.postMessage()
183 https://bugs.webkit.org/show_bug.cgi?id=178534
185 Reviewed by Youenn Fablet.
187 Add initial implementation for serviceWorker.postMessage():
188 - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
190 Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
193 * DerivedSources.make:
195 * WebCore.xcodeproj/project.pbxproj:
196 * bindings/js/JSBindingsAllInOne.cpp:
197 * bindings/js/JSExtendableMessageEvent.cpp: Added.
198 (WebCore::JSExtendableMessageEvent::data const):
199 * bindings/js/WebCoreBuiltinNames.h:
202 * dom/MessagePortChannel.h:
203 * dom/ScriptExecutionContext.h:
204 * workers/WorkerGlobalScope.h:
205 * workers/service/ExtendableEvent.cpp:
206 (WebCore::ExtendableEvent::ExtendableEvent):
207 (WebCore::ExtendableEvent::~ExtendableEvent):
208 * workers/service/ExtendableEvent.h:
209 * workers/service/ExtendableMessageEvent.cpp: Added.
210 (WebCore::ExtendableMessageEvent::create):
211 (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
212 (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
213 * workers/service/ExtendableMessageEvent.h: Added.
214 * workers/service/ExtendableMessageEvent.idl: Added.
215 * workers/service/ServiceWorker.cpp:
216 (WebCore::ServiceWorker::ServiceWorker):
217 (WebCore::ServiceWorker::postMessage):
218 (WebCore::ServiceWorker::state const):
219 (WebCore::ServiceWorker::scriptExecutionContext const):
220 * workers/service/ServiceWorker.h:
221 * workers/service/ServiceWorkerContainer.cpp:
222 (WebCore::ServiceWorkerContainer::controller const):
223 * workers/service/ServiceWorkerContainer.h:
224 * workers/service/ServiceWorkerGlobalScope.cpp:
225 (WebCore::ServiceWorkerGlobalScope::thread):
226 * workers/service/ServiceWorkerGlobalScope.h:
228 * workers/service/context/ServiceWorkerThread.cpp:
229 (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
230 * workers/service/context/ServiceWorkerThread.h:
231 * workers/service/server/SWClientConnection.h:
233 2017-10-24 Andy Estes <aestes@apple.com>
235 [Payment Request] Implement the "PaymentRequest updated" algorithm
236 https://bugs.webkit.org/show_bug.cgi?id=178689
238 Reviewed by Alex Christensen.
240 Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
241 shippingoptionchange events at the right times and implementing
242 PaymentRequestUpdateEvent.updateWith().
244 Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
245 http/tests/paymentrequest/payment-request-change-shipping-option.https.html
246 http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
248 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
249 (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
250 ApplePaySessionPaymentRequest::TotalAndLineItems.
251 (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
252 and passed it to PaymentCoordinator::completeShippingContactSelection().
253 (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
254 passed it to PaymentCoordinator::completeShippingMethodSelection().
255 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
256 * Modules/paymentrequest/PaymentHandler.h:
257 * Modules/paymentrequest/PaymentRequest.cpp:
258 (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
259 PaymentDetailsBase from PaymentRequest::create() to here.
260 (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
261 (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
262 parameterized the Exception with which to abort m_showPromise.
263 (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
264 (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
265 shippingaddresschangeEvent.
266 (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
267 (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
269 (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
270 (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
271 details and called PaymentHandler::shippingAddressUpdated() or
272 PaymentHandler::shippingOptionUpdated().
273 * Modules/paymentrequest/PaymentRequest.h:
274 * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
275 (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
276 (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
277 (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
278 PaymentRequestUpdateEventInterfaceType.
279 * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
280 * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
281 * testing/MockPaymentCoordinator.cpp:
282 (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
283 (WebCore::MockPaymentCoordinator::openPaymentSetup):
284 (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
285 PaymentCoordinator::didAuthorizePayment().
286 (WebCore::MockPaymentCoordinator::changeShippingOption): Called
287 PaymentCoordinator::didSelectShippingMethod().
288 (WebCore::MockPaymentCoordinator::acceptPayment): Called
289 PaymentCoordinator::didAuthorizePayment().
290 * testing/MockPaymentCoordinator.h:
291 * testing/MockPaymentCoordinator.idl:
293 2017-10-24 Alex Christensen <achristensen@webkit.org>
295 Apply custom header fields from WebsitePolicies to same-domain requests
296 https://bugs.webkit.org/show_bug.cgi?id=178356
297 <rdar://problem/31073436>
299 Reviewed by Brady Eidson.
301 Covered by new API tests.
303 * loader/cache/CachedResourceLoader.cpp:
304 (WebCore::CachedResourceLoader::requestResource):
305 * platform/network/ResourceRequestBase.cpp:
306 (WebCore::ResourceRequestBase::setCachePolicy):
307 (WebCore::ResourceRequestBase::setTimeoutInterval):
308 (WebCore::ResourceRequestBase::setHTTPMethod):
309 (WebCore::ResourceRequestBase::setHTTPHeaderField):
310 (WebCore::ResourceRequestBase::clearHTTPAuthorization):
311 (WebCore::ResourceRequestBase::clearHTTPContentType):
312 (WebCore::ResourceRequestBase::clearHTTPReferrer):
313 (WebCore::ResourceRequestBase::clearHTTPOrigin):
314 (WebCore::ResourceRequestBase::clearHTTPUserAgent):
315 (WebCore::ResourceRequestBase::clearHTTPAccept):
316 (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
317 (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
318 (WebCore::ResourceRequestBase::setHTTPBody):
319 (WebCore::ResourceRequestBase::setAllowCookies):
320 (WebCore::ResourceRequestBase::setPriority):
321 (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
322 (WebCore::ResourceRequestBase::addHTTPHeaderField):
323 (WebCore::ResourceRequestBase::setHTTPHeaderFields):
324 If we only update the platform request when headers are added (or other changes) for HTTP requests,
325 then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
326 This is necessary for these new tests to work, but it's also of growing importance since our
327 introduction of WKURLSchemeHandler.
329 2017-10-24 Brent Fulgham <bfulgham@apple.com>
331 Adopt new secure coding APIs
332 https://bugs.webkit.org/show_bug.cgi?id=178484
333 <rdar://problem/34837193>
335 Reviewed by Tim Horton.
337 Switch to new NSKeyed[Un]Archiver methods that active and use
338 NSSecureCoding by default.
340 Most of the new API is wrapped in a set of convenience methods so we can
341 build without the new API on older systems.
343 No change in behavior.
345 * editing/cocoa/EditorCocoa.mm:
346 (WebCore::archivedDataForAttributedString): Use new convenience method
347 to archive the string object.
348 * loader/archive/cf/LegacyWebArchiveMac.mm:
349 (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
350 use secure coding where possible.
351 (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
352 * platform/ios/PlatformPasteboardIOS.mm:
353 (WebCore::PlatformPasteboard::write): Use new secure API.
354 (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
355 * testing/cocoa/WebArchiveDumpSupport.mm:
356 (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
357 secure coding API where possible.
359 2017-10-24 Jeremy Jones <jeremyj@apple.com>
361 HTMLMediaElement should iterate HTMLTrackElements consistently.
362 https://bugs.webkit.org/show_bug.cgi?id=178423
363 rdar://problem/35044967
365 Reviewed by Eric Carlson.
367 No new tests because no expected behavior change.
369 HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
370 as descendants. It should always iterate them as children.
372 * html/HTMLMediaElement.cpp:
373 (WebCore::HTMLMediaElement::finishParsingChildren):
375 2017-10-24 Chris Dumez <cdumez@apple.com>
377 SerializedScriptValue::deserialize() should take ports as a const Vector&
378 https://bugs.webkit.org/show_bug.cgi?id=178727
380 Reviewed by Alex Christensen.
382 SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
383 It does not modify the input vector.
385 * bindings/js/JSMessageEventCustom.cpp:
386 (WebCore::JSMessageEvent::data const):
387 * bindings/js/SerializedScriptValue.cpp:
388 (WebCore::CloneDeserializer::deserialize):
389 (WebCore::CloneDeserializer::CloneDeserializer):
390 (WebCore::SerializedScriptValue::deserialize):
391 * bindings/js/SerializedScriptValue.h:
393 2017-10-24 Konstantin Tokarev <annulen@yandex.ru>
395 [MediaFoundation] Videos are always autoplaying for local files
396 https://bugs.webkit.org/show_bug.cgi?id=178693
398 Patch by Doug Massay.
399 Reviewed by Alex Christensen.
401 r199114 fixes autoplay issue only if starting session invokes
402 buffering stage. However when local files are played, onBufferingStarted
403 and onBufferingStopped are not called, and video is not paused.
405 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
406 (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
407 (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
408 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
410 2017-10-24 Matt Lewis <jlewis3@apple.com>
412 Unreviewed, rolling out r223889.
414 This caused multiple crashes on all platforms
418 "Adopt new secure coding APIs"
419 https://bugs.webkit.org/show_bug.cgi?id=178484
420 https://trac.webkit.org/changeset/223889
422 2017-10-24 Antti Koivisto <antti@apple.com>
424 Create inline wrappers for before/after pseudo elements that have display:contents
425 https://bugs.webkit.org/show_bug.cgi?id=178722
427 Reviewed by Ryosuke Niwa.
429 We can handle before and after pseudo elements with display:contents by giving them
430 inline renderers with style inherited from display:contents style. This removes
431 need for complicated logic for this case and handles everything correctly.
433 This is a better approach and replaces the one taken in bug 178584.
434 It also fixes two display:contents WPTs.
436 * dom/PseudoElement.h:
438 There is no need to track content renderers separately anymore. They always descendants of
439 pseudo element's renderer (which is an inline wrapper in case of display:contents).
441 * rendering/style/RenderStyle.cpp:
442 (WebCore::RenderStyle::copyContentFrom):
443 * rendering/style/RenderStyle.h:
444 * style/RenderTreeUpdaterGeneratedContent.cpp:
445 (WebCore::createContentRenderers):
446 (WebCore::updateStyleForContentRenderers):
447 (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
448 (WebCore::removeAndDestroyContentRenderers): Deleted.
450 Since content renderers are now always descendants of the pseudo renderer
451 there is no need for a separate destruction path.
453 * style/StyleTreeResolver.cpp:
454 (WebCore::Style::TreeResolver::resolvePseudoStyle):
456 Create ElementUpdate with a style that will produce an inline wrapper.
458 2017-10-24 Wenson Hsieh <wenson_hsieh@apple.com>
460 [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
461 https://bugs.webkit.org/show_bug.cgi?id=178713
462 <rdar://problem/35115906>
464 Reviewed by Eric Carlson.
466 Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
467 both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
468 avoid always dynamically loading AVFoundation and CoreMedia.
470 * platform/graphics/MediaPlayer.cpp:
471 (WebCore::MediaPlayer::isAvailable):
473 2017-10-24 Antoine Quint <graouts@apple.com>
475 RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
476 https://bugs.webkit.org/show_bug.cgi?id=178716
477 <rdar://problem/35112900>
479 Reviewed by Dean Jackson.
481 * rendering/RenderThemeCocoa.mm:
482 (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
484 2017-10-24 Ryosuke Niwa <rniwa@webkit.org>
486 SizesAttributeParser::SizesAttributeParser triggers layout
487 https://bugs.webkit.org/show_bug.cgi?id=178712
489 Reviewed by Antti Koivisto.
491 Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
493 The test had been marked as timing out since r191379 and changed to failing expectation in r199225
494 as the test result's error message changes from run to run.
496 Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
497 had been marked failing since r199225, prior to which it was marked as timeout in r191379.
498 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
499 is now marked as flaky.
501 * css/parser/SizesAttributeParser.cpp:
502 (WebCore::SizesAttributeParser::SizesAttributeParser):
504 2017-10-24 Keith Miller <keith_miller@apple.com>
506 Unreviewed, fix internal iOS build.
510 2017-10-24 Brent Fulgham <bfulgham@apple.com>
512 Adopt new secure coding APIs
513 https://bugs.webkit.org/show_bug.cgi?id=178484
514 <rdar://problem/34837193>
516 Reviewed by Tim Horton.
518 Switch to new NSKeyed[Un]Archiver methods that active and use
519 NSSecureCoding by default.
521 Most of the new API is wrapped in a set of convenience methods so we can
522 build without the new API on older systems.
524 No change in behavior.
526 * editing/cocoa/EditorCocoa.mm:
527 (WebCore::archivedDataForAttributedString): Use new convenience method
528 to archive the string object.
529 * loader/archive/cf/LegacyWebArchiveMac.mm:
530 (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
531 use secure coding where possible.
532 (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
533 * platform/ios/PlatformPasteboardIOS.mm:
534 (WebCore::PlatformPasteboard::write): Use new secure API.
535 (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
536 * testing/cocoa/WebArchiveDumpSupport.mm:
537 (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
538 secure coding API where possible.
540 2017-10-24 Miguel Gomez <magomez@igalia.com>
542 [GTK][X11] Windy.com shows always straight wind lines
543 https://bugs.webkit.org/show_bug.cgi?id=176718
545 Reviewed by Carlos Garcia Campos.
547 WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
548 and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
549 components appropriately.
553 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
554 (WebCore::GraphicsContext3D::texImage2D):
555 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
556 (WebCore::GraphicsContext3D::texSubImage2D):
558 2017-10-24 Ryosuke Niwa <rniwa@webkit.org>
560 DocumentOrderedMap::add should release assert that tree scopes match
561 https://bugs.webkit.org/show_bug.cgi?id=178708
563 Reviewed by Antti Koivisto.
565 Assert that the tree scope of element matches the given tree scope instead of asserting that
566 element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
567 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
569 Also removed now redudnant early exits which would never execute due to release assertions.
571 * dom/DocumentOrderedMap.cpp:
572 (WebCore::DocumentOrderedMap::add):
573 (WebCore::DocumentOrderedMap::remove):
574 (WebCore::DocumentOrderedMap::get const):
576 2017-10-24 Michael Catanzaro <mcatanzaro@igalia.com>
578 -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
579 https://bugs.webkit.org/show_bug.cgi?id=178698
581 Reviewed by Joseph Pecoraro.
583 * inspector/InspectorIndexedDBAgent.cpp:
585 2017-10-24 Antoine Quint <graouts@apple.com>
587 [Web Animations] Add basic timing and target properties
588 https://bugs.webkit.org/show_bug.cgi?id=178674
590 Reviewed by Dean Jackson.
592 We add three new interfaces to expose enough properties to establish basic timing properties,
593 a start time and duration, and the target of an animation. The startTime property is set on
594 the Animation object, the target is set on the KeyframeEffect set as the effect property on
595 the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
597 Tests: webanimations/animation-effect-timing.html
598 webanimations/animation-effect.html
599 webanimations/animation-interface-effect-property.html
600 webanimations/animation-interface-start-time-property.html
601 webanimations/keyframe-effect-interface-timing-duration.html
602 webanimations/keyframe-effect.html
605 * DerivedSources.make:
607 * WebCore.xcodeproj/project.pbxproj:
608 * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
609 (WebCore::AnimationEffect::AnimationEffect):
610 (WebCore::AnimationEffect::~AnimationEffect):
611 * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
612 (WebCore::AnimationEffect::isKeyframeEffect const):
613 (WebCore::AnimationEffect::timing const):
614 (WebCore::AnimationEffect::classType const):
615 * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
616 * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
617 (WebCore::AnimationEffectTiming::create):
618 (WebCore::AnimationEffectTiming::AnimationEffectTiming):
619 (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
620 * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
621 * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
622 * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
623 (WebCore::KeyframeEffect::create):
624 (WebCore::KeyframeEffect::KeyframeEffect):
625 * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
626 * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
627 * animation/WebAnimation.cpp:
628 (WebCore::WebAnimation::setEffect):
629 * animation/WebAnimation.h:
630 * animation/WebAnimation.idl:
631 * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
632 (WebCore::toJSNewlyCreated):
634 * bindings/js/WebCoreBuiltinNames.h:
636 2017-10-24 Ryosuke Niwa <rniwa@webkit.org>
638 RenderSVGModelObject::checkIntersection triggers layout
639 https://bugs.webkit.org/show_bug.cgi?id=178710
641 Reviewed by Antti Koivisto.
643 Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
645 * rendering/svg/RenderSVGModelObject.cpp:
646 (WebCore::getElementCTM):
647 * svg/SVGSVGElement.cpp:
648 (WebCore::SVGSVGElement::getEnclosureList):
650 2017-10-24 Nan Wang <n_wang@apple.com>
652 AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
653 https://bugs.webkit.org/show_bug.cgi?id=178697
655 Reviewed by Chris Fleizach.
657 When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS,
658 it might cause crash if the AX object has already been detached. Fixed this
659 by adding the necessary checks.
661 Test: accessibility/ios-simulator/slider-min-value-crash.html
663 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
664 (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
665 (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
667 2017-10-23 Keith Miller <keith_miller@apple.com>
669 Unreviewed, restore unneeded all in ones.
673 2017-10-23 Commit Queue <commit-queue@webkit.org>
675 Unreviewed, rolling out r223870 and r223871.
676 https://bugs.webkit.org/show_bug.cgi?id=178702
678 broke the windows build (Requested by keith_miller on
683 "Add html, inspector, loader to unified sources"
684 https://bugs.webkit.org/show_bug.cgi?id=178695
685 https://trac.webkit.org/changeset/223870
687 "Unrievwed, fix windows build."
688 https://trac.webkit.org/changeset/223871
690 2017-10-23 Michael Catanzaro <mcatanzaro@igalia.com>
692 Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
693 https://bugs.webkit.org/show_bug.cgi?id=178618
694 <rdar://problem/35108852>
696 * platform/MIMETypeRegistry.cpp:
697 (WebCore::initializeSupportedImageMIMETypes):
699 2017-10-23 Keith Miller <keith_miller@apple.com>
701 Unrievwed, fix windows build.
705 2017-10-23 Keith Miller <keith_miller@apple.com>
707 Add html, inspector, loader to unified sources
708 https://bugs.webkit.org/show_bug.cgi?id=178695
710 Rubber-stamped by Tim Horton.
714 * WebCore.xcodeproj/project.pbxproj:
716 2017-10-23 Joseph Pecoraro <pecoraro@apple.com>
718 Web Inspector: Remove unused Console.setMonitoringXHREnabled
719 https://bugs.webkit.org/show_bug.cgi?id=178617
721 Reviewed by Sam Weinig.
723 * inspector/InspectorInstrumentation.cpp:
724 (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
725 * inspector/InspectorInstrumentation.h:
726 (WebCore::InspectorInstrumentation::didFinishXHRLoading):
727 * inspector/WebConsoleAgent.cpp:
728 (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
729 (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
730 * inspector/WebConsoleAgent.h:
731 Remove XHR monitoring code.
733 * xml/XMLHttpRequest.h:
734 * xml/XMLHttpRequest.cpp:
735 (WebCore::XMLHttpRequest::send):
736 (WebCore::XMLHttpRequest::didFinishLoading):
737 (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
738 * xml/XMLHttpRequest.idl:
739 Remove now unused state on XHR and ExecState requirement for send().
741 2017-10-23 Keith Miller <keith_miller@apple.com>
743 Add dom, editing, fileapi, and history to unified sources
744 https://bugs.webkit.org/show_bug.cgi?id=178694
746 Rubber-stamped by Tim Horton.
750 * WebCore.xcodeproj/project.pbxproj:
752 2017-10-23 Keith Miller <keith_miller@apple.com>
754 Move bridge, contentextensions, crypto, and css to unified sources.
755 https://bugs.webkit.org/show_bug.cgi?id=178691
757 Reviewed by Tim Horton.
761 * WebCore.xcodeproj/project.pbxproj:
763 2017-10-23 Wenson Hsieh <wenson_hsieh@apple.com>
765 Unreviewed, fix the Windows build after r223860
767 UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.
769 * platform/MIMETypeRegistry.cpp:
770 (WebCore::initializeSupportedImageMIMETypes):
772 2017-10-23 Wenson Hsieh <wenson_hsieh@apple.com>
774 [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
775 https://bugs.webkit.org/show_bug.cgi?id=178618
776 <rdar://problem/35108852>
778 Reviewed by Said Abou-Hallawa.
780 Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
781 Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
782 of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
783 this can be an expensive operation on certain devices.
785 This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
786 stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
787 corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
788 array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
789 that we keep allowed image MIME types in sync with allowed image UTIs.
791 The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
792 initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
793 currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
794 needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.
796 * platform/MIMETypeRegistry.cpp:
797 (WebCore::initializeSupportedImageMIMETypes):
798 (WebCore::initializeSupportedJavaScriptMIMETypes):
799 (WebCore::initializePDFMIMETypes):
800 (WebCore::initializeSupportedNonImageMimeTypes):
801 (WebCore::initializeUnsupportedTextMIMETypes):
803 Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
804 initializePDFAndPostScriptMIMETypes, which is no longer necessary.
806 (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
807 (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
808 (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
809 (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
810 (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
811 (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
813 Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".
815 (WebCore::MIMETypeRegistry::isPDFMIMEType):
816 (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
817 (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
818 (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
819 (WebCore::MIMETypeRegistry::getPDFMIMETypes):
820 (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
822 Call only the relevant MIME type initializers when needed.
824 (WebCore::initializePostScriptMIMETypes): Deleted.
825 (WebCore::initializeMIMETypeRegistry): Deleted.
826 (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.
828 Remove an unused and unexported function.
830 * platform/MIMETypeRegistry.h:
832 2017-10-23 Andy Estes <aestes@apple.com>
834 [Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
835 https://bugs.webkit.org/show_bug.cgi?id=178686
837 Reviewed by Keith Miller.
839 This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.
841 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
842 (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
844 2017-10-23 Joseph Pecoraro <pecoraro@apple.com>
846 Web Inspector: Please support HAR Export for network traffic
847 https://bugs.webkit.org/show_bug.cgi?id=146692
848 <rdar://problem/7463672>
850 Reviewed by Brian Burg.
852 Tests: http/tests/inspector/network/har/har-basic.html
853 http/tests/inspector/network/har/har-page.html
855 * inspector/InspectorNetworkAgent.cpp:
856 (WebCore::InspectorNetworkAgent::willSendRequest):
857 Include the wall time when sending a request. This is needed for HAR to
858 include a wall time, and can be used for Cookie expiration time calculation
861 2017-10-23 Andy Estes <aestes@apple.com>
863 [Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
864 https://bugs.webkit.org/show_bug.cgi?id=178609
865 <rdar://problem/33542813>
867 Reviewed by Alex Christensen.
869 This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
870 the user authorizes a payment, and implements PaymentResponse.complete().
872 Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
873 http/tests/paymentrequest/payment-response-complete-method.https.html
874 http/tests/paymentrequest/payment-response-methodName-attribute.https.html
875 http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
876 http/tests/paymentrequest/payment-response-payerName-attribute.https.html
877 http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html
879 * DerivedSources.make:
880 * Modules/applepay/ApplePayPaymentContact.h:
881 * Modules/applepay/Payment.h:
882 (WebCore::Payment::Payment): Deleted.
883 (WebCore::Payment::pkPayment const): Deleted.
884 * Modules/applepay/PaymentContact.h:
885 (WebCore::PaymentContact::PaymentContact): Deleted.
886 (WebCore::PaymentContact::pkContact const): Deleted.
887 * Modules/applepay/cocoa/PaymentContactCocoa.mm:
889 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
890 (WebCore::ApplePayPaymentHandler::hasActiveSession):
891 (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
892 (WebCore::ApplePayPaymentHandler::document):
893 (WebCore::ApplePayPaymentHandler::paymentCoordinator):
894 (WebCore::ApplePayPaymentHandler::convertData):
895 (WebCore::ApplePayPaymentHandler::show):
896 (WebCore::ApplePayPaymentHandler::hide):
897 (WebCore::ApplePayPaymentHandler::canMakePayment):
898 (WebCore::ApplePayPaymentHandler::complete):
900 (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
901 (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
902 (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
903 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
904 * Modules/paymentrequest/PaymentAddress.h:
905 * Modules/paymentrequest/PaymentAddress.idl:
906 * Modules/paymentrequest/PaymentHandler.cpp:
907 (WebCore::PaymentHandler::create):
908 * Modules/paymentrequest/PaymentHandler.h:
909 * Modules/paymentrequest/PaymentRequest.cpp:
910 (WebCore::PaymentRequest::show):
911 (WebCore::PaymentRequest::stop):
912 (WebCore::PaymentRequest::canMakePayment):
913 (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
914 (WebCore::PaymentRequest::shippingAddressChanged):
915 (WebCore::PaymentRequest::shippingOptionChanged):
916 (WebCore::PaymentRequest::accept):
917 (WebCore::PaymentRequest::complete):
918 * Modules/paymentrequest/PaymentRequest.h:
919 * Modules/paymentrequest/PaymentResponse.cpp:
920 (WebCore::PaymentResponse::PaymentResponse):
921 (WebCore::PaymentResponse::complete):
922 * Modules/paymentrequest/PaymentResponse.h:
923 * WebCore.xcodeproj/project.pbxproj:
924 * testing/Internals.cpp:
925 (WebCore::Internals::Internals):
926 (WebCore::Internals::mockPaymentCoordinator const):
927 * testing/Internals.h:
928 * testing/Internals.idl:
929 * testing/MockPayment.h: Added.
930 * testing/MockPaymentAddress.h: Added.
931 * testing/MockPaymentAddress.idl: Added.
932 * testing/MockPaymentContact.h: Added.
933 * testing/MockPaymentCoordinator.cpp:
934 (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
935 (WebCore::MockPaymentCoordinator::openPaymentSetup):
936 (WebCore::dispatchIfShowing):
937 (WebCore::MockPaymentCoordinator::showPaymentUI):
938 (WebCore::MockPaymentCoordinator::completeMerchantValidation):
939 (WebCore::MockPaymentCoordinator::completePaymentSession):
940 (WebCore::MockPaymentCoordinator::abortPaymentSession):
941 (WebCore::MockPaymentCoordinator::cancelPaymentSession):
942 (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
943 * testing/MockPaymentCoordinator.h:
944 * testing/MockPaymentCoordinator.idl: Added.
946 2017-10-23 Dean Jackson <dino@apple.com>
948 Attempt to stop iOS Simulator tests from failing because
949 we don't support Accelerated ImageBuffer.
951 * html/ImageBitmap.cpp:
953 2017-10-23 Zalan Bujtas <zalan@apple.com>
955 [FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
956 https://bugs.webkit.org/show_bug.cgi?id=178621
957 <rdar://problem/35110321>
959 Reviewed by Simon Fraser.
961 This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.
963 Covered by existing cases.
965 * page/FrameView.cpp:
966 (WebCore::FrameView::reset):
967 (WebCore::FrameView::willDestroyRenderTree):
968 (WebCore::FrameView::didDestroyRenderTree):
969 (WebCore::FrameView::calculateScrollbarModesForLayout):
970 (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
971 (WebCore::FrameView::canPerformLayout const):
972 (WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
973 (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
974 (WebCore::FrameView::scheduleRelayout):
975 (WebCore::FrameView::scheduleRelayoutOfSubtree):
976 (WebCore::FrameView::needsLayout const):
977 (WebCore::FrameView::autoSizeIfEnabled):
980 2017-10-23 Keith Miller <keith_miller@apple.com>
982 Unreviewed, fix windows build.
986 2017-10-23 Keith Miller <keith_miller@apple.com>
988 Move shared accessibility and animiations files to unified sources.
989 https://bugs.webkit.org/show_bug.cgi?id=178677
991 Reviewed by Tim Horton.
994 * WebCore.xcodeproj/project.pbxproj:
996 2017-10-23 Chris Dumez <cdumez@apple.com>
998 Drop confusing Event::dispatched() method
999 https://bugs.webkit.org/show_bug.cgi?id=178670
1001 Reviewed by Youenn Fablet.
1003 Drop confusing Event::dispatched() method. What the call sites want to do is check
1004 that the Event's "dispatch" flag is set:
1005 - https://dom.spec.whatwg.org/#dispatch-flag
1007 This flag gets set at the beginning of dispatchEvent() and unset at the end of
1009 - https://dom.spec.whatwg.org/#ref-for-dispatch-flagâ‘¢
1011 See as an example event.initEvent():
1012 - https://dom.spec.whatwg.org/#dom-event-initevent
1014 The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
1015 method, so use this instead. One side effect of this change is that it is now
1016 possible to call the init*Event() method on events that have already been dispatched
1017 in order to dispatch them again, as per the specification.
1019 Test: fast/events/initEvent-after-dispatching.html
1021 * dom/CompositionEvent.cpp:
1022 (WebCore::CompositionEvent::initCompositionEvent):
1023 * dom/DeviceMotionEvent.cpp:
1024 (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
1025 * dom/DeviceOrientationEvent.cpp:
1026 (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
1028 * dom/HashChangeEvent.h:
1029 * dom/KeyboardEvent.cpp:
1030 (WebCore::KeyboardEvent::initKeyboardEvent):
1031 * dom/MessageEvent.cpp:
1032 (WebCore::MessageEvent::initMessageEvent):
1033 * dom/MouseEvent.cpp:
1034 (WebCore::MouseEvent::initMouseEvent):
1035 * dom/OverflowEvent.cpp:
1036 (WebCore::OverflowEvent::initOverflowEvent):
1037 * dom/TextEvent.cpp:
1038 (WebCore::TextEvent::initTextEvent):
1039 * dom/TouchEvent.cpp:
1040 (WebCore::TouchEvent::initTouchEvent):
1042 (WebCore::UIEvent::initUIEvent):
1043 * dom/WheelEvent.cpp:
1044 (WebCore::WheelEvent::initWheelEvent):
1045 * storage/StorageEvent.cpp:
1046 (WebCore::StorageEvent::initStorageEvent):
1048 2017-10-23 Antti Koivisto <antti@apple.com>
1050 Remember previous child renderer during render tree update
1051 https://bugs.webkit.org/show_bug.cgi?id=178659
1053 Reviewed by Zalan Bujtas.
1055 We shouldn't need to recompute the previous renderer, we know it already.
1057 * style/RenderTreePosition.cpp:
1058 (WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.
1060 No longer needed. This was also subtly wrong as doesn't take display:contents into account.
1062 * style/RenderTreePosition.h:
1063 * style/RenderTreeUpdater.cpp:
1064 (WebCore::RenderTreeUpdater::updateRenderTree):
1065 (WebCore::RenderTreeUpdater::textRendererIsNeeded):
1067 Use the saved previous renderer.
1069 (WebCore::RenderTreeUpdater::updateTextRenderer):
1070 (WebCore::RenderTreeUpdater::storePreviousRenderer):
1072 Save the previous renderere as we walk the tree.
1074 (WebCore::textRendererIsNeeded): Deleted.
1075 * style/RenderTreeUpdater.h:
1077 2017-10-23 Keith Miller <keith_miller@apple.com>
1079 Add Shared Modules files to the unified source build.
1080 https://bugs.webkit.org/show_bug.cgi?id=178675
1082 Reviewed by Tim Horton.
1084 This patch all the Modules sources files shared across all ports to
1089 * WebCore.xcodeproj/project.pbxproj:
1091 2017-10-22 Dean Jackson <dino@apple.com>
1093 Implement drawImage(ImageBitmap) on 2d canvas
1094 https://bugs.webkit.org/show_bug.cgi?id=178653
1095 <rdar://problem/35104360>
1097 Reviewed by Antoine Quint.
1099 Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
1100 It's probably not going to be a very common operation, but
1101 it importantly allows us to test the ImageBitmap creation
1104 Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html
1106 * html/ImageBitmap.cpp:
1107 (WebCore::taintsOrigin): New helper function to determine if a
1108 CachedImage would provide a clean origin.
1109 (WebCore::ImageBitmap::createPromise): Set the flag that records
1110 if this ImageBitmap has a clean origin.
1111 * html/ImageBitmap.h:
1112 (WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
1113 store, allowing access to the data for drawing.
1114 (WebCore::ImageBitmap::originClean const): Is this ImageBitmap
1115 going to taint a destination.
1116 * html/canvas/CanvasRenderingContext.cpp:
1117 (WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
1118 the ImageBitmap version of this template function.
1119 * html/canvas/CanvasRenderingContext.h:
1120 * html/canvas/CanvasRenderingContext2D.cpp:
1121 (WebCore::CanvasRenderingContext2D::drawImage): Implement the
1122 actual drawing of an ImageBitmap.
1124 2017-10-23 Daniel Bates <dabates@apple.com>
1126 Unreviewed, rolling out r223699.
1128 Caused regressions with right-to-left text selection and
1129 painting of markers in flipped writing mode and in overlapping
1130 lines. Will investigate offline.
1134 "Share logic in InlineTextBox to compute selection rect"
1135 https://bugs.webkit.org/show_bug.cgi?id=178232
1136 https://trac.webkit.org/changeset/223699
1138 2017-10-23 Youenn Fablet <youenn@apple.com>
1140 Create a Fetch event when ServiceWorker has to handle a fetch
1141 https://bugs.webkit.org/show_bug.cgi?id=178491
1143 Reviewed by Chris Dumez.
1145 Covered by existing test.
1147 Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
1148 Making it a CompletionHandler.
1149 Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.
1151 Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
1152 and processing when fetch event is responded.
1153 ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
1154 WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.
1156 Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.
1158 * WebCore.xcodeproj/project.pbxproj:
1159 * platform/network/ResourceResponseBase.h:
1160 * testing/Internals.cpp:
1161 (WebCore::Internals::waitForFetchEventToFinish):
1162 * workers/service/FetchEvent.cpp:
1163 (WebCore::FetchEvent::~FetchEvent):
1164 (WebCore::FetchEvent::respondWith):
1165 (WebCore::FetchEvent::onResponse):
1166 (WebCore::FetchEvent::respondWithError):
1167 (WebCore::FetchEvent::processResponse):
1168 (WebCore::FetchEvent::promiseIsSettled):
1169 * workers/service/FetchEvent.h:
1170 * workers/service/context/ServiceWorkerFetch.cpp: Added.
1171 (WebCore::ServiceWorkerFetch::dispatchFetchTask):
1172 (WebCore::ServiceWorkerFetch::processResponse):
1173 * workers/service/context/ServiceWorkerFetch.h: Added.
1174 * workers/service/context/ServiceWorkerThread.cpp:
1175 (WebCore::m_workerObjectProxy):
1176 (WebCore::ServiceWorkerThread::dispatchFetchEvent):
1177 * workers/service/context/ServiceWorkerThread.h:
1179 2017-10-23 Basuke Suzuki <Basuke.Suzuki@sony.com>
1181 [Curl] Fix authentication related bugs
1182 https://bugs.webkit.org/show_bug.cgi?id=178652
1184 Reviewed by Alex Christensen.
1186 * platform/network/curl/AuthenticationChallengeCurl.cpp:
1187 (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
1188 * platform/network/curl/CurlContext.cpp:
1189 (WebCore::CurlHandle::setHttpAuthUserPass):
1190 * platform/network/curl/CurlRequest.cpp:
1191 (WebCore::CurlRequest::setUserPass):
1192 (WebCore::CurlRequest::setupTransfer):
1193 (WebCore::CurlRequest::didReceiveHeader):
1194 * platform/network/curl/CurlRequest.h:
1196 2017-10-23 Matt Lewis <jlewis3@apple.com>
1198 Unreviewed, rolling out r223820.
1200 This caused a build break on Windows.
1204 "Web Inspector: Remove unused Console.setMonitoringXHREnabled"
1205 https://bugs.webkit.org/show_bug.cgi?id=178617
1206 https://trac.webkit.org/changeset/223820
1208 2017-10-23 Zalan Bujtas <zalan@apple.com>
1210 Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
1211 https://bugs.webkit.org/show_bug.cgi?id=178651
1212 <rdar://problem/35117448>
1214 Reviewed by Antti Koivisto.
1216 Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
1217 1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
1218 other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
1219 2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
1220 the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
1222 This patch addresses these issues by scheduling/converting subtree layout when needed.
1224 Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
1226 * editing/FrameSelection.cpp:
1227 (WebCore::FrameSelection::respondToNodeModification):
1228 * page/FrameView.cpp:
1229 (WebCore::FrameView::scheduleSelectionUpdate):
1232 2017-10-23 Miguel Gomez <magomez@igalia.com>
1234 [TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
1235 https://bugs.webkit.org/show_bug.cgi?id=175425
1237 Reviewed by Žan Doberšek.
1239 Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
1240 Direct OpenGL API calls, types and constants are used instead.
1242 By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
1243 shader adaptation to the used OpenGL/GLES2 version, so we need to do that
1244 inside TextureMapperShaderProgram. The main changes required for this are
1245 adding the #version directive and use in/out to define input/output parameters
1246 when using OpenGL >= 3.2, and defining the default precision only when using
1249 Besides that, now that VideoTextureCopierGStreamer doesn't have its own
1250 GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.
1252 Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.
1256 * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1257 (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1258 (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1259 (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1260 * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
1261 * platform/graphics/texmap/TextureMapperGL.cpp:
1262 (WebCore::TextureMapperGLData::getShaderProgram):
1263 (WebCore::prepareFilterProgram):
1264 (WebCore::TextureMapperGL::drawTexture):
1265 (WebCore::TextureMapperGL::drawFiltered):
1266 * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1267 (WebCore::TextureMapperShaderProgram::create):
1268 (WebCore::getShaderLog):
1269 (WebCore::getProgramLog):
1270 (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
1271 (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
1272 (WebCore::TextureMapperShaderProgram::setMatrix):
1273 (WebCore::TextureMapperShaderProgram::getLocation):
1274 * platform/graphics/texmap/TextureMapperShaderProgram.h:
1275 (WebCore::TextureMapperShaderProgram::programID const):
1277 2017-10-22 Sam Weinig <sam@webkit.org>
1279 [Settings] Replace current Settings generation with template file based approach
1280 https://bugs.webkit.org/show_bug.cgi?id=178634
1282 Reviewed by Joseph Pecoraro.
1284 This replaces the recently added python based Settings generation with a generator
1285 built in ruby, so we can take advantage of ERB for templating. The result has much
1286 of the logic in the templates and as a result feels much easier to follow and cleaner.
1288 Since I was moving things to ruby, I took the opertunity to switch the Settings definition
1289 file from our .in format to yaml, which is quite a bit easier to read.
1292 * DerivedSources.make:
1293 * Scripts/GenerateSettings: Removed.
1294 * Scripts/GenerateSettings.py: Removed.
1295 * Scripts/GenerateSettings.rb: Added.
1296 * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
1297 * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
1298 * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
1299 * Scripts/GenerateSettings/GenerateSettings.py: Removed.
1300 * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
1301 * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
1302 * Scripts/GenerateSettings/Settings.py: Removed.
1303 * Scripts/GenerateSettings/__init__.py: Removed.
1304 * Scripts/SettingsTemplates: Added.
1305 * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
1306 * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
1307 * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
1308 * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
1309 * Scripts/SettingsTemplates/Settings.h.erb: Added.
1310 * WebCore.xcodeproj/project.pbxproj:
1311 * WebCoreMacros.cmake:
1312 * page/Settings.in: Removed.
1313 * page/Settings.yaml: Added.
1315 2017-10-22 Joseph Pecoraro <pecoraro@apple.com>
1317 REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
1318 https://bugs.webkit.org/show_bug.cgi?id=178650
1319 <rdar://problem/35116347>
1321 Reviewed by Sam Weinig.
1323 Test: inspector/console/command-line-api-getEventListeners.html
1325 * inspector/CommandLineAPIHost.cpp:
1326 (WebCore::listenerEntriesFromListenerInfo):
1329 (WebCore::CommandLineAPIHost::getEventListeners):
1330 Fix incorrect early return.
1332 * inspector/CommandLineAPIHost.h:
1333 * inspector/CommandLineAPIHost.idl:
1334 Add more attributes about the listener. These new attributes match output from Chrome.
1336 2017-10-22 Antoine Quint <graouts@apple.com>
1338 [Web Animations] Add animations to the timeline
1339 https://bugs.webkit.org/show_bug.cgi?id=178643
1341 Reviewed by Dean Jackson.
1343 If a timeline is provided as a parameter to the Animation constructor,
1344 add it to the timeline, and remove it when the object is destroyed.
1346 We also start the basic mechanism to dump the contents of a timeline
1347 as text for testing purposes, currently only logging the number of
1348 animations in a timeline and just logging the class name for animation
1351 Test: webanimations/animation-creation-addition.html
1353 * animation/AnimationTimeline.cpp:
1354 (WebCore::AnimationTimeline::description):
1355 * animation/AnimationTimeline.h:
1356 * animation/AnimationTimeline.idl:
1357 * animation/WebAnimation.cpp:
1358 (WebCore::WebAnimation::create):
1359 (WebCore::WebAnimation::~WebAnimation):
1360 (WebCore::WebAnimation::description):
1361 * animation/WebAnimation.h:
1362 * testing/Internals.cpp:
1363 (WebCore::Internals::timelineDescription):
1364 * testing/Internals.h:
1365 * testing/Internals.idl:
1367 2017-10-21 Zalan Bujtas <zalan@apple.com>
1369 [FrameView::layout cleanup] Drop allowSubtree parameter
1370 https://bugs.webkit.org/show_bug.cgi?id=178623
1371 <rdar://problem/35111012>
1373 Reviewed by Sam Weinig.
1375 This flag is only set through ::forceLayout(). Let's just convert the subtree layout
1376 to full layout right before calling ::layout().
1378 No change in functionality.
1380 * page/FrameView.cpp:
1381 (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
1382 (WebCore::FrameView::layout):
1383 (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
1384 (WebCore::FrameView::forceLayout):
1387 2017-10-21 Joseph Pecoraro <pecoraro@apple.com>
1389 Web Inspector: Remove unused Console.setMonitoringXHREnabled
1390 https://bugs.webkit.org/show_bug.cgi?id=178617
1392 Reviewed by Sam Weinig.
1394 * inspector/InspectorInstrumentation.cpp:
1395 (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
1396 * inspector/InspectorInstrumentation.h:
1397 (WebCore::InspectorInstrumentation::didFinishXHRLoading):
1398 * inspector/WebConsoleAgent.cpp:
1399 (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
1400 (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
1401 * inspector/WebConsoleAgent.h:
1402 Remove XHR monitoring code.
1404 * xml/XMLHttpRequest.h:
1405 * xml/XMLHttpRequest.cpp:
1406 (WebCore::XMLHttpRequest::send):
1407 (WebCore::XMLHttpRequest::didFinishLoading):
1408 (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
1409 * xml/XMLHttpRequest.idl:
1410 Remove now unused state on XHR and ExecState requirement for send().
1412 2017-10-21 Dean Jackson <dino@apple.com>
1414 createImageBitmap with basic HTMLImageElement
1415 https://bugs.webkit.org/show_bug.cgi?id=178619
1416 <rdar://problem/35104118>
1418 Reviewed by Antoine Quint.
1420 Implement the basic infrastructure for creating
1421 an ImageBitmap from an HTMLImageElement.
1423 Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html
1425 * html/ImageBitmap.cpp:
1426 (WebCore::ImageBitmap::createPromise): Create the image buffer
1427 and draw the image into its backing store.
1428 * html/ImageBitmap.h:
1430 2017-10-21 Antoine Quint <graouts@apple.com>
1432 [Web Animations] Add bindings to unified sources
1433 https://bugs.webkit.org/show_bug.cgi?id=178620
1435 Reviewed by Dean Jackson.
1437 Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.
1440 * WebCore.xcodeproj/project.pbxproj:
1442 2017-10-21 Tim Horton <timothy_horton@apple.com>
1444 Fix the Mac CMake build
1446 * PlatformMac.cmake:
1448 2017-10-21 Antti Koivisto <antti@apple.com>
1450 Support ::before/::after pseudo elements with display:contents
1451 https://bugs.webkit.org/show_bug.cgi?id=178584
1453 Reviewed by Ryosuke Niwa.
1457 ::before { display:contents; content:'foo' }
1459 * css/StyleResolver.cpp:
1460 (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.
1462 Allow display:contents on pseudo elements.
1463 Factor into function.
1465 (WebCore::StyleResolver::adjustRenderStyle):
1466 * dom/PseudoElement.h:
1468 Add a weak vector of content renderers.
1470 * style/RenderTreePosition.h:
1471 (WebCore::RenderTreePosition::moveToLastChild):
1473 Add a way to set a valid render tree position without a node.
1475 * style/RenderTreeUpdaterGeneratedContent.cpp:
1476 (WebCore::createContentRenderers):
1478 Take RenderTreePosition.
1480 (WebCore::updateStyleForContentRenderers):
1482 Update based on the content renderer vector instead of doing a tree walk.
1484 (WebCore::removeAndDestroyContentRenderers):
1486 Helper for destroying content renderers.
1488 (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1490 In the normal case create a render tree position for the pseudo element renderer and
1491 use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
1492 RenderTreePosition interface didn't have way to move to positions in anonymous boxes)
1494 In the case of a non box generating display:contents pseudo element, use the current
1495 render tree position instead.
1497 Ensure that pseudo element renderers are destroyed before creating the new ones since in
1498 display:contents case they are not descendants of the pseudo renderer and don't get cleared
1501 2017-10-20 Zalan Bujtas <zalan@apple.com>
1503 [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
1504 https://bugs.webkit.org/show_bug.cgi?id=178604
1505 <rdar://problem/35101890>
1507 Reviewed by Simon Fraser.
1509 SetForScope guarantees state correctness even with nested layouts. This is a lot less
1510 error prone than resetting the state value after each potential recursive call.
1512 Covered by existing tests.
1514 * page/FrameView.cpp:
1515 (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
1516 not look too useful.
1517 (WebCore::FrameView::layout):
1518 * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
1519 so painting should be allowed in both cases.
1521 2017-10-20 Said Abou-Hallawa <sabouhallawa@apple.com>
1523 SVGPathElement should cache the built-up Path of its non animating pathByteStream()
1524 https://bugs.webkit.org/show_bug.cgi?id=178248
1526 Reviewed by Simon Fraser.
1528 Instead of creating a Path object from the non animating pathByteStream()
1529 every time we need to updatePathFromPathElement(), the Path object can be
1530 cached once it is created and used for later calls.
1532 * html/canvas/Path2D.h: buildPathFromString() now returns a Path.
1534 * platform/graphics/Path.h:
1535 * platform/graphics/cairo/PathCairo.cpp:
1536 (WebCore::Path::Path):
1537 (WebCore::Path::operator=):
1538 * platform/graphics/cg/PathCG.cpp:
1539 (WebCore::Path::Path):
1540 (WebCore::Path::operator=):
1541 * platform/graphics/win/PathDirect2D.cpp:
1542 (WebCore::Path::Path):
1543 (WebCore::Path::operator=):
1544 Define the move constructor and the move assignment operator for the the
1545 Path class so a statement like "Path path = buildPathFromString()" won't
1546 go through the copy constructor and the copy assignment operator.
1548 * rendering/style/BasicShapes.cpp:
1549 (WebCore::SVGPathTranslatedByteStream::path const):
1550 * rendering/svg/RenderSVGResourceClipper.cpp:
1551 (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1552 * rendering/svg/RenderSVGShape.cpp:
1553 (WebCore::RenderSVGShape::updateShapeFromElement):
1554 * rendering/svg/RenderSVGTextPath.cpp:
1555 (WebCore::RenderSVGTextPath::layoutPath const):
1556 * rendering/svg/SVGPathData.cpp:
1557 (WebCore::pathFromCircleElement):
1558 (WebCore::pathFromEllipseElement):
1559 (WebCore::pathFromLineElement):
1560 (WebCore::pathFromPathElement):
1561 (WebCore::pathFromPolygonElement):
1562 (WebCore::pathFromPolylineElement):
1563 (WebCore::pathFromRectElement):
1564 (WebCore::pathFromGraphicsElement):
1565 (WebCore::updatePathFromCircleElement): Deleted.
1566 (WebCore::updatePathFromEllipseElement): Deleted.
1567 (WebCore::updatePathFromLineElement): Deleted.
1568 (WebCore::updatePathFromPathElement): Deleted.
1569 (WebCore::updatePathFromPolygonElement): Deleted.
1570 (WebCore::updatePathFromPolylineElement): Deleted.
1571 (WebCore::updatePathFromRectElement): Deleted.
1572 (WebCore::updatePathFromGraphicsElement): Deleted.
1573 * rendering/svg/SVGPathData.h:
1574 * svg/SVGAnimateMotionElement.cpp:
1575 (WebCore::SVGAnimateMotionElement::parseAttribute):
1576 (WebCore::SVGAnimateMotionElement::updateAnimationPath):
1577 * svg/SVGGraphicsElement.cpp:
1578 (WebCore::SVGGraphicsElement::toClipPath):
1579 * svg/SVGGraphicsElement.h:
1580 Rename updatePathFromElement() to pathFromGraphicsElement().
1582 * svg/SVGPathElement.cpp:
1583 (WebCore::SVGPathElement::parseAttribute): Clear the cache when
1584 m_pathByteStream changes.
1585 (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
1587 (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
1588 m_pathByteStream changes.
1590 * svg/SVGPathElement.h:
1591 * svg/SVGPathUtilities.cpp:
1592 (WebCore::buildPathFromString):
1593 (WebCore::buildPathFromByteStream):
1594 * svg/SVGPathUtilities.h:
1595 Make thes buildPathFromString() and buildPathFromByteStream() return Paths.
1597 * svg/SVGUseElement.cpp:
1598 (WebCore::SVGUseElement::toClipPath):
1599 * svg/SVGUseElement.h:
1600 Make these toClipPath() return Path.
1602 2017-10-20 Ryosuke Niwa <rniwa@webkit.org>
1604 Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
1605 https://bugs.webkit.org/show_bug.cgi?id=178605
1607 Reviewed by Andy Estes.
1609 Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
1610 to make it clear that these functions can be called even when node's immediate parent didn't change.
1612 * dom/ContainerNodeAlgorithms.cpp:
1613 (WebCore::notifyNodeInsertedIntoDocument):
1614 (WebCore::notifyNodeInsertedIntoTree):
1615 (WebCore::notifyNodeRemovedFromDocument):
1616 (WebCore::notifyNodeRemovedFromTree):
1617 (WebCore::notifyChildNodeRemoved):
1618 * dom/ContainerNodeAlgorithms.h:
1620 (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
1621 (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
1624 (WebCore::Node::insertedIntoAncestor):
1625 (WebCore::Node::removedFromAncestor):
1626 (WebCore::Node::removedFrom): Deleted.
1628 * dom/ProcessingInstruction.cpp:
1629 (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
1630 (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
1631 * dom/ProcessingInstruction.h:
1632 * dom/ScriptElement.h:
1633 (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
1634 * dom/ShadowRoot.cpp:
1635 (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
1636 (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
1638 * html/FormAssociatedElement.cpp:
1639 (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
1640 (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
1641 * html/FormAssociatedElement.h:
1642 * html/HTMLBaseElement.cpp:
1643 (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
1644 (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
1645 * html/HTMLBaseElement.h:
1646 * html/HTMLBodyElement.cpp:
1647 (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
1648 * html/HTMLBodyElement.h:
1649 * html/HTMLFormControlElement.cpp:
1650 (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
1651 (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
1652 * html/HTMLFormControlElement.h:
1653 * html/HTMLFormControlElementWithState.cpp:
1654 (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
1655 (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
1656 * html/HTMLFormControlElementWithState.h:
1657 * html/HTMLFormElement.cpp:
1658 (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
1659 (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
1660 * html/HTMLFormElement.h:
1661 * html/HTMLFrameElementBase.cpp:
1662 (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
1663 * html/HTMLFrameElementBase.h:
1664 * html/HTMLFrameSetElement.cpp:
1665 (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
1666 (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
1667 * html/HTMLFrameSetElement.h:
1668 * html/HTMLImageElement.cpp:
1669 (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
1670 (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
1671 * html/HTMLImageElement.h:
1672 * html/HTMLInputElement.cpp:
1673 (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
1674 (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
1675 * html/HTMLInputElement.h:
1676 * html/HTMLLinkElement.cpp:
1677 (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
1678 (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
1679 * html/HTMLLinkElement.h:
1680 * html/HTMLMapElement.cpp:
1681 (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
1682 (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
1683 * html/HTMLMapElement.h:
1684 * html/HTMLMediaElement.cpp:
1685 (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
1686 (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
1687 * html/HTMLMediaElement.h:
1688 * html/HTMLMetaElement.cpp:
1689 (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
1690 * html/HTMLMetaElement.h:
1691 * html/HTMLObjectElement.cpp:
1692 (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
1693 (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
1694 * html/HTMLObjectElement.h:
1695 * html/HTMLOptionElement.cpp:
1696 (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
1697 * html/HTMLOptionElement.h:
1698 * html/HTMLScriptElement.cpp:
1699 (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
1700 * html/HTMLScriptElement.h:
1701 * html/HTMLSelectElement.cpp:
1702 (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
1703 * html/HTMLSelectElement.h:
1704 * html/HTMLSlotElement.cpp:
1705 (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
1706 (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
1707 * html/HTMLSlotElement.h:
1708 * html/HTMLSourceElement.cpp:
1709 (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
1710 (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
1711 * html/HTMLSourceElement.h:
1712 * html/HTMLStyleElement.cpp:
1713 (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
1714 (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
1715 * html/HTMLStyleElement.h:
1716 * html/HTMLTextFormControlElement.cpp:
1717 (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
1718 * html/HTMLTextFormControlElement.h:
1719 * html/HTMLTitleElement.cpp:
1720 (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
1721 (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
1722 * html/HTMLTitleElement.h:
1723 * html/HTMLTrackElement.cpp:
1724 (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
1725 (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
1726 * html/HTMLTrackElement.h:
1727 * svg/SVGElement.cpp:
1728 (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
1729 (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
1730 (WebCore::SVGElement::updateRelativeLengthsInformation):
1732 * svg/SVGFEImageElement.cpp:
1733 (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
1734 (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
1735 * svg/SVGFEImageElement.h:
1736 * svg/SVGFontFaceElement.cpp:
1737 (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
1738 (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
1739 * svg/SVGFontFaceElement.h:
1740 * svg/SVGFontFaceUriElement.cpp:
1741 (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
1742 * svg/SVGFontFaceUriElement.h:
1743 * svg/SVGImageElement.cpp:
1744 (WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
1745 * svg/SVGImageElement.h:
1746 * svg/SVGMPathElement.cpp:
1747 (WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
1748 (WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
1749 * svg/SVGMPathElement.h:
1750 * svg/SVGPathElement.cpp:
1751 (WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
1752 (WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
1753 * svg/SVGPathElement.h:
1754 * svg/SVGSVGElement.cpp:
1755 (WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
1756 (WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
1757 * svg/SVGSVGElement.h:
1758 * svg/SVGScriptElement.cpp:
1759 (WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
1760 * svg/SVGScriptElement.h:
1761 * svg/SVGStyleElement.cpp:
1762 (WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
1763 (WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
1764 * svg/SVGStyleElement.h:
1765 * svg/SVGTRefElement.cpp:
1766 (WebCore::SVGTRefElement::buildPendingResource):
1767 (WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
1768 (WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
1769 * svg/SVGTRefElement.h:
1770 * svg/SVGTextPathElement.cpp:
1771 (WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
1772 (WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
1773 * svg/SVGTextPathElement.h:
1774 * svg/SVGTitleElement.cpp:
1775 (WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
1776 (WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
1777 * svg/SVGTitleElement.h:
1778 * svg/SVGUseElement.cpp:
1779 (WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
1780 (WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
1781 * svg/SVGUseElement.h:
1782 * svg/animation/SVGSMILElement.cpp:
1783 (WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
1784 (WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
1785 * svg/animation/SVGSMILElement.h:
1787 2017-10-20 Ryosuke Niwa <rniwa@webkit.org>
1789 Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
1790 https://bugs.webkit.org/show_bug.cgi?id=178607
1792 Reviewed by Eric Carlson.
1794 Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
1795 semantically sensisble. Since these elements are only functional when their immediate parents are
1796 HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
1797 some of its ancestor had changed by insertion or removal.
1799 * html/HTMLSourceElement.cpp:
1800 (WebCore::HTMLSourceElement::insertedInto):
1801 (WebCore::HTMLSourceElement::removedFrom):
1802 * html/HTMLTrackElement.cpp:
1803 (WebCore::HTMLTrackElement::insertedInto):
1804 (WebCore::HTMLTrackElement::removedFrom):
1806 2017-10-20 Keith Miller <keith_miller@apple.com>
1808 Unreviewed, fix windows build.
1811 * WebCore.xcodeproj/project.pbxproj:
1813 2017-10-20 Daniel Bates <dabates@apple.com>
1815 Use "= default" for more default constructors and destructors in WebCore
1816 https://bugs.webkit.org/show_bug.cgi?id=178585
1818 Reviewed by Alex Christensen.
1820 Also remove some destructors that would be implicitly generated.
1822 * Modules/applepay/PaymentMerchantSession.h:
1823 (WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
1824 * platform/ControlStates.h:
1825 (WebCore::ControlStates::~ControlStates): Deleted.
1826 * platform/PlatformEvent.h:
1827 (WebCore::PlatformEvent::~PlatformEvent): Use default.
1828 * platform/PlatformStrategies.h:
1829 (WebCore::PlatformStrategies::PlatformStrategies): Ditto.
1830 * platform/image-decoders/gif/GIFImageReader.h:
1831 (GIFFrameContext::GIFFrameContext):
1832 (GIFFrameContext::~GIFFrameContext): Deleted.
1833 (GIFImageReader::~GIFImageReader): Deleted.
1834 * rendering/RenderBlockFlow.h:
1835 (WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.
1837 2017-10-20 Zalan Bujtas <zalan@apple.com>
1839 [FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
1840 https://bugs.webkit.org/show_bug.cgi?id=178562
1841 <rdar://problem/35089015>
1843 Reviewed by Simon Fraser.
1845 This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout().
1846 A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).
1848 Covered by existing tests.
1850 * page/FrameView.cpp:
1851 (WebCore::FrameView::layout):
1853 2017-10-20 Said Abou-Hallawa <sabouhallawa@apple.com>
1855 When destroying a resource, register "only" the clients who are losing their resource as having pending resources
1856 https://bugs.webkit.org/show_bug.cgi?id=178567
1857 <rdar://problem/35064781>
1859 Reviewed by Simon Fraser.
1861 SVGResources::resourceDestroyed() will return a bool indicating whether
1862 it had a reference to the destroyed resource or not. If it returns true
1863 SVGResourcesCache::resourceDestroyed() will register the client Element
1864 as having pending resources.
1866 * rendering/svg/SVGResources.cpp:
1867 (WebCore::paintingResourceFromSVGPaint):
1868 (WebCore::SVGResources::removeClientFromCache const):
1869 (WebCore::SVGResources::resourceDestroyed):
1870 (WebCore::SVGResources::buildSetOfResources):
1871 (WebCore::SVGResources::resetClipper):
1872 (WebCore::SVGResources::resetFilter):
1873 (WebCore::SVGResources::resetMarkerStart):
1874 (WebCore::SVGResources::resetMarkerMid):
1875 (WebCore::SVGResources::resetMarkerEnd):
1876 (WebCore::SVGResources::resetMasker):
1877 (WebCore::SVGResources::resetFill):
1878 (WebCore::SVGResources::resetStroke):
1879 (WebCore::SVGResources::resetLinkedResource):
1880 * rendering/svg/SVGResources.h:
1881 (WebCore::SVGResources::isEmpty const):
1882 (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
1883 (WebCore::SVGResources::MarkerData::MarkerData): Deleted.
1884 (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
1885 * rendering/svg/SVGResourcesCache.cpp:
1886 (WebCore::SVGResourcesCache::resourceDestroyed):
1888 2017-10-20 Ryosuke Niwa <rniwa@webkit.org>
1890 Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
1891 https://bugs.webkit.org/show_bug.cgi?id=178568
1893 Reviewed by Antti Koivisto.
1895 Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
1896 and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.
1898 Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.
1900 No new tests since there should be no behavioral changes.
1902 * dom/ContainerNode.cpp:
1903 (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
1904 (WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
1905 (WebCore::collectChildrenAndRemoveFromOldParent):
1906 (WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
1907 (WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
1908 (WebCore::willRemoveChild): Deleted. Ditto.
1909 (WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
1910 (WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
1911 (WebCore::ContainerNode::parserRemoveChild): Ditto.
1912 (WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
1913 outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
1914 doesn't execute any code with a side effect before invoking the callback.
1915 (WebCore::ContainerNode::removeChildren):
1916 (WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
1917 * dom/ContainerNode.h:
1918 (WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
1919 initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
1920 * editing/ApplyStyleCommand.cpp:
1921 (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
1922 * editing/ReplaceNodeWithSpanCommand.cpp:
1923 (WebCore::swapInNodePreservingAttributesAndChildren):
1924 * svg/SVGUseElement.cpp:
1925 (WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.
1927 2017-10-20 Youenn Fablet <youenn@apple.com>
1929 ResourceResponse should have a ServiceWorker source
1930 https://bugs.webkit.org/show_bug.cgi?id=178593
1932 Reviewed by Alex Christensen.
1934 Covered by updated tests.
1936 Added ResourceResponse::Source::ServiceWorker.
1937 Added internals to get FetchResponse source.
1939 * inspector/InspectorNetworkAgent.cpp:
1940 (WebCore::responseSource):
1941 * loader/ResourceLoader.cpp:
1942 (WebCore::logResourceResponseSource):
1943 * page/DiagnosticLoggingKeys.cpp:
1944 (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
1945 * page/DiagnosticLoggingKeys.h:
1946 * platform/network/ResourceResponseBase.h:
1947 * testing/Internals.cpp:
1948 (WebCore::responseSourceToString):
1949 (WebCore::Internals::fetchResponseSource):
1950 * testing/Internals.h:
1951 * testing/Internals.idl:
1953 2017-10-20 Andy Estes <aestes@apple.com>
1955 Generated serializers do not properly handle optional interface attributes
1956 https://bugs.webkit.org/show_bug.cgi?id=178542
1958 Reviewed by Sam Weinig.
1960 * bindings/scripts/CodeGeneratorJS.pm:
1961 (GenerateSerializerDefinition):
1962 * bindings/scripts/test/JS/JSTestSerialization.cpp:
1963 (WebCore::JSTestSerialization::serialize):
1965 2017-10-20 Antoine Quint <graouts@apple.com>
1967 [Web Animations] Provide basic timeline and animation interfaces
1968 https://bugs.webkit.org/show_bug.cgi?id=178526
1970 Reviewed by Dean Jackson.
1972 We're getting Web Animations work started by implementing a very minimal codebase which provides
1973 a DocumentTimeline class which has an instance created for each Document. The parent class,
1974 AnimationTimeline, allows for animations to be added and removed, and animations can be created
1975 using the Animation class, with an optional timeline as parameter.
1977 Tests: webanimations/animation-creation-basic.html
1978 webanimations/document-timeline.html
1981 * Configurations/FeatureDefines.xcconfig:
1982 * DerivedSources.make:
1983 * PlatformWin.cmake:
1984 * WebCore.xcodeproj/project.pbxproj:
1985 * animation/AnimationTimeline.cpp: Added.
1986 (WebCore::AnimationTimeline::AnimationTimeline):
1987 (WebCore::AnimationTimeline::~AnimationTimeline):
1988 (WebCore::AnimationTimeline::addAnimation):
1989 (WebCore::AnimationTimeline::removeAnimation):
1990 * animation/AnimationTimeline.h: Added.
1991 (WebCore::AnimationTimeline::isDocumentTimeline const):
1992 (WebCore::AnimationTimeline::classType const):
1993 * animation/AnimationTimeline.idl: Added.
1994 * animation/DocumentTimeline.cpp: Added.
1995 (WebCore::DocumentTimeline::create):
1996 (WebCore::DocumentTimeline::DocumentTimeline):
1997 * animation/DocumentTimeline.h: Added.
1998 * animation/DocumentTimeline.idl: Added.
1999 * animation/WebAnimation.cpp: Added.
2000 (WebCore::WebAnimation::create):
2001 (WebCore::WebAnimation::WebAnimation):
2002 (WebCore::WebAnimation::~WebAnimation):
2003 * animation/WebAnimation.h: Added.
2004 * animation/WebAnimation.idl: Added.
2005 * bindings/js/JSAnimationTimelineCustom.cpp: Added.
2006 (WebCore::toJSNewlyCreated):
2008 * bindings/js/WebCoreBuiltinNames.h:
2010 (WebCore::Document::timeline):
2013 * page/RuntimeEnabledFeatures.h:
2014 (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):
2016 2017-10-20 Commit Queue <commit-queue@webkit.org>
2018 Unreviewed, rolling out r223744, r223750, and r223751.
2019 https://bugs.webkit.org/show_bug.cgi?id=178594
2021 These caused consistent failures in test that existed and were
2022 added in the patches. (Requested by mlewis13 on #webkit).
2024 Reverted changesets:
2026 "[JSC] ScriptFetcher should be notified directly from module
2028 https://bugs.webkit.org/show_bug.cgi?id=178340
2029 https://trac.webkit.org/changeset/223744
2031 "Unreviewed, fix changed line number in test expect files"
2032 https://bugs.webkit.org/show_bug.cgi?id=178340
2033 https://trac.webkit.org/changeset/223750
2035 "Unreviewed, follow up to reflect comments"
2036 https://bugs.webkit.org/show_bug.cgi?id=178340
2037 https://trac.webkit.org/changeset/223751
2039 2017-10-20 Zalan Bujtas <zalan@apple.com>
2041 [FrameView::layout cleanup] Move can-enter-layout logic to a separate function
2042 https://bugs.webkit.org/show_bug.cgi?id=178546
2043 <rdar://problem/35083894>
2045 Reviewed by Antti Koivisto.
2047 No change in functionality.
2049 * page/FrameView.cpp:
2050 (WebCore::FrameView::canPerformLayout const):
2051 (WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
2052 does not seem to have high value.
2055 2017-10-20 Dean Jackson <dino@apple.com>
2057 Add createImageBitmap to Window and Worker
2058 https://bugs.webkit.org/show_bug.cgi?id=178573
2059 <rdar://problem/35092692>
2061 Reviewed by Sam Weinig.
2063 Implement the createImageBitmap functions that are exposed on the Window
2066 Covered by the Web Platform Tests.
2068 * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
2070 * html/ImageBitmap.h: Change the order of the classes in the Variant
2071 to match the order of definitions in the IDL.
2072 * page/DOMWindow.cpp:
2073 (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
2075 * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
2076 * workers/WorkerGlobalScope.cpp:
2077 (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
2078 * workers/WorkerGlobalScope.h:
2080 2017-10-20 Joanmarie Diggs <jdiggs@igalia.com>
2082 AX: [ATK] Events missing and state incorrect for aria-activedescendant
2083 https://bugs.webkit.org/show_bug.cgi?id=178523
2085 Reviewed by Chris Fleizach.
2087 When the aria-activedescendant of an element changes, emit object:state-changed:focused.
2088 When a focused element has a valid active descendant, do not expose the focused state on
2089 the element, but rather on the active descendant. Also expose the focusable state on the
2092 Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
2093 accessibility/gtk/aria-activedescendant.html
2095 * accessibility/AccessibilityObject.cpp:
2096 (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
2097 (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
2098 * accessibility/AccessibilityObject.h:
2099 * accessibility/AccessibilityRenderObject.cpp:
2100 (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
2101 * accessibility/atk/AXObjectCacheAtk.cpp:
2102 (WebCore::AXObjectCache::postPlatformNotification):
2103 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2104 (setAtkStateSetFromCoreObject):
2106 2017-10-20 Ms2ger <Ms2ger@igalia.com>
2108 Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
2109 https://bugs.webkit.org/show_bug.cgi?id=178572
2111 Reviewed by Žan Doberšek.
2113 Test: fast/canvas/webgl/webgl2/constants.html
2115 * html/canvas/WebGL2RenderingContext.idl:
2117 2017-10-20 Miguel Gomez <magomez@igalia.com>
2119 [GTK][WPE] Fix review comments on WEBPImageDecoder
2120 https://bugs.webkit.org/show_bug.cgi?id=178080
2122 Reviewed by Said Abou-Hallawa.
2124 Properly free the demuxer in case of error, improve the code to detect the first
2125 required frame to decode, fix the usage of the DecodingStatus and some styling
2128 Covered by existent tests.
2130 * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2131 (WebCore::webpFrameAtIndex):
2132 (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
2133 (WebCore::WEBPImageDecoder::decode):
2134 (WebCore::WEBPImageDecoder::decodeFrame):
2135 (WebCore::WEBPImageDecoder::initFrameBuffer):
2136 (WebCore::WEBPImageDecoder::clearFrameBufferCache):
2138 2017-10-20 Basuke Suzuki <Basuke.Suzuki@sony.com>
2140 [Curl] Clean up old style code in old curl files.
2141 https://bugs.webkit.org/show_bug.cgi?id=178569
2143 Reviewed by Ryosuke Niwa.
2145 * platform/network/curl/AuthenticationChallenge.h:
2146 * platform/network/curl/CertificateInfo.h:
2147 * platform/network/curl/CookieJarCurl.h:
2148 * platform/network/curl/CurlCacheEntry.h:
2149 * platform/network/curl/CurlCacheManager.cpp:
2150 (WebCore::CurlCacheManager::singleton):
2151 (WebCore::CurlCacheManager::getInstance): Deleted.
2152 * platform/network/curl/CurlCacheManager.h:
2153 * platform/network/curl/CurlContext.cpp:
2154 (WebCore::CurlContext::singleton):
2155 * platform/network/curl/CurlContext.h:
2156 (WebCore::CurlContext::singleton): Deleted.
2157 * platform/network/curl/CurlJobManager.cpp:
2158 (WebCore::CurlJobManager::singleton):
2159 * platform/network/curl/CurlJobManager.h:
2160 (WebCore::CurlJobManager::singleton): Deleted.
2161 * platform/network/curl/CurlRequest.cpp:
2162 (WebCore::CurlRequest::setupTransfer):
2163 * platform/network/curl/CurlRequest.h:
2164 * platform/network/curl/CurlRequestDelegate.h:
2165 * platform/network/curl/CurlResponse.h:
2166 (WebCore::CurlResponse::isolatedCopy const):
2167 * platform/network/curl/CurlSSLHandle.h:
2168 * platform/network/curl/CurlSSLVerifier.h:
2169 * platform/network/curl/DownloadBundle.h:
2170 * platform/network/curl/MultipartHandle.h:
2171 * platform/network/curl/ResourceError.h:
2172 * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2173 (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
2174 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2175 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
2176 (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
2177 (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
2178 * platform/network/curl/ResourceRequest.h:
2179 (WebCore::ResourceRequest::ResourceRequest):
2180 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2181 (WebCore::ResourceRequest::cfURLRequest const):
2182 (WebCore::ResourceRequest::httpPipeliningEnabled):
2183 (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
2184 (WebCore::ResourceRequest::doUpdatePlatformRequest):
2185 (WebCore::ResourceRequest::doUpdateResourceRequest):
2186 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2187 (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
2188 (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
2189 * platform/network/curl/ResourceResponseCurl.cpp:
2190 (WebCore::ResourceResponse::isAppendableHeader):
2191 (WebCore::ResourceResponse::ResourceResponse):
2193 2017-10-20 Frederic Wang <fwang@igalia.com>
2195 RenderLayerCompositor: Move implementation of simple methods into the header file.
2196 https://bugs.webkit.org/show_bug.cgi?id=178514
2198 Reviewed by Darin Adler.
2200 No new tests, behavior unchanged.
2202 2017-10-19 Antti Koivisto <antti@apple.com>
2204 Support ::before/::after pseudo elements on elements with display:contents
2205 https://bugs.webkit.org/show_bug.cgi?id=178513
2207 Reviewed by Ryosuke Niwa.
2211 div { display:contents }
2212 div::after { content:'foo' }
2214 That is support non-box generating elements with generated content.
2216 * style/RenderTreePosition.cpp:
2217 (WebCore::RenderTreePosition::nextSiblingRenderer const):
2219 Implement full pseudo-inclusive traversal starting from any element (including pseudo)
2220 to locate the next rendering sibling. In case of display:content this may need to look
2223 * style/RenderTreeUpdater.cpp:
2224 (WebCore::textRendererIsNeeded):
2226 RenderTreePosition::nextSiblingRenderer can no longer be called with a node that already has a renderer.
2227 Maintain the existing behavior.
2229 * style/RenderTreeUpdaterGeneratedContent.cpp:
2230 (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2231 (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
2233 Don't require for host to have a renderer.
2235 * style/RenderTreeUpdaterGeneratedContent.h:
2236 * style/StyleTreeResolver.cpp:
2237 (WebCore::Style::TreeResolver::resolvePseudoStyle):
2239 2017-10-20 Keith Miller <keith_miller@apple.com>
2241 Move common bindings files to unified sources
2242 https://bugs.webkit.org/show_bug.cgi?id=178561
2244 Rubber-stamped by Ryosuke Niwa.
2246 This patch moves most of the common bindings files to unified sources.
2248 Additionally, it adds a change to make_names to unique a struct
2249 name that caused name conflicts that I missed when I made the
2250 source changes before.
2252 Lastly, add missing reference to WebCoreJSBuiltins.cpp in CMake build.
2254 No new behavior no tests.
2258 * WebCore.xcodeproj/project.pbxproj:
2259 * dom/make_names.pl:
2260 (printFactoryCppFile):
2262 2017-10-20 Saam Barati <sbarati@apple.com>
2264 Optimize accesses to how we get the direct prototype
2265 https://bugs.webkit.org/show_bug.cgi?id=178548
2267 Reviewed by Yusuke Suzuki.
2269 No new tests: no functionality change.
2271 * bindings/js/JSDOMAbstractOperations.h:
2272 (WebCore::isVisibleNamedProperty):
2273 (WebCore::accessVisibleNamedProperty):
2274 * bindings/js/JSDOMWindowBase.cpp:
2275 (WebCore::toJSDOMWindow):
2276 * bindings/js/JSDOMWindowProperties.cpp:
2277 (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
2278 * bindings/js/JSPluginElementFunctions.cpp:
2279 (WebCore::pluginElementCustomGetOwnPropertySlot):
2280 * bindings/js/WorkerScriptController.cpp:
2281 (WebCore::WorkerScriptController::initScript):
2282 * bindings/scripts/CodeGeneratorJS.pm:
2284 (GeneratePutByIndex):
2285 (GenerateConstructorHelperMethods):
2286 * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2287 (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
2288 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2289 (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
2290 (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
2291 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2292 (WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
2293 (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
2294 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2295 (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
2296 (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
2297 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2298 (WebCore::JSTestNamedSetterNoIdentifier::put):
2299 (WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
2300 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2301 (WebCore::JSTestNamedSetterThrowingException::put):
2302 (WebCore::JSTestNamedSetterThrowingException::putByIndex):
2303 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2304 (WebCore::JSTestNamedSetterWithIdentifier::put):
2305 (WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
2306 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2307 (WebCore::JSTestNamedSetterWithIndexedGetter::put):
2308 (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
2309 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2310 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
2311 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
2312 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2313 (WebCore::JSTestNamedSetterWithUnforgableProperties::put):
2314 (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):
2316 2017-10-20 Yusuke Suzuki <utatane.tea@gmail.com>
2318 [JSC] ScriptFetcher should be notified directly from module pipeline
2319 https://bugs.webkit.org/show_bug.cgi?id=178340
2321 Reviewed by Sam Weinig.
2325 * bindings/js/JSMainThreadExecState.h:
2326 (WebCore::JSMainThreadExecState::loadModule):
2327 * bindings/js/ScriptController.cpp:
2328 (WebCore::ScriptController::loadModuleScriptInWorld):
2329 (WebCore::jsValueToModuleKey): Deleted.
2330 (WebCore::ScriptController::setupModuleScriptHandlers): Deleted.
2331 * bindings/js/ScriptController.h:
2332 * dom/LoadableModuleScript.cpp:
2333 (WebCore::LoadableModuleScript::notifyLoadFailed):
2334 * dom/LoadableModuleScript.h:
2336 2017-10-19 Ms2ger <Ms2ger@igalia.com>
2338 Remove proprietary constants from WebGL2RenderingContext.
2339 https://bugs.webkit.org/show_bug.cgi?id=178511
2341 Reviewed by Ryosuke Niwa.
2343 As far as I can tell, these constants are not in the specification,
2344 and no other browser supports them.
2346 No new tests: just code removal.
2348 * html/canvas/WebGL2RenderingContext.idl:
2350 2017-10-19 Zalan Bujtas <zalan@apple.com>
2352 [FrameView::layout cleanup] Move style update related logic to a separate function
2353 https://bugs.webkit.org/show_bug.cgi?id=178558
2354 <rdar://problem/35088218>
2356 Reviewed by Simon Fraser.
2358 No change in functionality.
2360 * page/FrameView.cpp:
2361 (WebCore::FrameView::ensureStyleIsUpToDateForLayout):
2362 (WebCore::FrameView::layout):
2365 2017-10-19 JF Bastien <jfbastien@apple.com>
2367 WebAssembly: no VM / JS version of everything but Instance
2368 https://bugs.webkit.org/show_bug.cgi?id=177473
2370 Reviewed by Filip Pizlo, Saam Barati.
2372 * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
2373 included in JSWebAssemblyModule.h.
2374 * bindings/js/SerializedScriptValue.cpp: Update postMessage code
2375 according to C++ API changes.
2377 2017-10-19 Chris Dumez <cdumez@apple.com>
2379 SerializedScriptValue passed to postMessage() cannot be null
2380 https://bugs.webkit.org/show_bug.cgi?id=178550
2382 Reviewed by Youenn Fablet.
2384 SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
2385 should use Ref<> type, not RefPtr<>.
2387 * dom/MessagePortChannel.h:
2388 * dom/default/PlatformMessagePortChannel.cpp:
2389 (WebCore::MessagePortChannel::postMessageToRemote):
2390 * workers/WorkerGlobalScopeProxy.h:
2391 * workers/WorkerMessagingProxy.cpp:
2392 (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
2393 (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
2394 * workers/WorkerMessagingProxy.h:
2395 * workers/WorkerObjectProxy.h:
2396 * workers/service/context/ServiceWorkerThread.cpp:
2398 2017-10-19 Daniel Bates <dabates@apple.com>
2400 Use "= default" to denote default constructor or destructor
2401 https://bugs.webkit.org/show_bug.cgi?id=178528
2403 Rubber-stamped by Andy Estes.
2405 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
2406 * Modules/applepay/ApplePayError.cpp:
2407 * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
2408 * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
2409 * Modules/applepay/ApplePaySession.cpp:
2410 * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
2411 * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
2412 * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2413 * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
2414 * Modules/applepay/Payment.h:
2415 * Modules/applepay/PaymentCoordinatorClient.h:
2416 * Modules/credentials/BasicCredential.cpp:
2417 * Modules/credentials/FederatedCredential.cpp:
2418 * Modules/credentials/NavigatorCredentials.cpp:
2419 * Modules/credentials/PasswordCredential.cpp:
2420 * Modules/encryptedmedia/CDMClient.h:
2421 * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
2422 * Modules/encryptedmedia/legacy/LegacyCDM.h:
2423 * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
2424 * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
2425 * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
2426 * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2427 * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
2428 * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
2429 * Modules/entriesapi/DOMFileSystem.cpp:
2430 * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2431 * Modules/entriesapi/FileSystemEntry.cpp:
2432 * Modules/fetch/FetchLoaderClient.h:
2433 * Modules/gamepad/Gamepad.cpp:
2434 * Modules/gamepad/GamepadEvent.h:
2435 * Modules/gamepad/deprecated/Gamepad.cpp:
2438 2017-10-19 Sam Weinig <sam@webkit.org>
2440 [Bindings] Standardize on DOMPromise as the way to store passed in promises
2441 https://bugs.webkit.org/show_bug.cgi?id=178533
2443 Reviewed by Youenn Fablet.
2445 This standardizes on RefPtr<DOMPromise> as the canonical way to store a promise
2446 that has been passed in from JS. This does not change promises that start off in
2447 WebCore and are passed to JS; they remain using DOMPromiseDeferred and DOMPromiseProxy.
2449 * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2450 * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
2451 * dom/PromiseRejectionEvent.cpp:
2452 * dom/PromiseRejectionEvent.h:
2453 * dom/RejectedPromiseTracker.cpp:
2455 Use a RefPtr<DOMPromise> rather than a JSPromise* to hold onto the promise.
2457 * bindings/IDLTypes.h:
2459 Use IDLWrapper to get better defaults, since DOMPromise is refcounted.
2461 * bindings/js/JSDOMConvertPromise.h:
2462 (WebCore::Converter<IDLPromise<T>>::convert):
2464 Switch default conversion to return a RefPtr<DOMPromise> rather than a JSPromise*
2466 (WebCore::JSConverter<IDLPromise<T>>::convert):
2468 Add support for converting from a DOMPromise to a JSValue.
2470 * bindings/js/JSDOMPromise.cpp:
2471 * bindings/js/JSDOMPromise.h:
2472 (WebCore::DOMPromise::create): Deleted.
2474 Remove now unused constructor.
2476 * workers/service/ExtendableEvent.cpp:
2477 (WebCore::ExtendableEvent::waitUntil):
2478 * workers/service/ExtendableEvent.h:
2479 * workers/service/ExtendableEvent.idl:
2480 * workers/service/FetchEvent.cpp:
2481 (WebCore::FetchEvent::respondWith):
2482 (WebCore::FetchEvent::promiseIsSettled):
2483 * workers/service/FetchEvent.h:
2484 * workers/service/FetchEvent.idl:
2486 Address FIXMEs and remove need for passing an ExecState to ExtendableEvent
2487 and FetchEvent by using the new default conversion to DOMPromise.
2489 2017-10-19 Sam Weinig <sam@webkit.org>
2491 [Settings] Move global settings into their own file
2492 https://bugs.webkit.org/show_bug.cgi?id=178512
2494 Reviewed by Darin Adler.
2496 Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
2497 It's called DeprecatedGlobalSettings to indicate that this is an anti-pattern we would
2498 like to discourage, as WebCore can operate in a process with multiple clients, each of
2499 which should be able to set their own preferences.
2501 * WebCore.xcodeproj/project.pbxproj:
2506 * page/DeprecatedGlobalSettings.cpp: Copied from Source/WebCore/page/SettingsBase.cpp.
2507 * page/DeprecatedGlobalSettings.h: Copied from Source/WebCore/page/SettingsBase.h.
2508 * page/SettingsBase.cpp:
2509 * page/SettingsBase.h:
2511 Move all global settings out of SettingsBase and into the new DeprecatedGlobalSettings.
2513 * Modules/mediastream/UserMediaRequest.cpp:
2514 * bindings/js/CommonVM.cpp:
2515 * css/CSSStyleDeclaration.cpp:
2516 * dom/DataTransfer.cpp:
2517 * dom/DataTransferItemList.cpp:
2518 * editing/Editor.cpp:
2519 * loader/ResourceLoadObserver.cpp:
2520 * page/FrameView.cpp:
2521 * page/PerformanceMonitor.cpp:
2522 * platform/ScrollbarTheme.cpp:
2523 (WebCore::ScrollbarTheme::theme):
2524 * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
2525 * platform/graphics/MediaPlayer.cpp:
2526 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2527 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2528 * platform/mac/NSScrollerImpDetails.mm:
2529 * platform/mock/ScrollbarThemeMock.cpp:
2530 * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2531 * platform/network/ios/NetworkStateNotifierIOS.mm:
2532 * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2533 * platform/win/MainThreadSharedTimerWin.cpp:
2534 * rendering/RenderLayer.cpp:
2535 * rendering/RenderListBox.cpp:
2536 * testing/InternalSettings.cpp:
2537 * testing/Internals.cpp:
2539 Update users of global settings to reference the new class name.
2541 2017-10-19 Youenn Fablet <youenn@apple.com>
2543 Add preliminary support for ServiceWorker Handle Fetch
2544 https://bugs.webkit.org/show_bug.cgi?id=178475
2545 <rdar://problem/35066424>
2547 Reviewed by Chris Dumez.
2549 Test: http/tests/workers/service/basic-fetch.https.html
2551 Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
2552 A script context is now storing its selected service worker identifier. This should be fully implemented later on.
2553 This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
2554 Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
2556 * WebCore.xcodeproj/project.pbxproj:
2557 * dom/ScriptExecutionContext.h:
2558 (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
2559 (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
2560 * loader/DocumentThreadableLoader.cpp:
2561 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2562 * loader/FetchOptions.h:
2563 (WebCore::isPotentialNavigationOrSubresourceRequest):
2564 (WebCore::isNonSubresourceRequest):
2565 * loader/ResourceLoaderOptions.h:
2566 * loader/WorkerThreadableLoader.cpp:
2567 (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
2568 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2569 * loader/WorkerThreadableLoader.h:
2570 * platform/network/ResourceRequestBase.h:
2571 * platform/network/ResourceResponseBase.h:
2572 * workers/WorkerThread.h:
2573 * workers/service/ServiceWorkerContainer.cpp:
2574 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2575 * workers/service/context/SWContextManager.cpp: Removed.
2576 * workers/service/context/ServiceWorkerThread.h:
2578 2017-10-19 Zalan Bujtas <zalan@apple.com>
2580 [FrameView::layout cleanup] Move post layout task scheduling logic to a separate function
2581 https://bugs.webkit.org/show_bug.cgi?id=178538
2582 <rdar://problem/35080743>
2584 Reviewed by Simon Fraser.
2586 Move and reorganize post layout task scheduling code.
2588 Covered by existing tests.
2590 * page/FrameView.cpp:
2591 (WebCore::FrameView::layout):
2592 (WebCore::FrameView::runOrSchedulePostLayoutTasks):
2595 2017-10-19 Zalan Bujtas <zalan@apple.com>
2597 [FrameView::layout cleanup] Move scrollbars setup logic to a separate function
2598 https://bugs.webkit.org/show_bug.cgi?id=178394
2599 <rdar://problem/35031066>
2601 Reviewed by Antti Koivisto.
2603 Decouple scrollbars setup and the unrelated first-layout logic.
2604 FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time).
2606 Covered by existing test cases.
2608 * page/FrameView.cpp:
2609 (WebCore::FrameView::adjustScrollbarsForLayout):
2610 (WebCore::FrameView::layout):
2613 2017-10-19 Tim Horton <timothy_horton@apple.com>
2615 Expand r209943 to suppress paste during provisional navigation as well
2616 https://bugs.webkit.org/show_bug.cgi?id=178429
2617 <rdar://problem/33952830>
2619 Reviewed by Dean Jackson.
2621 No new tests; adjusted an existing test to cover this case.
2623 * editing/Editor.cpp:
2624 (WebCore::Editor::canPaste const):
2625 Disable pasting during provisional navigation, like r209943 did for
2626 various other forms of text input.
2628 (WebCore::Editor::shouldInsertText const):
2629 * dom/EventDispatcher.cpp:
2630 (WebCore::shouldSuppressEventDispatchInDOM):
2631 * loader/FrameLoader.cpp:
2632 (WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
2633 (WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
2634 * loader/FrameLoader.h:
2636 Rename the setting to be about editing-related text input, not "keyboard" input.
2638 * editing/EditorCommand.cpp:
2639 (WebCore::allowExecutionWhenDisabled):
2640 (WebCore::doNotAllowExecutionWhenDisabled):
2641 (WebCore::allowExecutionWhenDisabledCopyCut):
2642 (WebCore::allowExecutionWhenDisabledPaste):
2643 (WebCore::createCommandMap):
2644 (WebCore::Editor::Command::allowExecutionWhenDisabled const):
2645 Completely disable execution of paste events when in no-text-input-from-editing mode.
2646 Otherwise, even though canPaste was false and we wouldn't do a default paste action,
2647 we would still dispatch the paste event to the DOM.
2649 2017-10-19 Dean Jackson <dino@apple.com>
2651 Avoid duplicate multisample resolve before WebGL compositing
2652 https://bugs.webkit.org/show_bug.cgi?id=178537
2653 <rdar://problem/35080724>
2657 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2658 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2660 2017-10-19 Dean Jackson <dino@apple.com>
2662 Avoid duplicate multisample resolve before WebGL compositing
2663 https://bugs.webkit.org/show_bug.cgi?id=178537
2664 <rdar://problem/35080724>
2666 Reviewed by Jer Noble.
2668 Both endPaint and prepareTexture were doing the MSAA resolve
2669 into the renderbuffer, and being called on macOS before compositing.
2670 Without that step, endPaint became unnecessary on iOS so I renamed
2671 it presentRenderbuffer.
2673 Covered by existing tests.
2675 * platform/graphics/GraphicsContext3D.h:
2676 * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2677 (WebCore::GraphicsContext3D::presentRenderbuffer):
2678 (WebCore::GraphicsContext3D::endPaint): Deleted.
2679 * platform/graphics/cocoa/WebGLLayer.mm:
2680 (-[WebGLLayer display]):
2682 2017-10-19 Andy Estes <aestes@apple.com>
2684 [Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
2685 https://bugs.webkit.org/show_bug.cgi?id=178535
2687 Reviewed by Alex Christensen.
2689 Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.
2691 * Modules/paymentrequest/PaymentRequest.cpp:
2692 (WebCore::PaymentRequest::create):
2694 2017-10-19 Daniel Bates <dabates@apple.com>
2696 Share logic in InlineTextBox to compute selection rect
2697 https://bugs.webkit.org/show_bug.cgi?id=178232
2698 <rdar://problem/34963452>
2700 Reviewed by Zalan Bujtas.
2702 Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
2703 rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
2704 and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
2705 We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
2706 in a subsequent patch.
2708 We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
2709 we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
2710 currently expect the enclosing integral rectangle of the selection rectangle. The function
2711 paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
2712 drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
2713 we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
2716 * rendering/InlineTextBox.cpp:
2717 (WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
2718 localSelectionRectWithClampedPositions() and modified code to use it.
2719 (WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
2720 (WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
2721 data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
2722 (WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
2723 (WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
2724 (WebCore::InlineTextBox::paintCompositionBackground): Ditto.
2725 (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
2726 (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
2727 (WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
2728 * rendering/InlineTextBox.h:
2730 2017-10-19 Daniel Bates <dabates@apple.com>
2732 Referrer policy should be inherited from creator
2733 https://bugs.webkit.org/show_bug.cgi?id=178403
2734 <rdar://problem/31546136>
2736 Reviewed by Andy Estes.
2738 As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
2739 (17 October 2017), the referrer policy of a document should initially be inherited from its
2742 Tests: http/tests/security/referrer-policy-nested-subframe.html
2743 http/tests/security/referrer-policy-nested-window-open.html
2744 http/tests/security/referrer-policy-subframe-window-open.html
2745 http/tests/security/referrer-policy-window-open-subframe.html
2748 (WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
2749 * loader/FrameLoader.cpp:
2750 (WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
2751 of the creator document. The creator document is document of the parent frame or the document
2752 of the opener for a subframe or child window, respectively. If we do not have a creator frame
2753 then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
2754 * loader/FrameLoader.h:
2756 2017-10-19 Zalan Bujtas <zalan@apple.com>
2758 [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
2759 https://bugs.webkit.org/show_bug.cgi?id=178518
2760 <rdar://problem/35075409>
2762 Reviewed by Antti Koivisto.
2764 This patch tightens existing reentrancy policy on performPostLayoutTasks.
2766 Covered by existing test cases.
2768 * page/FrameView.cpp:
2769 (WebCore::FrameView::FrameView):
2770 (WebCore::FrameView::reset):
2771 (WebCore::FrameView::layout):
2772 (WebCore::FrameView::performPostLayoutTasks):
2775 2017-10-19 Chris Dumez <cdumez@apple.com>
2777 Unreviewed, revert r223650 as it caused crashes on the bots.
2779 * WebCore.xcodeproj/project.pbxproj:
2780 * dom/ScriptExecutionContext.h:
2781 * loader/DocumentThreadableLoader.cpp:
2782 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2783 * loader/FetchOptions.h:
2784 * loader/ResourceLoaderOptions.h:
2785 * loader/WorkerThreadableLoader.cpp:
2786 (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
2787 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2788 * loader/WorkerThreadableLoader.h:
2789 * platform/network/ResourceRequestBase.h:
2790 * platform/network/ResourceResponseBase.h:
2791 * workers/WorkerThread.h:
2792 * workers/service/ServiceWorkerContainer.cpp:
2793 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2794 * workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2795 (WebCore::SWContextManager::singleton):
2796 (WebCore::SWContextManager::SWContextManager):
2797 (WebCore::SWContextManager::startServiceWorkerContext):
2798 * workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2799 * workers/service/context/ServiceWorkerThread.h:
2801 2017-10-19 Zalan Bujtas <zalan@apple.com>
2803 [FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
2804 https://bugs.webkit.org/show_bug.cgi?id=178503
2805 <rdar://problem/35066561>
2807 Reviewed by Antti Koivisto.
2809 Covered by existing tests.
2811 * page/FrameView.cpp:
2812 (WebCore::FrameView::reset):
2813 (WebCore::FrameView::layout):
2814 (WebCore::FrameView::updateLayerPositionsAfterScrolling):
2815 (WebCore::FrameView::updateCompositingLayersAfterScrolling):
2816 (WebCore::FrameView::updateEmbeddedObjects):
2817 (WebCore::FrameView::flushPostLayoutTasksQueue):
2818 (WebCore::FrameView::performPostLayoutTasks):
2819 (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
2822 2017-10-19 Antti Koivisto <antti@apple.com>
2824 Overlapping text on all CSS fonts specs
2825 https://bugs.webkit.org/show_bug.cgi?id=177585
2826 <rdar://problem/34704078>
2828 Reviewed by Daniel Bates.
2830 We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
2831 This resulted in 'rem' units being miscomputed.
2835 Test: fast/html/details-line-height-overlap.html
2837 * style/StyleTreeResolver.cpp:
2838 (WebCore::Style::TreeResolver::Scope::Scope):
2839 (WebCore::Style::TreeResolver::Scope::~Scope):
2841 Only reset overrideDocumentElementStyle when destroying the scope.
2843 (WebCore::Style::TreeResolver::pushScope):
2844 (WebCore::Style::TreeResolver::pushEnclosingScope):
2845 (WebCore::Style::TreeResolver::popScope):
2847 A scope can show up multiple times in scope stack.
2849 * style/StyleTreeResolver.h:
2851 2017-10-19 Ryosuke Niwa <rniwa@webkit.org>
2853 Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
2854 https://bugs.webkit.org/show_bug.cgi?id=178504
2856 Reviewed by Antti Koivisto.
2858 Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
2859 dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
2860 a new templatefunction which takes a closure to do the node insertion to make exactly when
2861 the script becomes runnable clear.
2863 Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
2864 shadow root during insertedInto, and turned ChildChangeSource into an enum class.
2866 * dom/CharacterData.cpp:
2867 (WebCore::CharacterData::parserAppendData):
2868 (WebCore::CharacterData::setDataAndUpdate):
2869 * dom/ContainerNode.cpp:
2870 (WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
2871 (WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
2872 (WebCore::ContainerNode::insertBefore): Ditto.
2873 (WebCore::ContainerNode::changeForChildInsertion): Deleted.
2874 (WebCore::ContainerNode::notifyChildInserted): Deleted.
2875 (WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion.
2876 (WebCore::ContainerNode::replaceChild): Ditto.
2877 (WebCore::ContainerNode::removeChild):
2878 (WebCore::ContainerNode::parserRemoveChild):
2879 (WebCore::ContainerNode::replaceAllChildren): Ditto.
2880 (WebCore::ContainerNode::removeChildren):
2881 (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
2882 (WebCore::ContainerNode::parserAppendChild): Ditto.
2883 (WebCore::ContainerNode::childrenChanged):
2884 (WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
2885 * dom/ContainerNode.h:
2887 (WebCore::Element::childrenChanged):
2888 * html/HTMLOutputElement.cpp:
2889 (WebCore::HTMLOutputElement::childrenChanged):
2890 * svg/SVGClipPathElement.cpp:
2891 (WebCore::SVGClipPathElement::childrenChanged):
2892 * svg/SVGElement.cpp:
2893 (WebCore::SVGElement::childrenChanged):
2894 * svg/SVGFELightElement.cpp:
2895 (WebCore::SVGFELightElement::childrenChanged):
2896 * svg/SVGFilterElement.cpp:
2897 (WebCore::SVGFilterElement::childrenChanged):
2898 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2899 (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
2900 * svg/SVGGradientElement.cpp:
2901 (WebCore::SVGGradientElement::childrenChanged):
2902 * svg/SVGMarkerElement.cpp:
2903 (WebCore::SVGMarkerElement::childrenChanged):
2904 * svg/SVGMaskElement.cpp:
2905 (WebCore::SVGMaskElement::childrenChanged):
2906 * svg/SVGPatternElement.cpp:
2907 (WebCore::SVGPatternElement::childrenChanged):
2908 * svg/SVGTRefElement.cpp:
2909 (WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.
2911 2017-10-19 Ryosuke Niwa <rniwa@webkit.org>
2913 Add an argument indicating the type of removal to Node::removedFrom
2914 https://bugs.webkit.org/show_bug.cgi?id=178505
2916 Reviewed by Antti Koivisto.
2918 Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
2919 whether the node just become disconnected from a document, and whether node's tree scope had changed or not.
2921 These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
2922 guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
2923 Node::isInShadowTree() are both outdated until Node::removedFrom is called.
2925 Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.
2927 Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
2928 the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
2929 This extra check is no longer necessary since no node will be removed from a document without first being inserted
2930 completely somewhere after r223458.
2932 No new tests since there should be no behavioral changes.
2934 * dom/ContainerNodeAlgorithms.cpp:
2935 (WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
2936 (WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
2937 by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
2938 Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
2939 as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
2940 (WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
2941 (WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
2942 * dom/ContainerNodeAlgorithms.h:
2944 (WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
2945 and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
2948 (WebCore::Node::removedFrom):
2949 * dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
2950 the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
2951 (WebCore::Node::RemovalType::RemovalType): Addedl
2952 * dom/ProcessingInstruction.cpp:
2953 (WebCore::ProcessingInstruction::removedFrom):
2954 * dom/ProcessingInstruction.h:
2955 * dom/ShadowRoot.cpp:
2956 (WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
2958 * html/FormAssociatedElement.cpp:
2959 (WebCore::FormAssociatedElement::removedFrom):
2960 * html/FormAssociatedElement.h:
2961 * html/HTMLBaseElement.cpp:
2962 (WebCore::HTMLBaseElement::removedFrom):
2963 * html/HTMLBaseElement.h:
2964 * html/HTMLFormControlElement.cpp:
2965 (WebCore::HTMLFormControlElement::removedFrom):
2966 * html/HTMLFormControlElement.h:
2967 * html/HTMLFormControlElementWithState.cpp:
2968 (WebCore::HTMLFormControlElementWithState::removedFrom):
2969 * html/HTMLFormControlElementWithState.h:
2970 * html/HTMLFormElement.cpp:
2971 (WebCore::HTMLFormElement::removedFrom):
2972 * html/HTMLFormElement.h:
2973 * html/HTMLFrameSetElement.cpp:
2974 (WebCore::HTMLFrameSetElement::removedFrom):
2975 * html/HTMLFrameSetElement.h:
2976 * html/HTMLImageElement.cpp:
2977 (WebCore::HTMLImageElement::removedFrom):
2978 * html/HTMLImageElement.h:
2979 * html/HTMLInputElement.cpp:
2980 (WebCore::HTMLInputElement::removedFrom):
2981 * html/HTMLInputElement.h:
2982 * html/HTMLLinkElement.cpp:
2983 (WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
2984 * html/HTMLLinkElement.h:
2985 * html/HTMLMapElement.cpp:
2986 (WebCore::HTMLMapElement::removedFrom):
2987 * html/HTMLMapElement.h:
2988 * html/HTMLMediaElement.cpp:
2989 (WebCore::HTMLMediaElement::removedFrom):
2990 * html/HTMLMediaElement.h:
2991 * html/HTMLObjectElement.cpp:
2992 (WebCore::HTMLObjectElement::removedFrom):
2993 * html/HTMLObjectElement.h:
2994 * html/HTMLSlotElement.cpp:
2995 (WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
2996 removed from a shadow tree using removalType.treeScopeChanged.
2997 * html/HTMLSlotElement.h:
2998 * html/HTMLSourceElement.cpp:
2999 (WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
3000 (WebCore::HTMLSourceElement::removedFrom): Ditto.
3001 * html/HTMLSourceElement.h:
3002 * html/HTMLStyleElement.cpp:
3003 (WebCore::HTMLStyleElement::removedFrom):
3004 * html/HTMLStyleElement.h:
3005 * html/HTMLTitleElement.cpp:
3006 (WebCore::HTMLTitleElement::removedFrom):
3007 * html/HTMLTitleElement.h:
3008 * html/HTMLTrackElement.cpp:
3009 (WebCore::HTMLTrackElement::removedFrom): Ditto.
3010 * html/HTMLTrackElement.h:
3011 * svg/SVGElement.cpp:
3012 (WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
3013 removalType.disconnectedFromDocument.
3015 * svg/SVGFEImageElement.cpp:
3016 (WebCore::SVGFEImageElement::removedFrom):
3017 * svg/SVGFEImageElement.h:
3018 * svg/SVGFontFaceElement.cpp:
3019 (WebCore::SVGFontFaceElement::removedFrom):
3020 * svg/SVGFontFaceElement.h:
3021 * svg/SVGMPathElement.cpp:
3022 (WebCore::SVGMPathElement::removedFrom):
3023 * svg/SVGMPathElement.h:
3024 * svg/SVGPathElement.cpp:
3025 (WebCore::SVGPathElement::removedFrom):
3026 * svg/SVGPathElement.h:
3027 * svg/SVGSVGElement.cpp:
3028 (WebCore::SVGSVGElement::removedFrom):
3029 * svg/SVGSVGElement.h:
3030 * svg/SVGStyleElement.cpp:
3031 (WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
3032 * svg/SVGStyleElement.h:
3033 * svg/SVGTRefElement.cpp:
3034 (WebCore::SVGTRefElement::removedFrom):
3035 * svg/SVGTRefElement.h:
3036 * svg/SVGTextPathElement.cpp:
3037 (WebCore::SVGTextPathElement::removedFrom):
3038 * svg/SVGTextPathElement.h:
3039 * svg/SVGTitleElement.cpp:
3040 (WebCore::SVGTitleElement::removedFrom):
3041 * svg/SVGTitleElement.h:
3042 * svg/SVGUseElement.cpp:
3043 (WebCore::SVGUseElement::removedFrom):
3044 * svg/SVGUseElement.h:
3045 * svg/animation/SVGSMILElement.cpp:
3046 (WebCore::SVGSMILElement::removedFrom):
3047 * svg/animation/SVGSMILElement.h:
3049 2017-10-19 Ms2ger <Ms2ger@igalia.com>
3051 Update the signatures of compressedTexSubImage3D.
3052 https://bugs.webkit.org/show_bug.cgi?id=178507
3054 Reviewed by Ryosuke Niwa.
3056 No new tests: not much point in adding tests now; this method doesn't
3059 * html/canvas/WebGL2RenderingContext.cpp:
3060 (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
3061 * html/canvas/WebGL2RenderingContext.h:
3062 * html/canvas/WebGL2RenderingContext.idl:
3064 2017-10-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
3066 [curl] Segfault in WebCore::CurlRequest::setupPOST
3067 https://bugs.webkit.org/show_bug.cgi?id=178434
3069 Reviewed by Ryosuke Niwa.
3071 * platform/network/curl/CurlRequest.cpp:
3072 (WebCore::CurlRequest::resolveBlobReferences):
3073 (WebCore::CurlRequest::setupPOST):
3075 2017-10-18 Ryosuke Niwa <rniwa@webkit.org>
3077 Don't expose raw HTML in pasteboard to the web content
3078 https://bugs.webkit.org/show_bug.cgi?id=178422
3079 <rdar://problem/34567052>
3081 Reviewed by Wenson Hsieh.
3083 This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
3084 just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
3085 local file paths and pasting potentially harmful content such as scripts in event handler serialized by
3086 WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
3087 the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.
3089 To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
3090 is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
3091 to be also used in WebContentReader.
3093 Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
3094 http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
3095 http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
3096 PasteWebArchive.SanitizesHTML
3098 * editing/WebContentReader.cpp:
3099 (WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
3100 * editing/WebContentReader.h:
3101 (WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
3102 (WebCore::FrameWebContentReader::FrameWebContentReader): Added.
3103 * editing/cocoa/EditorCocoa.mm:
3104 (WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
3105 avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
3106 into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
3107 (WebCore::Editor::writeSelection): Ditto.
3108 * editing/cocoa/WebContentReaderCocoa.mm:
3109 (WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
3110 instead of the parsed fragment.
3111 (WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
3112 (WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
3113 between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
3114 As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
3115 the main frame's markup would contain blob URLs to refer to those subframes.
3116 (WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
3117 Don't add the subresources to the document loader when the content will be loaded into the same origin since
3118 subresouces are mostly likely available in the document anyway.
3119 (WebCore::WebContentMarkupReader::readWebArchive):
3120 * platform/Pasteboard.h:
3121 (WebCore::PasteboardWebContent): Added contentOrigin.
3122 * platform/PasteboardWriterData.h:
3123 (WebCore::PasteboardWriterData): Ditto.
3124 * platform/ios/PasteboardIOS.mm:
3125 (WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
3126 * platform/ios/PlatformPasteboardIOS.mm:
3127 (WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
3128 * platform/mac/PasteboardMac.mm:
3129 (WebCore::Pasteboard::write): Ditto.
3130 * platform/mac/PasteboardWriter.mm:
3131 (WebCore::createPasteboardWriter): Ditto.
3133 2017-10-18 Sam Weinig <sam@webkit.org>
3135 Another attempt to fix the windows build.
3137 * page/SettingsBase.cpp:
3138 (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
3139 * page/SettingsBase.h:
3141 2017-10-18 Sam Weinig <sam@webkit.org>
3143 Attempt to fix the windows build.
3145 * page/SettingsBase.cpp:
3146 (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
3147 * page/SettingsBase.h:
3149 2017-10-18 Sam Weinig <sam@webkit.org>
3151 [Settings] Convert more settings to be generated
3152 https://bugs.webkit.org/show_bug.cgi?id=177766
3154 Reviewed by Dean Jackson.
3156 - Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
3157 with a more generic, onChange, which allows you to specify a function
3158 in SettingsBase that will be called when the setting changes.
3159 setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
3161 - Moves most (all but two) of the remaining non-static settings from
3162 SettingsBase to Settings.in
3164 * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
3166 * Scripts/GenerateSettings/Settings.py:
3169 (Setting.typeIsValueType):
3170 (Setting.setterFunctionName):
3171 (Setting.setterChangeFunctionName):
3172 (Setting.hasComplexSetter):
3175 Add support for the onChange option.
3179 Migrate most of the remaining non-static settings to Settings.in.
3180 Adopt onChange option.
3182 * page/SettingsBase.cpp:
3183 * page/SettingsBase.h:
3185 Add helper functions for use by the onChange option.
3187 2017-10-18 Chris Dumez <cdumez@apple.com>
3189 Implement ServiceWorkerRegistration.scope / updateViaCache
3190 https://bugs.webkit.org/show_bug.cgi?id=178497
3192 Reviewed by Youenn Fablet.
3194 Implement ServiceWorkerRegistration.scope / updateViaCache.
3196 No new tests, updated existing test.
3198 * WebCore.xcodeproj/project.pbxproj:
3199 * workers/service/ServiceWorkerContainer.cpp:
3200 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3201 * workers/service/ServiceWorkerContainer.h:
3202 * workers/service/ServiceWorkerJob.cpp:
3203 (WebCore::ServiceWorkerJob::resolvedWithRegistration):
3204 * workers/service/ServiceWorkerJob.h:
3205 * workers/service/ServiceWorkerJobClient.h:
3206 * workers/service/ServiceWorkerRegistration.cpp:
3207 (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
3208 (WebCore::ServiceWorkerRegistration::scope const):
3209 (WebCore::ServiceWorkerRegistration::updateViaCache const):
3210 (WebCore::ServiceWorkerRegistration::update):
3211 (WebCore::ServiceWorkerRegistration::unregister):
3212 (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
3213 (WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
3214 (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
3215 * workers/service/ServiceWorkerRegistration.h:
3216 * workers/service/ServiceWorkerRegistration.idl:
3217 * workers/service/ServiceWorkerRegistrationData.cpp:
3218 (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
3219 * workers/service/ServiceWorkerRegistrationData.h:
3220 (WebCore::ServiceWorkerRegistrationData::encode const):
3221 (WebCore::ServiceWorkerRegistrationData::decode):
3222 * workers/service/server/SWClientConnection.cpp:
3223 (WebCore::SWClientConnection::jobResolvedInServer):
3224 * workers/service/server/SWClientConnection.h:
3225 * workers/service/server/SWServerRegistration.cpp:
3226 (WebCore::SWServerRegistration::scriptContextStarted):
3227 (WebCore::SWServerRegistration::data const):
3229 2017-10-18 Youenn Fablet <youenn@apple.com>
3231 Add preliminary support for ServiceWorker Handle Fetch
3232 https://bugs.webkit.org/show_bug.cgi?id=178475
3234 Reviewed by Chris Dumez.
3236 Test: http/tests/workers/service/basic-fetch.https.html
3238 Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
3239 A script context is now storing its selected service worker identifier. This should be fully implemented later on.
3240 This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
3241 Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.
3243 * WebCore.xcodeproj/project.pbxproj:
3244 * dom/ScriptExecutionContext.h:
3245 (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
3246 (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
3247 * loader/DocumentThreadableLoader.cpp:
3248 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3249 * loader/FetchOptions.h:
3250 (WebCore::isPotentialNavigationOrSubresourceRequest):
3251 (WebCore::isNonSubresourceRequest):
3252 * loader/ResourceLoaderOptions.h:
3253 * loader/WorkerThreadableLoader.cpp:
3254 (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
3255 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3256 * loader/WorkerThreadableLoader.h:
3257 * platform/network/ResourceRequestBase.h:
3258 * platform/network/ResourceResponseBase.h:
3259 * workers/WorkerThread.h:
3260 * workers/service/ServiceWorkerContainer.cpp:
3261 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3262 * workers/service/ServiceWorkerProvider.h:
3263 * workers/service/context/SWContextManager.cpp: Removed.
3264 * workers/service/context/ServiceWorkerThread.h:
3265 * workers/service/server/SWServer.h:
3267 2017-10-18 Zalan Bujtas <zalan@apple.com>
3269 [FrameView::layout cleanup] Group related pre-layout code to improve readability
3270 https://bugs.webkit.org/show_bug.cgi?id=178496
3271 <rdar://problem/35065718>
3273 Reviewed by Simon Fraser.
3275 Early returns/asserts/member variable resets etc.
3277 Covered by existing tests.
3279 * page/FrameView.cpp:
3280 (WebCore::FrameView::layout):
3282 2017-10-17 Jiewen Tan <jiewen_tan@apple.com>
3284 Replace some stack raw pointers with RefPtrs within WebCore/html
3285 https://bugs.webkit.org/show_bug.cgi?id=178201
3286 <rdar://problem/34841692>
3288 Reviewed by Ryosuke Niwa.
3290 This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
3291 that are ref countable are blindly selected to be replaced with RefPtrs with one exception
3294 Also, this patch occasionally modifies the return type of some methods, and therefore callers
3295 of those methods are modified accordingly.
3297 * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
3298 (WebCore::LegacyCDM::mediaPlayer const):
3299 * Modules/encryptedmedia/legacy/LegacyCDM.h:
3300 * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
3301 (WebCore::CDMPrivateMediaPlayer::createSession):
3302 * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
3303 (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
3304 * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
3305 * Modules/mediacontrols/MediaControlsHost.cpp:
3306 (WebCore::MediaControlsHost::externalDeviceDisplayName const):
3307 (WebCore::MediaControlsHost::externalDeviceType const):
3309 (WebCore::Element::focusDelegate):
3310 (WebCore::Element::userAgentShadowRoot const):
3311 (WebCore::Element::ensureUserAgentShadowRoot):
3313 * dom/EventContext.cpp:
3314 (WebCore::TouchEventContext::checkReachability const):
3315 * dom/EventPath.cpp:
3316 (WebCore::shouldEventCrossShadowBoundary):
3317 (WebCore::EventPath::setRelatedTarget):
3318 (WebCore::EventPath::retargetTouch):
3320 * dom/EventTarget.cpp:
3321 (WebCore::EventTarget::toNode):
3322 (WebCore::EventTarget::addEventListener):
3323 * dom/EventTarget.h:
3324 * dom/MouseEvent.cpp:
3325 (WebCore::MouseEvent::toElement const):
3326 (WebCore::MouseEvent::fromElement const):
3328 * dom/MouseRelatedEvent.cpp:
3329 (WebCore::MouseRelatedEvent::computeRelativePosition):
3331 (WebCore::Node::toNode):
3333 * dom/ScopedEventQueue.cpp:
3334 * editing/Editor.cpp:
3335 (WebCore::Editor::selectionForCommand):
3336 * editing/EditorCommand.cpp:
3337 (WebCore::targetFrame):
3338 * editing/TextIterator.cpp:
3339 (WebCore::TextIterator::handleReplacedElement):
3340 * html/BaseChooserOnlyDateAndTimeInputType.cpp:
3341 (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
3342 * html/ColorInputType.cpp:
3343 (WebCore::ColorInputType::updateColorSwatch):
3344 (WebCore::ColorInputType::shadowColorSwatch const):
3345 * html/FileInputType.cpp:
3346 (WebCore::FileInputType::disabledAttributeChanged):
3347 (WebCore::FileInputType::multipleAttributeChanged):
3348 * html/FormAssociatedElement.cpp:
3349 (WebCore::FormAssociatedElement::findAssociatedForm):
3350 (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
3351 (WebCore::FormAssociatedElement::resetFormOwner):
3352 (WebCore::FormAssociatedElement::formAttributeChanged):
3353 * html/FormController.cpp:
3354 (WebCore::recordFormStructure):
3355 (WebCore::FormKeyGenerator::formKey):
3356 (WebCore::FormController::restoreControlStateIn):
3357 * html/HTMLAnchorElement.cpp:
3358 (WebCore::appendServerMapMousePosition):
3359 (WebCore::HTMLAnchorElement::handleClick):
3360 * html/HTMLAppletElement.cpp:
3361 (WebCore::HTMLAppletElement::updateWidget):
3362 * html/HTMLAreaElement.cpp:
3363 (WebCore::HTMLAreaElement::imageElement const):
3364 (WebCore::HTMLAreaElement::isFocusable const):
3365 (WebCore::HTMLAreaElement::setFocus):
3366 (WebCore::HTMLAreaElement::updateFocusAppearance):
3367 * html/HTMLBodyElement.cpp:
3368 (WebCore::HTMLBodyElement::scrollLeft):
3369 (WebCore::HTMLBodyElement::setScrollLeft):
3370 (WebCore::HTMLBodyElement::scrollTop):
3371 (WebCore::HTMLBodyElement::setScrollTop):
3372 (WebCore::HTMLBodyElement::scrollHeight):
3373 (WebCore::HTMLBodyElement::scrollWidth):
3374 * html/HTMLCanvasElement.cpp:
3375 (WebCore::HTMLCanvasElement::createElementRenderer):
3377 * html/HTMLDocument.cpp:
3378 (WebCore::HTMLDocument::width):
3379 (WebCore::HTMLDocument::height):
3380 * html/HTMLElement.cpp:
3381 (WebCore::HTMLElement::rendererIsNeeded):
3382 (WebCore::setHasDirAutoFlagRecursively):
3383 (WebCore::HTMLElement::directionality const):
3384 (WebCore::HTMLElement::dirAttributeChanged):
3385 (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
3386 * html/HTMLEmbedElement.cpp:
3387 (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
3388 (WebCore::HTMLEmbedElement::rendererIsNeeded):
3389 * html/HTMLFieldSetElement.cpp:
3390 (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
3391 (WebCore::HTMLFieldSetElement::disabledStateChanged):
3392 (WebCore::HTMLFieldSetElement::childrenChanged):
3393 * html/HTMLFormControlElement.cpp:
3394 (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
3395 (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
3396 (WebCore::HTMLFormControlElement::didChangeForm):
3397 (WebCore::HTMLFormControlElement::shouldAutocorrect const):
3398 (WebCore::HTMLFormControlElement::autocapitalizeType const):
3399 * html/HTMLFormElement.cpp:
3400 (WebCore::HTMLFormElement::handleLocalEvents):
3401 (WebCore::submitElementFromEvent):
3402 (WebCore::HTMLFormElement::prepareForSubmission):
3403 (WebCore::HTMLFormElement::submit):
3404 (WebCore::HTMLFormElement::reset):
3405 (WebCore::HTMLFormElement::shouldAutocorrect const):
3406 (WebCore::HTMLFormElement::parseAttribute):
3407 (WebCore::HTMLFormElement::resetDefaultButton):
3408 (WebCore::HTMLFormElement::elementFromPastNamesMap const):
3409 (WebCore::HTMLFormElement::namedElements):
3410 * html/HTMLFormElement.h:
3411 * html/HTMLFrameElement.cpp:
3412 (WebCore::HTMLFrameElement::didAttachRenderers):
3413 * html/HTMLFrameElementBase.cpp:
3414 (WebCore::HTMLFrameElementBase::isURLAllowed const):
3415 (WebCore::HTMLFrameElementBase::openURL):
3416 (WebCore::HTMLFrameElementBase::didAttachRenderers):
3417 * html/HTMLFrameOwnerElement.cpp:
3418 (WebCore::HTMLFrameOwnerElement::setContentFrame):
3419 (WebCore::HTMLFrameOwnerElement::clearContentFrame):
3420 (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
3421 (WebCore::SubframeLoadingDisabler::canLoadFrame):
3422 * html/HTMLFrameSetElement.cpp:
3423 (WebCore::HTMLFrameSetElement::findContaining):
3424 (WebCore::HTMLFrameSetElement::willAttachRenderers):
3425 (WebCore::HTMLFrameSetElement::insertedInto):
3426 (WebCore::HTMLFrameSetElement::removedFrom):
3427 * html/HTMLFrameSetElement.h:
3428 * html/HTMLImageElement.cpp:
3429 (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3430 (WebCore::HTMLImageElement::pictureElement const):
3431 (WebCore::HTMLImageElement::destroyImageControls):
3432 (WebCore::HTMLImageElement::hasImageControls const):
3433 * html/HTMLInputElement.cpp:
3434 (WebCore::HTMLInputElement::innerTextElement const):
3435 (WebCore::HTMLInputElement::endEditing):
3436 (WebCore::HTMLInputElement::dataList const):
3437 (WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
3438 (WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
3439 (WebCore::HTMLInputElement::isSteppable const): Deleted.
3440 (WebCore::HTMLInputElement::dateType const): Deleted.
3441 (WebCore::HTMLInputElement::isTextButton const): Deleted.
3442 (WebCore::HTMLInputElement::isRadioButton const): Deleted.
3443 (WebCore::HTMLInputElement::isSearchField const): Deleted.
3444 (WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
3445 (WebCore::HTMLInputElement::isPasswordField const): Deleted.
3446 (WebCore::HTMLInputElement::isCheckbox const): Deleted.