857df68ae5b592d13050c3c94cb892cfad54ec57
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         DataInteractionTests.ExternalSourceAttributedStringToContentEditable hits a debug assertion
4         https://bugs.webkit.org/show_bug.cgi?id=175787
5         <rdar://problem/33996612>
6
7         Reviewed by Wenson Hsieh.
8
9         The variation axis values of San Francisco changed from the GX-style scale to the CSS-style
10         scale. Previously, we were normalizing the values we got from Core Text to fit the CSS scale;
11         however, this is no longer necessary since the font now does this itself.
12
13         The assertion was getting hit because the normalized values were huge and were overflowing
14         a single FontSelectionValue (and going negative). This patch adds handling for this
15         situation.
16
17         Test: DataInteractionTests.ExternalSourceBoldSystemAttributedStringToContentEditable
18
19         * platform/graphics/FontSelectionAlgorithm.h: Typedef the backing type for a FontSelectionValue.
20         (WebCore::FontSelectionValue::rawValue const):
21         (WebCore::FontSelectionValue::maximumValue):
22         (WebCore::FontSelectionValue::minimumValue):
23         (WebCore::FontSelectionValue::FontSelectionValue):
24         * platform/graphics/cocoa/FontCacheCoreText.cpp: Opt-out of normalization for San Francisco.
25         (WebCore::variationCapabilitiesForFontDescriptor):
26         (WebCore::capabilitiesForFontDescriptor):
27
28 2017-08-21  Chris Dumez  <cdumez@apple.com>
29
30         [Beacon] Content extensions should be able to intercept Beacon / Ping redirects
31         https://bugs.webkit.org/show_bug.cgi?id=175746
32         <rdar://problem/33946050>
33
34         Reviewed by Alex Christensen.
35
36         Update PingLoad to process content extension rules upon redirect. This allows content
37         extensions to block and upgrade to HTTPS beacon / ping loads.
38
39         Because ping loads can outlive the WebProcess, the content extensions rules are passed
40         to the NetworkProcess when starting the Ping load. The PingLoad can then consult those
41         rules upon redirect, on the NetworkProcess side.
42
43         Tests: http/wpt/beacon/contentextensions/beacon-blocked.html
44                http/wpt/beacon/contentextensions/beacon-redirect-blocked.html
45
46         * contentextensions/ContentExtensionActions.h:
47         * contentextensions/ContentExtensionsBackend.cpp:
48         (WebCore::ContentExtensions::ContentExtensionsBackend::forEach):
49         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
50         * contentextensions/ContentExtensionsBackend.h:
51         * page/Page.h:
52         * page/UserContentProvider.cpp:
53         (WebCore::UserContentProvider::forEachContentExtension):
54         * page/UserContentProvider.h:
55
56 2017-08-21  Brady Eidson  <beidson@apple.com>
57
58         ASSERTION FAILED: !m_connections.contains(&connection) in WebCore::SWServer::unregisterConnection(WebCore::SWServer::Connection&).
59         https://bugs.webkit.org/show_bug.cgi?id=175795
60
61         Rubber-stamped by Andy Estes.
62
63         * workers/service/server/SWServer.cpp:
64         (WebCore::SWServer::unregisterConnection): Flip the ASSERT to be... correct.
65
66 2017-08-21  Daniel Bates  <dabates@apple.com>
67
68         Cleanup TextPainter
69         https://bugs.webkit.org/show_bug.cgi?id=175782
70
71         Reviewed by Myles C. Maxfield.
72
73         Remove redundant mention of "text" in the name of TextPainter member functions, add separate
74         setters for selection and non-selection shadows, and do some other minor cleanups.
75
76         * rendering/InlineTextBox.cpp:
77         (WebCore::InlineTextBox::paint): Update code for renamed functions.
78         * rendering/SimpleLineLayoutFunctions.cpp:
79         (WebCore::SimpleLineLayout::paintFlow): Ditto.
80         * rendering/TextPainter.cpp: Include ShadowData.h.
81         (WebCore::ShadowApplier::ShadowApplier): Use C++11 brace-initialization syntax.
82         (WebCore::ShadowApplier::isLastShadowIteration): Moved from TextPainter.h.
83         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto.
84         (WebCore::TextPainter::paintTextOrEmphasisMarks): Renamed; formerly named drawTextOrEmphasisMarks.
85         (WebCore::TextPainter::paintTextWithShadows): Update code for renamed functions.
86         (WebCore::TextPainter::paintRange): Renamed; formerly named paintTextInRange.
87         (WebCore::TextPainter::paint): Renamed; formerly named paintText.
88         (WebCore::TextPainter::drawTextOrEmphasisMarks): Renamed to paintTextOrEmphasisMarks() to match
89         the naming convention of all the other paint functions in this class.
90         (WebCore::TextPainter::paintTextInRange): Renamed to paintRange.
91         (WebCore::TextPainter::paintText): Renamed to paint.
92         * rendering/TextPainter.h: Forward declare ShadowData.
93         (WebCore::TextPainter::setStyle): Renamed; formerly named setTextPaintStyle.
94         (WebCore::TextPainter::setSelectionStyle): Renamed; formerly named setSelectionPaintStyle.
95         (WebCore::TextPainter::setShadow): Added.
96         (WebCore::TextPainter::setSelectionShadow): Added.
97         (WebCore::TextPainter::setEmphasisMark): Renamed; formerly named addEmphasis. 
98         (WebCore::TextPainter::setTextPaintStyle): Renamed to setStyle.
99         (WebCore::TextPainter::setSelectionPaintStyle): Renamed to setSelectionStyle.
100         (WebCore::TextPainter::addEmphasis): Renamed to setEmphasisMark.
101         (WebCore::TextPainter::addTextShadow): Split functionality into setShadow and setSelectionShadow.
102         (WebCore::ShadowApplier::isLastShadowIteration): Moved to TextPainter.cpp.
103         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto.
104
105 2017-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
106
107         Addressing post-review comments after r220725
108         https://bugs.webkit.org/show_bug.cgi?id=175382
109
110         Reviewed by Darin Adler.
111
112         * css/CSSFontFace.cpp:
113         (WebCore::CSSFontFace::setUnicodeRange):
114
115 2017-08-21  Youenn Fablet  <youenn@apple.com>
116
117         [Cache API] Add support for CacheStorage.match
118         https://bugs.webkit.org/show_bug.cgi?id=175747
119
120         Reviewed by Chris Dumez.
121
122         Covered by rebased tests.
123
124         Introducing Cache::doMatch so that CacheStorage can use it.
125         Make Cache::match use Cache::doMatch as well.
126
127         Implementing CacheStorage.match as per spec:
128         - If name is provided, query only the cache with the given name.
129         - Otherwise pick the first matching response in the caches.
130         The sequential asynchronous search is done in doSequentialMatch.
131
132         Making sure that response with a status code are returning false to isNull.
133         This allows passing more tests.
134
135         * Modules/cache/Cache.cpp:
136         (WebCore::Cache::match):
137         (WebCore::Cache::doMatch):
138         (WebCore::Cache::matchAll):
139         (WebCore::toConnectionRecord):
140         * Modules/cache/Cache.h:
141         * Modules/cache/CacheStorage.cpp:
142         (WebCore::doSequentialMatch):
143         (WebCore::copyCaches):
144         (WebCore::CacheStorage::match):
145         * platform/network/ResourceResponseBase.cpp:
146         (WebCore::ResourceResponseBase::setHTTPStatusCode):
147
148 2017-08-21  Dean Jackson  <dino@apple.com>
149
150         Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
151         https://bugs.webkit.org/show_bug.cgi?id=175783
152         <rdar://problem/33623867>
153
154         Reviewed by Alex Christensen.
155
156         The version of ANGLE we use inserts this line into each shader:
157         #extension GL_ARB_gpu_shader5 : enable
158         It causes our lower-level GLSL compiler to give a warning, which is
159         confusing to developers because they didn't write this code.
160
161         Until we upgrade our OpenGL support to version 4.1, we should remove
162         this error message from the log returned to the developer.
163         See https://bugs.webkit.org/show_bug.cgi?id=175785
164
165         Test: fast/canvas/webgl/no-info-log-for-simple-shaders.html
166
167         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
168         (WebCore::GraphicsContext3D::getUnmangledInfoLog): Search for and remove
169         this warning.
170
171 2017-08-21  Andy Estes  <aestes@apple.com>
172
173         [Payment Request] Use ExistingExceptionError to propagate JS exceptions thrown during JSON stringification
174         https://bugs.webkit.org/show_bug.cgi?id=175776
175
176         Reviewed by Darin Adler.
177
178         * Modules/paymentrequest/PaymentRequest.cpp:
179         (WebCore::PaymentRequest::create):
180         * Modules/paymentrequest/PaymentRequest.h:
181
182 2017-08-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
183
184         [PAL] Move spi/mac directory into PAL
185         https://bugs.webkit.org/show_bug.cgi?id=175649
186
187         Reviewed by Myles C. Maxfield.
188
189         * WebCore.xcodeproj/project.pbxproj:
190         * editing/cocoa/DataDetection.mm:
191         * editing/mac/DictionaryLookup.h:
192         * editing/mac/DictionaryLookup.mm:
193         * page/mac/ServicesOverlayController.mm:
194         * page/mac/WheelEventDeltaFilterMac.mm:
195         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
196         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
197         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
198         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
199         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
201         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
203         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
204         * platform/graphics/mac/FontCacheMac.mm:
205         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
206         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
207         * platform/graphics/mac/MediaTimeQTKit.h:
208         * platform/mac/MediaRemoteSoftLink.cpp:
209         * platform/mac/MediaRemoteSoftLink.h:
210         * platform/mac/PasteboardWriter.mm:
211         * platform/mac/PlatformEventFactoryMac.mm:
212         * platform/mac/ScrollAnimatorMac.mm:
213         * platform/mac/ScrollbarThemeMac.mm:
214         * platform/mac/VideoFullscreenInterfaceMac.mm:
215         * platform/mac/WebVideoFullscreenController.mm:
216         * rendering/RenderThemeMac.mm:
217
218 2017-08-21  Adrian Perez de Castro  <aperez@igalia.com>
219
220         [GTK][WPE][GSTREAMER_GL] Overriden virtual function not marked “override” in MediaPlayerPrivateGStreamerBase.h
221         https://bugs.webkit.org/show_bug.cgi?id=175780
222
223         Reviewed by Konstantin Tokarev.
224
225         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Add missing "override" qualifier.
226
227 2017-08-21  Brady Eidson  <beidson@apple.com>
228
229         Split the one SWServer::Connection into SWClientConnection and SWServer::Connection.
230         https://bugs.webkit.org/show_bug.cgi?id=175745
231
232         Reviewed by Andy Estes.
233
234         No new tests (No behavior change).
235
236         Each of these has a much different environment that it lives in, so being the same object
237         hinders clean development.
238         
239         This split will also make it easier for the WebCore objects to directly handle WK2 messages.
240         
241         * CMakeLists.txt:
242         * WebCore.xcodeproj/project.pbxproj:
243         
244         * platform/Logging.h:
245
246         * workers/service/ServiceWorkerContainer.cpp:
247         (WebCore::ServiceWorkerContainer::addRegistration):
248         (WebCore::ServiceWorkerContainer::scheduleJob):
249         * workers/service/ServiceWorkerContainer.h:
250
251         * workers/service/ServiceWorkerProvider.h:
252
253         * workers/service/server/SWClientConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServer.cpp.
254         (WebCore::SWClientConnection::SWClientConnection):
255         (WebCore::SWClientConnection::~SWClientConnection):
256         (WebCore::SWClientConnection::scheduleJob):
257         (WebCore::SWClientConnection::jobRejectedInServer):
258         * workers/service/server/SWClientConnection.h: Copied from Source/WebCore/workers/service/server/SWServer.h.
259
260         * workers/service/server/SWServer.cpp:
261         (WebCore::SWServer::Connection::Connection):
262         (WebCore::SWServer::Connection::~Connection):
263         (WebCore::SWServer::~SWServer):
264         (WebCore::SWServer::Connection::scheduleJobInServer):
265         (WebCore::SWServer::scheduleJob):
266         (WebCore::SWServer::registerConnection):
267         (WebCore::SWServer::unregisterConnection):
268         (WebCore::SWServer::Connection::scheduleJob): Deleted.
269         (WebCore::SWServer::Connection::jobRejected): Deleted.
270         * workers/service/server/SWServer.h:
271         (WebCore::SWServer::Connection::server):
272         (WebCore::SWServer::Connection::~Connection): Deleted.
273
274 2017-08-21  Andy Estes  <aestes@apple.com>
275
276         [Payment Request] Implement the PaymentRequest constructor
277         https://bugs.webkit.org/show_bug.cgi?id=175755
278
279         Reviewed by Darin Adler.
280
281         * Modules/paymentrequest/PaymentDetailsModifier.h: Changed total to an std::optional<PaymentItem>.
282         * Modules/paymentrequest/PaymentRequest.cpp:
283         (WebCore::isWellFormedCurrencyCode): Implements the IsWellFormedCurrencyCode abstract operation from ECMA 402.
284         (WebCore::isValidDecimalMonetaryValue): Implements the "valid decimal monetary value" validity checker.
285         (WebCore::checkAndCanonicalizeAmount): Implements the "check and canonicalize amount" validity checker.
286         (WebCore::checkAndCanonicalizeTotal): Implements the "check and canonicalize total" validity checker.
287         (WebCore::PaymentRequest::create): Implements the PaymentRequest Constructor
288         (WebCore::PaymentRequest::PaymentRequest):
289         (WebCore::PaymentRequest::id const): Implements the PaymentRequest id attribute.
290         (WebCore::PaymentRequest::shippingType const): Implements the PaymentRequest shippingType attribute.
291         * Modules/paymentrequest/PaymentRequest.h:
292         * Modules/paymentrequest/PaymentRequest.idl: Annotated PaymentRequest with ConstructorMayThrowException.
293         * WebCore.xcodeproj/project.pbxproj:
294
295 2017-08-21  Per Arne Vollan  <pvollan@apple.com>
296
297         [Win] DRT should only allow any https certificate for localhost.
298         https://bugs.webkit.org/show_bug.cgi?id=175147
299
300         Reviewed by Brent Fulgham.
301
302         Disabling validation of certificate chains, breaks SSL on Windows. In order
303         for SSL tests to succeed on Windows, we should avoid disabling it.
304
305         No new tests, covered by existing tests.
306
307         * platform/network/cf/ResourceHandleCFNet.cpp:
308         (WebCore::ResourceHandle::createCFURLConnection):
309
310 2017-08-21  Zan Dobersek  <zdobersek@igalia.com>
311
312         [EME] HTMLMediaElement: basic implementations of 'Attempt to Decrypt', 'Attempt to Resume Playback If Necessary'
313         https://bugs.webkit.org/show_bug.cgi?id=175761
314
315         Reviewed by Xabier Rodriguez-Calvar.
316
317         Add initial and incomplete implementations of the 'Attempt to Decrypt' and
318         'Attempt to Resume Playback If Necessary' algorithms.  The implementations
319         are interleaved with the specification text for clarity.
320
321         'Attempt to Decrypt' implementation doesn't yet address the encrypted block
322         queue or the 'decryption blocked waiting for key' flag since it's not yet
323         clear whether it would make more sense for this state to reside lower, in
324         the platform layer. The gist of the algorithm is to invoke the decryption
325         attempt through the MediaPlayer object, passing along the CDMInstance object
326         retrieved from the MediaKeys object that is associated with this media
327         element.
328
329         'Attempt to Resume Playback if Necessary' implementation similarly for now
330         omits the various state flag operations. The main task at this point is to
331         dispatch the 'Attempt to Decrypt' algorithm.
332
333         HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() method now
334         invokes the attemptToResumePlaybackIfNecessary() method.
335
336         MediaKeys::hasOpenSessions() is introduced, returning true if any session
337         that was created through this MediaKeys instance is still open. This allows
338         the 'Attempt to Decrypt' algorithm to proceed with the decryption attempt
339         dispatch into the MediaPlayer hierarchy.
340
341         For that, the MediaPlayer::attemptToDecryptWithInstance() method is added,
342         which simply dispatches the mirror method on MediaPlayerPrivate interface.
343         This will enable the platform-layer implementations to use the passed-in
344         CDMInstance object for decryption purposes.
345
346         * Modules/encryptedmedia/MediaKeySession.h:
347         * Modules/encryptedmedia/MediaKeys.cpp:
348         (WebCore::MediaKeys::hasOpenSessions const):
349         * Modules/encryptedmedia/MediaKeys.h:
350         * html/HTMLMediaElement.cpp:
351         (WebCore::HTMLMediaElement::attemptToDecrypt):
352         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
353         (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
354         * html/HTMLMediaElement.h: Mark cdmClientAttemptToResumePlaybackIfNecessary() as final.
355         * platform/graphics/MediaPlayer.cpp:
356         (WebCore::MediaPlayer::attemptToDecryptWithInstance):
357         * platform/graphics/MediaPlayer.h:
358         * platform/graphics/MediaPlayerPrivate.h:
359         (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
360
361 2017-08-20  Zan Dobersek  <zdobersek@igalia.com>
362
363         [EME] Add basic implementation of HTMLMediaElement::setMediaKeys()
364         https://bugs.webkit.org/show_bug.cgi?id=175717
365
366         Reviewed by Xabier Rodriguez-Calvar.
367
368         Add an initial and incomplete implementation of HTMLMediaElement::setMediaKeys(),
369         interleaved with the specification wording of how this operation should behave.
370         The implementation still doesn't cover cases of CDM instances being already
371         associated with a different HTMLMediaElement, of CDM instances that can't be
372         disassociated from the current HTMLMediaElement, and of failures during both
373         association and disassociation of MediaKeys with the HTMLMediaElement.
374
375         The HTMLMediaElement (as a CDMClient inheritor) has to be attached or detached
376         from the MediaKeys object as appropriate. This attachment allows MediaKeys to
377         initiate an attempt to resume playback whenever the key statuses of the
378         associated MediaKeys object are updated.
379
380         Upon association and disassociation with MediaKeys, the CDMInstance object of
381         that specific MediaKeys instance is attached to or detached from the MediaPlayer
382         instance. This allows the platform layer to gather information about the
383         CDMInstance that will be used for decryption of media content for this specific
384         media element.
385
386         Additionally, the detachment from both MediaKeys and MediaPlayer is done upon
387         HTMLMediaElement destruction.
388
389         Upon setting the MediaKeys object, a task is queued that launches the 'Attempt to
390         Resume Playback If Necessary' algorithm. A placeholder method is added that will
391         implement the algorithm in the future.
392
393         The HTMLMediaElement::mediaKeys() getter is also implemented, returning pointer
394         held in m_mediaKeys.
395
396         Covered to a degree by existing imported W3C tests, with a setMediaKeys()-oriented
397         test having WPE-specific baseline update.
398
399         * Modules/encryptedmedia/MediaKeys.h:
400         (WebCore::MediaKeys::cdmInstance const):
401         * html/HTMLMediaElement.cpp:
402         (WebCore::HTMLMediaElement::~HTMLMediaElement):
403         (WebCore::HTMLMediaElement::mediaKeys const):
404         (WebCore::HTMLMediaElement::setMediaKeys):
405         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
406         (WebCore::HTMLMediaElement::contextDestroyed):
407         * html/HTMLMediaElement.h:
408         * platform/graphics/MediaPlayer.cpp:
409         (WebCore::MediaPlayer::cdmInstanceAttached):
410         (WebCore::MediaPlayer::cdmInstanceDetached):
411         * platform/graphics/MediaPlayer.h:
412         * platform/graphics/MediaPlayerPrivate.h:
413         (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
414         (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
415
416 2017-08-20  Chris Dumez  <cdumez@apple.com>
417
418         Simplify calls to LoaderStrategy::startPingLoad()
419         https://bugs.webkit.org/show_bug.cgi?id=175756
420
421         Reviewed by Sam Weinig.
422
423         Simplify calls to LoaderStrategy::startPingLoad() by passing the Frame to it
424         and let its implementation gets what it needs from the frame. This reduces
425         the number of parameters to startPingLoad() and is more easily extensible.
426
427         * dom/Document.h:
428         * loader/LoaderStrategy.h:
429         * loader/PingLoader.cpp:
430         (WebCore::PingLoader::loadImage):
431         (WebCore::PingLoader::sendPing):
432         (WebCore::PingLoader::sendViolationReport):
433         (WebCore::PingLoader::startPingLoad):
434         * loader/PingLoader.h:
435         * loader/cache/CachedResource.cpp:
436         (WebCore::CachedResource::load):
437
438 2017-08-20  Antti Koivisto  <antti@apple.com>
439
440         Factor :before/:after render tree mutations into a RenderTreeUpdater helper class
441         https://bugs.webkit.org/show_bug.cgi?id=175752
442
443         Reviewed by Andreas Kling.
444
445         Move code that constructs generated content renderers out from PseudoElement.
446         Also refactor the related code from RenderTreeUpdater main class into
447         RenderTreeUpdater::GeneratedContent helper class.
448
449         * WebCore.xcodeproj/project.pbxproj:
450         * dom/PseudoElement.cpp:
451         (WebCore::PseudoElement::resolveCustomStyle): Deleted.
452
453             Not needed anymore.
454
455         (WebCore::PseudoElement::didAttachRenderers): Deleted.
456
457             Moves to createContentRenderers in GeneratedContent.
458
459         (WebCore::PseudoElement::didRecalcStyle): Deleted.
460
461             Moves to updateStyleForContentRenderers in GeneratedContent.
462
463         * dom/PseudoElement.h:
464         * style/RenderTreeUpdater.cpp:
465         (WebCore::RenderTreeUpdater::RenderTreeUpdater):
466         (WebCore::RenderTreeUpdater::~RenderTreeUpdater):
467         (WebCore::RenderTreeUpdater::commit):
468         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
469         (WebCore::RenderTreeUpdater::updateAfterDescendants):
470         (WebCore::needsPseudoElement): Deleted.
471         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Deleted.
472         (WebCore::RenderTreeUpdater::updateQuotesUpTo): Deleted.
473
474             Quotes and other :before/:after support moves to GeneratedContent helpwe.
475
476         * style/RenderTreeUpdater.h:
477         (WebCore::RenderTreeUpdater::generatedContent):
478         * style/RenderTreeUpdaterGeneratedContent.cpp: Added.
479         (WebCore::RenderTreeUpdater::GeneratedContent::GeneratedContent):
480         (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement):
481         (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement):
482         (WebCore::RenderTreeUpdater::GeneratedContent::updateRemainingQuotes):
483         (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
484         (WebCore::createContentRenderers):
485         (WebCore::updateStyleForContentRenderers):
486         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
487         (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
488         * style/RenderTreeUpdaterGeneratedContent.h: Added.
489
490 2017-08-19  Andy Estes  <aestes@apple.com>
491
492         [Payment Request] Add interface stubs
493         https://bugs.webkit.org/show_bug.cgi?id=175730
494
495         Reviewed by Youenn Fablet.
496
497         * DerivedSources.make:
498         * Modules/paymentrequest/PaymentAddress.h: Added.
499         * Modules/paymentrequest/PaymentAddress.idl: Added.
500         * Modules/paymentrequest/PaymentComplete.h: Added.
501         * Modules/paymentrequest/PaymentComplete.idl: Added.
502         * Modules/paymentrequest/PaymentCurrencyAmount.h: Added.
503         * Modules/paymentrequest/PaymentCurrencyAmount.idl: Added.
504         * Modules/paymentrequest/PaymentDetailsBase.h: Added.
505         * Modules/paymentrequest/PaymentDetailsBase.idl: Added.
506         * Modules/paymentrequest/PaymentDetailsInit.h: Added.
507         * Modules/paymentrequest/PaymentDetailsInit.idl: Added.
508         * Modules/paymentrequest/PaymentDetailsModifier.h: Added.
509         * Modules/paymentrequest/PaymentDetailsModifier.idl: Added.
510         * Modules/paymentrequest/PaymentDetailsUpdate.h: Added.
511         * Modules/paymentrequest/PaymentDetailsUpdate.idl: Added.
512         * Modules/paymentrequest/PaymentItem.h: Added.
513         * Modules/paymentrequest/PaymentItem.idl: Added.
514         * Modules/paymentrequest/PaymentMethodData.h: Added.
515         * Modules/paymentrequest/PaymentMethodData.idl: Added.
516         * Modules/paymentrequest/PaymentOptions.h: Added.
517         * Modules/paymentrequest/PaymentOptions.idl: Added.
518         * Modules/paymentrequest/PaymentRequest.cpp: Added.
519         (WebCore::PaymentRequest::create):
520         (WebCore::PaymentRequest::PaymentRequest):
521         (WebCore::PaymentRequest::~PaymentRequest):
522         (WebCore::PaymentRequest::show):
523         (WebCore::PaymentRequest::abort):
524         (WebCore::PaymentRequest::canMakePayment):
525         * Modules/paymentrequest/PaymentRequest.h: Added.
526         * Modules/paymentrequest/PaymentRequest.idl: Added.
527         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: Added.
528         (WebCore::PaymentRequestUpdateEvent::~PaymentRequestUpdateEvent):
529         (WebCore::PaymentRequestUpdateEvent::updateWith):
530         * Modules/paymentrequest/PaymentRequestUpdateEvent.h: Added.
531         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: Added.
532         * Modules/paymentrequest/PaymentRequestUpdateEventInit.h: Added.
533         * Modules/paymentrequest/PaymentRequestUpdateEventInit.idl: Added.
534         * Modules/paymentrequest/PaymentResponse.cpp: Added.
535         (WebCore::PaymentResponse::complete):
536         * Modules/paymentrequest/PaymentResponse.h: Added.
537         * Modules/paymentrequest/PaymentResponse.idl: Added.
538         * Modules/paymentrequest/PaymentShippingOption.h: Added.
539         * Modules/paymentrequest/PaymentShippingOption.idl: Added.
540         * Modules/paymentrequest/PaymentShippingType.h: Added.
541         * Modules/paymentrequest/PaymentShippingType.idl: Added.
542         * WebCore.xcodeproj/project.pbxproj:
543         * dom/EventNames.h:
544         * dom/EventNames.in:
545         * dom/EventTargetFactory.in:
546
547 2017-08-19  Sam Weinig  <sam@webkit.org>
548
549         [WebCrypto] Remove the KeyAlgorithm type hierarchy
550         https://bugs.webkit.org/show_bug.cgi?id=175750
551
552         Reviewed by Chris Dumez.
553
554         Removes the unnecessary indirection that existed to generate a
555         KeyAlgorithm dictionary (or rather, one of its derived dictionaries)
556         for a CryptoKey. We were calling the virtual buildAlgorithm(), which
557         return a std::unique_ptr<KeyAlgorithm>, which we then casted to the 
558         correct derived class and called dictionary() on. This can now be
559         simplified by making each CryptoKey derived class override a function
560         that returns the KeyAlgorithm variant.
561
562         * crypto/CryptoKey.cpp:
563         (WebCore::CryptoKey::algorithm const): Deleted.
564         * crypto/CryptoKey.h:
565         (WebCore::CryptoKey::extractable const):
566         (WebCore::KeyAlgorithm::~KeyAlgorithm): Deleted.
567         (WebCore::KeyAlgorithm::name const): Deleted.
568         (WebCore::KeyAlgorithm::KeyAlgorithm): Deleted.
569         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
570         (WebCore::CryptoKeyRSA::algorithm const):
571         (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.
572         * crypto/keys/CryptoKeyAES.cpp:
573         (WebCore::CryptoKeyAES::algorithm const):
574         (WebCore::AesKeyAlgorithm::dictionary const): Deleted.
575         (WebCore::CryptoKeyAES::buildAlgorithm const): Deleted.
576         * crypto/keys/CryptoKeyAES.h:
577         * crypto/keys/CryptoKeyEC.cpp:
578         (WebCore::CryptoKeyEC::algorithm const):
579         (WebCore::EcKeyAlgorithm::dictionary const): Deleted.
580         (WebCore::CryptoKeyEC::buildAlgorithm const): Deleted.
581         * crypto/keys/CryptoKeyEC.h:
582         (WebCore::EcKeyAlgorithm::EcKeyAlgorithm): Deleted.
583         (WebCore::EcKeyAlgorithm::namedCurve const): Deleted.
584         * crypto/keys/CryptoKeyHMAC.cpp:
585         (WebCore::CryptoKeyHMAC::algorithm const):
586         (WebCore::HmacKeyAlgorithm::dictionary const): Deleted.
587         (WebCore::CryptoKeyHMAC::buildAlgorithm const): Deleted.
588         * crypto/keys/CryptoKeyHMAC.h:
589         * crypto/keys/CryptoKeyRSA.cpp:
590         (WebCore::RsaKeyAlgorithm::dictionary const): Deleted.
591         (WebCore::RsaHashedKeyAlgorithm::dictionary const): Deleted.
592         * crypto/keys/CryptoKeyRSA.h:
593         (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm): Deleted.
594         (WebCore::RsaKeyAlgorithm::modulusLength const): Deleted.
595         (WebCore::RsaKeyAlgorithm::publicExponent const): Deleted.
596         * crypto/keys/CryptoKeyRaw.cpp:
597         (WebCore::CryptoKeyRaw::algorithm const):
598         (WebCore::RawKeyAlgorithm::dictionary const): Deleted.
599         (WebCore::CryptoKeyRaw::buildAlgorithm const): Deleted.
600         * crypto/keys/CryptoKeyRaw.h:
601         (WebCore::RawKeyAlgorithm::RawKeyAlgorithm): Deleted.
602         * crypto/mac/CryptoKeyRSAMac.cpp:
603         (WebCore::CryptoKeyRSA::algorithm const):
604         (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.
605
606 2017-08-19  Sam Weinig  <sam@webkit.org>
607
608         [Mac] Change uint8_t* to Vector<uint8_t> type in all crypto algorithm implementation
609         https://bugs.webkit.org/show_bug.cgi?id=164939
610
611         Reviewed by Chris Dumez.
612
613         Address FIXMEs, replacing uint8_t*/size_t parameters with Vector<uint8_t>&.
614
615         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
616         (WebCore::transformAES_CBC):
617         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
618         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
619         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
620         (WebCore::wrapKeyAES_KW):
621         (WebCore::unwrapKeyAES_KW):
622         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
623         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
624         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
625         (WebCore::calculateSignature):
626         (WebCore::CryptoAlgorithmHMAC::platformSign):
627         (WebCore::CryptoAlgorithmHMAC::platformVerify):
628         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
629         (WebCore::encryptRSAES_PKCS1_v1_5):
630         (WebCore::decryptRSAES_PKCS1_v1_5):
631         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
632         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
633         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
634         (WebCore::signRSASSA_PKCS1_v1_5):
635         (WebCore::verifyRSASSA_PKCS1_v1_5):
636         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
637         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
638         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
639         (WebCore::encryptRSA_OAEP):
640         (WebCore::decryptRSA_OAEP):
641         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
642         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
643
644 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
645
646         Forbid setDragImage after dragstart
647         https://bugs.webkit.org/show_bug.cgi?id=175751
648
649         Reviewed by Wenson Hsieh.
650
651         Removed the code to allow setting the drag mage after dragstart had happened.
652
653         The feature was apparently used in Mac WebKit1 port but using it today causes the drag image
654         to disapepar while the user is moving the mouse cursor and being drawn once it's stopped
655         and results in the contionus flickering of the drag image.
656
657         The feaure was never supported in WebKit2 and doesn't match the HTML5 specification:
658         https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-rw
659         https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage
660         or the behaviors of other browsers such as Chrome and Firefox.
661
662         No new tests. This patch simply removes code.
663
664         * dom/DataTransfer.cpp:
665         (WebCore::DataTransfer::setDragImage):
666         (WebCore::DataTransfer::canSetDragImage const): Deleted.
667         * dom/DataTransfer.h:
668         (WebCore::DataTransfer::makeDragImageWritable): Deleted.
669         * page/EventHandler.cpp:
670         (WebCore::EventHandler::handleDrag):
671
672 2017-08-18  Sam Weinig  <sam@webkit.org>
673
674         [WebCrypto] Get rid of CryptoKeyData class and all its subclasses
675         https://bugs.webkit.org/show_bug.cgi?id=169806
676
677         Reviewed by Chris Dumez.
678
679         - Replaces the CryptoKeyData type hierarchy 
680
681             CryptoKeyData
682               - CryptoKeyDataOctetSequence
683               - CryptoKeyDataRSAComponents
684
685           with the renamed CryptoKeyRSAComponents.
686
687         - Removes pure virtual exportData function on CryptoKey, and all
688           the implementations except the one on CryptoKeyRSA, which now is
689           non-virtual, and returns a CryptoKeyRSAComponents. Update the one
690           external caller, SerializedScriptValue, to handle this.
691
692         * CMakeLists.txt:
693         * WebCore.xcodeproj/project.pbxproj:
694         * bindings/js/SerializedScriptValue.cpp:
695         * crypto/CryptoAlgorithm.h:
696         * crypto/CryptoKey.h:
697         * crypto/CryptoKeyData.h: Removed.
698         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
699         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
700         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
701         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
702         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
703         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
704         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
705         (WebCore::CryptoKeyRSA::create):
706         (WebCore::CryptoKeyRSA::exportData const):
707         * crypto/keys/CryptoKeyAES.cpp:
708         (WebCore::CryptoKeyAES::exportData const): Deleted.
709         * crypto/keys/CryptoKeyAES.h:
710         * crypto/keys/CryptoKeyDataOctetSequence.cpp: Removed.
711         * crypto/keys/CryptoKeyDataOctetSequence.h: Removed.
712         * crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
713         * crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
714         * crypto/keys/CryptoKeyEC.cpp:
715         (WebCore::CryptoKeyEC::exportData const): Deleted.
716         * crypto/keys/CryptoKeyEC.h:
717         * crypto/keys/CryptoKeyHMAC.cpp:
718         (WebCore::CryptoKeyHMAC::exportData const): Deleted.
719         * crypto/keys/CryptoKeyHMAC.h:
720         * crypto/keys/CryptoKeyRSA.cpp:
721         (WebCore::CryptoKeyRSA::importJwk):
722         (WebCore::CryptoKeyRSA::exportJwk const):
723         * crypto/keys/CryptoKeyRSA.h:
724         * crypto/keys/CryptoKeyRSAComponents.cpp: Copied from crypto/keys/CryptoKeyDataRSAComponents.cpp.
725         (WebCore::CryptoKeyRSAComponents::CryptoKeyRSAComponents):
726         (WebCore::CryptoKeyRSAComponents::~CryptoKeyRSAComponents):
727         (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): Deleted.
728         (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents): Deleted.
729         * crypto/keys/CryptoKeyRSAComponents.h: Copied from crypto/keys/CryptoKeyDataRSAComponents.h.
730         (WebCore::CryptoKeyRSAComponents::createPublic):
731         (WebCore::CryptoKeyRSAComponents::createPrivate):
732         (WebCore::CryptoKeyRSAComponents::createPrivateWithAdditionalData):
733         * crypto/keys/CryptoKeyRaw.cpp:
734         (WebCore::CryptoKeyRaw::exportData const): Deleted.
735         * crypto/keys/CryptoKeyRaw.h:
736         * crypto/mac/CryptoKeyRSAMac.cpp:
737         (WebCore::getPrivateKeyComponents):
738         (WebCore::CryptoKeyRSA::create):
739         (WebCore::CryptoKeyRSA::exportData const):
740
741 2017-08-18  Youenn Fablet  <youenn@apple.com>
742
743         [Cache API] Add support for being loaded responses
744         https://bugs.webkit.org/show_bug.cgi?id=175732
745
746         Reviewed by Chris Dumez.
747
748         Covered by existing and rebased tests.
749
750         Introducing a callback-based method to consume the body when the load is finished.
751         Using that new method in Cache::put and calling batchPutOperation when the load is finished.
752
753         Fixing the case of a fetch response being cloned, in which case its body should be marked as ReadableStream.
754
755         * Modules/cache/Cache.cpp:
756         (WebCore::Cache::put): Changing order of checks to reduce test flakiness risks as there is not yet support for putting responses with ReadableStream.
757         (WebCore::toConnectionRecord):
758         (WebCore::Cache::batchPutOperation):
759         * Modules/cache/Cache.h:
760         * Modules/fetch/FetchBody.cpp:
761         (WebCore::FetchBody::readableStreamBody): Deleted.
762         * Modules/fetch/FetchBody.h:
763         (WebCore::FetchBody::loadingBody):
764         (WebCore::FetchBody::setAsReadableStream):
765         * Modules/fetch/FetchResponse.cpp:
766         (WebCore::FetchResponse::BodyLoader::didSucceed):
767         (WebCore::FetchResponse::BodyLoader::didFail):
768         (WebCore::FetchResponse::consumeBody):
769         (WebCore::FetchResponse::consumeBodyWhenLoaded):
770         * Modules/fetch/FetchResponse.h:
771
772 2017-08-18  Chris Dumez  <cdumez@apple.com>
773
774         [Beacon] Improve error reporting
775         https://bugs.webkit.org/show_bug.cgi?id=175723
776
777         Reviewed by Darin Adler.
778
779         Have Ping loads such as beacons report errors via their completion handler.
780         The Beacon API is using this error to log a console message when beacon loads
781         fail, provided that the page is still alive.
782
783         Test: http/wpt/beacon/beacon-async-error-logging.html
784
785         * Modules/beacon/NavigatorBeacon.cpp:
786         (WebCore::NavigatorBeacon::NavigatorBeacon):
787         (WebCore::NavigatorBeacon::~NavigatorBeacon):
788         (WebCore::NavigatorBeacon::from):
789         (WebCore::NavigatorBeacon::supplementName):
790         (WebCore::NavigatorBeacon::notifyFinished):
791         (WebCore::NavigatorBeacon::logError):
792         (WebCore::NavigatorBeacon::sendBeacon):
793         * Modules/beacon/NavigatorBeacon.h:
794         * loader/LoaderStrategy.h:
795         * loader/cache/CachedResource.cpp:
796         (WebCore::CachedResource::load):
797         * loader/cache/CachedResourceLoader.cpp:
798         (WebCore::CachedResourceLoader::requestBeaconResource):
799         * loader/cache/CachedResourceLoader.h:
800         * platform/network/PingHandle.h:
801
802 2017-08-18  Sam Weinig  <sam@webkit.org>
803
804         Remove the deprecated WebKitSubtleCrypto interface
805         https://bugs.webkit.org/show_bug.cgi?id=164938
806         <rdar://problem/29894563>
807
808         Reviewed by Chris Dumez.
809
810         Remove WebKitSubtleCrypto and all of its helper classes / functionality.
811
812         * CMakeLists.txt:
813         * DerivedSources.cpp:
814         * DerivedSources.make:
815         * WebCore.xcodeproj/project.pbxproj:
816         * bindings/js/JSCryptoAlgorithmDictionary.cpp: Removed.
817         * bindings/js/JSCryptoAlgorithmDictionary.h: Removed.
818         * bindings/js/JSCryptoKeySerializationJWK.cpp: Removed.
819         * bindings/js/JSCryptoKeySerializationJWK.h: Removed.
820         * bindings/js/JSCryptoOperationData.cpp: Removed.
821         * bindings/js/JSCryptoOperationData.h: Removed.
822         * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Removed.
823         * crypto/CryptoAlgorithm.cpp:
824         (WebCore::CryptoAlgorithm::deriveKey): Deleted.
825         (WebCore::CryptoAlgorithm::encryptForWrapKey): Deleted.
826         (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Deleted.
827         * crypto/CryptoAlgorithm.h:
828         * crypto/CryptoAlgorithmParametersDeprecated.h: Removed.
829         * crypto/CryptoKeySerialization.h: Removed.
830         * crypto/WebKitSubtleCrypto.cpp: Removed.
831         * crypto/WebKitSubtleCrypto.h: Removed.
832         * crypto/WebKitSubtleCrypto.idl: Removed.
833         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
834         (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches const): Deleted.
835         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
836         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
837         (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Deleted.
838         (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Deleted.
839         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
840         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
841         (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches const): Deleted.
842         * crypto/algorithms/CryptoAlgorithmHMAC.h:
843         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
844         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
845         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
846         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::keyAlgorithmMatches const): Deleted.
847         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
848         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
849         (WebCore::CryptoAlgorithmRSA_OAEP::keyAlgorithmMatches const): Deleted.
850         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
851         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
852         * crypto/algorithms/CryptoAlgorithmSHA1.h:
853         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
854         * crypto/algorithms/CryptoAlgorithmSHA224.h:
855         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
856         * crypto/algorithms/CryptoAlgorithmSHA256.h:
857         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
858         * crypto/algorithms/CryptoAlgorithmSHA384.h:
859         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
860         * crypto/algorithms/CryptoAlgorithmSHA512.h:
861         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
862         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
863         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
864         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
865         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
866         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
867         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
868         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
869         * crypto/keys/CryptoKeySerializationRaw.cpp: Removed.
870         * crypto/keys/CryptoKeySerializationRaw.h: Removed.
871         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
872         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
873         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
874         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
875         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
876         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
877         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
878         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
879         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Removed.
880         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Removed.
881         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Removed.
882         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Removed.
883         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Removed.
884         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Removed.
885         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Removed.
886         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Removed.
887         * features.json:
888         * page/Crypto.cpp:
889         * page/Crypto.h:
890         * page/Crypto.idl:
891
892 2017-08-18  Tim Horton  <timothy_horton@apple.com>
893
894         Remove classic mode screen scale clamping
895         https://bugs.webkit.org/show_bug.cgi?id=175739
896         <rdar://problem/33894531>
897
898         Reviewed by Andy Estes.
899
900         * platform/ios/PlatformScreenIOS.mm:
901         (WebCore::screenScaleFactor):
902         This code is no longer needed.
903
904 2017-08-18  Daewoong Jang  <daewoong.jang@navercorp.com>
905
906         [Curl] Improve multi-threaded networking
907         https://bugs.webkit.org/show_bug.cgi?id=175713
908
909         Reviewed by Alex Christensen.
910
911         * platform/Curl.cmake:
912         * platform/network/ResourceHandleInternal.h:
913         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
914         (WebCore::ResourceHandleInternal::m_failureTimer): Deleted.
915         * platform/network/curl/CurlCacheManager.cpp:
916         (WebCore::CurlCacheManager::didReceiveResponse):
917         * platform/network/curl/CurlDownload.cpp:
918         (WebCore::CurlDownload::init):
919         (WebCore::CurlDownload::start):
920         (WebCore::CurlDownload::cancel):
921         (WebCore::CurlDownload::retain):
922         (WebCore::CurlDownload::release):
923         (WebCore::CurlDownload::setupRequest):
924         (WebCore::CurlDownload::notifyFinish):
925         (WebCore::CurlDownload::notifyFail):
926         * platform/network/curl/CurlDownload.h:
927         * platform/network/curl/CurlJobManager.cpp:
928         (WebCore::CurlJobList::isEmpty const):
929         (WebCore::CurlJobList::startJobs):
930         (WebCore::CurlJobList::finishJobs):
931         (WebCore::CurlJobList::notifyResult):
932         (WebCore::CurlJobManager::add):
933         (WebCore::CurlJobManager::cancel):
934         (WebCore::CurlJobManager::callOnJobThread):
935         (WebCore::CurlJobManager::startThreadIfNeeded):
936         (WebCore::CurlJobManager::updateJobList):
937         (WebCore::CurlJobManager::workerThread):
938         (WebCore::CurlJobList::append): Deleted.
939         (WebCore::CurlJobList::cancel): Deleted.
940         (WebCore::CurlJobList::complete): Deleted.
941         (WebCore::CurlJobList::withJob): Deleted.
942         (WebCore::CurlJobList::withCurlHandle): Deleted.
943         (WebCore::CurlJob::invoke): Deleted.
944         (WebCore::CurlJobManager::updateJobs): Deleted.
945         * platform/network/curl/CurlJobManager.h:
946         (WebCore::CurlJob::CurlJob): Deleted.
947         (WebCore::CurlJob::~CurlJob): Deleted.
948         (WebCore::CurlJob::operator=): Deleted.
949         (WebCore::CurlJob::curlHandle const): Deleted.
950         (WebCore::CurlJob::ticket const): Deleted.
951         (WebCore::CurlJob::finished): Deleted.
952         (WebCore::CurlJob::error): Deleted.
953         (WebCore::CurlJob::cancel): Deleted.
954         (WebCore::CurlJobManager::isActiveJob const): Deleted.
955         * platform/network/curl/MultipartHandle.cpp:
956         (WebCore::MultipartHandle::didReceiveData):
957         * platform/network/curl/ResourceHandleCurl.cpp:
958         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
959         (WebCore::ResourceHandle::start):
960         (WebCore::ResourceHandle::cancel):
961         (WebCore::ResourceHandle::platformSetDefersLoading):
962         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
963         (WebCore::ResourceHandle::receivedCredential):
964         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
965         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
966         (WebCore::ResourceHandleInternal::initialize): Deleted.
967         (WebCore::ResourceHandleInternal::applyAuthentication): Deleted.
968         (WebCore::getFormElementsCount): Deleted.
969         (WebCore::ResourceHandleInternal::setupPUT): Deleted.
970         (WebCore::ResourceHandleInternal::setupPOST): Deleted.
971         (WebCore::ResourceHandleInternal::setupFormData): Deleted.
972         (WebCore::ResourceHandleInternal::didFinish): Deleted.
973         (WebCore::ResourceHandleInternal::didFail): Deleted.
974         (WebCore::ResourceHandleInternal::calculateWebTimingInformations): Deleted.
975         (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): Deleted.
976         (WebCore::isHttpInfo): Deleted.
977         (WebCore::isHttpRedirect): Deleted.
978         (WebCore::isHttpAuthentication): Deleted.
979         (WebCore::isHttpNotModified): Deleted.
980         (WebCore::isAppendableHeader): Deleted.
981         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
982         (WebCore::getProtectionSpace): Deleted.
983         (WebCore::ResourceHandleInternal::willPrepareSendData): Deleted.
984         (WebCore::ResourceHandleInternal::didReceiveHeaderLine): Deleted.
985         (WebCore::ResourceHandleInternal::didReceiveAllHeaders): Deleted.
986         (WebCore::ResourceHandleInternal::didReceiveContentData): Deleted.
987         (WebCore::ResourceHandleInternal::readCallback): Deleted.
988         (WebCore::ResourceHandleInternal::headerCallback): Deleted.
989         (WebCore::ResourceHandleInternal::writeCallback): Deleted.
990         (WebCore::ResourceHandleInternal::dispatchSynchronousJob): Deleted.
991         (WebCore::ResourceHandleInternal::handleDataURL): Deleted.
992         * platform/network/curl/ResourceHandleCurlDelegate.cpp: Added.
993         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
994         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
995         (WebCore::ResourceHandleCurlDelegate::hasHandle const):
996         (WebCore::ResourceHandleCurlDelegate::releaseHandle):
997         (WebCore::ResourceHandleCurlDelegate::start):
998         (WebCore::ResourceHandleCurlDelegate::cancel):
999         (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
1000         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
1001         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
1002         (WebCore::ResourceHandleCurlDelegate::retain):
1003         (WebCore::ResourceHandleCurlDelegate::release):
1004         (WebCore::ResourceHandleCurlDelegate::setupRequest):
1005         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
1006         (WebCore::ResourceHandleCurlDelegate::notifyFail):
1007         (WebCore::ResourceHandleCurlDelegate::response):
1008         (WebCore::ResourceHandleCurlDelegate::setupAuthentication):
1009         (WebCore::removeLeadingAndTrailingQuotes):
1010         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
1011         (WebCore::isHttpInfo):
1012         (WebCore::isHttpRedirect):
1013         (WebCore::isHttpAuthentication):
1014         (WebCore::isHttpNotModified):
1015         (WebCore::isAppendableHeader):
1016         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine):
1017         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
1018         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
1019         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
1020         (WebCore::ResourceHandleCurlDelegate::prepareSendData):
1021         (WebCore::ResourceHandleCurlDelegate::didFinish):
1022         (WebCore::ResourceHandleCurlDelegate::didFail):
1023         (WebCore::ResourceHandleCurlDelegate::handleDataURL):
1024         (WebCore::ResourceHandleCurlDelegate::setupPOST):
1025         (WebCore::ResourceHandleCurlDelegate::setupPUT):
1026         (WebCore::ResourceHandleCurlDelegate::getFormElementsCount):
1027         (WebCore::ResourceHandleCurlDelegate::setupFormData):
1028         (WebCore::ResourceHandleCurlDelegate::applyAuthentication):
1029         (WebCore::ResourceHandleCurlDelegate::setWebTimings):
1030         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1031         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
1032         (WebCore::ResourceHandleCurlDelegate::willSendData):
1033         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback):
1034         (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
1035         (WebCore::ResourceHandleCurlDelegate::willSendDataCallback):
1036         * platform/network/curl/ResourceHandleCurlDelegate.h: Added.
1037
1038 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
1039
1040         iOS 10 debug build fix.
1041
1042         * dom/DataTransfer.cpp:
1043         (WebCore::DataTransfer::DataTransfer):
1044
1045 2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>
1046
1047         Rename DataTransferAccessPolicy to match spec and refactor related node
1048         https://bugs.webkit.org/show_bug.cgi?id=175704
1049
1050         Reviewed by Wenson Hsieh.
1051
1052         Renamed DataTransferAccessPolicy to DataTransfer::StoreMode to match the drag data store mode concept
1053         in the HTML5 specification:
1054         https://html.spec.whatwg.org/multipage/dnd.html#drag-data-store-mode
1055
1056         DataTransfer in addition to those states can be disassociated from the drag data store when it becomes
1057         no longer valid. We also support a special mode which allows only updating the drag image.
1058         These two states, Invalid and DragImageWritable, are added in addition to the three states in the spec.
1059
1060         Also split DragAndDrop type of DataTransfer into DragAndDropData and DragAndDropFiles, and refactored
1061         the related code.
1062
1063         No new tests since there should be no behavioral change.
1064
1065         * WebCore.xcodeproj/project.pbxproj:
1066         * dom/DataTransfer.cpp:
1067         (WebCore::DataTransfer::DataTransfer): No longer takes forFileDrag boolean since it's folded into type.
1068         (WebCore::DataTransfer::createForCopyAndPaste):
1069         (WebCore::DataTransfer::~DataTransfer):
1070         (WebCore::DataTransfer::setAccessPolicy): Deleted.
1071         (WebCore::DataTransfer::canReadTypes const):
1072         (WebCore::DataTransfer::canReadData const):
1073         (WebCore::DataTransfer::canWriteData const):
1074         (WebCore::DataTransfer::createForInputEvent):
1075         (WebCore::DataTransfer::createForDrag):
1076         (WebCore::DataTransfer::createForDrop):
1077         (WebCore::DataTransfer::canSetDragImage const):
1078         * dom/DataTransfer.h:
1079         (WebCore::DataTransfer::makeInvalidForSecurity): Added.
1080         (WebCore::DataTransfer::makeDragImageWritable): Added.
1081         * dom/DataTransferAccessPolicy.h: Removed.
1082         * editing/Editor.cpp:
1083         (WebCore::dispatchClipboardEvent): Moved and renamed from dispatchCPPEvent. Now computes the store mode
1084         inside the function to match the spec: https://w3c.github.io/clipboard-apis/#fire-a-clipboard-event
1085         (WebCore::Editor::canDHTMLCut):
1086         (WebCore::Editor::canDHTMLCopy):
1087         (WebCore::Editor::canDHTMLPaste):
1088         (WebCore::Editor::tryDHTMLCopy):
1089         (WebCore::Editor::tryDHTMLCut):
1090         (WebCore::Editor::tryDHTMLPaste):
1091         (WebCore::Editor::dispatchCPPEvent): Deleted.
1092         * editing/Editor.h:
1093         * page/DragController.cpp:
1094         (WebCore::createDataTransferToUpdateDrag): Extracted to share code.
1095         (WebCore::DragController::dragExited):
1096         (WebCore::DragController::performDragOperation):
1097         (WebCore::DragController::tryDHTMLDrag):
1098         * page/EventHandler.cpp:
1099         (WebCore::EventHandler::invalidateDataTransfer):
1100         (WebCore::EventHandler::handleDrag):
1101
1102 2017-08-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1103
1104         Followup (r220289): RenderImageResourceStyleImage code clean up
1105         https://bugs.webkit.org/show_bug.cgi?id=175444
1106
1107         Reviewed by Darin Adler.
1108
1109         RenderImageResourceStyleImage may be created with a StyleImage of type
1110         StyleGeneratedImage. It may also be associated with a CachedImage which 
1111         is loaded through a source URL. In this case, adding and removing m_renderer
1112         as a client of the CachedImage will be done through 
1113         RenderImageResource::setCachedImage().
1114
1115         RenderImageResource::setCachedImage() is already called from 
1116         ImageLoader::updateRenderer() when the CachedImage finishes loading. This
1117         call adds m_renderer to the clients of the CachedImage. 
1118         RenderImageResource::setCachedImage() will also be called from 
1119         RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown()
1120         to remove m_renderer from the clients of CachedImage by passing a null pointer.
1121
1122         * rendering/RenderImage.cpp:
1123         (WebCore::RenderImage::styleWillChange):
1124         * rendering/RenderImageResource.cpp:
1125         (WebCore::RenderImageResource::initialize):
1126         (WebCore::RenderImageResource::shutdown):
1127         (WebCore::RenderImageResource::setCachedImage):
1128         (WebCore::RenderImageResource::resetAnimation):
1129         (WebCore::RenderImageResource::image const):
1130         (WebCore::RenderImageResource::setContainerSizeForRenderer):
1131         (WebCore::RenderImageResource::imageSize const):
1132         (WebCore::RenderImageResource::~RenderImageResource): Deleted.
1133         (WebCore::RenderImageResource::errorOccurred const): Deleted.
1134         (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted.
1135         (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted.
1136         (WebCore::RenderImageResource::intrinsicSize const): Deleted.
1137         (WebCore::RenderImageResource::getImageSize const): Deleted.
1138         * rendering/RenderImageResource.h:
1139         (WebCore::RenderImageResource::initialize):
1140         (WebCore::RenderImageResource::renderer const):
1141         (WebCore::RenderImageResource::errorOccurred const):
1142         (WebCore::RenderImageResource::imageHasRelativeWidth const):
1143         (WebCore::RenderImageResource::imageHasRelativeHeight const):
1144         (WebCore::RenderImageResource::imageSize const):
1145         (WebCore::RenderImageResource::intrinsicSize const):
1146         (WebCore::RenderImageResource::imagePtr const):
1147         * rendering/RenderImageResourceStyleImage.cpp:
1148         (WebCore::RenderImageResourceStyleImage::initialize):
1149         (WebCore::RenderImageResourceStyleImage::shutdown):
1150         (WebCore::RenderImageResourceStyleImage::image const):
1151         (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):
1152         (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted.
1153         * rendering/RenderImageResourceStyleImage.h:
1154         * rendering/RenderSnapshottedPlugIn.cpp:
1155         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
1156         * rendering/svg/RenderSVGImage.cpp:
1157         (WebCore::RenderSVGImage::RenderSVGImage):
1158
1159 2017-08-18  Jiewen Tan  <jiewen_tan@apple.com>
1160
1161         [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs
1162         https://bugs.webkit.org/show_bug.cgi?id=175657
1163         <rdar://problem/33797150>
1164
1165         Reviewed by Brent Fulgham.
1166
1167         CCECCryptorGetKeyComponents returns components in unpadded formats. In some minor cases, the ECC components
1168         do need padding. Therefore, we occasionally see some corrupted outputs in JWKs. To overcome that, this patch
1169         replaces CCECCryptorGetKeyComponents with CCECCryptorExportKey which does padding all the time.
1170
1171         In the meantime, this patch also makes export* methods return OperationError if any error occur in the
1172         underlying operations though very unlikely.
1173
1174         Test: crypto/subtle/ecdsa-generate-export-import-jwk-sign-verify.html
1175
1176         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
1177         (WebCore::CryptoAlgorithmECDH::exportKey):
1178         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
1179         (WebCore::CryptoAlgorithmECDSA::exportKey):
1180         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1181         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1182         * crypto/keys/CryptoKeyEC.cpp:
1183         (WebCore::CryptoKeyEC::exportRaw const):
1184         (WebCore::CryptoKeyEC::exportJwk const):
1185         (WebCore::CryptoKeyEC::exportSpki const):
1186         (WebCore::CryptoKeyEC::exportPkcs8 const):
1187         * crypto/keys/CryptoKeyEC.h:
1188         * crypto/mac/CryptoKeyECMac.cpp:
1189         (WebCore::CryptoKeyEC::platformExportRaw const):
1190         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1191         (WebCore::CryptoKeyEC::platformExportSpki const):
1192         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1193
1194 2017-08-18  Per Arne Vollan  <pvollan@apple.com>
1195
1196         [Win] accessibility/heading-crash-after-hidden.html is a flaky crash.
1197         https://bugs.webkit.org/show_bug.cgi?id=173536
1198
1199         Reviewed by Brent Fulgham.
1200
1201         If the tree state is dirty, accessible objects are deleted while iterating over children
1202         under AccessibilityNodeObject::textUnderElement when the style is updated. Make sure the
1203         style is updated before this method is called.
1204
1205         No new tests, covered by existing tests.
1206
1207         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
1208         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
1209
1210 2017-08-18  Youenn Fablet  <youenn@apple.com>
1211
1212         [Cache API] Add response body storage
1213         https://bugs.webkit.org/show_bug.cgi?id=175658
1214
1215         Reviewed by Alex Christensen.
1216
1217         Covered by rebased tests.
1218         Tests are still flaky until waiting for end of fetch load is implemented.
1219
1220         Adding a response body within CacheStorageConnection::Record.
1221         Adding ability to pass this body from/to the main thread.
1222
1223         Adding response body consumption into a CacheStorageConnection::Record.
1224         Adding response body setting from a CacheStorageConnection::Record.
1225
1226         * Modules/beacon/NavigatorBeacon.cpp:
1227         (WebCore::NavigatorBeacon::sendBeacon):
1228         * Modules/cache/Cache.cpp:
1229         (WebCore::Cache::put):
1230         (WebCore::toConnectionRecord):
1231         (WebCore::Cache::updateRecords):
1232         * Modules/cache/CacheStorageConnection.cpp:
1233         (WebCore::CacheStorageConnection::copyResponseBody):
1234         (WebCore::CacheStorageConnection::isolatedResponseBody):
1235         (WebCore::CacheStorageConnection::Record::copy const):
1236         * Modules/cache/CacheStorageConnection.h:
1237         * Modules/cache/WorkerCacheStorageConnection.cpp:
1238         (WebCore::toCrossThreadRecordData):
1239         (WebCore::fromCrossThreadRecordData):
1240         * Modules/fetch/FetchBody.cpp:
1241         (WebCore::FetchBody::bodyAsFormData const):
1242         (WebCore::FetchBody::take):
1243         (WebCore::FetchBody::bodyForInternalRequest const): Deleted.
1244         * Modules/fetch/FetchBody.h:
1245         (WebCore::FetchBody::setAsFormData):
1246         * Modules/fetch/FetchBodyConsumer.h:
1247         (WebCore::FetchBodyConsumer::setData):
1248         * Modules/fetch/FetchRequest.cpp:
1249         (WebCore::FetchRequest::resourceRequest const):
1250         * Modules/fetch/FetchResponse.cpp:
1251         (WebCore::FetchResponse::consumeBody):
1252         (WebCore::FetchResponse::setBodyData):
1253         * Modules/fetch/FetchResponse.h:
1254
1255 2017-08-18  Youenn Fablet  <youenn@apple.com>
1256
1257         [Fetch API] Add support for a callback-based fetch
1258         https://bugs.webkit.org/show_bug.cgi?id=175710
1259
1260         Reviewed by Alex Christensen.
1261
1262         No change of behavior.
1263
1264         Moving from a DOMPromise to a Callback taking an ExceptionOr<FetchResponse&>.
1265         Updating window and worker call sites.
1266
1267         * Modules/fetch/DOMWindowFetch.cpp:
1268         (WebCore::DOMWindowFetch::fetch):
1269         * Modules/fetch/FetchResponse.cpp:
1270         (WebCore::FetchResponse::fetch):
1271         (WebCore::FetchResponse::BodyLoader::didFail):
1272         (WebCore::FetchResponse::BodyLoader::BodyLoader):
1273         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1274         (WebCore::FetchResponse::BodyLoader::stop):
1275         * Modules/fetch/FetchResponse.h:
1276         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1277         (WebCore::WorkerGlobalScopeFetch::fetch):
1278
1279 2017-08-18  Brady Eidson  <beidson@apple.com>
1280
1281         Bounce ServiceWorker jobs to the Storage Process.
1282         https://bugs.webkit.org/show_bug.cgi?id=175650
1283
1284         Reviewed by Andy Estes.
1285
1286         No new tests (Covered by both changes and consistencies in existing tests)
1287
1288         This lays the groundwork for the SW job queue being in the StorageProcess by actually
1289         setting up some objects for IPC communication and actually sending things over the wire.
1290
1291         The main point of IPC is the WebCore abstract base class "SWServer::Connection"
1292
1293         A collection of them will soon be managed by the SWServer itself in the StorageProcess.
1294
1295         That object will be the stand-in for IPC on both the WebProcess and StorageProcess side.
1296
1297         Currently, any job that we try to schedule still immediately rejects (though now it does
1298         so asynchronously instead of synchronously).
1299
1300         * CMakeLists.txt:
1301         * WebCore.xcodeproj/project.pbxproj:
1302
1303         * dom/ExceptionData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1304         (WebCore::ExceptionData::toException const):
1305         (WebCore::ExceptionData::encode const):
1306         (WebCore::ExceptionData::decode):
1307
1308         * workers/service/ServiceWorkerContainer.cpp:
1309         (WebCore::ServiceWorkerContainer::addRegistration):
1310         (WebCore::ServiceWorkerContainer::scheduleJob):
1311         * workers/service/ServiceWorkerContainer.h:
1312
1313         * workers/service/ServiceWorkerJob.cpp:
1314         (WebCore::ServiceWorkerJob::failedWithException):
1315         (WebCore::ServiceWorkerJob::data const):
1316         * workers/service/ServiceWorkerJob.h:
1317
1318         * workers/service/ServiceWorkerJobData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1319         (WebCore::ServiceWorkerJobData::encode const):
1320         (WebCore::ServiceWorkerJobData::decode):
1321
1322         * workers/service/ServiceWorkerJobType.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1323
1324         * workers/service/ServiceWorkerProvider.h:
1325
1326         * workers/service/ServiceWorkerRegistrationParameters.h:
1327
1328         * workers/service/server/SWServer.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
1329         (WebCore::SWServer::Connection::scheduleJob):
1330         (WebCore::SWServer::Connection::jobRejected):
1331         * workers/service/server/SWServer.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
1332         (WebCore::SWServer::Connection::~Connection):
1333
1334 2017-08-18  Chris Dumez  <cdumez@apple.com>
1335
1336         [Beacon] Add support for quota limitation
1337         https://bugs.webkit.org/show_bug.cgi?id=175443
1338         <rdar://problem/33729002>
1339
1340         Reviewed by Youenn Fablet.
1341
1342         LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
1343         to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
1344         quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
1345         order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
1346         in-flight.
1347
1348         No new tests, updated existing test.
1349
1350         * loader/LoaderStrategy.h:
1351         * loader/PingLoader.cpp:
1352         (WebCore::PingLoader::startPingLoad):
1353         * loader/cache/CachedResource.cpp:
1354         (WebCore::CachedResource::load):
1355         * platform/network/PingHandle.h:
1356
1357 2017-08-18  Youenn Fablet  <youenn@apple.com>
1358
1359         [Cache API] Add a WK2 implementation of CacheStorageConnection
1360         https://bugs.webkit.org/show_bug.cgi?id=175640
1361
1362         Reviewed by Alex Christensen & Chris Dumez.
1363
1364         * Modules/cache/CacheStorageConnection.cpp: Adding Internal error.
1365         * Modules/cache/CacheStorageConnection.h: Ditto.
1366         * WebCore.xcodeproj/project.pbxproj: Exporting CacheQueryOptions.h header.
1367
1368 2017-08-18  Antti Koivisto  <antti@apple.com>
1369
1370         Factor render tree mutation code from RenderListItem to RenderTreeUpdater
1371         https://bugs.webkit.org/show_bug.cgi?id=175718
1372
1373         Reviewed by Andreas Kling.
1374
1375         We already stopped doing layout time mutations. We can now move the code out too.
1376
1377         * WebCore.xcodeproj/project.pbxproj:
1378         * rendering/RenderListItem.cpp:
1379         (WebCore::isHTMLListElement):
1380         (WebCore::getParentOfFirstLineBox): Deleted.
1381         (WebCore::firstNonMarkerChild): Deleted.
1382         (WebCore::RenderListItem::updateMarkerRenderer): Deleted.
1383
1384             Moved to RenderTreeUpdater::ListItem.
1385
1386         * rendering/RenderListItem.h:
1387         * rendering/RenderListMarker.cpp:
1388         (WebCore::RenderListMarker::willBeDestroyed):
1389         * rendering/TextAutoSizing.cpp:
1390         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
1391         * style/RenderTreeUpdater.cpp:
1392         (WebCore::RenderTreeUpdater::pushParent):
1393         (WebCore::RenderTreeUpdater::popParent):
1394         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1395         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1396
1397             Factor pre/post update into functions.
1398
1399         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1400         * style/RenderTreeUpdater.h:
1401         * style/RenderTreeUpdaterListItem.cpp: Added.
1402
1403             Mutation functions move here.
1404
1405         (WebCore::getParentOfFirstLineBox):
1406         (WebCore::firstNonMarkerChild):
1407         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
1408         * style/RenderTreeUpdaterListItem.h: Added.
1409
1410 2017-08-18  Ms2ger  <Ms2ger@gmail.com>
1411
1412         [GTK] Show controls if a video element isn't allowed to play inline.
1413         https://bugs.webkit.org/show_bug.cgi?id=141705
1414
1415         Reviewed by Xabier Rodriguez-Calvar.
1416
1417         Test: covered by media/video-fullscreeen-only-controls.html [sic].
1418
1419         * Modules/mediacontrols/mediaControlsGtk.js:
1420         (ControllerGtk.prototype.shouldHaveControls):
1421
1422 2017-08-18  Zan Dobersek  <zdobersek@igalia.com>
1423
1424         [EME] MediaKeySession has to initiate playback resume on HTMLMediaElement
1425         https://bugs.webkit.org/show_bug.cgi?id=175671
1426
1427         Reviewed by Xabier Rodriguez-Calvar.
1428
1429         In MediaKeySession::updateKeyStatuses(), HTMLMediaElement objects that are
1430         associated with the MediaKeys instance that created this session have to
1431         be notified in order to run the 'Attempt to Resume Playback If Necessary'
1432         algorithm.
1433
1434         MediaKeys object now tracks the sessions that were created through it.
1435         MediaKeySession object is passed a MediaKeys reference, and has that
1436         reference invalidated if/when the MediaKeys object is destroyed.
1437
1438         In MediaKeySession::updateKeyStatuses(), a task is now queued, notifying
1439         the MediaKeys object, if any, that the associated HTMLMediaElement
1440         instances have to run the mentioned algorithm. The associated media
1441         elements are stored through CDMClient pointers, with HTMLMediaElement
1442         class inheriting from the newly-introduced CDMClient interface.
1443
1444         HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() is left
1445         unimplemented for now. The object will attach itself to and detach from
1446         the associated MediaKeys object in setMediaKeys() and the destructor,
1447         enabling the MediaKeys object to properly dispatch the playback resume
1448         requests for the attached clients.
1449
1450         * Modules/encryptedmedia/CDMClient.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
1451         (WebCore::CDMClient::~CDMClient):
1452         * Modules/encryptedmedia/MediaKeySession.cpp:
1453         (WebCore::MediaKeySession::create):
1454         (WebCore::MediaKeySession::MediaKeySession):
1455         (WebCore::MediaKeySession::detachKeys):
1456         (WebCore::MediaKeySession::updateKeyStatuses):
1457         * Modules/encryptedmedia/MediaKeySession.h:
1458         * Modules/encryptedmedia/MediaKeys.cpp:
1459         (WebCore::MediaKeys::~MediaKeys):
1460         (WebCore::MediaKeys::createSession):
1461         (WebCore::MediaKeys::attachCDMClient):
1462         (WebCore::MediaKeys::detachCDMClient):
1463         (WebCore::MediaKeys::attemptToResumePlaybackOnClients):
1464         * Modules/encryptedmedia/MediaKeys.h:
1465         * html/HTMLMediaElement.cpp:
1466         (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
1467         * html/HTMLMediaElement.h:
1468
1469 2017-08-18  Commit Queue  <commit-queue@webkit.org>
1470
1471         Unreviewed, rolling out r220854.
1472         https://bugs.webkit.org/show_bug.cgi?id=175716
1473
1474         I'm not sure we really need this (Requested by KaL on
1475         #webkit).
1476
1477         Reverted changeset:
1478
1479         "[GTK][WPE] Add NTLM authentication enabled API"
1480         https://bugs.webkit.org/show_bug.cgi?id=122952
1481         http://trac.webkit.org/changeset/220854
1482
1483 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1484
1485         [Input Events] Rename inputType "formatForeColor" to "formatFontColor"
1486         https://bugs.webkit.org/show_bug.cgi?id=175703
1487
1488         Reviewed by Ryosuke Niwa.
1489
1490         Renames an inputType value to match the spec. There is no other change in behavior.
1491         Rebaselines fast/events/input-events-selection-forecolor-data.html and fast/events/input-events-forecolor-data.html.
1492
1493         * editing/EditCommand.cpp:
1494         (WebCore::inputTypeNameForEditingAction):
1495
1496 2017-08-17  Daewoong Jang  <daewoong.jang@navercorp.com>
1497
1498         [Curl] Improve multi-threaded networking
1499         https://bugs.webkit.org/show_bug.cgi?id=175253
1500
1501         Reviewed by Alex Christensen.
1502
1503         * platform/network/curl/CurlContext.cpp:
1504         (WebCore::CurlMultiHandle::CurlMultiHandle):
1505         (WebCore::CurlHandle::CurlHandle):
1506         (WebCore::CurlHandle::initialize):
1507         (WebCore::CurlHandle::setSslKeyPassword):
1508         (WebCore::CurlHandle::setSslErrors):
1509         (WebCore::CurlHandle::getSslErrors):
1510         * platform/network/curl/CurlContext.h:
1511         * platform/network/curl/CurlDownload.cpp:
1512         (WebCore::CurlDownload::init):
1513         (WebCore::CurlDownload::getResponse const):
1514         (WebCore::CurlDownload::setupRequest):
1515         (WebCore::CurlDownload::didReceiveHeader):
1516         (WebCore::CurlDownload::didReceiveData):
1517         (WebCore::CurlDownload::headerCallback):
1518         (WebCore::CurlDownload::getTempPath const): Deleted.
1519         (WebCore::CurlDownload::getUrl const): Deleted.
1520         (WebCore::CurlDownload::downloadFinishedCallback): Deleted.
1521         (WebCore::CurlDownload::downloadFailedCallback): Deleted.
1522         (WebCore::CurlDownload::receivedDataCallback): Deleted.
1523         (WebCore::CurlDownload::receivedResponseCallback): Deleted.
1524         * platform/network/curl/CurlDownload.h:
1525         * platform/network/curl/ResourceError.h:
1526         (WebCore::ResourceError::ResourceError):
1527         (WebCore::ResourceError::sslErrors const):
1528         (WebCore::ResourceError::setSSLErrors): Deleted.
1529         * platform/network/curl/ResourceHandleCurl.cpp:
1530         (WebCore::ResourceHandleInternal::initialize):
1531         (WebCore::ResourceHandleInternal::didFail):
1532         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
1533         * platform/network/curl/SSLHandle.cpp:
1534         (WebCore::allowedClientHosts):
1535         (WebCore::addAllowedClientCertificate):
1536         (WebCore::getSSLClientCertificate):
1537         (WebCore::certVerifyCallback):
1538         (WebCore::setSSLVerifyOptions):
1539         (WebCore::setSSLClientCertificate): Deleted.
1540         * platform/network/curl/SSLHandle.h:
1541
1542 2017-08-17  Chris Dumez  <cdumez@apple.com>
1543
1544         Regression(r220817): We should only copy the original request headers for Ping loads
1545         https://bugs.webkit.org/show_bug.cgi?id=175679
1546
1547         Reviewed by Youenn Fablet.
1548
1549         For performance reason, we should only copy the original request headers for Ping loads
1550         (Beacon at the moment), not for all CachedResourceRequests.
1551
1552         * loader/LoaderStrategy.h:
1553         * loader/cache/CachedResource.cpp:
1554         (WebCore::CachedResource::CachedResource):
1555         (WebCore::CachedResource::load):
1556         * loader/cache/CachedResource.h:
1557         (WebCore::CachedResource::shouldUsePingLoad):
1558         (WebCore::CachedResource::setOriginalRequestHeaders):
1559         * loader/cache/CachedResourceLoader.cpp:
1560         (WebCore::CachedResourceLoader::requestResource):
1561         * loader/cache/CachedResourceRequest.cpp:
1562         (WebCore::CachedResourceRequest::CachedResourceRequest):
1563         * loader/cache/CachedResourceRequest.h:
1564         (WebCore::CachedResourceRequest::releaseResourceRequest):
1565         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): Deleted.
1566
1567 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1568
1569         [PAL] Relocate SessionID to root
1570         https://bugs.webkit.org/show_bug.cgi?id=175684
1571
1572         Reviewed by Alex Christensen.
1573
1574         No new tests. No change in functionality.
1575
1576         * dom/Document.h:
1577         * html/HTMLMediaElement.cpp:
1578         * loader/cache/CachedResource.h:
1579         * loader/cache/CachedResourceLoader.cpp:
1580         * loader/cache/MemoryCache.h:
1581         * loader/cocoa/DiskCacheMonitorCocoa.h:
1582         * page/CacheStorageProvider.h:
1583         * page/Page.h:
1584         * page/PlugInClient.h:
1585         * page/SocketProvider.h:
1586         * platform/CookiesStrategy.h:
1587         * platform/WebCoreCrossThreadCopier.cpp:
1588         * platform/network/CacheValidation.h:
1589         * platform/network/NetworkStorageSession.cpp:
1590         * platform/network/NetworkStorageSession.h:
1591         * platform/network/cf/SocketStreamHandleImpl.h:
1592         * platform/network/curl/SocketStreamHandleImpl.h:
1593         * platform/network/soup/SocketStreamHandleImpl.h:
1594         * workers/WorkerGlobalScope.h:
1595         * workers/service/ServiceWorkerContainer.h:
1596         * workers/service/ServiceWorkerRegistrationParameters.h:
1597
1598 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1599
1600         Fix the build on other platforms after r220865
1601         https://bugs.webkit.org/show_bug.cgi?id=175683
1602
1603         Reviewed by Tim Horton.
1604
1605         Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special
1606         casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are
1607         neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item
1608         providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the
1609         PlatformPasteboard::write methods.
1610
1611         There is no change in behavior.
1612
1613         * platform/ios/PlatformPasteboardIOS.mm:
1614         (WebCore::registerItemToPasteboard):
1615         (WebCore::PlatformPasteboard::write):
1616
1617 2017-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1618
1619         -Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp
1620         https://bugs.webkit.org/show_bug.cgi?id=175675
1621
1622         Reviewed by Jiewen Tan.
1623
1624         * crypto/CryptoKey.cpp:
1625         (WebCore::CryptoKey::algorithm const):
1626         * crypto/SubtleCrypto.cpp:
1627         (WebCore::toCryptoKeyUsageBitmap):
1628         (WebCore::toKeyData):
1629
1630 2017-08-17  Andreas Kling  <akling@apple.com>
1631
1632         Disable CSS regions at compile time
1633         https://bugs.webkit.org/show_bug.cgi?id=175630
1634
1635         Reviewed by Antti Koivisto.
1636
1637         * Configurations/FeatureDefines.xcconfig:
1638
1639 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1640
1641         [iOS] Respect type fidelities when copying image elements to the pasteboard
1642         https://bugs.webkit.org/show_bug.cgi?id=175638
1643         <rdar://problem/26556043>
1644
1645         Reviewed by Ryosuke Niwa.
1646
1647         Ensures that we respect type fidelities when copying on iOS, by unifying pasteboard writing codepaths across
1648         dragging and copying. When dragging and copying, we now generate and set UIItemProviders on the UIPasteboard.
1649
1650         Tests: ActionSheetTests.CopyImageElementWithHREF
1651                ActionSheetTests.CopyImageElementWithoutHREF
1652
1653         * platform/PlatformPasteboard.h:
1654
1655         Remove all variants of the writeObjectRepresentations helper method. Now that both paths for writing to the
1656         pasteboard are unified, it's no longer useful to separate out item-provider-based pasteboard logic.
1657
1658         * platform/ios/AbstractPasteboard.h:
1659         * platform/ios/PlatformPasteboardIOS.mm:
1660
1661         Replaces -setItemsUsingRegistrationInfoLists: with -setRegistrationInfoLists:. Rather than have a helper that
1662         both sets up item providers and item registration lists, split this functionality out into two setters. This is
1663         because UIPasteboard does not need to know about the registration info lists used to set up the item providers
1664         in the first place, but internal drag-and-drop clients require this information immediately when starting a drag
1665         in order to construct custom drag previews.
1666
1667         (WebCore::richTextRepresentationsForPasteboardWebContent):
1668         (WebCore::registerItemToPasteboard):
1669
1670         Add a new helper to register item providers to the pasteboard, given an WebItemProviderRegistrationInfoList.
1671
1672         (WebCore::PlatformPasteboard::write):
1673         (WebCore::PlatformPasteboard::writeObjectRepresentations): Deleted.
1674
1675         Refactors PlatformPasteboard::write to always generate and set item providers, unless we're building for an SDK
1676         prior to iOS 11. For images, strings and URLs, we can simply transition to using the new item-provider-based
1677         codepaths used for drag and drop. For web content, we add two additional UTIs that were present when copying,
1678         but not when dragging: flat RTFD and a string constant used to indicate to UIKit that the pasteboard contains
1679         rich text.
1680
1681         * platform/ios/WebItemProviderPasteboard.h:
1682         * platform/ios/WebItemProviderPasteboard.mm:
1683         (-[WebItemProviderRegistrationInfoList init]):
1684         (-[WebItemProviderRegistrationInfoList addData:forType:]):
1685         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1686         (-[WebItemProviderRegistrationInfoList numberOfItems]):
1687         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
1688         (-[WebItemProviderRegistrationInfoList itemProvider]):
1689         (-[WebItemProviderRegistrationInfoList description]):
1690
1691         Make some small tweaks in WebItemProviderPasteboard (and related classes):
1692         1. Transition to preferredPresentationSize from estimatedDisplayedSize, which is now deprecated.
1693         2. Remove calls to -initWithItemProviderData:typeIdentifier:error:, which is deprecated.
1694         3. Rename _items to _representations to better reflect the role of WebItemProviderRegistrationInfo.
1695         4. Implement -description for WebItemProviderRegistrationInfoList for debugging purposes.
1696
1697         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1698         (-[WebItemProviderPasteboard setRegistrationInfoLists:]):
1699         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Deleted.
1700
1701 2017-08-17  Youenn Fablet  <youenn@apple.com>
1702
1703         Add a DOMPromiseDeferred method to handle ExceptionOr<> results
1704         https://bugs.webkit.org/show_bug.cgi?id=175603
1705
1706         Reviewed by Darin Adler.
1707
1708         No change of behavior.
1709
1710         Introduce DOMPromiseDeferred::settle to reject/resolve a promise with an ExceptionOr<>.
1711         Making batchPutOperation/batchDeleteOperation take a Function with an ExceptionOr<>.
1712         Using DOMPromiseDeferred::settle in Cache put/remove.
1713         Updated CacheStorageConnection to create ExceptionOr<> from CacheStorageConnection::Error.
1714
1715         * Modules/cache/Cache.cpp:
1716         (WebCore::Cache::put):
1717         (WebCore::Cache::remove):
1718         (WebCore::Cache::batchDeleteOperation):
1719         (WebCore::Cache::batchPutOperation):
1720         * Modules/cache/Cache.h:
1721         * Modules/cache/CacheStorage.cpp:
1722         (WebCore::CacheStorage::open):
1723         (WebCore::CacheStorage::remove):
1724         * Modules/cache/CacheStorageConnection.cpp:
1725         (WebCore::CacheStorageConnection::errorToException):
1726         * Modules/cache/CacheStorageConnection.h:
1727         (WebCore::CacheStorageConnection::errorToException):
1728         (WebCore::CacheStorageConnection::exceptionOrResult):
1729         * bindings/js/JSDOMPromiseDeferred.h:
1730         (WebCore::DOMPromiseDeferred::settle):
1731         (WebCore::DOMPromiseDeferred<void>::settle):
1732
1733 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1734
1735         [GStreamer] AppendPipeline: support dispatch of decryption-specific GstStructure into the pipeline
1736         https://bugs.webkit.org/show_bug.cgi?id=175668
1737
1738         Reviewed by Xabier Rodriguez-Calvar.
1739
1740         Add the AppendPipeline::dispatchDecryptionStructure() method. Callers can
1741         pass in a GstStructure object that contains all the information the
1742         decryption elements in the pipeline will require to properly decrypt the
1743         content. In case the decryptor element isn't available yet, the
1744         GstStructure is stored and dispatched when that element becomes available.
1745
1746         The dispatch itself simply creates a new custom GstEvent that adopts the
1747         given GstStructure object, sends that into the pipeline element, and
1748         shifts the state to 'ongoing'.
1749
1750         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1751         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1752         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure):
1753         (WebCore::AppendPipeline::dispatchDecryptionStructure):
1754         * platform/graphics/gstreamer/mse/AppendPipeline.h: Remove a redundant private: label.
1755
1756 2017-08-17  Zan Dobersek  <zdobersek@igalia.com>
1757
1758         [GStreamer] GstStructure shouldn't be handled through GRefPtr
1759         https://bugs.webkit.org/show_bug.cgi?id=175673
1760
1761         Reviewed by Xabier Rodriguez-Calvar.
1762
1763         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1764         (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't
1765         ref-counted, so it should be handled through the GUniquePtr<GstStructure>
1766         smart pointer.
1767
1768 2017-08-17  Youenn Fablet  <youenn@apple.com>
1769
1770         [Mac/iOS] Increase the audio buffer size when audio capture is on but web audio is not used
1771         https://bugs.webkit.org/show_bug.cgi?id=175631
1772
1773         Reviewed by Eric Carlson.
1774
1775         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1776         (PlatformMediaSessionManager::updateSessionState): Change value from 128 to the equivalent of 20ms when audio capture happens but not web audio.
1777
1778 2017-08-17  Antti Koivisto  <antti@apple.com>
1779
1780         RenderListItem - Avoid render tree mutation during layout
1781         https://bugs.webkit.org/show_bug.cgi?id=175666
1782
1783         Reviewed by Andreas Kling.
1784
1785         Mutations should be done by RenderTreeUpdater only.
1786
1787         * rendering/RenderListItem.cpp:
1788         (WebCore::RenderListItem::updateMarkerRenderer):
1789
1790             This is now called by RenderTreeUpdater only.
1791             Remove code dealing with this being called at layout time.
1792             Merged marker construction code from styleDidChange here and renamed for clarity.
1793
1794         (WebCore::RenderListItem::layout):
1795         (WebCore::RenderListItem::computePreferredLogicalWidths):
1796
1797             Remove mutating calls.
1798
1799         (WebCore::RenderListItem::styleDidChange): Deleted.
1800         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted.
1801         * rendering/RenderListItem.h:
1802         * rendering/TextAutoSizing.cpp:
1803         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
1804
1805             Call updateMarkerRenderer.
1806
1807         * style/RenderTreeUpdater.cpp:
1808         (WebCore::RenderTreeUpdater::popParent):
1809         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1810
1811             Call updateMarkerRenderer.
1812
1813 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1814
1815         [PAL] Move SessionID into PAL
1816         https://bugs.webkit.org/show_bug.cgi?id=174192
1817
1818         Reviewed by Antti Koivisto.
1819
1820         No new tests. No change in behavior.
1821
1822         * CMakeLists.txt:
1823         * Modules/websockets/WebSocketChannel.cpp:
1824         (WebCore::WebSocketChannel::connect):
1825         * WebCore.xcodeproj/project.pbxproj:
1826         * dom/Document.cpp:
1827         (WebCore::Document::sessionID const):
1828         * dom/Document.h:
1829         * dom/ScriptExecutionContext.h:
1830         * html/HTMLMediaElement.cpp:
1831         (WebCore::HTMLMediaElement::elementWithID):
1832         (WebCore::HTMLMediaElement::finishParsingChildren):
1833         (WebCore::HTMLMediaElement::scheduleEvent):
1834         (WebCore::HTMLMediaElement::canPlayType const):
1835         (WebCore::HTMLMediaElement::load):
1836         (WebCore::HTMLMediaElement::loadResource):
1837         (WebCore::HTMLMediaElement::textTracksAreReady const):
1838         (WebCore::HTMLMediaElement::textTrackModeChanged):
1839         (WebCore::HTMLMediaElement::noneSupported):
1840         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
1841         (WebCore::HTMLMediaElement::mediaLoadingFailed):
1842         (WebCore::HTMLMediaElement::setReadyState):
1843         (WebCore::HTMLMediaElement::addPlayedRange):
1844         (WebCore::HTMLMediaElement::seekTask):
1845         (WebCore::HTMLMediaElement::refreshCachedTime const):
1846         (WebCore::HTMLMediaElement::currentMediaTime const):
1847         (WebCore::HTMLMediaElement::setWebkitPreservesPitch):
1848         (WebCore::HTMLMediaElement::ended const):
1849         (WebCore::HTMLMediaElement::playInternal):
1850         (WebCore::HTMLMediaElement::pause):
1851         (WebCore::HTMLMediaElement::togglePlayState):
1852         (WebCore::HTMLMediaElement::beginScrubbing):
1853         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
1854         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
1855         (WebCore::HTMLMediaElement::didAddTextTrack):
1856         (WebCore::HTMLMediaElement::didRemoveTextTrack):
1857         (WebCore::controllerJSValue):
1858         (WebCore::HTMLMediaElement::configureTextTracks):
1859         (WebCore::HTMLMediaElement::selectNextSourceChild):
1860         (WebCore::HTMLMediaElement::sourceWasAdded):
1861         (WebCore::HTMLMediaElement::sourceWasRemoved):
1862         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1863         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
1864         (WebCore::HTMLMediaElement::potentiallyPlaying const):
1865         (WebCore::HTMLMediaElement::endedPlayback const):
1866         (WebCore::HTMLMediaElement::stoppedDueToErrors const):
1867         (WebCore::HTMLMediaElement::updatePlayState):
1868         (WebCore::HTMLMediaElement::userCancelledLoad):
1869         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const):
1870         (WebCore::HTMLMediaElement::addEventListener):
1871         (WebCore::HTMLMediaElement::isFullscreen const):
1872         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
1873         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
1874         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
1875         (WebCore::HTMLMediaElement::updateTextTrackDisplay):
1876         (WebCore::HTMLMediaElement::mediaControls const):
1877         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
1878         (WebCore::HTMLMediaElement::setMediaGroup):
1879         (WebCore::HTMLMediaElement::setControllerForBindings):
1880         (WebCore::HTMLMediaElement::isBlockedOnMediaController const):
1881         (WebCore::HTMLMediaElement::prepareMediaFragmentURI):
1882         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1883         (WebCore::HTMLMediaElement::fileSize const):
1884         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1885         (WebCore::needsSeekingSupportQuirk):
1886         (WebCore::HTMLMediaElement::supportsSeeking const):
1887         (WebCore::HTMLMediaElement::doesHaveAttribute const):
1888         (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback):
1889         * loader/DocumentLoader.cpp:
1890         (WebCore::DocumentLoader::continueAfterContentPolicy):
1891         * loader/EmptyClients.cpp:
1892         * loader/FrameLoaderClient.h:
1893         * loader/cache/CachedCSSStyleSheet.cpp:
1894         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1895         * loader/cache/CachedCSSStyleSheet.h:
1896         * loader/cache/CachedFont.cpp:
1897         (WebCore::CachedFont::CachedFont):
1898         * loader/cache/CachedFont.h:
1899         * loader/cache/CachedImage.cpp:
1900         (WebCore::CachedImage::CachedImage):
1901         * loader/cache/CachedImage.h:
1902         * loader/cache/CachedRawResource.cpp:
1903         (WebCore::CachedRawResource::CachedRawResource):
1904         * loader/cache/CachedRawResource.h:
1905         * loader/cache/CachedResource.cpp:
1906         (WebCore::CachedResource::CachedResource):
1907         * loader/cache/CachedResource.h:
1908         (WebCore::CachedResource::sessionID const):
1909         * loader/cache/CachedResourceLoader.cpp:
1910         (WebCore::createResource):
1911         (WebCore::CachedResourceLoader::sessionID const):
1912         * loader/cache/CachedResourceLoader.h:
1913         * loader/cache/CachedSVGDocument.cpp:
1914         (WebCore::CachedSVGDocument::CachedSVGDocument):
1915         * loader/cache/CachedSVGDocument.h:
1916         * loader/cache/CachedSVGFont.cpp:
1917         (WebCore::CachedSVGFont::CachedSVGFont):
1918         * loader/cache/CachedSVGFont.h:
1919         * loader/cache/CachedScript.cpp:
1920         (WebCore::CachedScript::CachedScript):
1921         * loader/cache/CachedScript.h:
1922         * loader/cache/CachedTextTrack.cpp:
1923         (WebCore::CachedTextTrack::CachedTextTrack):
1924         * loader/cache/CachedTextTrack.h:
1925         * loader/cache/CachedXSLStyleSheet.cpp:
1926         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1927         * loader/cache/CachedXSLStyleSheet.h:
1928         * loader/cache/MemoryCache.cpp:
1929         (WebCore::MemoryCache::sessionResourceMap const):
1930         (WebCore::MemoryCache::ensureSessionResourceMap):
1931         (WebCore::MemoryCache::resourceForRequest):
1932         (WebCore::MemoryCache::addImageToCache):
1933         (WebCore::MemoryCache::removeImageFromCache):
1934         (WebCore::MemoryCache::forEachSessionResource):
1935         (WebCore::MemoryCache::removeResourcesWithOrigins):
1936         (WebCore::MemoryCache::originsWithCache const):
1937         (WebCore::MemoryCache::evictResources):
1938         * loader/cache/MemoryCache.h:
1939         * loader/cocoa/DiskCacheMonitorCocoa.h:
1940         (WebCore::DiskCacheMonitor::sessionID const):
1941         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1942         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation):
1943         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
1944         * page/CacheStorageProvider.h:
1945         * page/DatabaseProvider.h:
1946         * page/Page.cpp:
1947         (WebCore::Page::Page):
1948         (WebCore::Page::enableLegacyPrivateBrowsing):
1949         (WebCore::Page::sessionID const):
1950         (WebCore::Page::setSessionID):
1951         * page/Page.h:
1952         * page/PlugInClient.h:
1953         * page/SocketProvider.cpp:
1954         (WebCore::SocketProvider::createSocketStreamHandle):
1955         * page/SocketProvider.h:
1956         * platform/CookiesStrategy.h:
1957         * platform/WebCoreCrossThreadCopier.cpp:
1958         (WTF::PAL::SessionID>::copy):
1959         (WTF::WebCore::SessionID>::copy): Deleted.
1960         * platform/WebCoreCrossThreadCopier.h:
1961         * platform/network/CacheValidation.cpp:
1962         (WebCore::headerValueForVary):
1963         (WebCore::collectVaryingRequestHeaders):
1964         (WebCore::verifyVaryingRequestHeaders):
1965         * platform/network/CacheValidation.h:
1966         * platform/network/NetworkStorageSession.cpp:
1967         (WebCore::NetworkStorageSession::globalSessionMap):
1968         (WebCore::NetworkStorageSession::storageSession):
1969         (WebCore::NetworkStorageSession::destroySession):
1970         * platform/network/NetworkStorageSession.h:
1971         (WebCore::NetworkStorageSession::sessionID const):
1972         * platform/network/NetworkStorageSessionStub.cpp:
1973         (WebCore::NetworkStorageSession::NetworkStorageSession):
1974         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1975         (WebCore::NetworkStorageSession::ensureSession):
1976         (WebCore::NetworkStorageSession::defaultStorageSession):
1977         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1978         (WebCore::NetworkStorageSession::NetworkStorageSession):
1979         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1980         (WebCore::NetworkStorageSession::defaultStorageSession):
1981         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1982         (WebCore::NetworkStorageSession::ensureSession):
1983         * platform/network/cf/SocketStreamHandleImpl.h:
1984         (WebCore::SocketStreamHandleImpl::create):
1985         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1986         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
1987         * platform/network/curl/SocketStreamHandleImpl.h:
1988         (WebCore::SocketStreamHandleImpl::create):
1989         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1990         (WebCore::NetworkStorageSession::NetworkStorageSession):
1991         (WebCore::NetworkStorageSession::defaultStorageSession):
1992         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
1993         (WebCore::NetworkStorageSession::ensureSession):
1994         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1995         * platform/network/soup/SocketStreamHandleImpl.h:
1996         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1997         (WebCore::SocketStreamHandleImpl::create):
1998         * workers/DedicatedWorkerGlobalScope.cpp:
1999         (WebCore::DedicatedWorkerGlobalScope::create):
2000         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2001         * workers/DedicatedWorkerGlobalScope.h:
2002         * workers/DedicatedWorkerThread.cpp:
2003         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2004         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2005         * workers/DedicatedWorkerThread.h:
2006         * workers/Worker.cpp:
2007         (WebCore::Worker::notifyFinished):
2008         * workers/WorkerGlobalScope.cpp:
2009         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2010         * workers/WorkerGlobalScope.h:
2011         * workers/WorkerGlobalScopeProxy.h:
2012         * workers/WorkerMessagingProxy.cpp:
2013         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2014         * workers/WorkerMessagingProxy.h:
2015         * workers/WorkerThread.cpp:
2016         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2017         (WebCore::WorkerThread::WorkerThread):
2018         * workers/WorkerThread.h:
2019         * workers/service/ServiceWorkerContainer.h:
2020         * workers/service/ServiceWorkerRegistrationParameters.h:
2021
2022 2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2023
2024         [GTK][WPE] Add NTLM authentication enabled API
2025         https://bugs.webkit.org/show_bug.cgi?id=122952
2026
2027         Reviewed by Michael Catanzaro.
2028
2029         Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled.
2030
2031         * platform/network/soup/SoupNetworkSession.cpp:
2032         (WebCore::SoupNetworkSession::SoupNetworkSession):
2033         (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled):
2034         (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled):
2035         * platform/network/soup/SoupNetworkSession.h:
2036
2037 2017-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2038
2039         Add the support for mutating clipboard data via DataTransferItemList
2040         https://bugs.webkit.org/show_bug.cgi?id=175639
2041
2042         Reviewed by Wenson Hsieh.
2043
2044         Added the support for adding plaintext data via dataTransfer.items.add, clearing data via clear,
2045         and removing an entry via remove. When DataTransferItem is removed from DataTransferItemList,
2046         we must put into the disabled mode.
2047
2048         To support the removal of DataTransferItem, this patch replaces a reference to DataTransfer by
2049         a WeakPtr to DataTransferItemList, and stops forwarding ref from DataTransferItem to DataTransfer.
2050         This means that DataTransfer can now be GC'ed before DataTransferItem is GC'ed.
2051
2052         Because the identify and the order of DataTransferItems need to be preserved, we can't simply
2053         re-popluate m_itemList in DataTransferItemList. Instead, whenever the clipboard content is mutated,
2054         we make the parallel modifications to m_itemList. This includes changes made via DataTransfer
2055         methods such as setData and clearData.
2056
2057         Test: editing/pasteboard/datatransfer-items-copy-plaintext.html
2058
2059         * dom/DataTransfer.cpp:
2060         (WebCore::DataTransfer::clearData): Invoke didClearStringData when m_itemList exists.
2061         (WebCore::DataTransfer::setData): Ditto.
2062         (WebCore::DataTransfer::createForInputEvent):
2063         (WebCore::DataTransfer::createForDrag):
2064         (WebCore::DataTransfer::createForDrop):
2065         * dom/DataTransferItem.cpp:
2066         (WebCore::DataTransferItem::create):
2067         (WebCore::DataTransferItem::DataTransferItem):
2068         (WebCore::DataTransferItem::clearListAndPutIntoDisabledMode): Added.
2069         (WebCore::DataTransferItem::type const): Moved from the header.
2070         (WebCore::DataTransferItem::getAsString const):
2071         (WebCore::DataTransferItem::getAsFile const):
2072         * dom/DataTransferItem.h:
2073         (WebCore::DataTransferItem::ref): Deleted.
2074         (WebCore::DataTransferItem::deref): Deleted.
2075         (WebCore::DataTransferItem::isFile const): Added.
2076         (WebCore::DataTransferItem::type const): Move to the cpp file.
2077         * dom/DataTransferItemList.cpp:
2078         (WebCore::isSupportedType): Moved.
2079         (WebCore::DataTransferItemList::DataTransferItemList): Moved from the header.
2080         (WebCore::DataTransferItemList::~DataTransferItemList): Added.
2081         (WebCore::DataTransferItemList::item):
2082         (WebCore::DataTransferItemList::add): Implemented the variant to add string data.
2083         (WebCore::DataTransferItemList::remove): Implemented. For now, we don't have to deal with removing
2084         a file since a writable dataTransfer never contains a File object.
2085         (WebCore::DataTransferItemList::clear): Implemented.
2086         (WebCore::DataTransferItemList::ensureItems const):
2087         (WebCore::removeStringItemOfLowercasedType): Added.
2088         (WebCore::DataTransferItemList::didClearStringData): Called when dataTransfer.clear is called.
2089         (WebCore::DataTransferItemList::didSetStringData): Ditto for 
2090         * dom/DataTransferItemList.h:
2091         (WebCore::DataTransferItemList): Added a WeakPtrFactory. Also use a vector of Ref<DataTransferItem>
2092         instead of unique_ptr<DataTransferItem> since DataTransferItem can outlive DataTransferItemList.
2093         (WebCore::DataTransferItemList::dataTransfer): Added.
2094         * dom/DataTransferItemList.idl:
2095
2096 2017-08-16  Andy Estes  <aestes@apple.com>
2097
2098         [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
2099         https://bugs.webkit.org/show_bug.cgi?id=175648
2100
2101         Reviewed by Tim Horton.
2102
2103         The W3C Payment Request API defines an interface called PaymentRequest, which conflicts with
2104         an existing Apple Pay class. This patch renames PaymentRequest to
2105         ApplePaySessionPaymentRequest so that a follow-on patch can introduce PaymentRequest for the
2106         W3C API.
2107
2108         * Modules/applepay/ApplePayError.h:
2109         * Modules/applepay/ApplePayLineItem.h:
2110         * Modules/applepay/ApplePayPaymentRequest.h:
2111         * Modules/applepay/ApplePaySession.cpp:
2112         (WebCore::convertAndValidateTotal):
2113         (WebCore::convertAndValidate):
2114         (WebCore::ApplePaySession::ApplePaySession):
2115         (WebCore::ApplePaySession::didSelectShippingMethod):
2116         * Modules/applepay/ApplePaySession.h:
2117         * Modules/applepay/ApplePaySessionPaymentRequest.cpp: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.cpp.
2118         (WebCore::ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest):
2119         (WebCore::ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest):
2120         (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork):
2121         * Modules/applepay/ApplePaySessionPaymentRequest.h: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.h.
2122         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2123         (WebCore::convert):
2124         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
2125         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
2126         * Modules/applepay/PaymentCoordinator.cpp:
2127         (WebCore::PaymentCoordinator::beginPaymentSession):
2128         (WebCore::PaymentCoordinator::didSelectShippingMethod):
2129         * Modules/applepay/PaymentCoordinator.h:
2130         * Modules/applepay/PaymentCoordinatorClient.h:
2131         * Modules/applepay/PaymentHeaders.h:
2132         * Modules/applepay/PaymentRequestValidator.cpp:
2133         (WebCore::PaymentRequestValidator::validate):
2134         (WebCore::PaymentRequestValidator::validateTotal):
2135         (WebCore::validateMerchantCapabilities):
2136         (WebCore::validateShippingMethod):
2137         (WebCore::validateShippingMethods):
2138         * Modules/applepay/PaymentRequestValidator.h:
2139         * WebCore.xcodeproj/project.pbxproj:
2140         * loader/EmptyClients.cpp:
2141
2142 2017-08-16  Chris Dumez  <cdumez@apple.com>
2143
2144         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
2145         https://bugs.webkit.org/show_bug.cgi?id=175628
2146         <rdar://problem/33919278>
2147
2148         Reviewed by Geoffrey Garen.
2149
2150         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
2151         To achieve this, the following changes were made:
2152         1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
2153         2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
2154            preflight merely because the fetch mode is set to "cors").
2155
2156         Test: http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html
2157
2158         * Modules/fetch/FetchBody.cpp:
2159         (WebCore::FetchBody::extract):
2160         * loader/CrossOriginAccessControl.h:
2161         * loader/LoaderStrategy.h:
2162         * loader/PingLoader.cpp:
2163         (WebCore::PingLoader::loadImage):
2164         (WebCore::PingLoader::sendPing):
2165         (WebCore::PingLoader::sendViolationReport):
2166         (WebCore::PingLoader::startPingLoad):
2167         * loader/PingLoader.h:
2168         * loader/cache/CachedResource.cpp:
2169         (WebCore::CachedResource::CachedResource):
2170         (WebCore::CachedResource::load):
2171         * loader/cache/CachedResource.h:
2172         * loader/cache/CachedResourceRequest.cpp:
2173         (WebCore::CachedResourceRequest::CachedResourceRequest):
2174         * loader/cache/CachedResourceRequest.h:
2175         (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders):
2176         * platform/network/HTTPHeaderValues.cpp:
2177         * platform/network/HTTPHeaderValues.h:
2178
2179 2017-08-16  Matt Baker  <mattbaker@apple.com>
2180
2181         Web Inspector: capture async stack trace when workers/main context posts a message
2182         https://bugs.webkit.org/show_bug.cgi?id=167084
2183         <rdar://problem/30033673>
2184
2185         Reviewed by Brian Burg.
2186
2187         Add instrumentation to DOMWindow to support showing asynchronous
2188         stack traces when the debugger pauses in a MessageEvent handler.
2189
2190         Test: inspector/debugger/async-stack-trace.html
2191
2192         * inspector/InspectorInstrumentation.cpp:
2193         (WebCore::InspectorInstrumentation::didPostMessageImpl):
2194         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
2195         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
2196         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
2197
2198         * inspector/InspectorInstrumentation.h:
2199         (WebCore::InspectorInstrumentation::didPostMessage):
2200         (WebCore::InspectorInstrumentation::didFailPostMessage):
2201         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
2202         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
2203
2204         * inspector/PageDebuggerAgent.cpp:
2205         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
2206         (WebCore::PageDebuggerAgent::didPostMessage):
2207         (WebCore::PageDebuggerAgent::didFailPostMessage):
2208         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
2209         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
2210         * inspector/PageDebuggerAgent.h:
2211
2212         * page/DOMWindow.cpp:
2213         (WebCore::DOMWindow::postMessage):
2214         (WebCore::DOMWindow::postMessageTimerFired):
2215
2216 2017-08-16  Timothy Horton  <timothy_horton@apple.com>
2217
2218         Try to fix the build
2219
2220         * platform/ios/PlatformPasteboardIOS.mm:
2221
2222 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2223
2224         Build fix after r220812
2225
2226         Fix builds where LOG_DISABLED is defined.
2227
2228         * css/MediaQueryEvaluator.cpp:
2229
2230 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2231
2232         Add a log channel for media queries
2233         https://bugs.webkit.org/show_bug.cgi?id=175591
2234
2235         Reviewed by Zalan Bujtas.
2236
2237         Add a "MediaQueries" log channel which logs data about media query evaluation.
2238
2239         * css/MediaList.cpp:
2240         (WebCore::MediaQuerySet::MediaQuerySet):
2241         (WebCore::operator<<):
2242         * css/MediaList.h:
2243         * css/MediaQuery.cpp:
2244         (WebCore::operator<<):
2245         * css/MediaQuery.h:
2246         * css/MediaQueryEvaluator.cpp:
2247         (WebCore::operator<<):
2248         (WebCore::MediaQueryEvaluator::evaluate const):
2249         (WebCore::aspectRatioValueAsString):
2250         (WebCore::orientationEvaluate):
2251         (WebCore::aspectRatioEvaluate):
2252         (WebCore::deviceAspectRatioEvaluate):
2253         (WebCore::evaluateResolution):
2254         (WebCore::deviceHeightEvaluate):
2255         (WebCore::deviceWidthEvaluate):
2256         (WebCore::heightEvaluate):
2257         (WebCore::widthEvaluate):
2258         * css/MediaQueryExpression.cpp:
2259         (WebCore::operator<<):
2260         * css/MediaQueryExpression.h:
2261         * css/MediaQueryMatcher.cpp:
2262         (WebCore::MediaQueryMatcher::styleResolverChanged):
2263         * css/StyleResolver.cpp:
2264         (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const):
2265         (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const):
2266         * dom/InlineStyleSheetOwner.cpp:
2267         (WebCore::InlineStyleSheetOwner::createSheet):
2268         * html/HTMLImageElement.cpp:
2269         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2270         * html/HTMLLinkElement.cpp:
2271         (WebCore::HTMLLinkElement::process):
2272         * html/HTMLMediaElement.cpp:
2273         (WebCore::HTMLMediaElement::selectNextSourceChild):
2274         * html/HTMLPictureElement.cpp:
2275         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
2276         * html/parser/HTMLPreloadScanner.cpp:
2277         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2278         * page/FrameView.cpp:
2279         (WebCore::FrameView::layout):
2280         * platform/Logging.cpp:
2281         (WebCore::initializeLogChannelsIfNecessary):
2282         * platform/Logging.h:
2283         * platform/URL.cpp:
2284         (WebCore::isSchemeFirstChar):
2285         (WebCore::operator<<):
2286         * platform/URL.h:
2287
2288 2017-08-16  Sam Weinig  <sam@webkit.org>
2289
2290         [WebIDL] Remove the need for JSSubtleCryptoCustom.cpp
2291         https://bugs.webkit.org/show_bug.cgi?id=175526
2292
2293         Reviewed by Chris Dumez.
2294
2295         - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, 
2296           which is defined in the WebCrypto spec to happen after normal IDL operations.
2297         - Adds initial support for IDL object types in unions (some, unneeded at the moment,
2298           edge cases remain).
2299
2300         * CMakeLists.txt:
2301         * WebCore.xcodeproj/project.pbxproj:
2302         * bindings/js/JSSubtleCryptoCustom.cpp: Removed.
2303
2304             Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h
2305
2306         * bindings/js/JSDOMConvertObject.h:
2307
2308             Add needed, when included in generated code, #include of StrongInlines.h
2309
2310         * bindings/js/JSDOMConvertUnion.h:
2311         
2312             Add initial support for object (needed for AlgorithmIdentifier which is 
2313             (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616
2314
2315             Also add remaining spec comments while in the area.
2316
2317         * bindings/js/JSDOMPromiseDeferred.cpp:
2318         (WebCore::DeferredPromise::reject):
2319
2320             Add support for the special ExistingExceptionError error code. Capturing
2321             the current exception and using it as the rejection value.
2322
2323         * crypto/SubtleCrypto.cpp:
2324         (WebCore::SubtleCrypto::~SubtleCrypto):
2325         (WebCore::toHashIdentifier):
2326         (WebCore::normalizeCryptoAlgorithmParameters):
2327         (WebCore::toCryptoKeyUsageBitmap):
2328         (WebCore::rejectWithException):
2329         (WebCore::normalizeJsonWebKey):
2330         (WebCore::toKeyData):
2331         (WebCore::copyToVector):
2332         (WebCore::isSupportedExportKey):
2333         (WebCore::SubtleCrypto::encrypt):
2334         (WebCore::SubtleCrypto::decrypt):
2335         (WebCore::SubtleCrypto::sign):
2336         (WebCore::SubtleCrypto::verify):
2337         (WebCore::SubtleCrypto::digest):
2338         (WebCore::SubtleCrypto::generateKey):
2339         (WebCore::SubtleCrypto::deriveKey):
2340         (WebCore::SubtleCrypto::deriveBits):
2341         (WebCore::SubtleCrypto::importKey):
2342         (WebCore::SubtleCrypto::exportKey):
2343         (WebCore::SubtleCrypto::wrapKey):
2344         (WebCore::SubtleCrypto::unwrapKey):
2345         * crypto/SubtleCrypto.h:
2346         * crypto/SubtleCrypto.idl:
2347
2348             Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come
2349             with that are:
2350             - All parameters are now converted / type checked for us.
2351             - Rather than throwing exceptions and expecting the bindings layer to convert
2352               them to promise rejections, all rejections are now explicitly made.
2353             - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters
2354               and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return
2355               an Exception if its not supported.
2356             - Shaves 251 lines off the file.
2357
2358         * crypto/CryptoKeyFormat.h: Added.
2359
2360             Add new header for unified key format enum. (For bindings purposes, SubtleCrypto
2361             re aliases it to SubtleCrypto::KeyFormat).
2362
2363         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2364         * crypto/CryptoAlgorithm.cpp:
2365         * crypto/CryptoAlgorithm.h:
2366         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2367         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2368         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
2369         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
2370         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
2371         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
2372         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
2373         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
2374         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2375         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2376         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
2377         * crypto/algorithms/CryptoAlgorithmECDH.h:
2378         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
2379         * crypto/algorithms/CryptoAlgorithmECDSA.h:
2380         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
2381         * crypto/algorithms/CryptoAlgorithmHKDF.h:
2382         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2383         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2384         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
2385         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
2386         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2387         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2388         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2389         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2390         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2391         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2392         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
2393         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
2394
2395             Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat,
2396             to allow not including SubtleCrypto.h.
2397
2398         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
2399         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
2400         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2401         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
2402         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
2403         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
2404         * crypto/parameters/EcdsaParams.idl:
2405         * crypto/parameters/HkdfParams.idl:
2406         * crypto/parameters/HmacKeyParams.idl:
2407         * crypto/parameters/Pbkdf2Params.idl:
2408         * crypto/parameters/RsaHashedImportParams.idl:
2409         * crypto/parameters/RsaHashedKeyGenParams.idl:
2410
2411             Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier,
2412             which is (object or DOMString), now that it is supported.
2413
2414 2017-08-16  Youenn Fablet  <youenn@apple.com>
2415
2416         [Cache API] Implement Worker connection to the Cache storage engine
2417         https://bugs.webkit.org/show_bug.cgi?id=175599
2418
2419         Reviewed by Chris Dumez.
2420
2421         Covered by existing tests.
2422
2423         Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage
2424         to the cache storage engine.
2425         WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job.
2426         Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection. 
2427
2428         * Modules/cache/CacheQueryOptions.h:
2429         (WebCore::CacheQueryOptions::isolatedCopy const):
2430         * Modules/cache/CacheStorageConnection.cpp:
2431         (WebCore::CacheStorageConnection::open):
2432         (WebCore::CacheStorageConnection::remove):
2433         (WebCore::CacheStorageConnection::retrieveCaches):
2434         (WebCore::CacheStorageConnection::retrieveRecords):
2435         (WebCore::CacheStorageConnection::batchDeleteOperation):
2436         (WebCore::CacheStorageConnection::batchPutOperation):
2437         (WebCore::CacheStorageConnection::openOrRemoveCompleted):
2438         (WebCore::CacheStorageConnection::updateCaches):
2439         (WebCore::CacheStorageConnection::updateRecords):
2440         (WebCore::CacheStorageConnection::removeRecordsCompleted):
2441         (WebCore::CacheStorageConnection::putRecordsCompleted):
2442         * Modules/cache/CacheStorageConnection.h:
2443         (WebCore::CacheStorageConnection::openCompleted):
2444         (WebCore::CacheStorageConnection::removeCompleted):
2445         (WebCore::CacheStorageConnection::doOpen):
2446         (WebCore::CacheStorageConnection::doRemove):
2447         (WebCore::CacheStorageConnection::doRetrieveCaches):
2448         (WebCore::CacheStorageConnection::doRetrieveRecords):
2449         (WebCore::CacheStorageConnection::doBatchDeleteOperation):
2450         (WebCore::CacheStorageConnection::doBatchPutOperation):
2451         * Modules/cache/WorkerCacheStorageConnection.cpp: Added.
2452         (WebCore::toCrossThreadRecordData):
2453         (WebCore::fromCrossThreadRecordData):
2454         (WebCore::WorkerCacheStorageConnection::create):
2455         (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
2456         (WebCore::WorkerCacheStorageConnection::doOpen):
2457         (WebCore::WorkerCacheStorageConnection::doRemove):
2458         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2459         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
2460         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
2461         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
2462         * Modules/cache/WorkerCacheStorageConnection.h: Added.
2463         * Modules/cache/WorkerGlobalScopeCaches.cpp:
2464         (WebCore::WorkerGlobalScopeCaches::caches const):
2465         * WebCore.xcodeproj/project.pbxproj:
2466         * loader/FetchOptions.h:
2467         (WebCore::FetchOptions::isolatedCopy const):
2468         * workers/WorkerGlobalScope.cpp:
2469         (WebCore::WorkerGlobalScope::cacheStorageConnection):
2470         * workers/WorkerGlobalScope.h:
2471
2472 2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2473
2474         [PAL] Move spi/ios and spi/win directories into PAL
2475         https://bugs.webkit.org/show_bug.cgi?id=175171
2476
2477         Reviewed by Antti Koivisto.
2478
2479         * PlatformWin.cmake:
2480         * WebCore.xcodeproj/project.pbxproj:
2481         * editing/cocoa/DataDetection.mm:
2482         * loader/ios/PreviewLoader.mm:
2483         * page/CaptionUserPreferencesMediaAF.cpp:
2484         * page/cocoa/MemoryReleaseCocoa.mm:
2485         * page/cocoa/SettingsCocoa.mm:
2486         * page/ios/UserAgentIOS.mm:
2487         * platform/audio/ios/MediaSessionManagerIOS.mm:
2488         * platform/graphics/ca/PlatformCALayer.cpp:
2489         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2490         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2491         * platform/graphics/opentype/OpenTypeCG.h:
2492         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2493         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
2494         * platform/ios/Device.h:
2495         * platform/ios/PlatformPasteboardIOS.mm:
2496         * platform/ios/PlatformScreenIOS.mm:
2497         * platform/ios/QuickLookSoftLink.h:
2498         * platform/ios/QuickLookSoftLink.mm:
2499         * platform/ios/ValidationBubbleIOS.mm:
2500         * platform/ios/WebItemProviderPasteboard.mm:
2501         * platform/network/ios/PreviewConverter.mm:
2502         * platform/sql/SQLiteFileSystem.cpp:
2503         * rendering/RenderThemeIOS.mm:
2504
2505 2017-08-16  Tim Horton  <timothy_horton@apple.com>
2506
2507         2-3% of main thread time under UTTypeCreatePreferredIdentifierForTag on wunderground map
2508         https://bugs.webkit.org/show_bug.cgi?id=175618
2509
2510         Reviewed by Simon Fraser.
2511
2512         No new tests, just a perf win.
2513
2514         UTTypeCreatePreferredIdentifierForTag is fairly expensive, and is called
2515         under every toDataURL, which the Wunderground wundermap does a /lot/.
2516
2517         Keep a 16-item LRU cache of MIMEType->UTI mappings.
2518
2519         Also, make other callers of UTTypeCreatePreferredIdentifierForTag use
2520         the UTIUtilities version so they can share in the caching.
2521
2522         Also, as a drive-by, add and make other callers use mimeTypeFromUTI too,
2523         and make the UTIUtilities operate on Strings for a slightly more WebCore-y feel.
2524
2525         * editing/ios/EditorIOS.mm:
2526         (WebCore::Editor::WebContentReader::readImage):
2527         * platform/MIMETypeRegistry.cpp:
2528         (WebCore::initializeSupportedImageMIMETypes):
2529         (WebCore::initializeSupportedImageMIMETypesForEncoding):
2530         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2531         (WebCore::createFileTypesSet):
2532         * platform/graphics/cg/ImageSourceCGMac.mm:
2533         (WebCore::MIMETypeForImageSourceType):
2534         Adopt newly-added MIMETypeFromUTI().
2535
2536         * platform/graphics/cg/ImageBufferCG.cpp:
2537         (WebCore::utiFromImageBufferMIMEType):
2538         (WebCore::ImageBuffer::toCFData const):
2539         (WebCore::cfData):
2540         (WebCore::utiFromMIMEType): Deleted.
2541         Adopt UTIFromMIMEType, and rename the local helper that does something
2542         different (a small static map) on iOS and Windows to not have an overlapping name.
2543
2544         * platform/ios/PasteboardIOS.mm:
2545         (WebCore::Pasteboard::resourceMIMEType):
2546         (WebCore::utiTypeFromCocoaType):
2547         Adopt UTIFromMIMEType().
2548
2549         * platform/ios/PlatformPasteboardIOS.mm:
2550         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2551         * platform/mac/PasteboardMac.mm:
2552         (WebCore::cocoaTypeFromHTMLClipboardType):
2553         Adopt isDeclaredUTI and UTIFromMIMEType().
2554
2555         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2556         (WebCore::WebCoreAVFResourceLoader::responseReceived):
2557         * platform/network/ios/WebCoreURLResponseIOS.mm:
2558         (WebCore::adjustMIMETypeIfNecessary):
2559         * platform/network/mac/WebCoreURLResponse.mm:
2560         (WebCore::adjustMIMETypeIfNecessary):
2561         * rendering/RenderThemeIOS.mm:
2562         (WebCore::iconForAttachment):
2563         * rendering/RenderThemeMac.mm:
2564         (WebCore::iconForAttachment):
2565         Deal with the fact that UTI utilities deal in Strings now.
2566
2567         * platform/network/mac/UTIUtilities.h:
2568         * platform/network/mac/UTIUtilities.mm:
2569         (WebCore::MIMETypeFromUTI):
2570         Added. This doesn't crawl up the UTI tree if the first conversion fails,
2571         which is what most of the existing code does. It's possible we want to
2572         use MIMETypeFromUTITree's logic everywhere, but I didn't want to change
2573         that in this patch.
2574
2575         (WebCore::MIMETypeFromUTITree):
2576         (WebCore::isDeclaredUTI):
2577         Take and return strings.
2578
2579         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2580         (WebCore::UTIFromMIMEType):
2581         Add the aforementioned cache.
2582
2583 2017-08-16  Simon Fraser  <simon.fraser@apple.com>
2584
2585         Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging
2586         https://bugs.webkit.org/show_bug.cgi?id=175634
2587
2588         Reviewed by Zalan Bujtas.
2589
2590         Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging.
2591
2592         Convert CompositingUpdateType to an enum class.
2593
2594         * page/FrameView.cpp:
2595         (WebCore::FrameView::updateCompositingLayersAfterLayout):
2596         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
2597         * page/ios/FrameIOS.mm:
2598         (WebCore::Frame::viewportOffsetChanged):
2599         * rendering/RenderLayer.cpp:
2600         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
2601         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
2602         (WebCore::RenderLayer::calculateClipRects const):
2603         * rendering/RenderLayer.h:
2604         * rendering/RenderLayerBacking.cpp:
2605         (WebCore::RenderLayerBacking::updateAfterLayout):
2606         (WebCore::RenderLayerBacking::updateGeometry):
2607         (WebCore::operator<<):
2608         * rendering/RenderLayerBacking.h:
2609         * rendering/RenderLayerCompositor.cpp:
2610         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2611         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2612         (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired):
2613         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2614         (WebCore::RenderLayerCompositor::layerTreeAsText):
2615         (WebCore::operator<<):
2616         * rendering/RenderLayerCompositor.h:
2617
2618 2017-08-16  Eric Carlson  <eric.carlson@apple.com>
2619
2620         Consider allow gUM to be called from localhost without https
2621         https://bugs.webkit.org/show_bug.cgi?id=173457
2622         <rdar://problem/33900527>
2623
2624         Reviewed by Youenn Fablet.
2625
2626         Tests: http/tests/media/media-stream/get-user-media-localhost.html
2627                http/tests/media/media-stream/get-user-media-loopback-ip.html
2628
2629         * Modules/mediastream/UserMediaRequest.cpp:
2630         (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for
2631         the string 'https'.
2632         (WebCore::canCallGetUserMedia): Allow localhost or loopback address.
2633
2634         * page/SecurityOrigin.cpp:
2635         (WebCore::isLoopbackIPAddress): Add a comment.
2636         (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address
2637         to isLocalHostOrLoopbackIPAddress, call it.
2638         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 
2639         * page/SecurityOrigin.h:
2640
2641 2017-08-16  Chris Dumez  <cdumez@apple.com>
2642
2643         EventSource: ignore IDs with U+0000
2644         https://bugs.webkit.org/show_bug.cgi?id=175178
2645
2646         Reviewed by Darin Adler.
2647
2648         EventSource: ignore IDs with U+0000 as per:
2649         https://github.com/whatwg/html/pull/2849
2650
2651         Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm
2652
2653         * page/EventSource.cpp:
2654         (WebCore::EventSource::parseEventStreamLine):
2655
2656 2017-08-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2657
2658         [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
2659         https://bugs.webkit.org/show_bug.cgi?id=174418
2660
2661         Reviewed by Michael Catanzaro.
2662
2663         HarfBuzzShaper should normalize the input text before collecting
2664         HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
2665         the task. But, this function hasn't been called from anywhere
2666         since Bug 90951.
2667
2668         Test: fast/text/international/vietnamese-nfd.html
2669               imported/blink/fast/text/international/text-shaping-arabic-diffs.html
2670
2671         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2672         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
2673         Call setNormalizedBuffer instead of normalizeCharacters.
2674         (WebCore::normalizeCharacters): Deleted.
2675         (WebCore::normalizeSpacesAndMirrorChars) Use
2676         FontCascade::treatAsZeroWidthSpaceInComplexScript instead of
2677         FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ.
2678
2679 2017-08-16  Antti Koivisto  <antti@apple.com>
2680
2681         Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
2682         https://bugs.webkit.org/show_bug.cgi?id=175627
2683
2684         Reviewed by Andreas Kling.
2685
2686         Render tree should not mutate itself. We already fixed this for first-letter, supporting code
2687         can now move to RenderTreeUpdater too.
2688
2689         * CMakeLists.txt:
2690         * WebCore.xcodeproj/project.pbxproj:
2691         * rendering/RenderBlock.cpp:
2692         (WebCore::styleForFirstLetter): Deleted.
2693         (WebCore::isPunctuationForFirstLetter): Deleted.
2694         (WebCore::shouldSkipForFirstLetter): Deleted.
2695         (WebCore::RenderBlock::updateFirstLetterStyle): Deleted.
2696         (WebCore::RenderBlock::createFirstLetterRenderer): Deleted.
2697         (WebCore::RenderBlock::updateFirstLetter): Deleted.
2698         * rendering/RenderBlock.h:
2699         * rendering/RenderRubyRun.cpp:
2700         (WebCore::RenderRubyRun::updateFirstLetter): Deleted.
2701         * rendering/RenderRubyRun.h:
2702         * rendering/RenderTable.cpp:
2703         (WebCore::RenderTable::updateFirstLetter): Deleted.
2704         * rendering/RenderTable.h:
2705
2706             Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via
2707             supportsFirstLetter test in the first letter updater.
2708
2709         * rendering/TextAutoSizing.cpp:
2710         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2711         * rendering/svg/RenderSVGText.cpp:
2712         (WebCore::RenderSVGText::updateFirstLetter): Deleted.
2713         * rendering/svg/RenderSVGText.h:
2714         * style/RenderTreeUpdater.cpp:
2715         (WebCore::RenderTreeUpdater::popParent):
2716         * style/RenderTreeUpdater.h:
2717         * style/RenderTreeUpdaterFirstLetter.cpp: Added.
2718         (WebCore::styleForFirstLetter):
2719         (WebCore::isPunctuationForFirstLetter):
2720         (WebCore::shouldSkipForFirstLetter):
2721         (WebCore::updateFirstLetterStyle):
2722         (WebCore::createFirstLetterRenderer):
2723         (WebCore::supportsFirstLetter):
2724         (WebCore::RenderTreeUpdater::FirstLetter::update):
2725         * style/RenderTreeUpdaterFirstLetter.h: Added.
2726
2727 2017-08-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2728
2729         [GStreamer][EME] Rework handling key systems and UUIDs
2730         https://bugs.webkit.org/show_bug.cgi?id=175567
2731
2732         Reviewed by Žan Doberšek.
2733
2734         The UUIDs and key system strings were moved to the
2735         GStreamerEMEUtilities class because so far they were managed by
2736         the decryptors and that was ugly.
2737
2738         * platform/GStreamer.cmake:
2739         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2740         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2741         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp: Added.
2742         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Added.
2743         (WebCore::GStreamerEMEUtilities::isClearKeyKeySystem):
2744         (WebCore::GStreamerEMEUtilities::keySystemToUuid):
2745         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2746         (webkit_media_clear_key_decrypt_class_init):
2747         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
2748
2749 2017-08-16  Andy Estes  <aestes@apple.com>
2750
2751         [Payment Request] Add an ENABLE flag and an experimental feature preference
2752         https://bugs.webkit.org/show_bug.cgi?id=175622
2753
2754         Reviewed by Tim Horton.
2755
2756         * Configurations/FeatureDefines.xcconfig:
2757         * page/Settings.in:
2758
2759 2017-08-15  Ryosuke Niwa  <rniwa@webkit.org>
2760
2761         Make DataTransferItemList work with plain text entries
2762         https://bugs.webkit.org/show_bug.cgi?id=175596
2763
2764         Reviewed by Wenson Hsieh.
2765
2766         Added the basic machinery to get the list of plain text items to DataTransferItemList and DataTransferItem.
2767
2768         Each DataTransferItem now depends on DataTransfer so it does ref-forwarding like DataTransferItemList to make
2769         DataTransfer alive as long as any DataTransferItem is alive.
2770
2771         Specifications: https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface
2772                         https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
2773
2774         Tests: editing/pasteboard/datatransfer-items-drop-plaintext-file.html
2775                editing/pasteboard/datatransfer-items-paste-plaintext.html
2776
2777         * dom/DataTransferItem.cpp:
2778         (WebCore::DataTransferItem::DataTransferItem): Added two variants one for plain text and another one for a file.
2779         (WebCore::DataTransferItem::kind const): Rewritten.
2780         (WebCore::DataTransferItem::getAsString const): Implemented.
2781         (WebCore::DataTransferItem::getAsFile const): Implemented.
2782         * dom/DataTransferItem.h:
2783         (WebCore::DataTransferItem::ref): Added.
2784         (WebCore::DataTransferItem::deref): Added.
2785         (WebCore::DataTransferItem::type const): Returns String instead of AtomicString.
2786         (WebCore::DataTransferItem::kind const): Moved to cpp.
2787         * dom/DataTransferItem.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2788         * dom/DataTransferItemList.cpp:
2789         (WebCore::DataTransferItemList::length): Implemented.
2790         (WebCore::DataTransferItemList::item): Ditto.
2791         (WebCore::isSupportedType): Added. For now, we only support text/plain.
2792         (WebCore::DataTransferItemList::ensureItems): Added. Constructs the list of DataTransferItems.
2793         * dom/DataTransferItemList.h:
2794         (DataTransferItemList): Added m_items. The list is filled lazily by ensureItems.
2795         * dom/DataTransferItemList.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
2796
2797 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2798
2799         Remove ScrollView::clipsRepaints() which was only used by Chromium
2800         https://bugs.webkit.org/show_bug.cgi?id=175594
2801
2802         Reviewed by Tim Horton.
2803
2804         clipsRepaints() was added in r74568 but was only used by Chromium. It's always
2805         true for other platforms, so remove conditionals that test for it and assume true.
2806
2807         * page/FrameView.cpp:
2808         (WebCore::FrameView::scrollContentsFastPath):
2809         * platform/ScrollView.cpp:
2810         (WebCore::ScrollView::repaintContentRectangle):
2811         (WebCore::ScrollView::setClipsRepaints): Deleted.
2812         * platform/ScrollView.h:
2813         (WebCore::ScrollView::clipsRepaints const): Deleted.
2814
2815 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
2816
2817         Allow WebCore logging channels to be set from the UI process
2818         https://bugs.webkit.org/show_bug.cgi?id=175608
2819
2820         Reviewed by Tim Horton.
2821
2822         Change initializeLogChannelsIfNecessary() to take an optional String, which can
2823         be a list of log channels passed from the UI process.
2824
2825         * platform/LogInitialization.h:
2826         * platform/Logging.cpp:
2827         (WebCore::initializeLogChannelsIfNecessary):
2828
2829 2017-08-15  Chris Dumez  <cdumez@apple.com>
2830
2831         Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
2832         https://bugs.webkit.org/show_bug.cgi?id=175600
2833
2834         Reviewed by Youenn Fablet.
2835
2836         Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon.
2837         If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded"
2838         Content-Type header, which is worse.
2839
2840         Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch.
2841         The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately
2842         not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the
2843         lesser evil.
2844
2845         Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html
2846
2847         * Modules/fetch/FetchBody.cpp:
2848         (WebCore::FetchBody::extract):
2849         * platform/network/HTTPHeaderValues.cpp:
2850         (WebCore::HTTPHeaderValues::octetStreamContentType):
2851         * platform/network/HTTPHeaderValues.h:
2852
2853 2017-08-15  Robin Morisset  <rmorisset@apple.com>
2854
2855         Change the order of arguments of JSWithScope::create() for consistency
2856         https://bugs.webkit.org/show_bug.cgi?id=175585
2857
2858         Reviewed by Saam Barati.
2859
2860         No change of behavior.
2861
2862         * bindings/js/JSHTMLElementCustom.cpp:
2863         (WebCore::JSHTMLElement::pushEventHandlerScope const):
2864
2865 2017-08-15  Youenn Fablet  <youenn@apple.com>
2866
2867         [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
2868         https://bugs.webkit.org/show_bug.cgi?id=175538
2869
2870         Reviewed by Chris Dumez.
2871
2872         No change of behavior.
2873         This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
2874         This will allow Cache API to preserve responses when reading them from a different process.
2875
2876         * platform/network/ResourceResponseBase.cpp:
2877         (WebCore::ResourceResponseBase::setType):
2878         * platform/network/ResourceResponseBase.h:
2879         (WebCore::ResourceResponseBase::setType):
2880
2881 2017-08-15  Chris Dumez  <cdumez@apple.com>
2882
2883         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2884         https://bugs.webkit.org/show_bug.cgi?id=175505
2885
2886         Reviewed by Youenn Fablet.
2887
2888         Update CachedResourceLoader::requestResource() to return a WTF::Expected
2889         type instead of using an out parameter for the ResourceError in case of
2890         synchronous failure.
2891
2892         * Modules/beacon/NavigatorBeacon.cpp:
2893         (WebCore::NavigatorBeacon::sendBeacon):
2894         * bindings/js/CachedScriptFetcher.cpp:
2895         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2896         * css/CSSFontFaceSrcValue.cpp:
2897         (WebCore::CSSFontFaceSrcValue::cachedFont):
2898         * css/CSSImageSetValue.cpp:
2899         (WebCore::CSSImageSetValue::loadBestFitImage):
2900         * css/CSSImageValue.cpp:
2901         (WebCore::CSSImageValue::loadImage):
2902         * css/StyleRuleImport.cpp:
2903         (WebCore::StyleRuleImport::requestStyleSheet):
2904         * dom/ProcessingInstruction.cpp:
2905         (WebCore::ProcessingInstruction::checkStyleSheet):
2906         * html/HTMLLinkElement.cpp:
2907         (WebCore::HTMLLinkElement::process):
2908         * loader/CrossOriginPreflightChecker.cpp:
2909         (WebCore::CrossOriginPreflightChecker::startPreflight):
2910         * loader/DocumentLoader.cpp:
2911         (WebCore::DocumentLoader::startLoadingMainResource):
2912         * loader/DocumentThreadableLoader.cpp:
2913         (WebCore::DocumentThreadableLoader::loadRequest):
2914         * loader/FrameLoader.cpp:
2915         (WebCore::FrameLoader::loadedResourceFromMemoryCache):
2916         * loader/FrameLoader.h:
2917         * loader/ImageLoader.cpp:
2918         (WebCore::ImageLoader::updateFromElement):
2919         * loader/LinkLoader.cpp:
2920         (WebCore::LinkLoader::preloadIfNeeded):
2921         * loader/MediaResourceLoader.cpp:
2922         (WebCore::MediaResourceLoader::requestResource):
2923         * loader/TextTrackLoader.cpp:
2924         (WebCore::TextTrackLoader::load):
2925         * loader/cache/CachedResourceLoader.cpp:
2926         (WebCore::castCachedResourceTo):
2927         (WebCore::CachedResourceLoader::requestImage):
2928         (WebCore::CachedResourceLoader::requestFont):
2929         (WebCore::CachedResourceLoader::requestTextTrack):
2930         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
2931         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2932         (WebCore::CachedResourceLoader::requestScript):
2933         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
2934         (WebCore::CachedResourceLoader::requestSVGDocument):
2935         (WebCore::CachedResourceLoader::requestLinkResource):
2936         (WebCore::CachedResourceLoader::requestMedia):
2937         (WebCore::CachedResourceLoader::requestIcon):
2938         (WebCore::CachedResourceLoader::requestRawResource):
2939         (WebCore::CachedResourceLoader::requestBeaconResource):
2940         (WebCore::CachedResourceLoader::requestMainResource):
2941         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
2942         (WebCore::CachedResourceLoader::requestResource):
2943         (WebCore::CachedResourceLoader::preload):
2944         * loader/cache/CachedResourceLoader.h:
2945         * loader/cache/CachedSVGDocumentReference.cpp:
2946         (WebCore::CachedSVGDocumentReference::load):
2947         * loader/icon/IconLoader.cpp:
2948         (WebCore::IconLoader::startLoading):
2949         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2950         (WebCore::WebCoreAVFResourceLoader::startLoading):
2951         * svg/SVGFEImageElement.cpp:
2952         (WebCore::SVGFEImageElement::requestImageResource):
2953         * svg/SVGFontFaceUriElement.cpp:
2954         (WebCore::SVGFontFaceUriElement::loadFont):
2955         * svg/SVGUseElement.cpp:
2956         (WebCore::SVGUseElement::updateExternalDocument):
2957         * xml/XSLImportRule.cpp:
2958         (WebCore::XSLImportRule::loadSheet):
2959
2960 2017-08-15  Don Olmstead  <don.olmstead@sony.com>
2961
2962         [PAL] Move Sleep classes into PAL
2963         https://bugs.webkit.org/show_bug.cgi?id=175456
2964
2965         Reviewed by Ryosuke Niwa.
2966
2967         No new tests. No change in behavior.
2968
2969         * CMakeLists.txt:
2970         * PlatformMac.cmake:
2971         * WebCore.xcodeproj/project.pbxproj:
2972         * html/HTMLMediaElement.cpp:
2973         * html/HTMLMediaElement.h:
2974         * platform/audio/PlatformMediaSessionManager.cpp:
2975         * platform/audio/PlatformMediaSessionManager.h:
2976         * platform/mac/WebVideoFullscreenController.h:
2977         * platform/mac/WebVideoFullscreenController.mm:
2978
2979 2017-08-15  Youenn Fablet  <youenn@apple.com>
2980
2981         [Cache API] Adding generic support for CacheStorage and Cache methods
2982         https://bugs.webkit.org/show_bug.cgi?id=175455
2983
2984         Reviewed by Chris Dumez.
2985
2986         Covered by existing tests.
2987
2988         Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
2989         The CacheStorageProvider is accessed from the page for Document calls.
2990         The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
2991         At the moment, it does nothing but return not implemented errors.
2992
2993         Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
2994         CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
2995         The CacheStorageConnection is a generic connection and not tied to any document/context.
2996         CacheStorage objects are manipulated by providing to the connection the origin of the context.
2997         CacheStorage are global to all contexts with the same origin.
2998         Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.
2999
3000         Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.
3001
3002         * Modules/cache/Cache.cpp:
3003         (WebCore::Cache::Cache):
3004         (WebCore::Cache::~Cache):
3005         The CacheStorageConnection is a generic connection and not tied to any document/context.
3006         (WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
3007         Redirect to matchAll as per spec.
3008         (WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
3009         Checks for request as per spec. Then either refresh the request to response map and return all responses.
3010         Or call the query cache algorithm and return copies of the responses (using clone).
3011         (WebCore::Cache::put):
3012         Check the request and response as per spec.
3013         Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
3014         Call the batch put operation.
3015         (WebCore::Cache::remove):
3016         Check the request and response as per spec.
3017         Call the batch delete operation.
3018         (WebCore::Cache::keys):
3019         Refresh the request to response map and return corresponding requests.
3020         Making sure to reuse the same request objects as per spec.
3021         As per spec, the request to response map is ordered. We implement it as a Vector.
3022         (WebCore::Cache::refreshRequestToResponseMap):
3023         Use the cache storage connection to get an up-to-date list of cached records.
3024         (WebCore::Cache::queryCacheMatch):
3025         Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
3026         This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
3027         (WebCore::Cache::queryCache):
3028         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
3029         (WebCore::Cache::queryCacheWithTargetStorage):
3030         Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
3031         (WebCore::Cache::batchDeleteOperation):
3032         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
3033         Delete operation are always done one at a time.
3034         (WebCore::Cache::batchPutOperation):
3035         Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
3036         Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
3037         (WebCore::Cache::updateRequestToResponseMap):
3038         Update the cache request to response map based on the records retrieved from the cache storage connection.
3039         * Modules/cache/Cache.h:
3040         (WebCore::Cache::create):
3041         (WebCore::Cache::name const):
3042         * Modules/cache/Cache.idl:
3043         * Modules/cache/CacheStorage.cpp:
3044         (WebCore::CacheStorage::origin const):
3045         Computing the cache origin that is passed to the CacheStorageConnection.
3046         (WebCore::CacheStorage::has):
3047         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
3048         Call the cache storage connection to refresh its cache map.
3049         Then use it to check whether a cache exists.
3050         (WebCore::CacheStorage::refreshCacheMap):
3051         Use the cache storage connection to get the list of existing caches.
3052         (WebCore::CacheStorage::open):
3053         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
3054         Refreshing the cache map so as to return a pre-existing cache if any.
3055         (WebCore::CacheStorage::remove):
3056         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
3057         Refreshing the cache map so as to do nothing if there is no cache to remove.
3058         (WebCore::CacheStorage::keys):
3059         Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
3060         Refreshing the cache map and returnin its keys.
3061         As per spec, the cache map is ordered. We implement it as a Vector.
3062         (WebCore::CacheStorage::cacheMap):
3063         Get the list of cache objects, used as a private accessor for JS built-ins.
3064         * Modules/cache/CacheStorage.h:
3065         (WebCore::CacheStorage::create):
3066         (WebCore::CacheStorage::CacheStorage):
3067         * Modules/cache/CacheStorageConnection.cpp: Added.
3068         (WebCore::CacheStorageConnection::exceptionFromError):
3069         * Modules/cache/CacheStorageConnection.h: Added.
3070         Makes the link between Web facing Cache API and the cache storage engine.
3071         Envisioned implementation are:
3072         - One main thread connection used by all documents in the given process.
3073         - One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.
3074         (WebCore::CacheStorageConnection::create):
3075         (WebCore::CacheStorageConnection::open):
3076         (WebCore::CacheStorageConnection::remove):
3077         (WebCore::CacheStorageConnection::refreshCacheMap):
3078         (WebCore::CacheStorageConnection::refreshRequestToResponseMap):
3079         (WebCore::CacheStorageConnection::batchDeleteOperation):
3080         (WebCore::CacheStorageConnection::batchPutOperation):
3081         * Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
3082         * Modules/cache/DOMWindowCaches.cpp:
3083         (WebCore::DOMWindowCaches::caches const):
3084         * Modules/cache/WorkerGlobalScopeCaches.cpp:
3085         (WebCore::WorkerGlobalScopeCaches::from):
3086         (WebCore::WorkerGlobalScopeCaches::caches const):
3087         * Modules/cache/WorkerGlobalScopeCaches.h:
3088         (WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):
3089         * Modules/fetch/FetchBodyOwner.h:
3090         (WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.
3091         * Modules/fetch/FetchHeaders.h:
3092         (WebCore::FetchHeaders::create): Add another create as used by the cache API.
3093         (WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.
3094         * Modules/fetch/FetchLoader.cpp:
3095         (WebCore::FetchLoader::start):
3096         * Modules/fetch/FetchRequest.cpp:
3097         (WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
3098         Add a check so that no value at all is the same as a null/undefined value.
3099         (WebCore::FetchRequest::resourceRequest const):
3100         * Modules/fetch/FetchRequest.h:
3101         * Modules/fetch/FetchResponse.h:
3102         * WebCore.xcodeproj/project.pbxproj:
3103         * inspector/InspectorOverlay.cpp:
3104         (WebCore::InspectorOverlay::overlayPage):
3105         * page/CacheStorageProvider.h: Added.
3106         Interface to create main thread cache storage connection for the given page.
3107         There will be one provider for each process.
3108         Passing a sessionID so that we will create a connection per session.
3109         * page/Page.cpp:
3110         (WebCore::Page::Page):
3111         * page/Page.h:
3112         (WebCore::Page::cacheStorageProvider):
3113         * page/PageConfiguration.cpp:
3114         (WebCore::PageConfiguration::PageConfiguration):
3115         * page/PageConfiguration.h:
3116         * svg/graphics/SVGImage.cpp:
3117         (WebCore::SVGImage::dataChanged):
3118
3119 2017-08-15  Chris Dumez  <cdumez@apple.com>
3120
3121         Implement quota limitation for keepalive Fetch requests
3122         https://bugs.webkit.org/show_bug.cgi?id=175482
3123
3124         Reviewed by Sam Weinig and Youenn Fablet.
3125
3126         Implement quota limitation for keepalive Fetch requests as per:
3127         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
3128
3129         This partly works for Beacon as well, meaning that no Beacon with a body
3130         over 64Kb can be sent. However, we don't keep track about wether or not
3131         beacon loads are inflight or not.
3132
3133         Also update CachedResourceLoader::requestResource() so that the caller
3134         can get a ResourceError when it returns null. This is useful for both
3135         Fetch and Beacon to return better error messages.
3136
3137         Test: http/wpt/beacon/beacon-quota.html
3138
3139         * CMakeLists.txt:
3140         * Modules/beacon/NavigatorBeacon.cpp:
3141         (WebCore::NavigatorBeacon::sendBeacon):
3142         * Modules/fetch/FetchBodyOwner.cpp:
3143         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3144         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3145         * Modules/fetch/FetchBodyOwner.h:
3146         * Modules/fetch/FetchLoader.cpp:
3147         (WebCore::FetchLoader::start):
3148         (WebCore::FetchLoader::didFail):
3149         * Modules/fetch/FetchLoaderClient.h:
3150         * Modules/fetch/FetchResponse.cpp:
3151         (WebCore::FetchResponse::BodyLoader::didFail):
3152         * Modules/fetch/FetchResponse.h:
3153         * WebCore.xcodeproj/project.pbxproj:
3154         * loader/DocumentThreadableLoader.cpp:
3155         (WebCore::DocumentThreadableLoader::loadRequest):
3156         * loader/cache/CachedResource.cpp:
3157         (WebCore::CachedResource::load):
3158         * loader/cache/CachedResource.h:
3159         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3160         * loader/cache/CachedResourceLoader.cpp:
3161         (WebCore::createResource):
3162         (WebCore::CachedResourceLoader::requestImage):
3163         (WebCore::CachedResourceLoader::requestFont):
3164         (WebCore::CachedResourceLoader::requestTextTrack):
3165         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3166         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3167         (WebCore::CachedResourceLoader::requestScript):
3168         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3169         (WebCore::CachedResourceLoader::requestSVGDocument):
3170         (WebCore::CachedResourceLoader::requestLinkResource):
3171         (WebCore::CachedResourceLoader::requestMedia):
3172         (WebCore::CachedResourceLoader::requestIcon):
3173         (WebCore::CachedResourceLoader::requestRawResource):
3174         (WebCore::CachedResourceLoader::requestBeaconResource):
3175         (WebCore::CachedResourceLoader::requestMainResource):
3176         (WebCore::CachedResourceLoader::requestResource):
3177         (WebCore::CachedResourceLoader::preload):
3178         * loader/cache/CachedResourceLoader.h:
3179         * loader/cache/KeepaliveRequestTracker.cpp: Added.
3180         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
3181         (WebCore::KeepaliveRequestTracker::canLoadRequest):
3182         (WebCore::KeepaliveRequestTracker::registerRequest):
3183         (WebCore::KeepaliveRequestTracker::responseReceived):
3184         (WebCore::KeepaliveRequestTracker::notifyFinished):
3185         (WebCore::KeepaliveRequestTracker::unregisterRequest):
3186         * loader/cache/KeepaliveRequestTracker.h: Added.
3187         * platform/network/FormData.cpp:
3188         (WebCore::FormDataElement::lengthInBytes const):
3189         (WebCore::FormData::lengthInBytes const):
3190         * platform/network/FormData.h:
3191
3192 2017-08-15  Darin Adler  <darin@apple.com>
3193
3194         REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
3195         https://bugs.webkit.org/show_bug.cgi?id=175107
3196
3197         Reviewed by Alexey Proskuryakov.
3198
3199         * loader/FrameLoader.cpp:
3200         (WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check.
3201
3202 2017-08-15  Commit Queue  <commit-queue@webkit.org>
3203
3204         Unreviewed, rolling out r219504.
3205         https://bugs.webkit.org/show_bug.cgi?id=175580
3206
3207         Broke Arabic text shaping (Requested by mcatanzaro on
3208         #webkit).
3209
3210         Reverted changeset:
3211
3212         "[HarfBuzz] Decomposed Vietnamese characters are rendered
3213         incorrectly"
3214         https://bugs.webkit.org/show_bug.cgi?id=174418
3215         http://trac.webkit.org/changeset/219504
3216
3217 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3218
3219         WebDriver: handle click events on option elements
3220         https://bugs.webkit.org/show_bug.cgi?id=174710
3221         <rdar://problem/33459305>
3222
3223         Reviewed by Brian Burg.
3224
3225         Export WebCore symbols required by WebKit layer.
3226
3227         * html/HTMLOptGroupElement.h:
3228         * html/HTMLOptionElement.h:
3229
3230 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3231
3232         Remove Proximity Events and related code
3233         https://bugs.webkit.org/show_bug.cgi?id=175545
3234
3235         Reviewed by Daniel Bates.
3236
3237         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
3238         and other related code.
3239
3240         * CMakeLists.txt:
3241         * Configurations/FeatureDefines.xcconfig:
3242         * DerivedSources.cpp:
3243         * Modules/proximity/DeviceProximityClient.h: Removed.
3244         * Modules/proximity/DeviceProximityController.cpp: Removed.
3245         * Modules/proximity/DeviceProximityController.h: Removed.
3246         * Modules/proximity/DeviceProximityEvent.cpp: Removed.
3247         * Modules/proximity/DeviceProximityEvent.h: Removed.
3248         * Modules/proximity/DeviceProximityEvent.idl: Removed.
3249         * dom/EventNames.h:
3250         * dom/EventNames.in:
3251         * history/PageCache.cpp:
3252         (WebCore::canCachePage):
3253         * page/DOMWindow.cpp:
3254         (WebCore::DOMWindow::addEventListener):
3255         (WebCore::DOMWindow::removeEventListener):
3256         (WebCore::DOMWindow::removeAllEventListeners):
3257         * page/DOMWindow.idl:
3258         * page/DiagnosticLoggingKeys.cpp:
3259         (WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted.
3260         * page/DiagnosticLoggingKeys.h:
3261         * testing/Internals.cpp:
3262         (WebCore::Internals::setDeviceProximity): Deleted.
3263         * testing/Internals.h:
3264         * testing/Internals.idl:
3265
3266 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3267
3268         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
3269         https://bugs.webkit.org/show_bug.cgi?id=175504
3270
3271         Reviewed by Sam Weinig.
3272         
3273         REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596,
3274         however no further work was done, and it was left disabled. So remove the code.
3275
3276         * Configurations/FeatureDefines.xcconfig:
3277         * DerivedSources.make:
3278         * WebCore.xcodeproj/project.pbxproj:
3279         * dom/AutocompleteErrorEvent.h: Removed.
3280         * dom/AutocompleteErrorEvent.idl: Removed.
3281         * dom/EventNames.in:
3282         * dom/GlobalEventHandlers.idl:
3283         * html/HTMLFormElement.cpp:
3284         (WebCore::HTMLFormElement::HTMLFormElement):
3285         (WebCore::HTMLFormElement::requestAutocomplete): Deleted.
3286         (WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted.
3287         (WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted.
3288         * html/HTMLFormElement.h:
3289         * html/HTMLFormElement.idl:
3290         * loader/EmptyClients.cpp:
3291         * loader/FrameLoaderClient.h:
3292
3293 2017-08-14  Chris Dumez  <cdumez@apple.com>
3294
3295         XHR should only fire an abort event if the cancellation was requested by the client
3296         https://bugs.webkit.org/show_bug.cgi?id=175546
3297
3298         Reviewed by Youenn Fablet.
3299
3300         XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
3301         Blink and Gecko already match the specification.
3302
3303         Specification:
3304         - https://xhr.spec.whatwg.org/#handle-errors
3305         - https://xhr.spec.whatwg.org/#the-abort()-method
3306
3307         Test: http/tests/navigation/page-cache-xhr-in-pagehide.html
3308
3309         * xml/XMLHttpRequest.cpp:
3310         (WebCore::XMLHttpRequest::open):
3311         (WebCore::XMLHttpRequest::abort):
3312         (WebCore::XMLHttpRequest::abortError):
3313         (WebCore::XMLHttpRequest::didFail):
3314         * xml/XMLHttpRequest.h:
3315
3316 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
3317
3318         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
3319         https://bugs.webkit.org/show_bug.cgi?id=175557
3320
3321         Reviewed by Jon Lee.
3322
3323         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
3324
3325         * Configurations/FeatureDefines.xcconfig:
3326         * css/CSSValueKeywords.in:
3327         * css/MediaFeatureNames.h:
3328         * css/MediaQueryEvaluator.cpp:
3329         (WebCore::viewModeEvaluate): Deleted.
3330         * css/MediaQueryExpression.cpp:
3331         (WebCore::featureWithValidIdent):
3332         (WebCore::isFeatureValidWithoutValue):
3333         * page/Page.cpp:
3334         (WebCore::Page::stringToViewMode): Deleted.
3335         (WebCore::Page::setViewMode): Deleted.
3336         * page/Page.h:
3337         (WebCore::Page::viewMode const): Deleted.
3338
3339 2017-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
3340
3341         Parse font-display
3342         https://bugs.webkit.org/show_bug.cgi?id=175382
3343
3344         Reviewed by Simon Fraser.
3345
3346         The syntax is very simple: font-display: auto | block | swap | fallback | optional.
3347         So, parsing support is quite straightfoward.
3348
3349         Test: fast/text/font-display/parse.html
3350
3351         * css/CSSComputedStyleDeclaration.cpp:
3352         (WebCore::ComputedStyleExtractor::propertyValue):
3353         * css/CSSFontFace.cpp:
3354         (WebCore::CSSFontFace::setLoadingBehavior):
3355         * css/CSSFontFace.h:
3356         * css/CSSFontSelector.cpp:
3357         (WebCore::CSSFontSelector::addFontFaceRule):
3358         * css/CSSPrimitiveValueMappings.h:
3359         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3360         (WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
3361         * css/CSSProperties.json:
3362         * css/CSSProperty.cpp:
3363         (WebCore::CSSProperty::isDescriptorOnly):
3364         * css/CSSValueKeywords.in:
3365         * css/parser/CSSPropertyParser.cpp:
3366         (WebCore::consumeFontFaceFontDisplay):
3367         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3368         * rendering/style/RenderStyleConstants.h:
3369
3370 2017-08-14  Jer Noble  <jer.noble@apple.com>
3371
3372         Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
3373         https://bugs.webkit.org/show_bug.cgi?id=175547
3374
3375         Reviewed by Eric Carlson.
3376
3377         When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored
3378         proof-of-key-release data.
3379
3380         Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private
3381         Browsing mode, to match the behavior of WebKitMediaKeySession.
3382
3383         * html/HTMLMediaElement.cpp:
3384         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
3385         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3386         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3387         (WebCore::CDMSessionAVStreamSession::update):
3388         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3389
3390 2017-08-14  Andy Estes  <aestes@apple.com>
3391
3392         REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
3393         https://bugs.webkit.org/show_bug.cgi?id=175548
3394         <rdar://problem/33866206>
3395
3396         Reviewed by Brady Eidson.
3397
3398         New API test: QuickLook.ShouldCreateForMIMEType
3399
3400         * WebCore.xcodeproj/project.pbxproj:
3401         * loader/ios/PreviewLoader.h:
3402         * loader/ios/PreviewLoader.mm:
3403         (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
3404         calling HashSet::contains().
3405
3406 2017-08-14  Andy Estes  <aestes@apple.com>
3407
3408         [Apple Pay] Add support for phonetic contact names
3409         https://bugs.webkit.org/show_bug.cgi?id=175537
3410         <rdar://problem/32002644>
3411
3412         Reviewed by Tim Horton.
3413
3414         * Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
3415         * Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
3416         in ApplePayPaymentContact.
3417         * Modules/applepay/ApplePayPaymentContact.idl: Ditto.
3418         * Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
3419         ApplePayPaymentRequest::ContactField.
3420         * Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
3421         * Modules/applepay/ApplePaySession.cpp:
3422         (WebCore::convertAndValidate): Added a version parameter. Added code to convert
3423         ContactField::PhoneticName, throwing an exception if version is less than 3.
3424         * Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
3425         * Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
3426         and defined PhoneticName in PaymentError::ContactField.
3427         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3428         (WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
3429         PKContact's name if there are non-empty phonetic names and version is 3 or greater.
3430         (WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().
3431
3432 2017-08-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3433
3434         The none smooth stroke applied to an SVG shape breaks its hit testing
3435         https://bugs.webkit.org/show_bug.cgi?id=175506
3436
3437         Reviewed by Simon Fraser.
3438
3439         Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement().
3440         The m_path will be recalculated when RenderSVGShape::updateShapeFromElement()
3441         is called from RenderSVGRect::shapeDependentStrokeContains().
3442
3443         Test: svg/stroke/stroke-linejoin-click.html
3444
3445         * rendering/svg/RenderSVGRect.cpp:
3446         (WebCore::RenderSVGRect::updateShapeFromElement):
3447         * rendering/svg/RenderSVGShape.h:
3448         (WebCore::RenderSVGShape::clearPath):
3449
3450 2017-08-14  Adrian Perez de Castro  <aperez@igalia.com>
3451
3452         [WPE] Implement WebCore::standardUserAgent()
3453         https://bugs.webkit.org/show_bug.cgi?id=175507
3454
3455         Reviewed by Michael Catanzaro.
3456
3457         Remove "_GLIB" from user-agent version macros.
3458
3459         * platform/glib/UserAgentGLib.cpp:
3460         (WebCore::versionForUAString):
3461
3462 2017-08-14  Chris Dumez  <cdumez@apple.com>
3463
3464         Unreviewed, rollout r220622 & r220696
3465         https://bugs.webkit.org/show_bug.cgi?id=175482
3466         <rdar://problem/33860695>
3467
3468         Seems to have caused failures on iOS.
3469
3470         * CMakeLists.txt:
3471         * Modules/beacon/NavigatorBeacon.cpp:
3472         (WebCore::NavigatorBeacon::sendBeacon):
3473         * Modules/fetch/FetchBodyOwner.cpp:
3474         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3475         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3476         * Modules/fetch/FetchBodyOwner.h:
3477         * Modules/fetch/FetchLoader.cpp:
3478         (WebCore::FetchLoader::start):
3479         (WebCore::FetchLoader::didFail):
3480         * Modules/fetch/FetchLoaderClient.h:
3481         * Modules/fetch/FetchResponse.cpp:
3482         (WebCore::FetchResponse::BodyLoader::didFail):
3483         * Modules/fetch/FetchResponse.h:
3484         * WebCore.xcodeproj/project.pbxproj:
3485         * loader/DocumentThreadableLoader.cpp:
3486         (WebCore::DocumentThreadableLoader::loadRequest):
3487         * loader/cache/CachedRawResource.cpp:
3488         (WebCore::CachedRawResource::finishLoading):
3489         * loader/cache/CachedResource.cpp:
3490         (WebCore::CachedResource::load):
3491         * loader/cache/CachedResource.h:
3492         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3493         * loader/cache/CachedResourceLoader.cpp:
3494         (WebCore::createResource):
3495         (WebCore::CachedResourceLoader::requestImage):
3496         (WebCore::CachedResourceLoader::requestFont):
3497         (WebCore::CachedResourceLoader::requestTextTrack):
3498         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3499         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3500         (WebCore::CachedResourceLoader::requestScript):
3501         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3502         (WebCore::CachedResourceLoader::requestSVGDocument):
3503         (WebCore::CachedResourceLoader::requestLinkResource):
3504         (WebCore::CachedResourceLoader::requestMedia):
3505         (WebCore::CachedResourceLoader::requestIcon):
3506         (WebCore::CachedResourceLoader::requestRawResource):
3507         (WebCore::CachedResourceLoader::requestBeaconResource):
3508         (WebCore::CachedResourceLoader::requestMainResource):
3509         (WebCore::CachedResourceLoader::requestResource):
3510         (WebCore::CachedResourceLoader::preload):
3511         * loader/cache/CachedResourceLoader.h:
3512         * loader/cache/KeepaliveRequestTracker.cpp: Removed.
3513         * loader/cache/KeepaliveRequestTracker.h: Removed.
3514         * platform/network/FormData.cpp:
3515         (WebCore::FormData::appendFile):
3516         (WebCore::FormData::appendFileRange):
3517         (WebCore::FormData::appendBlob):
3518         (WebCore::FormData::expandDataStore):
3519         * platform/network/FormData.h:
3520
3521 2017-08-14  Daniel Bates  <dabates@apple.com>
3522
3523         [css-ui] Implement caret-color support
3524         https://bugs.webkit.org/show_bug.cgi?id=166572
3525         <rdar://problem/33852589>
3526
3527         Reviewed by David Hyatt.
3528
3529         Add support for the CSS property caret-color as per <https://www.w3.org/TR/css-ui-3/#caret-color> (02 March 2017).
3530         The property caret-color specifies the color of the text insertion caret in an editable element,
3531         say an HTML textarea element.
3532
3533         Unlike other CSS color properties caret-color can have value "auto" and this is its initial
3534         value. Internally we treat value "auto" as an invalid caret color to simplify the code.
3535
3536         Tests: editing/pasteboard/preserve-caret-color.html
3537                fast/css/caret-color-auto.html
3538                fast/css/caret-color-fallback-to-color.html
3539                fast/css/caret-color-inherit.html
3540                fast/css/caret-color-span-inside-editable-parent.html
3541                fast/css/caret-color.html
3542                fast/history/visited-link-caret-color.html
3543
3544         * css/CSSComputedStyleDeclaration.cpp:
3545         (WebCore::ComputedStyleExtractor::propertyValue):
3546         * css/CSSProperties.json: Add property caret-color. We represent the initial  "auto" Also, fix up
3547         wording in a comment while I am here.
3548         * css/StyleResolver.cpp:
3549         (WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be
3550         applied to visited hyperlinks.
3551         * css/parser/CSSParserFastPaths.cpp:
3552         (WebCore::parseCaretColor): Added.
3553         (WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color
3554         can be defined to be "auto". We explicitly check if the property is caret-color and use
3555         parseCaretColor() to parse its value.
3556         * css/parser/CSSPropertyParser.cpp:
3557         (WebCore::consumeCaretColor): Added.
3558         (WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue()
3559         use a dedicated code path to parse caret-color.
3560         * editing/EditingStyle.cpp: Preserve caret-color during editing operations.
3561         * editing/FrameSelection.cpp:
3562         (WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of
3563         color for the color of the text insertion caret. Always honor the caret-color of the editable
3564         element if it is valid color. Note that "caret-color: auto" is treated as an invalid color
3565         internally. A caret-color can have an invalid color if its inherits from the CSS color property
3566         with an invalid color. If caret-color is a valid color then we take it to be the color of the
3567         text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the
3568         color of the text-insertion caret.
3569         (WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret().
3570         * page/animation/CSSPropertyAnimation.cpp:
3571         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper
3572         to support animating caret-color.
3573         * rendering/style/RenderStyle.cpp:
3574         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider
3575         changes to caret color.
3576         (WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate
3577         color for property caret-color with respect to an unvisited or visited link.
3578         * rendering/style/RenderStyle.h:
3579         (WebCore::RenderStyle::setCaretColor): Added.
3580         (WebCore::RenderStyle::setVisitedLinkCaretColor): Added.
3581         (WebCore::RenderStyle::caretColor const): Added.
3582         (WebCore::RenderStyle::visitedLinkCaretColor const): Added.
3583         * rendering/style/StyleRareInheritedData.cpp:
3584         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color.
3585         (WebCore::StyleRareInheritedData::operator== const): Ditto.
3586         * rendering/style/StyleRareInheritedData.h:
3587
3588 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
3589
3590         REGRESSION(r220517-r220521) [GTK] Various compositing tests fail
3591         https://bugs.webkit.org/show_bug.cgi?id=175478
3592
3593         Reviewed by Sergio Villar Senin.
3594
3595         Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL
3596         away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer
3597         binding state that's kept in the GraphicsContext3D class. This mismatch in how the
3598         framebuffer was bound was causing a couple of test failures in compositing tests.
3599
3600         No new tests -- regressed tests have their failure expectations removed.
3601
3602         * platform/graphics/texmap/TextureMapperGL.cpp:
3603         (WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the
3604         glBindFramebuffer() call. This would be done in subsequent patches that would move
3605         TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes
3606         with the framebuffer binding that's done in BitmapTextureGL and was causing test
3607         failures.
3608
3609 2017-08-14  Chris Dumez  <cdumez@apple.com>
3610
3611         Unreviewed fix after r220622 to address crashes on iOS.
3612
3613         * loader/cache/CachedRawResource.cpp:
3614         (WebCore::CachedRawResource::finishLoading):
3615
3616 2017-08-14  Antti Koivisto  <antti@apple.com>
3617
3618         Factor text autosizing into a class
3619         https://bugs.webkit.org/show_bug.cgi?id=175530
3620
3621         Reviewed by Andreas Kling.
3622
3623         Move the remaining parts out of Document.
3624
3625         * css/StyleBuilderCustom.h:
3626         (WebCore::computeLineHeightMultiplierDueToFontSize):
3627         * dom/Document.cpp:
3628         (WebCore::Document::destroyRenderTree):
3629         (WebCore::Document::textAutoSizing):
3630         (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
3631         (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
3632         (WebCore::Document::addAutoSizedNode): Deleted.
3633         (WebCore::Document::updateAutoSizedNodes): Deleted.
3634         (WebCore::Document::clearAutoSizedNodes): Deleted.
3635         * dom/Document.h:
3636         * rendering/RenderBlockFlow.cpp:
3637         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3638         * rendering/RenderElement.cpp:
3639         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
3640         (WebCore::RenderElement::resetTextAutosizing):
3641         * rendering/TextAutoSizing.cpp:
3642         (WebCore::TextAutoSizingTraits::constructDeletedValue):
3643         (WebCore::TextAutoSizingTraits::isDeletedValue):
3644         (WebCore::TextAutoSizing::addTextNode):
3645         (WebCore::TextAutoSizing::updateRenderTree):
3646         (WebCore::TextAutoSizing::reset):
3647         * rendering/TextAutoSizing.h:
3648
3649 2017-08-14  Antti Koivisto  <antti@apple.com>
3650
3651         [Render Tree Mutation] First letter should not mutate the render tree while in layout.
3652         https://bugs.webkit.org/show_bug.cgi?id=163848
3653
3654         Reviewed by Zalan Bujtas.
3655
3656         RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
3657         be invoked by the RenderTreeUpdater.
3658
3659         With this future patches can move updateFirstLetter() and the related functions
3660         completely out of the render tree.
3661
3662         * rendering/RenderBlock.cpp:
3663         (WebCore::RenderBlock::layout):
3664
3665             No more updateFirstLetter calls during layout...
3666
3667         (WebCore::RenderBlock::computePreferredLogicalWidths):
3668
3669             ...or preferred width computation.
3670
3671         (WebCore::RenderBlock::updateFirstLetter):
3672         * rendering/RenderBlock.h:
3673         * rendering/RenderRubyRun.cpp:
3674         (WebCore::RenderRubyRun::updateFirstLetter):
3675         * rendering/RenderRubyRun.h:
3676         * rendering/RenderTable.cpp:
3677         (WebCore::RenderTable::updateFirstLetter):
3678         * rendering/RenderTable.h:
3679         * rendering/svg/RenderSVGText.cpp:
3680         (WebCore::RenderSVGText::updateFirstLetter):
3681         * rendering/svg/RenderSVGText.h:
3682         * style/RenderTreeUpdater.cpp:
3683         (WebCore::RenderTreeUpdater::popParent):
3684
3685             Call updateFirstLetter when closing the element. All of of descedant renderers are known here
3686             so this can be resolved correctly.
3687
3688 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
3689
3690         Composition underline color is always black
3691         https://bugs.webkit.org/show_bug.cgi?id=174675
3692
3693         Reviewed by Ryosuke Niwa.
3694
3695         This patch uses the current color of the text instead of black
3696         for the composition underline marker.
3697         This makes it visible in the case we have a black/dark background.
3698
3699         Test: editing/composition-underline-color.html
3700
3701         * editing/CompositionUnderline.h:
3702         (WebCore::CompositionUnderline::CompositionUnderline):
3703         Added new attribute compositionUnderlineColor.
3704         * rendering/InlineTextBox.cpp:
3705         (WebCore::InlineTextBox::paintCompositionUnderline):
3706         Use the text color if compositionUnderlineColor is TextColor.
3707
3708 2017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3709
3710         [GTK] stop kinetic scrolling when a zero movement is reached
3711         https://bugs.webkit.org/show_bug.cgi?id=175468
3712
3713         Reviewed by Michael Catanzaro.
3714
3715         This is GTK+ change by Christian Hergert.
3716         https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6
3717
3718         When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
3719         followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
3720         feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.
3721
3722         * platform/ScrollAnimationKinetic.cpp:
3723         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
3724
3725 2017-08-13  Chris Dumez  <cdumez@apple.com>
3726
3727         Drop non-const getter for CachedResource::resourceRequest()
3728         https://bugs.webkit.org/show_bug.cgi?id=175524
3729
3730         Reviewed by Youenn Fablet.
3731
3732         Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource
3733         after it has been cached. Exposing such a getter is therefore a footgun.
3734
3735         * loader/LinkLoader.cpp:
3736         (WebCore::LinkLoader::preloadIfNeeded):
3737         * loader/cache/CachedImage.cpp:
3738         (WebCore::CachedImage::CachedImage):
3739         * loader/cache/CachedImage.h:
3740         * loader/cache/CachedResource.cpp:
3741         (WebCore::CachedResource::CachedResource):
3742         * loader/cache/CachedResource.h:
3743         (WebCore::CachedResource::resourceRequest const):
3744         (WebCore::CachedResource::ignoreForRequestCount const):
3745         (WebCore::CachedResource::setIgnoreForRequestCount):
3746         * loader/cache/CachedResourceLoader.cpp:
3747         (WebCore::CachedResourceLoader::requestResource):
3748         * loader/cache/CachedResourceRequest.h:
3749         (WebCore::CachedResourceRequest::ignoreForRequestCount const):
3750         (WebCore::CachedResourceRequest::setIgnoreForRequestCount):
3751         * loader/cache/MemoryCache.cpp:
3752         (WebCore::MemoryCache::addImageToCache):
3753         * platform/network/ResourceRequestBase.h:
3754
3755 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
3756
3757         [WPE] Implement WebCore::standardUserAgent()
3758         https://bugs.webkit.org/show_bug.cgi?id=175507
3759
3760         Reviewed by Carlos Alberto Lopez Perez.
3761
3762         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
3763
3764         * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
3765         * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
3766         * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
3767         (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".
3768
3769 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
3770
3771         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
3772         https://bugs.webkit.org/show_bug.cgi?id=175474
3773         <rdar://problem/33844628>
3774
3775         Reviewed by Wenson Hsieh.
3776
3777         Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList
3778         and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items,
3779         and its lifetime is tied to DataTransfer by forwarding ref and deref.
3780
3781         See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
3782
3783         Tests: editing/pasteboard/datatransfer-idl.html
3784
3785         * CMakeLists.txt:
3786         * Configurations/FeatureDefines.xcconfig:
3787         * WebCore.xcodeproj/project.pbxproj:
3788         * dom/DataTransfer.cpp:
3789         (WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily
3790         * dom/DataTransfer.h:
3791         * dom/DataTransfer.idl:
3792         * dom/DataTransferItem.cpp:
3793         (WebCore::DataTransferItem::DataTransferItem): Added a stub implementation.
3794         (WebCore::DataTransferItem::~DataTransferItem): Ditto.
3795         (WebCore::DataTransferItem::getAsString const): Ditto.
3796         (WebCore::DataTransferItem::getAsFile const): Ditto.
3797         * dom/DataTransferItem.h:
3798         (WebCore::DataTransferItemList): Devirtualized functions.
3799         (WebCore::DataTransferItemList::kind const):
3800         (WebCore::DataTransferItemList::type const):
3801         * dom/DataTransferItem.idl:
3802         * dom/DataTransferItemList.cpp: Added.
3803         (WebCore::DataTransferItemList::length const): Added a stub implementation.
3804         (WebCore::DataTransferItemList::item): Ditto.
3805         (WebCore::DataTransferItemList::add): Ditto.
3806         (WebCore::DataTransferItemList::remove): Ditto.
3807         (WebCore::DataTransferItemList::clear): Ditto.
3808         * dom/DataTransferItemList.h:
3809         (WebCore::DataTransferItemList::DataTransferItemList):
3810         (WebCore::DataTransferItemList::~DataTransferItemList): Deleted.
3811         (WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref.
3812         (WebCore::DataTransferItemList::deref): Ditto.
3813         * dom/DataTransferItemList.idl: Updated to match the latest specification.
3814         * page/RuntimeEnabledFeatures.h:
3815         (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added.
3816         (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added.
3817
3818 2017-08-11  Brady Eidson  <beidson@apple.com>
3819
3820         Move files inside WebCore/workers to WebCore/workers/service.
3821         https://bugs.webkit.org/show_bug.cgi?id=175495
3822
3823         Rubberstamped by Tim Horton.
3824
3825         * CMakeLists.txt:
3826         * DerivedSources.make:
3827         * WebCore.xcodeproj/project.pbxproj:
3828
3829         * workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp.
3830         * workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h.
3831         * workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl.
3832         * workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp.
3833         * workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h.
3834         * workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl.
3835         * workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp.
3836         * workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h.
3837         * workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl.
3838         * workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp.
3839         * workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h.
3840         * workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h.
3841         * workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp.
3842         * workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h.
3843         * workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp.
3844         * workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h.
3845         * workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl.
3846         * workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h.
3847         * workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp.
3848         * workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h.
3849         * workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h.
3850         * workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl.
3851
3852 2017-08-11  Chris Dumez  <cdumez@apple.com>
3853
3854         Implement quota limitation for keepalive Fetch requests
3855         https://bugs.webkit.org/show_bug.cgi?id=175482
3856
3857         Reviewed by Sam Weinig and Youenn Fablet.
3858
3859         Implement quota limitation for keepalive Fetch requests as per:
3860         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
3861
3862         This partly works for Beacon as well, meaning that no Beacon with a body
3863         over 64Kb can be sent. However, we don't keep track about wether or not
3864         beacon loads are inflight or not.
3865
3866         Also update CachedResourceLoader::requestResource() so that the caller
3867         can get a ResourceError when it returns null. This is useful for both
3868         Fetch and Beacon to return better error messages.
3869
3870         Test: http/wpt/beacon/beacon-quota.html
3871
3872         * CMakeLists.txt:
3873         * Modules/beacon/NavigatorBeacon.cpp:
3874         (WebCore::NavigatorBeacon::sendBeacon):
3875         * Modules/fetch/FetchBodyOwner.cpp:
3876         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
3877         (WebCore::FetchBodyOwner::BlobLoader::didFail):
3878         * Modules/fetch/FetchBodyOwner.h:
3879         * Modules/fetch/FetchLoader.cpp:
3880         (WebCore::FetchLoader::start):
3881         (WebCore::FetchLoader::didFail):
3882         * Modules/fetch/FetchLoaderClient.h:
3883         * Modules/fetch/FetchResponse.cpp:
3884         (WebCore::FetchResponse::BodyLoader::didFail):
3885         * Modules/fetch/FetchResponse.h:
3886         * WebCore.xcodeproj/project.pbxproj:
3887         * loader/DocumentThreadableLoader.cpp:
3888         (WebCore::DocumentThreadableLoader::loadRequest):
3889         * loader/cache/CachedResource.cpp:
3890         (WebCore::CachedResource::load):
3891         * loader/cache/CachedResource.h:
3892         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
3893         * loader/cache/CachedResourceLoader.cpp:
3894         (WebCore::createResource):
3895         (WebCore::CachedResourceLoader::requestImage):
3896         (WebCore::CachedResourceLoader::requestFont):
3897         (WebCore::CachedResourceLoader::requestTextTrack):
3898         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
3899         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3900         (WebCore::CachedResourceLoader::requestScript):
3901         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
3902         (WebCore::CachedResourceLoader::requestSVGDocument):
3903         (WebCore::CachedResourceLoader::requestLinkResource):
3904         (WebCore::CachedResourceLoader::requestMedia):
3905         (WebCore::CachedResourceLoader::requestIcon):
3906         (WebCore::CachedResourceLoader::requestRawResource):
3907         (WebCore::CachedResourceLoader::requestBeaconResource):
3908         (WebCore::CachedResourceLoader::requestMainResource):
3909         (WebCore::CachedResourceLoader::requestResource):
3910         (WebCore::CachedResourceLoader::preload):
3911         * loader/cache/CachedResourceLoader.h:
3912         * loader/cache/KeepaliveRequestTracker.cpp: Added.
3913         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
3914         (WebCore::KeepaliveRequestTracker::canLoadRequest):
3915         (WebCore::KeepaliveRequestTracker::registerRequest):
3916         (WebCore::KeepaliveRequestTracker::responseReceived):
3917         (WebCore::KeepaliveRequestTracker::notifyFinished):
3918         (WebCore::KeepaliveRequestTracker::unregisterRequest):
3919         * loader/cache/KeepaliveRequestTracker.h: Added.
3920         * platform/network/FormData.cpp:
3921         (WebCore::FormDataElement::lengthInBytes const):
3922         (WebCore::FormData::lengthInBytes const):
3923         * platform/network/FormData.h:
3924
3925 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
3926
3927         [WTF] Move ValueToString into WTF
3928         https://bugs.webkit.org/show_bug.cgi?id=175469
3929
3930         Reviewed by Sam Weinig.
3931
3932         No new tests. No change in behavior.
3933
3934         * WebCore.xcodeproj/project.pbxproj:
3935         * html/HTMLMediaElement.h:
3936         (WTF::ValueToString<WebCore::TextTrackCue::string):
3937         (WebCore::ValueToString<TextTrackCue::string): Deleted.
3938         (WebCore::ValueToString<MediaTime>::string): Deleted.
3939         * platform/LayoutUnit.h:
3940         (WTF::ValueToString<WebCore::LayoutUnit>::string):
3941         (WebCore::ValueToString<LayoutUnit>::string): Deleted.
3942         * platform/PODInterval.h:
3943         * platform/PODIntervalTree.h:
3944         * platform/PODRedBlackTree.h:
3945         * platform/graphics/FloatPolygon.h:
3946         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
3947         (WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
3948         * rendering/FloatingObjects.h:
3949         (WTF::ValueToString<WebCore::FloatingObject::string):
3950         (WebCore::ValueToString<FloatingObject::string): Deleted.
3951         * rendering/RenderFlowThread.h:
3952         (WTF::ValueToString<WebCore::RenderRegion::string):
3953         (WebCore::ValueToString<RenderRegion::string): Deleted.
3954
3955 2017-08-11  Sam Weinig  <sam@webkit.org>
3956
3957         [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
3958         https://bugs.webkit.org/show_bug.cgi?id=175394
3959
3960         Reviewed by Chris Dumez.
3961
3962         * bindings/IDLTypes.h:
3963         (WebCore::IDLWrapper::convertToParameterType): Deleted.
3964
3965             Remove no longer used convertToParameterType.
3966
3967         * bindings/js/DOMPromiseProxy.h:
3968
3969             - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
3970             - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
3971               IDLType::ImplementationType, now that WTF::Function supports references as the 
3972               return type. This is needed, since the IDLType::ParameterType for an interface T
3973               is T&.
3974
3975         * css/FontFace.cpp:
3976         * css/FontFace.h:
3977         * css/FontFaceSet.cpp:
3978         * css/FontFaceSet.h:
3979
3980             Update resolve callbacks to return a reference rather than a RefPtr, matching
3981             the new signature requirement.