[CMake] Remove WebCoreDerivedSources library target
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         [CMake] Remove WebCoreDerivedSources library target
4         https://bugs.webkit.org/show_bug.cgi?id=181664
5
6         Reviewed by Carlos Garcia Campos.
7
8         After unified source build has been introduced, CMake Visual
9         Studio build suffers complicated unnecessary recompilation issues
10         because Visual Studio invokes scripts twice in both WebCore and
11         WebCoreDerivedSources projects (Bug 181117).
12
13         WebCoreDerivedSources library has been introduced in r198766 to
14         avoid command line length limit of CMake Ninja build on macOS.
15         Fortunately, unified source build has reduced the number of source
16         files to compile, WebCore doesn't need to be split anymore.
17
18         No new tests (No behavior change)
19
20         * CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
21         Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
22         * PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
23         * PlatformWin.cmake: Ditto.
24
25 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
26
27         Can't scroll iframe after toggling it to display:none and back
28         https://bugs.webkit.org/show_bug.cgi?id=181708
29         rdar://problem/13234778
30
31         Reviewed by Tim Horton.
32
33         Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
34         Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
35         the FrameView's scrollable area set as dirty.
36
37         Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
38
39         * page/FrameView.cpp:
40         (WebCore::FrameView::addChild):
41         * page/FrameView.h:
42         * platform/ScrollView.h:
43
44 2018-01-16  Chris Dumez  <cdumez@apple.com>
45
46         SWServerWorker::m_contextConnectionIdentifier may get out of date
47         https://bugs.webkit.org/show_bug.cgi?id=181687
48         <rdar://problem/36548111>
49
50         Reviewed by Brady Eidson.
51
52         SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
53         context process crashes and is relaunched.
54
55         No new tests, added assertion in terminateWorkerInternal() that hits without this fix.
56
57         * workers/service/server/SWServer.cpp:
58         (WebCore::SWServer::runServiceWorker):
59         (WebCore::SWServer::terminateWorkerInternal):
60         (WebCore::SWServer::unregisterServiceWorkerClient):
61         * workers/service/server/SWServerWorker.h:
62         (WebCore::SWServerWorker::setContextConnectionIdentifier):
63
64 2018-01-16  Jer Noble  <jer.noble@apple.com>
65
66         Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
67         https://bugs.webkit.org/show_bug.cgi?id=181707
68         <rdar://problem/34809474>
69
70         Reviewed by Eric Carlson.
71
72         Test: media/media-source/media-source-remove-unload-crash.html
73
74         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
75         (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
76
77 2018-01-12  Jiewen Tan  <jiewen_tan@apple.com>
78
79         [WebAuthN] Implement dummy WebAuthN IDLs
80         https://bugs.webkit.org/show_bug.cgi?id=181627
81         <rdar://problem/36459864>
82
83         Reviewed by Alex Christensen.
84
85         This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
86         All implementations in this patch are subject to change when real implementations land. The
87         purpose here on the other hand is to have IDLs, bindings and implementations connected. This
88         patch should handle all IDLs that we need.
89
90         No tests.
91
92         * CMakeLists.txt:
93         * DerivedSources.make:
94         * Modules/credentialmanagement/CredentialCreationOptions.h:
95         * Modules/credentialmanagement/CredentialCreationOptions.idl:
96         * Modules/credentialmanagement/CredentialRequestOptions.h:
97         * Modules/credentialmanagement/CredentialRequestOptions.idl:
98         * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
99         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
100         (WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
101         (WebCore::AuthenticatorAssertionResponse::authenticatorData):
102         (WebCore::AuthenticatorAssertionResponse::signature):
103         (WebCore::AuthenticatorAssertionResponse::userHandle):
104         * Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
105         * Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
106         * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
107         (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
108         (WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
109         (WebCore::AuthenticatorAttestationResponse::attestationObject):
110         * Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
111         * Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
112         * Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
113         (WebCore::AuthenticatorResponse::AuthenticatorResponse):
114         (WebCore::AuthenticatorResponse::~AuthenticatorResponse):
115         (WebCore::AuthenticatorResponse::clientDataJSON):
116         * Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
117         * Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
118         * Modules/webauthn/PublicKeyCredential.cpp:
119         (WebCore::PublicKeyCredential::rawId):
120         (WebCore::PublicKeyCredential::response):
121         (WebCore::PublicKeyCredential::getClientExtensionResults):
122         (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
123         * Modules/webauthn/PublicKeyCredential.h:
124         * Modules/webauthn/PublicKeyCredential.idl:
125         * Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
126         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
127         * Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
128         * Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
129         * Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
130         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
131         * Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
132         * Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
133         * Sources.txt:
134         * WebCore.xcodeproj/project.pbxproj:
135         * bindings/js/WebCoreBuiltinNames.h:
136
137 2018-01-16  Zalan Bujtas  <zalan@apple.com>
138
139         AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
140         https://bugs.webkit.org/show_bug.cgi?id=181703
141         <rdar://problem/36365706>
142
143         Reviewed by Ryosuke Niwa.
144
145         Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
146
147         Unable to create test with WebInspector involved. 
148
149         * accessibility/AccessibilityObject.cpp:
150         (WebCore::AccessibilityObject::updateBackingStore):
151         * dom/Document.cpp:
152         (WebCore::Document::isSafeToUpdateStyleOrLayout const):
153         (WebCore::Document::updateStyleIfNeeded):
154         (WebCore::Document::updateLayout):
155         (WebCore::isSafeToUpdateStyleOrLayout): Deleted.
156         * dom/Document.h:
157
158 2018-01-16  Ryan Haddad  <ryanhaddad@apple.com>
159
160         Unreviewed, rolling out r226962.
161
162         The LayoutTest added with this change is a flaky timeout.
163
164         Reverted changeset:
165
166         "Support for preconnect Link headers"
167         https://bugs.webkit.org/show_bug.cgi?id=181657
168         https://trac.webkit.org/changeset/226962
169
170 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
171
172         Text looks bad on some CSS spec pages
173         https://bugs.webkit.org/show_bug.cgi?id=181700
174         rdar://problem/36552107
175
176         Reviewed by Tim Horton.
177
178         When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
179         setting, so tile caches could end up with a mixture of layers that do and do not support
180         antialiased layer text.
181
182         No tests because the tiled drawing tests don't dump out tiles inside of tile caches.
183
184         * platform/graphics/ca/TileController.cpp:
185         (WebCore::TileController::createTileLayer):
186
187 2018-01-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
188
189         REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
190         https://bugs.webkit.org/show_bug.cgi?id=179986
191
192         Reviewed by Simon Fraser.
193
194         This patch reverts all or parts of the following changes-sets
195             <http://trac.webkit.org/changeset/221292>
196             <http://trac.webkit.org/changeset/197967>
197             <http://trac.webkit.org/changeset/196670>
198
199         A JS statement like this:
200             var item = text.x.animVal.getItem(0);
201
202         Creates the following C++ objects:
203             SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
204             SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
205             SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'
206
207         If 'item' changes, the attribute 'x' of the element '<text>' will change
208         as well. But this binding works only in one direction. If the attribute
209         'x' of the element '<text>' changes, e.g.:
210
211             text.setAttribute('x', '10,20,30');
212
213         This will detach 'item' from the element <text> and any further changes 
214         in 'item' won't affect the attribute 'x' of element <text>.
215
216         The one direction binding can only work if this chain of tear-off objects
217         is kept connected. This is implemented by RefCounted back pointers from
218         SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.
219
220         The security crashes and the memory leaks are happening because of the
221         raw forward pointers:
222             -- SVGAnimatedListPropertyTearOff maintains raw pointers of type
223                SVGListPropertyTearOff for m_baseVal and m_animVal
224             -- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
225                are vectors of raw pointer Vector<SVGLength*>
226
227         To control the life cycle of the raw pointers, SVGListPropertyTearOff and
228         SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
229         to notify it they are going to be deleted. In propertyWillBeDeleted(), we
230         clear the pointers so they are not used after being freed. This mechanism
231         has been error-prone and we've never got it 100% right.
232
233         The solution we need to adopt with SVG tear-off objects is the following:
234             -- All the forward pointers should be weak pointers.
235             -- All the back pointers should be ref pointers.
236
237         This solution may not look intuitive but it solves the bugs and keeps the
238         one direction binding. The forward weak pointers allows the tear-off
239         objects to go aways if no reference from JS exists. The back ref pointers
240         maintains the chain of objects and guarantees the correct binding.
241
242         * svg/SVGPathSegList.h:
243         * svg/SVGTransformList.h:
244         * svg/properties/SVGAnimatedListPropertyTearOff.h:
245         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
246         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
247         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
248         * svg/properties/SVGAnimatedProperty.h:
249         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
250         (WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
251         * svg/properties/SVGAnimatedPropertyTearOff.h:
252         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
253         * svg/properties/SVGListProperty.h:
254         (WebCore::SVGListProperty::initializeValuesAndWrappers):
255         (WebCore::SVGListProperty::getItemValuesAndWrappers):
256         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
257         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
258         (WebCore::SVGListProperty::removeItemValuesAndWrappers):
259         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
260         (WebCore::SVGListProperty::createWeakPtr const):
261         * svg/properties/SVGListPropertyTearOff.h:
262         (WebCore::SVGListPropertyTearOff::removeItemFromList):
263         (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
264         * svg/properties/SVGPropertyTearOff.h:
265         (WebCore::SVGPropertyTearOff::createWeakPtr const):
266         (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
267
268 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
269
270         AVSampleBufferDisplayLayer should be flushed when application activates
271         https://bugs.webkit.org/show_bug.cgi?id=181623
272         <rdar://problem/36487738>
273
274         Reviewed by Darin Adler.
275
276         No new tests, I wasn't able to reproduce it in a test.
277
278         * WebCore.xcodeproj/project.pbxproj:
279         * dom/Document.cpp:
280         (WebCore::Document::addApplicationStateChangeListener): New.
281         (WebCore::Document::removeApplicationStateChangeListener): Ditto.
282         (WebCore::Document::forEachApplicationStateChangeListener): Ditto.
283         * dom/Document.h:
284
285         * html/HTMLMediaElement.cpp:
286         (WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
287         (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
288         (WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
289         (WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
290         * html/HTMLMediaElement.h:
291
292         * page/ApplicationStateChangeListener.h: Added.
293         (WebCore::ApplicationStateChangeListener::applicationWillResignActive):
294         (WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
295         * page/Page.cpp:
296         (WebCore::Page::forEachDocument):
297         (WebCore::Page::applicationWillResignActive):
298         (WebCore::Page::applicationDidEnterBackground):
299         (WebCore::Page::applicationWillEnterForeground):
300         (WebCore::Page::applicationDidBecomeActive):
301         * page/Page.h:
302         * platform/graphics/MediaPlayer.cpp:
303         (WebCore::MediaPlayer::applicationWillResignActive):
304         (WebCore::MediaPlayer::applicationDidBecomeActive):
305         * platform/graphics/MediaPlayer.h:
306         * platform/graphics/MediaPlayerPrivate.h:
307         (WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
308         (WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):
309
310         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
311         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
312         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
313         to release logging.
314         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
315         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
316         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
317         the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
318         buffer has the correct timestamp.
319         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
320         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
321         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
322         layer is in the "failed" state, flush the renderer and update the display mode.
323         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
324         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
325         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
326         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
327         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
328         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
329         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
330         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
331         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
332         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
333         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
334         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.
335
336 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
337
338         PAL should link to JavaScriptCore rather than WTF
339         https://bugs.webkit.org/show_bug.cgi?id=181683
340
341         Reviewed by Konstantin Tokarev.
342
343         Do not link directly to JavaScriptCore. Get it via PAL.
344
345         * CMakeLists.txt:
346
347 2018-01-16  Zach Li  <zachli@apple.com>
348
349         Add pop-up policy support in website policies.
350         https://bugs.webkit.org/show_bug.cgi?id=181544.
351         rdar://problem/30521400.
352
353         Reviewed by Alex Christensen.
354
355         * loader/DocumentLoader.h:
356         Introduce pop-up policy getter and setter. Initialize
357         the policy as Default.
358         (WebCore::DocumentLoader::popUpPolicy const):
359         (WebCore::DocumentLoader::setPopUpPolicy):
360         * page/DOMWindow.cpp:
361         (WebCore::DOMWindow::allowPopUp):
362         Pop-up policy specified on a per-page basis holds
363         precedence over the global policy. If no pop-up policy
364         is specified during navigation, global policy is used.
365
366 2018-01-16  Jer Noble  <jer.noble@apple.com>
367
368         Crash playing audio-only HLS stream via hls.js (MSE)
369         https://bugs.webkit.org/show_bug.cgi?id=181691
370         <rdar://problem/32967295>
371
372         Reviewed by Eric Carlson.
373
374         Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
375
376         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
377         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
378         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
379         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
380
381 2018-01-16  Simon Fraser  <simon.fraser@apple.com>
382
383         Rename applyHorizontalScale/applyVerticalScale in SVG filters, and related cleanup
384         https://bugs.webkit.org/show_bug.cgi?id=181684
385
386         Reviewed by Alex Christensen.
387
388         Rename the confusing applyHorizontalScale/applyVerticalScale to scaledByFilterResolution(),
389         and have it take and return a FloatSize. Change callers to do math in terms of FloatSizes.
390
391         Add inflate(size) to each of the rect classes.
392
393         * platform/graphics/FloatRect.h:
394         (WebCore::FloatRect::inflate):
395         * platform/graphics/IntRect.h:
396         (WebCore::IntRect::inflate):
397         * platform/graphics/LayoutRect.h:
398         (WebCore::LayoutRect::inflate):
399         * platform/graphics/filters/FEDisplacementMap.cpp:
400         (WebCore::FEDisplacementMap::platformApplySoftware):
401         * platform/graphics/filters/FEDropShadow.cpp:
402         (WebCore::FEDropShadow::determineAbsolutePaintRect):
403         (WebCore::FEDropShadow::platformApplySoftware):
404         * platform/graphics/filters/FEGaussianBlur.cpp:
405         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
406         (WebCore::FEGaussianBlur::calculateKernelSize):
407         (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
408         (WebCore::FEGaussianBlur::platformApplySoftware):
409         * platform/graphics/filters/FEGaussianBlur.h:
410         * platform/graphics/filters/FEMorphology.cpp:
411         (WebCore::FEMorphology::determineAbsolutePaintRect):
412         (WebCore::FEMorphology::platformApplySoftware):
413         * platform/graphics/filters/FEOffset.cpp:
414         (WebCore::FEOffset::determineAbsolutePaintRect):
415         (WebCore::FEOffset::platformApplySoftware):
416         * platform/graphics/filters/Filter.h:
417         (WebCore::Filter::setSourceImage):
418         (WebCore::Filter::scaledByFilterResolution const):
419         (WebCore::Filter::applyHorizontalScale const): Deleted.
420         (WebCore::Filter::applyVerticalScale const): Deleted.
421         * platform/graphics/filters/FilterOperations.cpp:
422         (WebCore::outsetSizeForBlur):
423         * rendering/FilterEffectRenderer.h:
424         * svg/graphics/filters/SVGFilter.cpp:
425         (WebCore::SVGFilter::scaledByFilterResolution const):
426         (WebCore::SVGFilter::applyHorizontalScale const): Deleted.
427         (WebCore::SVGFilter::applyVerticalScale const): Deleted.
428         * svg/graphics/filters/SVGFilter.h:
429
430 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
431
432         [CMake][Mac] Fix the build errors
433         https://bugs.webkit.org/show_bug.cgi?id=181665
434
435         Reviewed by Alex Christensen.
436
437         No new tests (No behavior change)
438
439         * CMakeLists.txt: Added Modules/paymentrequest/MerchantValidationEvent.idl to compile.
440         * PlatformMac.cmake: Added Modules/paymentrequest/MerchantValidationEvent.cpp to compile.
441         Added workers/service/context and Modules/applicationmanifest as forwarding header paths.
442
443 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
444
445         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
446         https://bugs.webkit.org/show_bug.cgi?id=181638
447         <rdar://problem/36508702>
448
449         Reviewed by Dan Bernstein.
450
451         Adjust the `didInsertAttachment` codepath to additionally propagate the attachment element's `src`.
452         Additionally, fix an issue with insertion and removal client notifications wherein the client can receive
453         insertion calls without corresponding removal calls, or vice versa. This is an existing issue, but matters more
454         now because we actually need to access the attachment element for its `src` when propagating changes to the
455         client. See below for details.
456
457         Test: WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup
458
459         * dom/Document.h:
460         (WebCore::Document::attachmentElementsByIdentifier const):
461         * editing/Editor.cpp:
462         (WebCore::Editor::notifyClientOfAttachmentUpdates):
463         * page/EditorClient.h:
464         (WebCore::EditorClient::didInsertAttachment):
465         * page/Frame.cpp:
466         (WebCore::Frame::setDocument):
467
468         When a Frame's document changes, inform the client that the attachments in the previous document are going away.
469         For each attachment currently connected to the document, we have either (1) already informed the client that it
470         was inserted, or (2) the attachment is pending an insertion call to the client. If (1) is the case, then we'll
471         tell the client that the attachment is removed, which will balance out the earlier insertion call. If (2) is the
472         case, then we'll remove the previously inserted attachment identifier from the set of attachment identifiers
473         pending insertion, and the client won't be informed of insertions or removals.
474
475 2018-01-16  Antoine Quint  <graouts@apple.com>
476
477         Use traits for animation timing functions
478         https://bugs.webkit.org/show_bug.cgi?id=181651
479
480         Reviewed by Dean Jackson.
481
482         Cleaning up Dean's previous patch as suggested by Darin's post-commit review comments. The
483         downcast function can match const automatically and it's a better style to put the * inside
484         the downcast call rather than outside.
485
486         * css/CSSComputedStyleDeclaration.cpp:
487         (WebCore::createTimingFunctionValue):
488         * platform/animation/TimingFunction.cpp:
489         (WebCore::operator<<):
490         (WebCore::TimingFunction::transformTime const):
491         * platform/animation/TimingFunction.h:
492         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
493         (WebCore::toCAMediaTimingFunction):
494
495 2018-01-16  Philippe Normand  <pnormand@igalia.com>
496
497         [GStreamer] Live streaming cleanups
498         https://bugs.webkit.org/show_bug.cgi?id=181672
499
500         Reviewed by Michael Catanzaro.
501
502         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
503         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Switch to
504         streaming code path when no content-length was reported by the
505         http source element.
506         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): Return early when streaming.
507         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
508         (CachedResourceStreamingClient::responseReceived): Emit headers as
509         an element message, like souphttpsrc.
510
511 2018-01-15  Philippe Normand  <pnormand@igalia.com>
512
513         [GStreamer] misc fixes and cleanups
514         https://bugs.webkit.org/show_bug.cgi?id=181647
515
516         Reviewed by Michael Catanzaro.
517
518         * platform/graphics/MediaPlayer.cpp:
519         (WebCore::convertEnumerationToString): New utility function to convert preload enum to string.
520         * platform/graphics/MediaPlayerEnums.h: Ditto.
521         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
522         (WebCore::MediaPlayerPrivateGStreamer::load): Debug tweak
523         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Ditto
524         (WebCore::MediaPlayerPrivateGStreamer::play): Ditto
525         (WebCore::MediaPlayerPrivateGStreamer::paused const): Ditto
526         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Prevent useless state update.
527         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
528         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Debug tweak.
529         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Ditto.
530         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
531         Remove useless handlesSyncMessage method.
532         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
533         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Prevent useless state update.
534         (WebCore::MediaPlayerPrivateGStreamerBase::muted const): Debug tweak.
535         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Ditto.
536         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
537         (webkit_web_src_init): Enable keepAlive by default like in souphttpsrc.
538         (webKitWebSrcStart): Debug tweak.
539         (webKitWebSrcQueryWithParent): Ditto.
540         (webKitWebSrcNeedData): Ditto.
541         (CachedResourceStreamingClient::responseReceived): Change appsrc
542         stream-type when we wan't seek. Also update caps like souphttpsrc
543         does.
544         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Add forward declaration of MediaPlayer.
545         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
546         (WebCore::MediaSourceClientGStreamerMSE::append): Fix compilation warning.
547
548 2018-01-16  Yacine Bandou  <yacine.bandou_ext@softathome.com>
549
550         [WPE] Two clearkey tests failing since r226621
551         https://bugs.webkit.org/show_bug.cgi?id=181532
552
553         Reviewed by Xabier Rodriguez-Calvar.
554
555         Whith a fake initData, we can have a pssh size nul, thus we should check it.
556         We saw this issue in the subtest "initData longer than 64Kb characters" in
557         the clearkey-generate-request-disallowed-input layout test.
558
559         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
560         (WebCore::extractKeyidsLocationFromCencInitData):
561
562 2018-01-15  Yoav Weiss  <yoav@yoav.ws>
563
564         Support for preconnect Link headers
565         https://bugs.webkit.org/show_bug.cgi?id=181657
566
567         Reviewed by Darin Adler.
568
569         Move the preconnect functionality into its own function, and
570         also call this function when Link headers are processed.
571
572         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
573
574         * loader/LinkLoader.cpp:
575         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnect.
576         (WebCore::LinkLoader::preconnect): Preconnect to a host functionality moved here.
577         (WebCore::LinkLoader::preload): Renamed `preloadIfNeeded` to `preload`.
578         (WebCore::LinkLoader::loadLink): Call preconnect.
579         * loader/LinkLoader.h:
580
581 2018-01-15  Michael Catanzaro  <mcatanzaro@igalia.com>
582
583         Improve use of ExportMacros
584         https://bugs.webkit.org/show_bug.cgi?id=181652
585
586         Reviewed by Konstantin Tokarev.
587
588         Remove a comment.
589
590         * platform/PlatformExportMacros.h:
591
592 2018-01-15  Konstantin Tokarev  <annulen@yandex.ru>
593
594         image-rendering should affect scaling of border-image
595         https://bugs.webkit.org/show_bug.cgi?id=169440
596
597         Reviewed by Michael Catanzaro.
598
599         Test: fast/borders/border-image-pixelated.html
600
601         * rendering/style/NinePieceImage.cpp:
602         (WebCore::NinePieceImage::paint):
603
604 2018-01-15  Tomas Popela  <tpopela@redhat.com>
605
606         2.19.3 ACCELERATED_2D_CANVAS support is broken
607         https://bugs.webkit.org/show_bug.cgi?id=180799
608
609         Reviewed by Michael Catanzaro.
610
611         * html/canvas/CanvasRenderingContext2DBase.cpp:
612         (WebCore::CanvasRenderingContext2DBase::didDraw):
613
614 2018-01-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
615
616         [Curl] Enable HTTP/2
617         https://bugs.webkit.org/show_bug.cgi?id=181551
618
619         Reviewed by Michael Catanzaro.
620
621         Start supporting HTTP/2 protocol. The first step is just enabling the HTTP/2 on Curl backend.
622         Next step will be to enable multiplexing feature.
623
624         No new tests because we don't have HTTP/2 test backend yet.
625
626         * platform/network/curl/CurlContext.cpp:
627         (WebCore::CurlContext::isHttp2Enabled const):
628         (WebCore::CurlHandle::enableHttp):
629         (WebCore::CurlHandle::enableHttpGetRequest):
630         (WebCore::CurlHandle::enableHttpHeadRequest):
631         (WebCore::CurlHandle::enableHttpPostRequest):
632         (WebCore::CurlHandle::enableHttpPutRequest):
633         (WebCore::CurlHandle::setHttpCustomRequest):
634         * platform/network/curl/CurlContext.h:
635
636 2018-01-15  Dean Jackson  <dino@apple.com>
637
638         Use a helper function for checked arithmetic in WebGL validation
639         https://bugs.webkit.org/show_bug.cgi?id=181620
640         <rdar://problem/36485879>
641
642         Reviewed by Eric Carlson.
643
644         Eric recommended using a templated helper function to do
645         a common arithmetic check in WebGL validation.
646
647         * html/canvas/WebGL2RenderingContext.cpp:
648         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
649         * html/canvas/WebGLRenderingContext.cpp:
650         (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
651         * html/canvas/WebGLRenderingContextBase.cpp:
652         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
653         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
654         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
655         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
656         * html/canvas/WebGLRenderingContextBase.h:
657         (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
658
659 2018-01-15  Dean Jackson  <dino@apple.com>
660
661         Use traits for animation timing functions
662         https://bugs.webkit.org/show_bug.cgi?id=181651
663         <rdar://problem/36525328>
664
665         Reviewed by Antoine Quint.
666
667         Use the type traits for TimingFunction classes, so
668         we can is<> and downcast<>.
669
670         * css/CSSComputedStyleDeclaration.cpp:
671         (WebCore::createTimingFunctionValue):
672         * platform/animation/TimingFunction.cpp:
673         (WebCore::TimingFunction::transformTime const):
674         * platform/animation/TimingFunction.h:
675         * platform/graphics/ca/GraphicsLayerCA.cpp:
676         (WebCore::animationHasStepsTimingFunction):
677         (WebCore::animationHasFramesTimingFunction):
678         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
679         (WebCore::toCAMediaTimingFunction):
680
681 2018-01-15  Youenn Fablet  <youenn@apple.com>
682
683         RealtimeMediaSource should be ThreadSafeRefCounted
684         https://bugs.webkit.org/show_bug.cgi?id=181649
685
686         Reviewed by Eric Carlson.
687
688         Difficult to write a test as this is really racy.
689         RealtimeIncomingVideoSourceCocoa::OnFrame is taking a reference on a background thread
690         to send a task to the main thread.
691         This requires it to be thread safe ref counted.
692
693         * platform/mediastream/RealtimeMediaSource.h:
694
695 2018-01-15  Philippe Normand  <pnormand@igalia.com>
696
697         Prevent useless MediaPlayer mute state notifications
698         https://bugs.webkit.org/show_bug.cgi?id=181646
699
700         Reviewed by Carlos Garcia Campos.
701
702         On GTK port the mute change notification was triggering the test
703         runner to think the whole page mute state had changed and that
704         media elements were muted. The simplest solution is to propagate
705         the notification only if the state actually changed.
706
707         * platform/graphics/MediaPlayer.cpp:
708         (WebCore::MediaPlayer::muteChanged): Propagate mute notification
709         only if the mute state actually changed.
710
711 2018-01-15  Sebastian Dröge  <sebastian@centricular.com>
712
713         [GStreamer] Don't wait for draw condition variable when shutting down.
714         https://bugs.webkit.org/show_bug.cgi?id=180978
715
716         Reviewed by Carlos Garcia Campos.
717
718         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
719         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
720         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
721         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
722         By also waiting for the draw condition variable while shutting down,
723         it is possible that the GStreamer video sink is waiting for the main
724         thread to actually render the current frame, while at the same time
725         the main thread is waiting for the GStreamer video sink to shut down,
726         resulting in a deadlock.
727
728 2018-01-13  Minsheng Liu  <lambda@liu.ms>
729
730         MathML Lengths should take zoom level into account
731         https://bugs.webkit.org/show_bug.cgi?id=180029
732
733         Reviewed by Frédéric Wang.
734
735         The patch applies the effective zoom factor to physical units in toUserUnits().
736
737         Test: mathml/presentation/mspace-units-with-zoom.html
738
739         * rendering/mathml/RenderMathMLBlock.cpp:
740         (WebCore::toUserUnits):
741
742 2018-01-12  Chris Dumez  <cdumez@apple.com>
743
744         ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
745         https://bugs.webkit.org/show_bug.cgi?id=181603
746         <rdar://problem/36476050>
747
748         Reviewed by Youenn Fablet.
749
750         No new tests, covered by existing tests that crash flakily.
751
752         * workers/service/server/SWServer.cpp:
753         (WebCore::SWServer::terminateWorkerInternal):
754         If the connection to the context process is gone, make sure we make the worker as terminated
755         so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.
756
757         * workers/service/server/SWServerRegistration.cpp:
758         (WebCore::SWServerRegistration::~SWServerRegistration):
759         Add assertions to make sure none of the registration's workers are still running when
760         the registration is destroyed.
761
762         (WebCore::SWServerRegistration::updateRegistrationState):
763         Make sure registration workers that are overwritten are not still running.
764
765         * workers/service/server/SWServerWorker.cpp:
766         (WebCore::SWServerWorker::setState):
767         If a worker's state is set to redundant, make sure we also terminate it.
768
769 2018-01-12  Commit Queue  <commit-queue@webkit.org>
770
771         Unreviewed, rolling out r226927.
772         https://bugs.webkit.org/show_bug.cgi?id=181621
773
774         Breaks 32-bit and iOS release for some reason that i don't
775         understand yet (Requested by dino on #webkit).
776
777         Reverted changeset:
778
779         "Use a helper function for checked arithmetic in WebGL
780         validation"
781         https://bugs.webkit.org/show_bug.cgi?id=181620
782         https://trac.webkit.org/changeset/226927
783
784 2018-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
785
786         Data URL fonts split in the middle of an alphabet cause random letters to disappear
787         https://bugs.webkit.org/show_bug.cgi?id=175845
788         <rdar://problem/33996578>
789
790         Reviewed by Brent Fulgham.
791
792         It is fairly common practice for a font foundry to split a font up into two files such that a semi-random
793         half of the alphabet is present in one of the files, and the other half is present in the other file. This
794         practice involves representing the files as data URLs, so as to minimize the time it takes to load them.
795
796         Because resource loading is asynchronous (even for data URLs), it is possible today to get a paint after
797         the first file is loaded but before the second file is loaded. Indeed, because of the way font fallback
798         works, we will never start loading the second file until a layout has occurred with the first font.
799
800         Because a site usually only uses this pattern for a handful of fonts, and I've never seen this pattern
801         being used for CJK fonts, it isn't very expensive to opportunistically decode these data URLs eagerly.
802         Using this method doesn't actually guarantee that the two fonts will load in between successive paints,
803         but it at least makes this much more likely. This patch implements this strategy, along with a size
804         threshold to make sure that we won't decode any super large data URLs when it isn't necessary.
805
806         Test: fast/text/font-load-data-partitioned-alphabet.html
807
808         * css/CSSFontFace.cpp:
809         (WebCore::CSSFontFace::opportunisticallyStartFontDataURLLoading):
810         * css/CSSFontFace.h:
811         * css/CSSFontFaceSource.cpp:
812         (WebCore::CSSFontFaceSource::opportunisticallyStartFontDataURLLoading):
813         * css/CSSFontFaceSource.h:
814         * css/CSSFontSelector.cpp:
815         (WebCore::CSSFontSelector::opportunisticallyStartFontDataURLLoading):
816         * css/CSSFontSelector.h:
817         * platform/graphics/FontCascadeFonts.cpp:
818         (WebCore::opportunisticallyStartFontDataURLLoading):
819         (WebCore::FontCascadeFonts::glyphDataForVariant):
820         * platform/graphics/FontSelector.h:
821
822 2018-01-12  Alex Christensen  <achristensen@webkit.org>
823
824         History state should be updated during client redirects with asynchronous policy decisions
825         https://bugs.webkit.org/show_bug.cgi?id=181358
826         <rdar://problem/35547689>
827
828         Reviewed by Andy Estes.
829
830         When decidePolicyForNavigationAction is responded to asynchronously during a client redirect, 
831         HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because
832         the document loader has not been marked as a client redirect because the FrameLoader only looks
833         at its provisional document loader to mark it as a client redirect.  When decidePolicyForNavigationAction
834         is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to 
835         its policy document loader.  To get both asynchronous and synchronous cases, let's just mark the document
836         loader as a client redirect whether it's the provisional or policy document loader.
837
838         Covered by a new API test.
839
840         * loader/FrameLoader.cpp:
841         (WebCore::FrameLoader::loadURL):
842         (WebCore::FrameLoader::loadPostRequest):
843
844 2018-01-12  Dean Jackson  <dino@apple.com>
845
846         Use a helper function for checked arithmetic in WebGL validation
847         https://bugs.webkit.org/show_bug.cgi?id=181620
848         <rdar://problem/36485879>
849
850         Reviewed by Eric Carlson.
851
852         Eric recommended using a templated helper function to do
853         a common arithmetic check in WebGL validation.
854
855         * html/canvas/WebGL2RenderingContext.cpp:
856         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
857         * html/canvas/WebGLRenderingContext.cpp:
858         (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
859         * html/canvas/WebGLRenderingContextBase.cpp:
860         (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
861         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
862         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
863         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
864         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
865         * html/canvas/WebGLRenderingContextBase.h:
866
867 2018-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
868
869         [Cocoa] CTFontCopyDefaultCascadeListForLanguages() can return nullptr
870         https://bugs.webkit.org/show_bug.cgi?id=181615
871         <rdar://problem/36334637>
872
873         Reviewed by Jon Lee.
874
875         Speculative fix. We are getting crash reports saying that this call can return nullptr, and we
876         don't check for it.
877
878         No new tests because I couldn't find the specific input that causes it to return nullptr. (I
879         tried running this code with every 0, 1, and 2 length locale string, every weight value, and
880         every italic value, and couldn't get it to crash. I also inspected the code to figure out what
881         values would cause it to return nullptr, and I couldn't find anything other than if the system
882         has a totally busted font setup.)
883
884         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
885         (WebCore::SystemFontDatabase::computeCascadeList):
886
887 2018-01-11  Dean Jackson  <dino@apple.com>
888
889         [WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
890         https://bugs.webkit.org/show_bug.cgi?id=181558
891         <rdar://problem/36189833>
892
893         Reviewed by Eric Carlson.
894
895         Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
896         our simulated vertexAttrib0 buffer might be too large. We need
897         to check for out-of-memory, but we can also detect some of the issues
898         earlier in our validation code. Additionally, make sure that we don't
899         accidentally cast an unsigned to a signed.
900
901         Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
902
903         * html/canvas/WebGL2RenderingContext.cpp:
904         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
905         code to look for overflow, rather than relying on looking for sign changes.
906         * html/canvas/WebGLRenderingContext.cpp:
907         (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
908         * html/canvas/WebGLRenderingContextBase.cpp:
909         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
910         (WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
911         (WebCore::WebGLRenderingContextBase::drawElements):
912         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
913         use GC3Duint, since that's what the indicies are.
914         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
915         (WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
916         (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
917         * html/canvas/WebGLRenderingContextBase.h:
918
919 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
920
921         Large in-place attachment elements cause the document width to expand when inserted
922         https://bugs.webkit.org/show_bug.cgi?id=181614
923
924         Reviewed by Dan Bernstein.
925
926         Make in-place images and videos have a max-width of 100%, so that large attachments aren't inserted with full
927         display size, causing the document and viewport width to expand.
928
929         * html/HTMLAttachmentElement.cpp:
930         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
931
932 2018-01-12  Keith Rollin  <krollin@apple.com>
933
934         Logged JSON should escape "'s and \'s in strings.
935         https://bugs.webkit.org/show_bug.cgi?id=181608
936
937         Reviewed by Brent Fulgham.
938
939         No new tests -- no new functionality, just changed logging. The
940         efficacy of the logging was verified by inspecting its output.
941
942         * loader/ResourceLoadObserver.cpp:
943         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
944
945 2018-01-12  Dean Jackson  <dino@apple.com>
946
947         drawElements should be invalid if vertexAttrib0 doesn't have data
948         https://bugs.webkit.org/show_bug.cgi?id=181609
949         <rdar://problem/36392883>
950
951         Reviewed by Antoine Quint.
952
953         If a vertex attribute has been enabled, but no data provided, then
954         draw validation should fail.
955
956         Test: fast/canvas/webgl/drawElements-empty-vertex-data.html
957
958         * html/canvas/WebGLRenderingContextBase.cpp:
959         (WebCore::WebGLRenderingContextBase::validateVertexAttributes): If there were
960         never any data in the vertex buffer, then we incorrectly compared with 0.
961
962 2018-01-12  Youenn Fablet  <youenn@apple.com>
963
964         FormDataElement::lengthInBytes should use ThreadableBlobRegistry
965         https://bugs.webkit.org/show_bug.cgi?id=181554
966
967         Reviewed by Chris Dumez.
968
969         Covered by updated test.
970
971         Fix blobRegistry() use and add support for creating a response that may trigger the issue.
972
973
974         * platform/network/FormData.cpp:
975         (WebCore::FormDataElement::lengthInBytes const): Was using directly blobRegistry() while ThreadableBlobRegistry is more appropriate
976         in case this is called from workers.
977         * Modules/fetch/FetchBody.h:
978         * Modules/fetch/FetchResponse.h:
979         * fileapi/Blob.h:
980         * testing/ServiceWorkerInternals.cpp:
981         (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
982         * testing/ServiceWorkerInternals.h:
983         * testing/ServiceWorkerInternals.idl:
984
985 2018-01-12  Jer Noble  <jer.noble@apple.com>
986
987         Wrap CDMFairPlayStreaming and related classes in ENABLE(ENCRYPTED_MEDIA) checks
988         https://bugs.webkit.org/show_bug.cgi?id=181602
989
990         Reviewed by Maciej Stachowiak.
991
992         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
993         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
994         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
995
996 2018-01-12  Youenn Fablet  <youenn@apple.com>
997
998         WebProcess should pass the registration identifier and not the worker identifier for fetch events
999         https://bugs.webkit.org/show_bug.cgi?id=181591
1000
1001         Reviewed by Chris Dumez.
1002
1003         Test: http/wpt/service-workers/update-service-worker.https.html
1004
1005         Store service worker registration identifier in ResourceLoaderOptions instead of service worker identifier.
1006
1007         * loader/DocumentThreadableLoader.cpp:
1008         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1009         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1010         * loader/ResourceLoaderOptions.h:
1011         * loader/WorkerThreadableLoader.cpp:
1012         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1013         * loader/cache/CachedResourceLoader.cpp:
1014         (WebCore::CachedResourceLoader::prepareFetch):
1015         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
1016         * loader/cache/CachedResourceRequest.cpp:
1017         (WebCore::CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeeded):
1018         (WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
1019         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded): Deleted.
1020         * loader/cache/CachedResourceRequest.h:
1021         * workers/WorkerScriptLoader.cpp:
1022         (WebCore::WorkerScriptLoader::loadSynchronously):
1023         (WebCore::WorkerScriptLoader::loadAsynchronously):
1024         * workers/service/server/SWServer.cpp:
1025         (WebCore::SWServer::activeWorkerFromRegistrationID):
1026         * workers/service/server/SWServer.h:
1027
1028 2018-01-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1029
1030         [Win][CMake] Remove all-in-one file for WebCore DerivedSources
1031         https://bugs.webkit.org/show_bug.cgi?id=181582
1032
1033         Reviewed by Alex Christensen.
1034
1035         Those source files are compiled in unified source build nowadays.
1036
1037         No new tests (No behavior change)
1038
1039         * CMakeLists.txt: Removed calling PROCESS_ALLINONE_FILE.
1040         * DerivedSources.cpp: Removed.
1041         * WebCoreMacros.cmake: Removed a macro PROCESS_ALLINONE_FILE.
1042
1043 2018-01-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1044
1045         [WinCairo][CMake] Use ${CURL_LIBRARY} instead of specifying the library name libcurl_imp explicitly
1046         https://bugs.webkit.org/show_bug.cgi?id=181578
1047
1048         Reviewed by Alex Christensen.
1049
1050         vcpkg has libcurl.lib, not libcurl_imp.lib.
1051
1052         No new tests because no behavior change.
1053
1054         * PlatformWinCairo.cmake: Link ${CURL_LIBRARY} instead of libcurl_imp.
1055
1056 2018-01-12  Jer Noble  <jer.noble@apple.com>
1057
1058         WebGL video texture black in Safari 11.0.2 and wrong colored in Safari Preview 11.1
1059         https://bugs.webkit.org/show_bug.cgi?id=181445
1060         <rdar://problem/36383183>
1061
1062         Reviewed by Dean Jackson.
1063
1064         Tests: added compile-time correctness tests for YCbCrMatrix values.
1065
1066         Perform the derivation from YCbCr coefficients into matrices in constexpr expressions
1067         at compile-time. This allows us to also perform compile-time correctness checks to catch
1068         regressions which may cause incorrect color conversions.
1069
1070         Since we now have general-purpose derivation of matrix values from coefficients,
1071         adding missing specificed matrices is trivial, so add support for SMPTE 240M and BT.2020
1072         matrices.
1073
1074         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1075         (WebCore::GLfloatColor::GLfloatColor):
1076         (WebCore::GLfloatColor::abs):
1077         (WebCore::GLfloatColor::isApproximatelyEqualTo const):
1078         (WebCore::YCbCrMatrix::operator Vector<GLfloat> const):
1079         (WebCore::YCbCrMatrix::YCbCrMatrix):
1080         (WebCore::YCbCrMatrix::operator* const):
1081         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
1082
1083 2018-01-12  Antoine Quint  <graouts@apple.com>
1084
1085         Add support for the frames() timing function
1086         https://bugs.webkit.org/show_bug.cgi?id=181585
1087         <rdar://problem/36463317>
1088
1089         Reviewed by Dean.
1090
1091         Implement the frames() timing function as specified in the CSS Timing Functions Level 1
1092         specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
1093         A frames timing function is a type of timing function that divides the input time into a
1094         specified number of intervals of equal length.
1095
1096         Test: transitions/frames-timing-function.html
1097
1098         * css/CSSComputedStyleDeclaration.cpp:
1099         (WebCore::createTimingFunctionValue):
1100         * css/CSSTimingFunctionValue.cpp:
1101         (WebCore::CSSFramesTimingFunctionValue::customCSSText const):
1102         (WebCore::CSSFramesTimingFunctionValue::equals const):
1103         * css/CSSTimingFunctionValue.h:
1104         * css/CSSToStyleMap.cpp:
1105         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1106         * css/CSSValue.cpp:
1107         (WebCore::CSSValue::equals const):
1108         (WebCore::CSSValue::cssText const):
1109         (WebCore::CSSValue::destroy):
1110         * css/CSSValue.h:
1111         (WebCore::CSSValue::isFramesTimingFunctionValue const):
1112         * css/CSSValueKeywords.in:
1113         * css/parser/CSSPropertyParser.cpp:
1114         (WebCore::consumeSteps):
1115         (WebCore::consumeFrames):
1116         (WebCore::consumeAnimationTimingFunction):
1117         * platform/animation/TimingFunction.cpp:
1118         (WebCore::operator<<):
1119         (WebCore::TimingFunction::transformTime const):
1120         * platform/animation/TimingFunction.h:
1121         (WebCore::TimingFunction::isFramesTimingFunction const):
1122         * platform/graphics/ca/GraphicsLayerCA.cpp:
1123         (WebCore::animationHasFramesTimingFunction):
1124         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
1125
1126 2018-01-12  Commit Queue  <commit-queue@webkit.org>
1127
1128         Unreviewed, rolling out r226721.
1129         https://bugs.webkit.org/show_bug.cgi?id=181583
1130
1131         Lets do a slightly different fix (Requested by anttik on
1132         #webkit).
1133
1134         Reverted changeset:
1135
1136         "REGRESSION(r225650): The scores of MotionMark tests Multiply
1137         and Leaves dropped by 8%"
1138         https://bugs.webkit.org/show_bug.cgi?id=181460
1139         https://trac.webkit.org/changeset/226721
1140
1141 2018-01-11  Keith Miller  <keith_miller@apple.com>
1142
1143         Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
1144         https://bugs.webkit.org/show_bug.cgi?id=181573
1145
1146         Reviewed by Simon Fraser.
1147
1148         * Configurations/FeatureDefines.xcconfig:
1149
1150 2018-01-11  Jiewen Tan  <jiewen_tan@apple.com>
1151
1152         [WebAuthN] Import a CBOR coder from Chromium
1153         https://bugs.webkit.org/show_bug.cgi?id=181522
1154         <rdar://problem/36055729>
1155
1156         Reviewed by Brent Fulgham.
1157
1158         This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder
1159         is needed for WebAuthN to encode attestation object into binaries. When supporting extensions
1160         in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining
1161         a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore,
1162         importing a most suitable third party implementation will be wise.
1163
1164         In this patch, it fully integrate the whole coder into our codebase. Those changes includes:
1165             1. Substitute data structures that enjoy a better WTF version.
1166             2. Replacing marcos.
1167             3. Implementating workarounds for some functionalities that we lack fundamental types' support.
1168             4. Changing the coding style to match ours.
1169
1170         This patch doesn't intend to improve the logic of the original codebase. Hence some of the
1171         coding logic might not match what WebKit ususally has.
1172
1173         Here is a full list of Chromium changes that constructed this CBOR coder in chronological order:
1174         6efcf495521d18d060027762f48bb292d6979136,
1175         9eb43fd347890b4c6cf54c4bd7ec1bbb88e381e1,
1176         31c85e74fd567772f18e0a41be468d04af721f21,
1177         68672fdcad280a8ff69b91927d38d0eabf2c87f2,
1178         0ca8667c0584fb21c0748ebd7468d32889759a07,
1179         df763d790d7e45d70116bdefacbfd4f9faa8995e,
1180         6d30c4a621c65314db63eb56e87c19ab75627b26,
1181         50fe92953f4739f17a62303fedbf8db9234317c8,
1182         47be22c3603424d1832d046a348ff3f982500288,
1183         98a59e46948b2c71608926004fac8192b0ff2208,
1184         07540c6d850ed6e0fa508d63c20a8ce96d751de6,
1185         06ae32d640c8e4b86ea8914a80ee419ea16e56d8.
1186
1187         Covered by API tests.
1188
1189         * Modules/webauthn/cbor/CBORBinary.h: Added.
1190         * Modules/webauthn/cbor/CBORReader.cpp: Added.
1191         (cbor::CBORReader::CBORReader):
1192         (cbor::CBORReader::~CBORReader):
1193         (cbor::CBORReader::read):
1194         (cbor::CBORReader::decodeCBOR):
1195         (cbor::CBORReader::readVariadicLengthInteger):
1196         (cbor::CBORReader::decodeValueToNegative):
1197         (cbor::CBORReader::decodeValueToUnsigned):
1198         (cbor::CBORReader::readSimpleValue):
1199         (cbor::CBORReader::readString):
1200         Workarounds applied.
1201         (cbor::CBORReader::readBytes):
1202         (cbor::CBORReader::readCBORArray):
1203         (cbor::CBORReader::readCBORMap):
1204         (cbor::CBORReader::canConsume):
1205         (cbor::CBORReader::checkMinimalEncoding):
1206         (cbor::CBORReader::checkExtraneousData):
1207         (cbor::CBORReader::checkDuplicateKey):
1208         (cbor::CBORReader::hasValidUTF8Format):
1209         Workarounds applied.
1210         (cbor::CBORReader::checkOutOfOrderKey):
1211         (cbor::CBORReader::getErrorCode):
1212         (cbor::CBORReader::errorCodeToString):
1213         * Modules/webauthn/cbor/CBORReader.h: Added.
1214         * Modules/webauthn/cbor/CBORValue.cpp: Added.
1215         (cbor::CBORValue::CBORValue):
1216         (cbor::CBORValue::operator=):
1217         (cbor::CBORValue::~CBORValue):
1218         (cbor::CBORValue::clone const):
1219         (cbor::CBORValue::getInteger const):
1220         (cbor::CBORValue::getUnsigned const):
1221         (cbor::CBORValue::getNegative const):
1222         (cbor::CBORValue::getString const):
1223         (cbor::CBORValue::getByteString const):
1224         (cbor::CBORValue::getArray const):
1225         (cbor::CBORValue::getMap const):
1226         (cbor::CBORValue::getSimpleValue const):
1227         (cbor::CBORValue::internalMoveConstructFrom):
1228         (cbor::CBORValue::internalCleanup):
1229         * Modules/webauthn/cbor/CBORValue.h: Added.
1230         * Modules/webauthn/cbor/CBORWriter.cpp: Added.
1231         (cbor::CBORWriter::~CBORWriter):
1232         (cbor::CBORWriter::write):
1233         (cbor::CBORWriter::CBORWriter):
1234         (cbor::CBORWriter::encodeCBOR):
1235         Workarounds applied.
1236         (cbor::CBORWriter::startItem):
1237         (cbor::CBORWriter::setAdditionalInformation):
1238         (cbor::CBORWriter::setUint):
1239         (cbor::CBORWriter::getNumUintBytes):
1240         * Modules/webauthn/cbor/CBORWriter.h: Added.
1241         * Sources.txt:
1242         * WebCore.xcodeproj/project.pbxproj:
1243
1244 2018-01-11  Chris Dumez  <cdumez@apple.com>
1245
1246         Setting Window.opener to null should disown its opener
1247         https://bugs.webkit.org/show_bug.cgi?id=181505
1248         <rdar://problem/36443151>
1249
1250         Reviewed by Ryosuke Niwa.
1251
1252         Setting Window.opener to null should disown its opener as per:
1253         - https://html.spec.whatwg.org/#dom-opener
1254
1255         With this change, tabs opened by clicking link inside Gmail no
1256         longer have the Gmail window as opener.
1257
1258         Tests: fast/dom/Window/window-opener-set-to-null.html
1259                fast/dom/Window/window-opener-shadowing.html
1260
1261         * bindings/js/JSDOMWindowCustom.cpp:
1262         (WebCore::JSDOMWindow::setOpener):
1263         * page/DOMWindow.cpp:
1264         (WebCore::DOMWindow::disownOpener):
1265         * page/DOMWindow.h:
1266         * page/DOMWindow.idl:
1267
1268 2018-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
1269
1270         [Cocoa] Star character disappears when bolded
1271         https://bugs.webkit.org/show_bug.cgi?id=181568
1272         <rdar://problem/18755569>
1273
1274         Reviewed by Simon Fraser.
1275
1276         We had some code in ComplexTextController to ask the FontCache for a font, given the name
1277         of a particular font CoreText used inside a CTRun. This is wrong for two reasons: fonts
1278         are not identifiable by PostScript name (in the general case), and because the lookup
1279         procedure requires a FontDescription, the result may yield a font that is not the one
1280         looked up. The goal of this code was simply to preserve the rendering mode of the font,
1281         but we removed support for these rendering modes years ago. So the solution is to skip
1282         that lookup and use the CoreText font directly.
1283
1284         Test: fast/text/unknown-font.html
1285
1286         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1287         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1288
1289 2018-01-11  Keith Rollin  <krollin@apple.com>
1290
1291         Add optional logging of ITP-related user interaction information
1292         https://bugs.webkit.org/show_bug.cgi?id=181556
1293
1294         Reviewed by Brent Fulgham.
1295
1296         In order to support the tracking of the efficacy of Intelligent
1297         Tracking Protection, add some logging indicating when the user
1298         interacts with a page in a way that affects cookie partitioning. This
1299         logging is off by default, and is enabled with `defaults write -g
1300         WebKitLogCookieInformation -bool true`.
1301
1302         No new tests -- no changed functionality.
1303
1304         * loader/ResourceLoadObserver.cpp:
1305         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1306         * loader/ResourceLoadObserver.h:
1307         (WebCore::ResourceLoadObserver::shouldLogUserInteraction const):
1308         (WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
1309
1310 2018-01-11  James Craig  <jcraig@apple.com>
1311
1312         AX: when invert colors is on, double-invert video elements in UserAgentStyleSheet
1313         https://bugs.webkit.org/show_bug.cgi?id=168447
1314         <rdar://problem/30559874>
1315
1316         Reviewed by Simon Fraser.
1317
1318         Double-invert video when platform "invert colors" setting is enabled. Behavior matches 
1319         current "Smart Invert" feature of Safari Reader on macOS/iOS and other iOS native apps.
1320
1321         Tests: accessibility/smart-invert-reference.html
1322                accessibility/smart-invert.html
1323
1324         * Modules/modern-media-controls/controls/media-controls.css:
1325         (@media (inverted-colors)):
1326         (:host):
1327         (picture):
1328         * css/html.css:
1329         (@media (inverted-colors)):
1330         (video):
1331
1332 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1333
1334         Don't load inline data when requesting info for an attachment element backed by a file path
1335         https://bugs.webkit.org/show_bug.cgi?id=181550
1336
1337         Reviewed by Tim Horton.
1338
1339         When requesting data for an attachment element that is backed by a file path, we currently trigger a load in the
1340         web process to fetch contents of the attachment data as inline data in the AttachmentInfo. This is unnecessary,
1341         since the file path of the attachment element must have come from the UI process anyways, so it is sufficient to
1342         simply send the file path to the UI process and have the UI process read the contents of the path as a memory-
1343         mapped NSData.
1344
1345         This patch lets HTMLAttachmentElement skip over resource loading codepaths when creating an AttachmentInfo for
1346         the client, and also teaches _WKAttachment to read a AttachmentInfo's filepath as memory-mapped data if a file
1347         path is present, and no inline data was specified.
1348
1349         Covered by existing API tests.
1350
1351         * html/HTMLAttachmentElement.cpp:
1352         (WebCore::HTMLAttachmentElement::requestInfo):
1353
1354 2018-01-10  Ryosuke Niwa  <rniwa@webkit.org>
1355
1356         Make elements of zero width or height focusable
1357         https://bugs.webkit.org/show_bug.cgi?id=181516
1358
1359         Reviewed by Chris Dumez.
1360
1361         Don't check render box's size or bounding rect when deciding whether an element is focusable.
1362         New behavior matches that of Firefox and Chrome.
1363
1364         Test: fast/events/focus-zero-size-element.html
1365
1366         * dom/Element.cpp:
1367         (WebCore::Element::isFocusable): Only update the style.
1368         * html/HTMLFormControlElement.cpp:
1369         (WebCore::HTMLFormControlElement::isFocusable const): Deleted.
1370         * html/HTMLFormControlElement.h:
1371         * mathml/MathMLElement.cpp:
1372         (WebCore::MathMLElement::isFocusable const): Deleted. As far as I can tell, no math ml element is focusable.
1373         * mathml/MathMLElement.h:
1374         * svg/SVGAElement.cpp:
1375         (WebCore::SVGAElement::isFocusable const): Deleted.
1376         * svg/SVGAElement.h:
1377
1378 2018-01-11  Filip Pizlo  <fpizlo@apple.com>
1379
1380         Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
1381         https://bugs.webkit.org/show_bug.cgi?id=181543
1382
1383         Rubber stamped by Michael Saboff.
1384
1385         No new tests because I'm just renaming things.
1386
1387         * ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
1388         * ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
1389         * bindings/js/DOMGCOutputConstraint.cpp:
1390
1391 2018-01-11  Alex Christensen  <achristensen@webkit.org>
1392
1393         REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
1394         https://bugs.webkit.org/show_bug.cgi?id=181553
1395         <rdar://problem/35733938>
1396
1397         Reviewed by Eric Carlson.
1398
1399         There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
1400         r225003 broke loading in this environment.  This fixes it and updates the test that r225003 fixed.
1401         It failed sometimes because loading was happening in a different order than html parsing, so I made
1402         the test not depend on html parsing timing by updating media/video-src-remove.html.
1403
1404         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1405         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
1406
1407 2018-01-11  Dean Jackson  <dino@apple.com>
1408
1409         Rolling out 226814. It crashes on some bots.
1410
1411 2018-01-11  Dean Jackson  <dino@apple.com>
1412
1413         [WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
1414         https://bugs.webkit.org/show_bug.cgi?id=181558
1415         <rdar://problem/36189833>
1416
1417         Reviewed by Eric Carlson.
1418
1419         Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
1420         our simulated vertexAttrib0 buffer might be too large. We need
1421         to check for out-of-memory, but we can also detect some of the issues
1422         earlier in our validation code. Additionally, make sure that we don't
1423         accidentally cast an unsigned to a signed.
1424
1425         Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
1426
1427         * html/canvas/WebGL2RenderingContext.cpp:
1428         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
1429         code to look for overflow, rather than relying on looking for sign changes.
1430         * html/canvas/WebGLRenderingContext.cpp:
1431         (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
1432         * html/canvas/WebGLRenderingContextBase.cpp:
1433         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
1434         (WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
1435         (WebCore::WebGLRenderingContextBase::drawElements):
1436         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
1437         use GC3Duint, since that's what the indicies are.
1438         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
1439         (WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
1440         (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
1441         * html/canvas/WebGLRenderingContextBase.h:
1442
1443 2018-01-11  Chris Dumez  <cdumez@apple.com>
1444
1445         ASSERTION FAILED: registration in WebCore::SWServerWorker::skipWaiting()
1446         https://bugs.webkit.org/show_bug.cgi?id=181222
1447         <rdar://problem/36332686>
1448
1449         Reviewed by Youenn Fablet.
1450
1451         Replace assertion in SWServerWorker::skipWaiting() that assumes the worker
1452         has a registration. Nowadays, a SWServerWorker can stay alive for a short
1453         period without having a registration, while it is terminating.
1454
1455         No new tests, unskipped existing test.
1456
1457         * workers/service/server/SWServerWorker.cpp:
1458         (WebCore::SWServerWorker::skipWaiting):
1459
1460 2018-01-11  Antti Koivisto  <antti@apple.com>
1461
1462         Don't call RenderElement::setStyle when nothing changes
1463         https://bugs.webkit.org/show_bug.cgi?id=181530
1464
1465         Reviewed by Zalan Bujtas.
1466
1467         * style/StyleChange.h:
1468
1469         Remove 'Force' value. This essentially meant 'compute style for all descendants and call setStyle unconditionally'.
1470         Using this value lost information about whether anything actually changed in a particular style as it was automatically
1471         inherited by all descendants. The 'compute all descendants' part of the behavior is what is actually needed.
1472
1473         Instead add separate DescendantsToResolve enum for communicating what else to compute.
1474
1475         * style/StyleTreeResolver.cpp:
1476         (WebCore::Style::TreeResolver::Parent::Parent):
1477         (WebCore::Style::computeDescendantsToResolve):
1478
1479             Figure out which descendants will need resolving based on how the current elements style changed.
1480
1481         (WebCore::Style::TreeResolver::resolveElement):
1482         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1483         (WebCore::Style::TreeResolver::pushParent):
1484         (WebCore::Style::shouldResolveElement):
1485
1486             Use DescendantsToResolve as input.
1487
1488         (WebCore::Style::TreeResolver::resolveComposedTree):
1489         * style/StyleTreeResolver.h:
1490         * style/StyleUpdate.h:
1491         (WebCore::Style::ElementUpdates::ElementUpdates):
1492
1493             Add DescendantsToResolve.
1494
1495 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1496
1497         Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
1498         https://bugs.webkit.org/show_bug.cgi?id=181497
1499
1500         Reviewed by Tim Horton.
1501
1502         Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
1503         change in behavior; promised blob dragging covered by WKAttachment API tests.
1504
1505         * loader/EmptyClients.cpp:
1506         * page/DragClient.h:
1507         (WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
1508         * page/DragController.cpp:
1509         (WebCore::DragController::startDrag):
1510         (WebCore::DragController::doImageDrag):
1511         (WebCore::DragController::doSystemDrag):
1512         (WebCore::DragController::promisedBlobInfo):
1513         (WebCore::DragController::dragAttachmentElement): Deleted.
1514         * page/DragController.h:
1515         * platform/DragItem.h:
1516         (WebCore::DragItem::encode const):
1517         (WebCore::DragItem::decode):
1518
1519 2018-01-11  Youenn Fablet  <youenn@apple.com>
1520
1521         RTCController should disable ICE candidate filtering in case of getUserMedia based on the RTCPerrConnection origin
1522         https://bugs.webkit.org/show_bug.cgi?id=180851
1523
1524         Reviewed by Eric Carlson.
1525
1526         Test: http/wpt/webrtc/third-party-frame-ice-candidate-filtering.html
1527
1528         RTCController now stores all the client origins (top+frame origins) of frames that got access to camera/microphone access.
1529         For any such client origin, PeerConnection objects ICE candidate filtering is disabled.
1530         ICE candidate filtering is reset whenever navigating/reloading the page.
1531
1532         * Modules/mediastream/RTCController.cpp:
1533         (WebCore::RTCController::reset):
1534         (WebCore::matchDocumentOrigin):
1535         (WebCore::RTCController::shouldDisableICECandidateFiltering):
1536         (WebCore::RTCController::add):
1537         (WebCore::RTCController::disableICECandidateFilteringForAllOrigins):
1538         (WebCore::RTCController::disableICECandidateFiltering):
1539         (WebCore::RTCController::enableICECandidateFiltering):
1540         * Modules/mediastream/RTCController.h:
1541         * Modules/mediastream/RTCPeerConnection.cpp:
1542         (WebCore::RTCPeerConnection::create):
1543         * Modules/mediastream/UserMediaRequest.cpp:
1544         (WebCore::UserMediaRequest::allow):
1545         * page/Page.cpp:
1546         (WebCore::Page::disableICECandidateFiltering):
1547         * testing/Internals.cpp:
1548         (WebCore::Internals::setICECandidateFiltering):
1549
1550 2018-01-11  Ali Juma  <ajuma@chromium.org>
1551
1552         window.visualViewport should behave as [SameObject]
1553         https://bugs.webkit.org/show_bug.cgi?id=181548
1554
1555         Reviewed by Chris Dumez.
1556
1557         Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
1558         JS wrapper object doesn't get garbage collected too soon.
1559
1560         Test: fast/visual-viewport/visual-viewport-same-object.html
1561
1562         * page/VisualViewport.idl:
1563
1564 2018-01-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1565
1566         [Curl] Extract multipart handling from ResourceHandle to CurlRequest.
1567         https://bugs.webkit.org/show_bug.cgi?id=181506
1568
1569         Reviewed by Alex Christensen.
1570
1571         Rename old MultipartHandle class to CurlMultipartHandle and modernize it. Also move the responsibility 
1572         of handling multi part from ResourceHandle to CurlRequest. This is required for upcoming NetworkLoadTask.
1573
1574         No new tests because no new behavior.
1575
1576         * platform/Curl.cmake:
1577         * platform/network/curl/CurlMultipartHandle.cpp: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.cpp.
1578         (WebCore::CurlMultipartHandle::createIfNeeded):
1579         (WebCore::CurlMultipartHandle::extractBoundary):
1580         (WebCore::CurlMultipartHandle::extractBoundaryFromContentType):
1581         (WebCore::CurlMultipartHandle::CurlMultipartHandle):
1582         (WebCore::CurlMultipartHandle::didReceiveData):
1583         (WebCore::CurlMultipartHandle::didComplete):
1584         (WebCore::CurlMultipartHandle::processContent):
1585         (WebCore::CurlMultipartHandle::checkForBoundary):
1586         (WebCore::CurlMultipartHandle::matchedLength):
1587         (WebCore::CurlMultipartHandle::parseHeadersIfPossible):
1588         * platform/network/curl/CurlMultipartHandle.h: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.h.
1589         (WebCore::CurlMultipartHandle::~CurlMultipartHandle):
1590         * platform/network/curl/CurlMultipartHandleClient.h: Added.
1591         (WebCore::CurlMultipartHandleClient::~CurlMultipartHandleClient):
1592         * platform/network/curl/CurlRequest.cpp:
1593         (WebCore::CurlRequest::CurlRequest):
1594         (WebCore::CurlRequest::didReceiveHeader):
1595         (WebCore::CurlRequest::didReceiveData):
1596         (WebCore::CurlRequest::didReceiveHeaderFromMultipart):
1597         (WebCore::CurlRequest::didReceiveDataFromMultipart):
1598         (WebCore::CurlRequest::didCompleteTransfer):
1599         (WebCore::CurlRequest::finalizeTransfer):
1600         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
1601         (WebCore::CurlRequest::invokeDidReceiveResponse):
1602         (WebCore::CurlRequest::completeDidReceiveResponse):
1603         * platform/network/curl/CurlRequest.h:
1604         (WebCore::CurlRequest::create):
1605         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1606         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
1607         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
1608         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
1609         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
1610         * platform/network/curl/ResourceHandleCurlDelegate.h:
1611
1612 2018-01-11  Zalan Bujtas  <zalan@apple.com>
1613
1614         RenderTreeUpdater::current() returns null_ptr when mutation is done through Document::resolveStyle.
1615         https://bugs.webkit.org/show_bug.cgi?id=181513
1616         <rdar://problem/36367085>
1617
1618         Reviewed by Antti Koivisto.
1619
1620         This patch ensures that we use a valid RenderTreeBuilder even when
1621         Document::resolveStyle (incorrectly) triggers tree mutation.
1622         It can be reverted soon after the incorrect mutations are taken care of.
1623
1624         Test: fast/forms/button-set-text-crash.html
1625
1626         * rendering/RenderButton.cpp:
1627         (WebCore::RenderButton::setText):
1628         * rendering/RenderMenuList.cpp:
1629         (RenderMenuList::setText):
1630
1631 2018-01-11  Antoine Quint  <graouts@apple.com>
1632
1633         Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
1634         https://bugs.webkit.org/show_bug.cgi?id=181547
1635         <rdar://problem/35947650>
1636
1637         Reviewed by Eric Carlson.
1638
1639         Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS,
1640         we only listen to such events when controls are visible to the user. In other words, the MediaControls need to
1641         have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on
1642         MediaControls such that it can tell the MediaController that the "visible" property changed. With this message,
1643         MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which
1644         lets AirplaySupport disable itself when controls are no longer visible.
1645
1646         Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html
1647
1648         * Modules/modern-media-controls/controls/media-controls.js:
1649         (MediaControls.prototype.set visible):
1650         * Modules/modern-media-controls/media/airplay-support.js:
1651         (AirplaySupport.prototype.controlsUserVisibilityDidChange):
1652         * Modules/modern-media-controls/media/media-controller-support.js:
1653         (MediaControllerSupport.prototype.controlsUserVisibilityDidChange):
1654         * Modules/modern-media-controls/media/media-controller.js:
1655         (MediaController.prototype.mediaControlsVisibilityDidChange):
1656         (MediaController.prototype.mediaControlsFadedStateDidChange):
1657         (MediaController.prototype._controlsUserVisibilityDidChange):
1658
1659 2018-01-11  Antoine Quint  <graouts@apple.com>
1660
1661         [iOS] There should be no controls markup generated in fullscreen
1662         https://bugs.webkit.org/show_bug.cgi?id=181540
1663         <rdar://problem/35060379>
1664
1665         Reviewed by Eric Carlson.
1666
1667         We completely forgo the display of any content when fullscreen on iOS by setting the
1668         "visible" flag to "false" on the MediaControls, which will prevent any DOM content from
1669         being added.
1670
1671         * Modules/modern-media-controls/media/media-controller.js:
1672         (MediaController.prototype.handleEvent):
1673         (MediaController.prototype._updateiOSFullscreenProperties):
1674         (MediaController):
1675         (MediaController.prototype._updateSupportingObjectsEnabledState): Deleted.
1676
1677 2018-01-11  Alex Christensen  <achristensen@webkit.org>
1678
1679         Revert changes accidentally committed with r226789.
1680         https://bugs.webkit.org/show_bug.cgi?id=181423
1681
1682         I had some local changes I did not mean to commit.
1683
1684         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1685         (scheduledWithCustomRunLoopMode):
1686         (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
1687         (WebCore::if): Deleted.
1688         (WebCore::>::fromCallable): Deleted.
1689
1690 2018-01-10  Simon Fraser  <simon.fraser@apple.com>
1691
1692         On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
1693         https://bugs.webkit.org/show_bug.cgi?id=181511
1694         rdar://problem/33741427
1695
1696         Reviewed by Zalan Bujtas.
1697         
1698         When reverting "client coordinates are relative to layout viewport" in r219829
1699         I broke documentToClientOffset() on macOS by failing to take pinch zoom scale into
1700         account (frameScaleFactor() is always 1 on iOs, so this bug doesn't manifest there).
1701
1702         Covered by existing tests.
1703
1704         * page/FrameView.cpp:
1705         (WebCore::FrameView::documentToClientOffset const):
1706
1707 2018-01-11  Youenn Fablet  <youenn@apple.com>
1708
1709         Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
1710         https://bugs.webkit.org/show_bug.cgi?id=181480
1711
1712         Reviewed by Eric Carlson.
1713
1714         No change of behavior.
1715
1716         * page/RuntimeEnabledFeatures.h: Set default value to false.
1717
1718 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1719
1720         [Attachment Support] Support moving attachment elements in editable areas using drag and drop
1721         https://bugs.webkit.org/show_bug.cgi?id=181337
1722         <rdar://problem/36324813>
1723
1724         Reviewed by Tim Horton.
1725
1726         Makes slight adjustments to attachment-specific drag and drop logic to ensure that moving attachments via drag
1727         and drop behaves correctly. See per-change comments for more detail.
1728
1729         Tests:  WKAttachmentTests.DragInPlaceVideoAttachmentElement
1730                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
1731                 WKAttachmentTests.MoveInPlaceAttachmentElementByDragging
1732
1733         * editing/cocoa/EditorCocoa.mm:
1734         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
1735
1736         Stop vending the private web archive pasteboard type for attachments, for now. This works around issues where an
1737         attachment element that is dragged and dropped within the same page may lose its blob backing data if we try to
1738         remove and insert it as a fragment from the archive. Providing a web archive would allow us to avoid destroying
1739         and recreating an attachment element when dragging within the same page, but this is a nice-to-have optimization
1740         we can re-enable after investigation in a subsequent patch.
1741
1742         * html/HTMLAttachmentElement.cpp:
1743         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
1744
1745         Add `draggable=false` to the image element of an in-place attachment element.
1746
1747         * page/DragController.cpp:
1748         (WebCore::enclosingAttachmentElement):
1749         (WebCore::DragController::draggableElement const):
1750
1751         Tweak single-selected-attachment handling to account for in-place attachments. Since the hit-tested node is
1752         inside the shadow subtree of the attachment element, the condition needs to check for the startElement as well
1753         as the startElement's shadow host.
1754
1755         (WebCore::DragController::startDrag):
1756
1757         Make two tweaks here. First, don't require a RenderAttachment to drag an attachment element (this is required
1758         for dragging in-place attachments). This was added in r217083 to address <rdar://problem/32282831>, but is no
1759         longer correct, since attachments may now be displayed in-place.
1760
1761         Secondly, only restore the previous selection if the attachment is in a richly contenteditable area. This was
1762         added to prevent the selection highlight from appearing in when dragging non-editable attachment elements in the
1763         Mail viewer. However, to allow drag moves to occur, we need the selection to persist after drag start.
1764
1765 2018-01-04  Filip Pizlo  <fpizlo@apple.com>
1766
1767         CodeBlocks should be in IsoSubspaces
1768         https://bugs.webkit.org/show_bug.cgi?id=180884
1769
1770         Reviewed by Saam Barati.
1771
1772         No new tests because no new behavior.
1773         
1774         Adopting new parallel constraint API, so that more of the logic of doing parallel
1775         constraint solving is shared between the DOM's output constraints and JSC's output
1776         constraints.
1777
1778         * bindings/js/DOMGCOutputConstraint.cpp:
1779         (WebCore::DOMGCOutputConstraint::executeImpl):
1780         (WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
1781         (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
1782         * bindings/js/DOMGCOutputConstraint.h:
1783
1784 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1785
1786         [Attachment Support] Support dragging attachment elements out as files on iOS
1787         https://bugs.webkit.org/show_bug.cgi?id=181199
1788         <rdar://problem/36299316>
1789
1790         Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
1791
1792         Adds support for dragging "files" (i.e. creating item providers with preferred attachment presentation styles)
1793         from attachment elements on iOS for Mail. See below for more detail.
1794
1795         Tests:  WKAttachmentTestsIOS.DragAttachmentInsertedAsData
1796                 WKAttachmentTestsIOS.DragAttachmentInsertedAsFile
1797
1798         * page/DragController.cpp:
1799         (WebCore::DragController::platformContentTypeForBlobType const):
1800         (WebCore::DragController::dragAttachmentElement):
1801         * page/DragController.h:
1802         * page/mac/DragControllerMac.mm:
1803         (WebCore::DragController::platformContentTypeForBlobType const):
1804
1805         Add a private method to convert the type of a promised blob to a platform type. For Cocoa platforms, this
1806         converts the blob type (either a UTI or a MIME type) to a UTI for the platform to consume.
1807
1808         * platform/ios/WebItemProviderPasteboard.h:
1809         * platform/ios/WebItemProviderPasteboard.mm:
1810
1811         Refactor WebItemProviderRegistrationInfo. WebItemProviderRegistrationInfo currently encapsulates a single item
1812         provider registration call, and contains either a type identifier and data buffer, or an NSItemProviderWriting-
1813         conformant object. To register an item provider using a WebItemProviderRegistrationInfo, the item provider
1814         pasteboard currently checks to see whether the info contains an object or a type and data.
1815
1816         This patch removes WebItemProviderRegistrationInfo and replaces it with WebItemProviderDataRegistrar. Objects
1817         that implement this protocol know how to take an NSItemProvider and register data to it. So far, there are
1818         three implementations below.
1819
1820         (-[WebItemProviderDataRegistrar initWithData:type:]):
1821         (-[WebItemProviderDataRegistrar typeIdentifier]):
1822         (-[WebItemProviderDataRegistrar data]):
1823         (-[WebItemProviderDataRegistrar typeIdentifierForClient]):
1824         (-[WebItemProviderDataRegistrar dataForClient]):
1825         (-[WebItemProviderDataRegistrar registerItemProvider:]):
1826         (-[WebItemProviderDataRegistrar description]):
1827
1828         A data registrar takes a UTI and data buffer, and registers the UTI to the data. This replaces a
1829         WebItemProviderRegistrationInfo with both a type and data, but no representing object.
1830
1831         (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
1832         (-[WebItemProviderWritableObjectRegistrar representingObjectForClient]):
1833         (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
1834         (-[WebItemProviderWritableObjectRegistrar description]):
1835
1836         The writable object registrar writes an NSItemProviderWriting-conformant object to an item provider. This
1837         replaces a WebItemProviderRegistrationInfo with only a representing object.
1838
1839         (-[WebItemProviderPromisedFileRegistrar initWithType:callback:]):
1840         (-[WebItemProviderPromisedFileRegistrar registerItemProvider:]):
1841         (-[WebItemProviderPromisedFileRegistrar description]):
1842         (-[WebItemProviderRegistrationInfoList addData:forType:]):
1843         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1844         (-[WebItemProviderRegistrationInfoList addPromisedType:fileCallback:]):
1845
1846         Helper methods to add new registrars to a registration info list.
1847
1848         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
1849         (-[WebItemProviderRegistrationInfoList enumerateItems:]):
1850         (-[WebItemProviderRegistrationInfoList itemProvider]):
1851         (-[WebItemProviderRegistrationInfoList description]):
1852         (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]): Deleted.
1853         (-[WebItemProviderRegistrationInfo representingObject]): Deleted.
1854         (-[WebItemProviderRegistrationInfo typeIdentifier]): Deleted.
1855
1856 2018-01-11  Michael Saboff  <msaboff@apple.com>
1857
1858         Add a DOM gadget for Spectre testing
1859         https://bugs.webkit.org/show_bug.cgi?id=181351
1860
1861         Reviewed by Ryosuke Niwa.
1862
1863         This change is used to test Spectre mitigations.
1864
1865         Added a new DOM class to test for Spectre issues in the DOM layer.
1866         This additional functionality is disabled by default and must be enabled
1867         through the JSC option "enableSpectreGadgets".
1868
1869         * CMakeLists.txt:
1870         * DerivedSources.make:
1871         * Sources.txt:
1872         * WebCore.xcodeproj/project.pbxproj:
1873         * bindings/js/WebCoreBuiltinNames.h:
1874         * dom/SpectreGadget.cpp: Added.
1875         (WebCore::SpectreGadget::SpectreGadget):
1876         (WebCore::SpectreGadget::create):
1877         (WebCore::SpectreGadget::setReadLength):
1878         (WebCore::SpectreGadget::charCodeAt):
1879         (WebCore::SpectreGadget::clflushReadLength):
1880         * dom/SpectreGadget.h: Added.
1881         * dom/SpectreGadget.idl: Added.
1882         * page/RuntimeEnabledFeatures.cpp:
1883         (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
1884         * page/RuntimeEnabledFeatures.h:
1885
1886 2018-01-11  Philippe Normand  <pnormand@igalia.com>
1887
1888         [GTK] media/muted-video-is-playing-audio.html is timing out
1889         https://bugs.webkit.org/show_bug.cgi?id=163781
1890
1891         Reviewed by Carlos Garcia Campos.
1892
1893         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1894         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Sprinkle some debugging.
1895         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
1896         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1897         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Ditto.
1898
1899 2018-01-10  Andy Estes  <aestes@apple.com>
1900
1901         [Payment Request] Rename ApplePayMerchantValidationEvent to MerchantValidationEvent
1902         https://bugs.webkit.org/show_bug.cgi?id=181437
1903         <rdar://problem/36376481>
1904
1905         Reviewed by Tim Horton.
1906         
1907         Renamed ApplePayMerchantValidationEvent to MerchantValidationEvent and changed complete() to accept a Promise.
1908
1909         Test: http/tests/paymentrequest/payment-request-merchant-validation.https.html
1910
1911         * DerivedSources.make:
1912         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1913         (WebCore::ApplePayPaymentHandler::merchantValidationCompleted):
1914         (WebCore::ApplePayPaymentHandler::validateMerchant):
1915         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1916         * Modules/paymentrequest/MerchantValidationEvent.cpp: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp.
1917         (WebCore::MerchantValidationEvent::create):
1918         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
1919         (WebCore::MerchantValidationEvent::eventInterface const):
1920         (WebCore::MerchantValidationEvent::complete):
1921         * Modules/paymentrequest/MerchantValidationEvent.h: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h.
1922         * Modules/paymentrequest/MerchantValidationEvent.idl: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl.
1923         * Modules/paymentrequest/PaymentHandler.h:
1924         * Modules/paymentrequest/PaymentRequest.cpp:
1925         (WebCore::PaymentRequest::completeMerchantValidation):
1926         * Modules/paymentrequest/PaymentRequest.h:
1927         * Modules/paymentrequest/PaymentRequest.idl:
1928         * WebCore.xcodeproj/project.pbxproj:
1929         * dom/EventNames.h:
1930         * dom/EventNames.in:
1931
1932 2018-01-10  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1933
1934         [Curl] Cross-protocol, cross-site scripting (XPXSS) using HTML forms
1935         Nhttps://bugs.webkit.org/show_bug.cgi?id=153088
1936
1937         Reviewed by Alex Christensen.
1938
1939         No new tests because it's covered by existing tests.
1940
1941         * platform/network/curl/CurlContext.cpp:
1942         (WebCore::CurlHandle::getHttpVersion):
1943         * platform/network/curl/CurlContext.h:
1944         * platform/network/curl/CurlRequest.cpp:
1945         (WebCore::CurlRequest::didReceiveHeader):
1946         * platform/network/curl/CurlResponse.h:
1947         (WebCore::CurlResponse::isolatedCopy const):
1948         * platform/network/curl/ResourceResponseCurl.cpp:
1949         (WebCore::ResourceResponse::ResourceResponse):
1950         (WebCore::ResourceResponse::setStatusLine):
1951
1952 2018-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1953
1954         REGRESSION(r222507): Composition highlight doesn't render when using IME
1955         https://bugs.webkit.org/show_bug.cgi?id=181485
1956         <rdar://problem/35896516>
1957
1958         Reviewed by Ryosuke Niwa.
1959
1960         Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.
1961
1962         Test: editing/marked-text-appearance.html
1963
1964         * rendering/InlineTextBox.cpp:
1965         (WebCore::InlineTextBox::paintCompositionBackground):
1966
1967 2018-01-10  Youenn Fablet  <youenn@apple.com>
1968
1969         Use no-cache fetch mode when loading main documents with location.reload()
1970         https://bugs.webkit.org/show_bug.cgi?id=181285
1971
1972         Reviewed by Alex Christensen.
1973
1974         Covered by rebased tests.
1975
1976         Start to translate cache policy used for navigation as FetchOptions::Cache.
1977         This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
1978         To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
1979
1980         For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
1981         as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
1982         Keep reload mode for ReloadFromOrigin.
1983
1984         * loader/DocumentLoader.cpp:
1985         (WebCore::toFetchOptionsCache):
1986         (WebCore::DocumentLoader::loadMainResource):
1987         * loader/FrameLoader.cpp:
1988         (WebCore::FrameLoader::loadFrameRequest):
1989         (WebCore::FrameLoader::loadURL):
1990         (WebCore::FrameLoader::load):
1991         (WebCore::FrameLoader::reload):
1992         (WebCore::FrameLoader::defaultRequestCachingPolicy):
1993         (WebCore::FrameLoader::loadDifferentDocumentItem):
1994         * loader/NavigationScheduler.cpp:
1995
1996 2018-01-10  Commit Queue  <commit-queue@webkit.org>
1997
1998         Unreviewed, rolling out r226667 and r226673.
1999         https://bugs.webkit.org/show_bug.cgi?id=181488
2000
2001         This caused a flaky crash. (Requested by mlewis13 on #webkit).
2002
2003         Reverted changesets:
2004
2005         "CodeBlocks should be in IsoSubspaces"
2006         https://bugs.webkit.org/show_bug.cgi?id=180884
2007         https://trac.webkit.org/changeset/226667
2008
2009         "REGRESSION (r226667): CodeBlocks should be in IsoSubspaces"
2010         https://bugs.webkit.org/show_bug.cgi?id=180884
2011         https://trac.webkit.org/changeset/226673
2012
2013 2018-01-10  Antti Koivisto  <antti@apple.com>
2014
2015         REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
2016         https://bugs.webkit.org/show_bug.cgi?id=181460
2017         <rdar://problem/36379776>
2018
2019         Reviewed by Ryosuke Niwa.
2020
2021         * css/parser/CSSParser.cpp:
2022         (WebCore::CSSParserContext::CSSParserContext):
2023
2024         Don't do the expensive security origin test if the sheet base URL and document URL are identical.
2025         This is true for inline style and inline stylesheets.
2026
2027 2018-01-10  Antti Koivisto  <antti@apple.com>
2028
2029         Try to fix windows build.
2030
2031         * css/RuleFeature.cpp:
2032         (WebCore::RuleFeatureSet::computeNextMatchElement):
2033
2034 2018-01-10  Zalan Bujtas  <zalan@apple.com>
2035
2036         [RenderTreeBuilder] Move RenderRuby's moveChildren logic to RenderTreeBuilder
2037         https://bugs.webkit.org/show_bug.cgi?id=181470
2038         <rdar://problem/36397683>
2039
2040         Reviewed by Antti Koivisto.
2041
2042         This is about moving code, no cleanup and/or normalization (unfortunately it also means
2043         some temporary changes).  
2044
2045         No change in functionality.
2046
2047         * rendering/RenderBlockFlow.h:
2048         * rendering/RenderRubyBase.cpp:
2049         (WebCore::RenderRubyBase::moveChildren): Deleted.
2050         (WebCore::RenderRubyBase::mergeChildrenWithBase): Deleted.
2051         (WebCore::RenderRubyBase::moveInlineChildren): Deleted.
2052         (WebCore::RenderRubyBase::moveBlockChildren): Deleted.
2053         * rendering/RenderRubyBase.h:
2054         * rendering/RenderRubyRun.cpp:
2055         (WebCore::RenderRubyRun::takeChild):
2056         * rendering/updating/RenderTreeBuilder.cpp:
2057         (WebCore::RenderTreeBuilder::moveRubyChildren):
2058         * rendering/updating/RenderTreeBuilder.h:
2059         * rendering/updating/RenderTreeBuilderRuby.cpp:
2060         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
2061         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2062         (WebCore::RenderTreeBuilder::Ruby::moveChildren):
2063         (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
2064         (WebCore::RenderTreeBuilder::Ruby::insertChild):
2065         * rendering/updating/RenderTreeBuilderRuby.h:
2066
2067 2018-01-10  Philippe Normand  <pnormand@igalia.com>
2068
2069         [GStreamer] fix critical GObject warning
2070
2071         Rubber-stamped by Carlos Garcia Campos.
2072
2073         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2074         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): No need to
2075         resort to complicated things to get the element name...
2076
2077 2018-01-10  Philippe Normand  <pnormand@igalia.com>
2078
2079         [GStreamer] REGRESSION(r226629): broke media/video-interruption-with-resume-allowing-play.html
2080         https://bugs.webkit.org/show_bug.cgi?id=181471
2081         <rdar://problem/36402323>
2082
2083         Reviewed by Carlos Garcia Campos.
2084
2085         This patch mainly reduces the amount of playback state changes
2086         emitted by the GStreamer player to its client. Emitting those
2087         notifications too often has bad side effects.
2088
2089         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2090         (WebCore::MediaPlayerPrivateGStreamer::paused const): Add debug messages.
2091         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): This debug message appears too much. Demote.
2092         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const): Ditto.
2093         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const): Ditto.
2094         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Try to emit
2095         playback state change notification only when going to PLAYING.
2096         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed): Add warning message.
2097
2098 2018-01-10  Youenn Fablet  <youenn@apple.com>
2099
2100         Add Service Worker CSP persistency
2101         https://bugs.webkit.org/show_bug.cgi?id=181434
2102
2103         Reviewed by Alex Christensen.
2104
2105         Covered by manual testing.
2106         Future work on service worker test infrastructure should allow automating such tests.
2107
2108         Add support for service worker CSP data persistency.
2109         Add a version parameter to increment each time the schema is changing.
2110         This allows the same store to be used by multiple WebKits.
2111
2112         * workers/service/server/RegistrationDatabase.cpp:
2113         (WebCore::v1RecordsTableSchema):
2114         (WebCore::RegistrationDatabase::openSQLiteDatabase):
2115         (WebCore::RegistrationDatabase::doPushChanges):
2116         (WebCore::RegistrationDatabase::importRecords):
2117
2118 2018-01-10  Antti Koivisto  <antti@apple.com>
2119
2120         Invalidate current element style on class change accurately
2121         https://bugs.webkit.org/show_bug.cgi?id=181210
2122
2123         Reviewed by Zalan Bujtas.
2124
2125         * css/DocumentRuleSets.cpp:
2126         (WebCore::DocumentRuleSets::collectFeatures const):
2127         (WebCore::DocumentRuleSets::subjectClassRules const):
2128
2129             New rule set containing class rules affecting the subject element.
2130
2131         (WebCore::DocumentRuleSets::ancestorClassRules const):
2132         * css/DocumentRuleSets.h:
2133         * css/RuleFeature.cpp:
2134         (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
2135
2136             Classify selector components into various buckets based on the elements they match relative to
2137             the subject element. There are more categories than this patch strictly needs, for future use.
2138
2139         (WebCore::RuleFeatureSet::collectFeatures):
2140         (WebCore::RuleFeatureSet::add):
2141         (WebCore::RuleFeatureSet::clear):
2142         (WebCore::RuleFeatureSet::shrinkToFit):
2143         * css/RuleFeature.h:
2144         * css/StyleResolver.h:
2145         (WebCore::StyleResolver::hasSelectorForClass const): Deleted.
2146         * style/ClassChangeInvalidation.cpp:
2147         (WebCore::Style::elementNeedsInvalidation):
2148         (WebCore::Style::ClassChangeInvalidation::computeInvalidation):
2149
2150             Don't invalidate current element unconditionally on class change. Instead find the subject rulesets
2151             that might affect it use them to perform invalidation.
2152
2153         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
2154         (WebCore::Style::ClassChangeInvalidation::invalidateStyle): Deleted.
2155         (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle): Deleted.
2156         * style/ClassChangeInvalidation.h:
2157         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
2158         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
2159         * style/StyleSharingResolver.cpp:
2160         (WebCore::Style::SharingResolver::classNamesAffectedByRules const):
2161
2162 2018-01-09  Antoine Quint  <graouts@apple.com>
2163
2164         [Web Animations] Expose the id property on Animation
2165         https://bugs.webkit.org/show_bug.cgi?id=181450
2166         <rdar://problem/36383600>
2167
2168         Reviewed by Dean Jackson.
2169
2170         Expose the "id" property on Animation and handle the "id" property on the optional KeyframeAnimationOptions object
2171         passed to Element.animate(). All of the WPT tests related to this property are now passing.
2172
2173         * animation/WebAnimation.h:
2174         * animation/WebAnimation.idl:
2175         * dom/Element.cpp:
2176         (WebCore::Element::animate):
2177
2178 2018-01-09  Chris Dumez  <cdumez@apple.com>
2179
2180         Make service workers behave correctly with regards to Page Cache
2181         https://bugs.webkit.org/show_bug.cgi?id=181446
2182         <rdar://problem/36164291>
2183
2184         Reviewed by Youenn Fablet.
2185
2186         Make service workers behave correctly with regards to Page Cache:
2187         1. If a document has an active service worker, do not let it go into PageCache
2188         2. When a document goes into page cache, unregister it from the list of service worker clients
2189         3. When a document is restored from page cache, add it nack to the list of service worker clients
2190
2191         Tests: http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html
2192                http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html
2193                http/tests/workers/service/no-page-cache-when-controlled.html
2194                http/tests/workers/service/other_resources/test.html
2195
2196         * dom/Document.cpp:
2197         (WebCore::Document::suspend):
2198         (WebCore::Document::resume):
2199         * history/PageCache.cpp:
2200         (WebCore::canCacheFrame):
2201         * page/DiagnosticLoggingKeys.cpp:
2202         (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
2203         * page/DiagnosticLoggingKeys.h:
2204
2205 2018-01-09  Chris Dumez  <cdumez@apple.com>
2206
2207         We should not return undefined for most properties of a detached Window
2208         https://bugs.webkit.org/show_bug.cgi?id=181416
2209         <rdar://problem/36162489>
2210
2211         Reviewed by Ryosuke Niwa.
2212
2213         We should not return undefined for most properties on a detached Window. WebKit previously only exposed "closed"
2214         and "close" properties on detached / frameless windows. However, this does not match the HTML specification [1]
2215         or the behavior of Firefox and Chrome.
2216
2217         Note that Chrome does not seem to fully follow the HTML specification either, it seems to treat detached windows
2218         the same way as cross-origin ones. As a result, it only exposed properties that are visible cross-origin when
2219         a window is detached / frameless.
2220
2221         [1] https://html.spec.whatwg.org/#windowproxy-get
2222
2223         No new tests, updated existingt tests.
2224
2225         * bindings/js/JSDOMWindowCustom.cpp:
2226         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2227         (WebCore::JSDOMWindow::getOwnPropertySlot):
2228         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2229
2230 2018-01-09  Darin Adler  <darin@apple.com>
2231
2232         Further refinement to list item and counter code after "list-item" counter fix
2233         https://bugs.webkit.org/show_bug.cgi?id=181426
2234
2235         Reviewed by Zalan Bujtas.
2236
2237         * css/StyleBuilderCustom.h:
2238         (WebCore::StyleBuilderCustom::applyInheritCounter): Use auto.
2239         (WebCore::StyleBuilderCustom::applyValueCounter): Use auto, removed unneeded
2240         null checks for things that can never be null, moved the saturated addition
2241         here and got rid of the addIncrementValue function from CounterDirectives.
2242         Use the saturatedAddition function from SaturatedArithmetic.h instead of the
2243         much less efficient one that did the same thing, CounterDirectives::addClamped.
2244
2245         * rendering/RenderCounter.cpp:
2246         (WebCore::listItemCounterDirectives): Use aggregate syntax for the return
2247         statements.
2248         (WebCore::planCounter): Changed to use a struct return value instead of two
2249         out arguments. Use the saturatedAddition function from SaturatedArithmetic.h
2250         instead of the much less efficient one that did the same thing,
2251         CounterDirectives::addClamped.
2252         (WebCore::findPlaceForCounter): Changed to use a struct return value instead
2253         of two out arguments.
2254         (WebCore::makeCounterNode): Updated for the above changes. Changed code to
2255         use add instead of both get and set. Updated to keep the counter maps inside
2256         the values of the "map of maps" instead of using a unique_ptr and allocating
2257         each one on the heap.
2258         (WebCore::destroyCounterNodeWithoutMapRemoval): Changed argument to a reference
2259         instead of a pointer. Updated for changes to the map. Use RefPtr more
2260         consistently.
2261         (WebCore::RenderCounter::destroyCounterNodes): Use iterators less.
2262         (WebCore::RenderCounter::destroyCounterNode): Ditto.
2263         (WebCore::RenderCounter::rendererRemovedFromTree): Add a check of
2264         hasCounterNodeMap here before calling destroyCounterNodes, so that function
2265         can assume the flag is true (both other callers already check it).
2266         (WebCore::updateCounters): Use auto and update for changes above.
2267         (WebCore::RenderCounter::rendererStyleChanged): Use modern for loops instead
2268         of iterators.
2269         (showCounterRendererTree): Use auto and udpate for changes above.
2270
2271         * rendering/RenderListItem.cpp:
2272         (WebCore::enclosingList): Stop referring to elements as "nodes". Changed
2273         the local variable names for clarity.
2274         (WebCore::nextListItemHelper): Renamed from nextListItem since it's not
2275         intended to be called directly and we want to use a function pointer to
2276         nextListItem. Fixed the algorithm to correctly handle ad hoc "lists" that
2277         are not actually HTML list elements, using the definition in the enclosingList
2278         function as the previousListItem function already did.
2279         (WebCore::nextListItem): Updated for name changes.
2280         (WebCore::firstListItem): Renamed from nextListItem for clarity.
2281         (WebCore::previousListItem): Rewrote loop so it doesn't have to do things
2282         so strangely when we find another list.
2283         (WebCore::RenderListItem::updateItemValuesForOrderedList): Use auto and
2284         update local variable names.
2285         (WebCore::RenderListItem::itemCountForOrderedList): Ditto.
2286         (WebCore::RenderListItem::updateValueNow const): Rewrote to use an iterative
2287         algorithm instead of a recursive one. Fixes the FIXME here.
2288         (WebCore::RenderListItem::updateValue): Use m_valueWasSetExplicitly
2289         instead of m_explicitValue.
2290         (WebCore::RenderListItem::explicitValueChanged): Use auto and simplified
2291         the loop a bit.
2292         (WebCore::RenderListItem::setExplicitValue): Set m_valueWasSetExplicitly
2293         instead of m_explicitValue.
2294         (WebCore::previousOrNextItem): Deleted.
2295         (WebCore::RenderListItem::updateListMarkerNumbers): Streamlined the loop
2296         a bit and used a fucntion pointer to handle the two different directions.
2297         (WebCore::RenderListItem::isInReversedOrderedList const): Simplified by
2298         getting rid of an unneeded use of pointers and local variables.
2299
2300         * rendering/RenderListItem.h: Use a boolean, m_valueWasSetExplicitly,
2301         instead of a separate optional m_explicitValue.
2302
2303         * rendering/style/CounterDirectives.h: Since all the code in this file was
2304         rewritten, removed old copyrights. Deleted the addIncrementValue function,
2305         since it is clear enough in the one call site in the style builder.
2306         Deleted the addClamped function because it was just a much slower
2307         version of the saturatedAddition function. Made == and != into constexpr
2308         functions since they are simple enough to be.
2309
2310         * rendering/style/RenderStyle.cpp:
2311         (WebCore::RenderStyle::getCounterDirectives const): Deleted. Caller can
2312         handle this just fine without a helper function.
2313         * rendering/style/RenderStyle.h: Ditto.
2314
2315 2018-01-09  Myles C. Maxfield  <mmaxfield@apple.com>
2316
2317         font-display:fallback can cause a visual flash (which is supposed to be impossible)
2318         https://bugs.webkit.org/show_bug.cgi?id=181374
2319
2320         Reviewed by Simon Fraser.
2321
2322         A FontCascade represents an entire font-family fallback list, but sometimes we need to pull out a single
2323         representative font from the list to calculate things like line height. Previously, if the first item in
2324         the font-family list was in the middle of being downloaded, this representative font was hardcoded to be
2325         Times. However, when actually laying out and drawing the glyphs, we have logic to skip the interstitial
2326         Times if there are any installed fonts present in the font-family list (so you wouldn't ever actually
2327         see Times). This means that line height (among other things) was being calculated as if Times was used,
2328         but in reality, some other font from the font-family list was being used.
2329
2330         Alone, this isn't a huge problem, but font-display:fallback makes a font transition between "timed out"
2331         and "failed," and when the font hits the failed state, the representative font skips over the cancelled
2332         item and hits the next item in the fallback list. This means that line heights will change, which causes
2333         a visual flash, even when font-display:fallback is specified.
2334
2335         The solution is simply to educate the logic which identifies this representative font so that it
2336         understands what to do for currently-loading fonts.
2337
2338         Tests: fast/text/font-display/swap-flash.html
2339
2340         * platform/graphics/FontCascadeFonts.h:
2341         (WebCore::FontCascadeFonts::primaryFont):
2342         * rendering/line/BreakingContext.h:
2343         (WebCore::textWidth):
2344
2345 2018-01-04  Filip Pizlo  <fpizlo@apple.com>
2346
2347         CodeBlocks should be in IsoSubspaces
2348         https://bugs.webkit.org/show_bug.cgi?id=180884
2349
2350         Reviewed by Saam Barati.
2351
2352         No new tests because no new behavior.
2353         
2354         Adopting new parallel constraint API, so that more of the logic of doing parallel
2355         constraint solving is shared between the DOM's output constraints and JSC's output
2356         constraints.
2357
2358         * bindings/js/DOMGCOutputConstraint.cpp:
2359         (WebCore::DOMGCOutputConstraint::executeImpl):
2360         (WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
2361         (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
2362         * bindings/js/DOMGCOutputConstraint.h:
2363
2364 2018-01-08  Simon Fraser  <simon.fraser@apple.com>
2365
2366         Clean up Marquee-related enums
2367         https://bugs.webkit.org/show_bug.cgi?id=181347
2368
2369         Reviewed by Anders Carlsson.
2370
2371         Modernize EMarqueeBehavior and EMarqueeDirection enums. Stop using the weird negative
2372         values in the MarqueeDirection and do manual reverse direction mapping.
2373
2374         Make some member functions of RenderMarquee private.
2375
2376         Stop using bitfields in RenderMarquee because the memory saving is not worth it, and doing so
2377         allows us to use modern initialization.
2378
2379         No behavior change.
2380
2381         * css/CSSPrimitiveValueMappings.h:
2382         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2383         (WebCore::CSSPrimitiveValue::operator MarqueeBehavior const):
2384         (WebCore::CSSPrimitiveValue::operator MarqueeDirection const):
2385         (WebCore::CSSPrimitiveValue::operator EMarqueeBehavior const): Deleted.
2386         (WebCore::CSSPrimitiveValue::operator EMarqueeDirection const): Deleted.
2387         * css/StyleResolver.cpp:
2388         (WebCore::StyleResolver::adjustRenderStyle):
2389         * rendering/RenderBox.cpp:
2390         (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
2391         * rendering/RenderLayer.cpp:
2392         (WebCore::RenderLayer::calculateClipRects const):
2393         * rendering/RenderMarquee.cpp:
2394         (WebCore::RenderMarquee::RenderMarquee):
2395         (WebCore::reverseDirection):
2396         (WebCore::RenderMarquee::direction const):
2397         (WebCore::RenderMarquee::isHorizontal const):
2398         (WebCore::RenderMarquee::computePosition):
2399         (WebCore::RenderMarquee::start):
2400         (WebCore::RenderMarquee::updateMarqueePosition):
2401         (WebCore::RenderMarquee::updateMarqueeStyle):
2402         (WebCore::RenderMarquee::timerFired):
2403         * rendering/RenderMarquee.h:
2404         * rendering/style/RenderStyle.h:
2405         (WebCore::RenderStyle::marqueeBehavior const):
2406         (WebCore::RenderStyle::marqueeDirection const):
2407         (WebCore::RenderStyle::setMarqueeDirection):
2408         (WebCore::RenderStyle::setMarqueeBehavior):
2409         (WebCore::RenderStyle::initialMarqueeBehavior):
2410         (WebCore::RenderStyle::initialMarqueeDirection):
2411         * rendering/style/RenderStyleConstants.h:
2412         * rendering/style/StyleMarqueeData.cpp:
2413         (WebCore::StyleMarqueeData::StyleMarqueeData):
2414         * rendering/style/StyleMarqueeData.h:
2415
2416 2018-01-09  Jer Noble  <jer.noble@apple.com>
2417
2418         Many CVDisplayLink threads created and destroyed while watching a YouTube video
2419         https://bugs.webkit.org/show_bug.cgi?id=181396
2420
2421         Reviewed by Simon Fraser.
2422
2423         When watching some YouTube videos (or any video with default controls), event handlers for
2424         the "timeupdate" event which use rAF will cause the underlying platform objects to be
2425         destroyed in between "timeupdate" events being fired, since they occur every 250ms, and rAF
2426         objects are destroyed every 166ms (or 10/60hz). Update this constant to destroy the
2427         underlying objects every 333ms (or 20/60hz) so that this common pattern doesn't lead to
2428         excessive rAF platform object turnover.
2429
2430         * platform/Logging.h:
2431         * platform/graphics/DisplayRefreshMonitor.h:
2432         (WebCore::DisplayRefreshMonitor::shouldBeTerminated const):
2433         * platform/graphics/DisplayRefreshMonitor.cpp:
2434         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
2435         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2436         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
2437         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2438
2439 2018-01-09  Zalan Bujtas  <zalan@apple.com>
2440
2441         [RenderTreeBuilder] Move RenderElement addChild mutation logic to RenderTreeBuilder
2442         https://bugs.webkit.org/show_bug.cgi?id=181451
2443         <rdar://problem/36385562>
2444
2445         Reviewed by Antti Koivisto.
2446
2447         This is about moving code, no cleanup and/or normalization (unfortunately it also means
2448         some temporary changes).  
2449
2450         No change in functionality.
2451
2452         * rendering/RenderElement.cpp:
2453         (WebCore::RenderElement::addChild):
2454         (WebCore::RenderElement::childRequiresTable const): Deleted.
2455         * rendering/RenderElement.h:
2456         * rendering/updating/RenderTreeBuilder.cpp:
2457         (WebCore::RenderTreeBuilder::insertChildToRenderElement):
2458         (WebCore::RenderTreeBuilder::childRequiresTable):
2459         * rendering/updating/RenderTreeBuilder.h:
2460         * rendering/updating/RenderTreeBuilderInline.cpp:
2461         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
2462         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
2463         (WebCore::RenderTreeBuilder::Inline::newChildIsInline):
2464         (WebCore::newChildIsInline): Deleted.
2465         * rendering/updating/RenderTreeBuilderInline.h:
2466
2467 2018-01-09  Matt Lewis  <jlewis3@apple.com>
2468
2469         Unreviewed, rolling out r226531.
2470
2471         This caused test failures on macOS WK2.
2472
2473         Reverted changeset:
2474
2475         "Use no-cache fetch mode when loading main documents with
2476         location.reload()"
2477         https://bugs.webkit.org/show_bug.cgi?id=181285
2478         https://trac.webkit.org/changeset/226531
2479
2480 2018-01-09  Michael Saboff  <msaboff@apple.com>
2481
2482         Unreviewed, rolling out r226600 and r226603
2483         https://bugs.webkit.org/show_bug.cgi?id=181351
2484
2485         Add a DOM gadget for Spectre testing
2486
2487         * dom/Comment.cpp:
2488         (WebCore::Comment::Comment):
2489         (WebCore::Comment::setReadLength): Deleted.
2490         (WebCore::Comment::charCodeAt): Deleted.
2491         (WebCore::Comment::clflushReadLength): Deleted.
2492         * dom/Comment.h:
2493         * dom/Comment.idl:
2494         * page/RuntimeEnabledFeatures.cpp:
2495         (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const): Deleted.
2496         * page/RuntimeEnabledFeatures.h:
2497
2498 2018-01-09  Don Olmstead  <don.olmstead@sony.com>
2499
2500         Add additional WEBCORE_EXPORTs
2501         https://bugs.webkit.org/show_bug.cgi?id=181414
2502
2503         Reviewed by Alex Christensen.
2504
2505         No new tests. No change in behavior.
2506
2507         * dom/Document.h:
2508         * dom/ViewportArguments.h:
2509         * page/DOMWindow.h:
2510         * page/FrameView.h:
2511         * page/PageOverlayController.h:
2512         * platform/ContextMenuItem.h:
2513         * platform/Pasteboard.h:
2514         * platform/SharedBuffer.h:
2515         * platform/UserAgent.h:
2516         * platform/graphics/GLContext.h:
2517         * platform/graphics/GraphicsContext.h:
2518         * platform/graphics/GraphicsLayerTransform.h:
2519         * platform/graphics/PlatformDisplay.h:
2520         * platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
2521         * platform/graphics/cairo/PlatformContextCairo.h:
2522         * platform/graphics/cairo/RefPtrCairo.h:
2523         * platform/graphics/nicosia/NicosiaBuffer.h:
2524         * platform/graphics/nicosia/NicosiaPaintingEngine.h:
2525         * platform/graphics/texmap/TextureMapper.h:
2526         * platform/graphics/texmap/TextureMapperAnimation.h:
2527         * platform/graphics/texmap/TextureMapperBackingStore.h:
2528         * platform/graphics/texmap/TextureMapperFPSCounter.h:
2529         * platform/graphics/texmap/TextureMapperLayer.h:
2530         (WebCore::TextureMapperLayer::TextureMapperLayer): Deleted.
2531         (WebCore::TextureMapperLayer::setID): Deleted.
2532         (WebCore::TextureMapperLayer::id): Deleted.
2533         (WebCore::TextureMapperLayer:: const): Deleted.
2534         (WebCore::TextureMapperLayer::setScrollClient): Deleted.
2535         (WebCore::TextureMapperLayer::setIsScrollable): Deleted.
2536         (WebCore::TextureMapperLayer::isScrollable const): Deleted.
2537         (WebCore::TextureMapperLayer::textureMapper const): Deleted.
2538         (WebCore::TextureMapperLayer::setTextureMapper): Deleted.
2539         (WebCore::TextureMapperLayer::drawsContent const): Deleted.
2540         (WebCore::TextureMapperLayer::contentsAreVisible const): Deleted.
2541         (WebCore::TextureMapperLayer::size const): Deleted.
2542         (WebCore::TextureMapperLayer::opacity const): Deleted.
2543         (WebCore::TextureMapperLayer::transform const): Deleted.
2544         (WebCore::TextureMapperLayer::hasFilters const): Deleted.
2545         (WebCore::TextureMapperLayer::isShowingRepaintCounter const): Deleted.
2546         (WebCore::TextureMapperLayer::fixedToViewport const): Deleted.
2547         (WebCore::TextureMapperLayer::rootLayer const): Deleted.
2548         (WebCore::TextureMapperLayer::texture): Deleted.
2549         (WebCore::TextureMapperLayer::adjustedPosition const): Deleted.
2550         (WebCore::TextureMapperLayer::layerRect const): Deleted.
2551         (WebCore::TextureMapperLayer::State::State): Deleted.
2552         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2553         * platform/graphics/texmap/TextureMapperTile.h:
2554         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2555         (WebCore::CoordinatedGraphicsLayer::isScrollable const): Deleted.
2556         (WebCore::CoordinatedGraphicsLayer::id const): Deleted.
2557         (WebCore::CoordinatedGraphicsLayer::coverRect const): Deleted.
2558         (WebCore::CoordinatedGraphicsLayer::fixedToViewport const): Deleted.
2559         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
2560         (WebCore::CoordinatedImageBacking::id const): Deleted.
2561         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2562         * platform/graphics/texmap/coordinated/UpdateAtlas.h:
2563         * platform/network/AuthenticationChallengeBase.h:
2564         * platform/network/CredentialBase.h:
2565         * platform/network/ProtectionSpaceBase.h:
2566         * platform/network/curl/SocketStreamHandleImpl.h:
2567         * replay/UserInputBridge.h:
2568
2569 2018-01-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2570
2571         [Curl] Move FormData related tasks into new CurlFormDataStream class.
2572         https://bugs.webkit.org/show_bug.cgi?id=181106
2573
2574         Reviewed by Alex Christensen.
2575
2576         No new tests because no behavior change.
2577
2578         * platform/Curl.cmake:
2579         * platform/network/curl/CurlFormDataStream.cpp: Added.
2580         (WebCore::CurlFormDataStream::CurlFormDataStream):
2581         (WebCore::CurlFormDataStream::~CurlFormDataStream):
2582         (WebCore::CurlFormDataStream::clean):
2583         (WebCore::CurlFormDataStream::shouldUseChunkTransfer):
2584         (WebCore::CurlFormDataStream::totalSize):
2585         (WebCore::CurlFormDataStream::computeContentLength):
2586         (WebCore::CurlFormDataStream::read):
2587         (WebCore::CurlFormDataStream::readFromFile):
2588         (WebCore::CurlFormDataStream::readFromData):
2589         * platform/network/curl/CurlFormDataStream.h: Renamed from Source/WebCore/platform/network/curl/FormDataStreamCurl.h.
2590         (WebCore::CurlFormDataStream::elementSize):
2591         (WebCore::CurlFormDataStream::totalReadSize):
2592         * platform/network/curl/CurlRequest.cpp:
2593         (WebCore::CurlRequest::CurlRequest):
2594         (WebCore::CurlRequest::willSendData):
2595         (WebCore::CurlRequest::finalizeTransfer):
2596         (WebCore::CurlRequest::setupPUT):
2597         (WebCore::CurlRequest::setupPOST):
2598         (WebCore::CurlRequest::setupSendData):
2599         (WebCore::CurlRequest::resolveBlobReferences): Deleted.
2600         (WebCore::CurlRequest::setupFormData): Deleted.
2601         * platform/network/curl/CurlRequest.h:
2602         * platform/network/curl/FormDataStreamCurl.cpp: Removed.
2603
2604 2018-01-09  Zalan Bujtas  <zalan@apple.com>
2605
2606         [RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
2607         https://bugs.webkit.org/show_bug.cgi?id=181443
2608         <rdar://problem/36380228>
2609
2610         Reviewed by Antti Koivisto.
2611
2612         This is about moving code, no cleanup and/or normalization (unfortunately it also means
2613         some temporary changes).  
2614
2615         No change in functionality.
2616
2617         * Sources.txt:
2618         * WebCore.xcodeproj/project.pbxproj:
2619         * rendering/mathml/RenderMathMLFenced.cpp:
2620         (WebCore::RenderMathMLFenced::addChild):
2621         (WebCore::RenderMathMLFenced::createMathMLOperator): Deleted.
2622         (WebCore::RenderMathMLFenced::makeFences): Deleted.
2623         * rendering/mathml/RenderMathMLFenced.h:
2624         * rendering/updating/RenderTreeBuilder.cpp:
2625         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
2626         (WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced):
2627         * rendering/updating/RenderTreeBuilder.h:
2628         (WebCore::RenderTreeBuilder::mathMLBuilder):
2629
2630 2018-01-09  Antti Koivisto  <antti@apple.com>
2631
2632         Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
2633         https://bugs.webkit.org/show_bug.cgi?id=180940
2634         <rdar://problem/36116507>
2635
2636         Reviewed by Darin Adler.
2637
2638         Test: http/tests/local/loading-stylesheet-import-remove.html
2639
2640         If a <link> referencing a stylesheet containing an @import that was still loading was removed
2641         from the document, the loading state was never cleared. For head stylesheets this blocked
2642         rendering permanently.
2643
2644         Test reduction by Justin Ridgewell.
2645
2646         * html/HTMLLinkElement.cpp:
2647         (WebCore::HTMLLinkElement::removedFromAncestor):
2648
2649         Test if the stylesheet it loading before clearing the pointer.
2650
2651 2018-01-09  Dan Bernstein  <mitz@apple.com>
2652
2653         Removed some empty directories that were left behind
2654
2655         * Modules/indieui: Removed.
2656         * Modules/vibration: Removed.
2657         * platform/graphics/ca/mac: Removed.
2658         * platform/mediastream/gstreamer: Removed.
2659
2660 2018-01-09  Antoine Quint  <graouts@apple.com>
2661
2662         Refactor timing function solving code
2663         https://bugs.webkit.org/show_bug.cgi?id=181428
2664
2665         Reviewed by Dean Jackson.
2666
2667         We have duplicated code to solve "cubic" and "steps" timing functions in AnimationBase and TextureMapperAnimation,
2668         and we will soon need similar code to deal with timing functions in Web Animations. We move this code into TimingFunction
2669         with a single transformTime() function that can be called directly on the timing function rather than having callers
2670         figure out what type timing functions are to solve them.
2671
2672         No test as there shouldn't be any behavior change.
2673
2674         * page/animation/AnimationBase.cpp:
2675         (WebCore::AnimationBase::progress const):
2676         (WebCore::solveEpsilon): Deleted.
2677         (WebCore::solveCubicBezierFunction): Deleted.
2678         (WebCore::solveStepsFunction): Deleted.
2679         (WebCore::solveSpringFunction): Deleted.
2680         * platform/animation/TimingFunction.cpp:
2681         (WebCore::TimingFunction::transformTime const):
2682         * platform/animation/TimingFunction.h:
2683         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2684         (WebCore::TextureMapperAnimation::apply):
2685         (WebCore::solveEpsilon): Deleted.
2686         (WebCore::solveCubicBezierFunction): Deleted.
2687         (WebCore::solveStepsFunction): Deleted.
2688         (WebCore::applyTimingFunction): Deleted.
2689
2690 2018-01-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2691
2692         Unreviewed, silence -Wunused-parameter warning
2693
2694         * testing/js/WebCoreTestSupport.cpp:
2695         (WebCoreTestSupport::setupNewlyCreatedServiceWorker):
2696
2697 2018-01-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2698
2699         Check Image::m_image is not null in ImageLoader::decode()
2700         https://bugs.webkit.org/show_bug.cgi?id=180386
2701         <rdar://problem/34634483>
2702
2703         Reviewed by Tim Horton.
2704
2705         Ensure ImageLoader::m_image is not null before referencing it.
2706
2707         * loader/ImageLoader.cpp:
2708         (WebCore::ImageLoader::decode):
2709
2710 2018-01-09  Yusuke Suzuki  <utatane.tea@gmail.com>
2711
2712         [FreeType] Use FastMalloc for FreeType
2713         https://bugs.webkit.org/show_bug.cgi?id=181387
2714
2715         Reviewed by Michael Catanzaro.
2716
2717         Add custom memory allocator for FreeType to use FastMalloc.
2718
2719         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2720         (WebCore::initializeFreeTypeLibrary):
2721         (WebCore::createFontCustomPlatformData):
2722
2723 2018-01-09  Zalan Bujtas  <zalan@apple.com>
2724
2725         [RenderTreeBuilder] Move RenderTable* addChild mutation logic to RenderTreeBuilder
2726         https://bugs.webkit.org/show_bug.cgi?id=181424
2727         <rdar://problem/36368628>
2728
2729         Reviewed by Antti Koivisto.
2730
2731         This is about moving code, no cleanup and/or normalization (unfortunately it also means
2732         some temporary changes).  
2733
2734         Covered by existing tests.
2735
2736         * rendering/RenderTable.cpp:
2737         (WebCore::RenderTable::addChild):
2738         * rendering/RenderTableRow.cpp:
2739         (WebCore::RenderTableRow::addChild):
2740         * rendering/RenderTableSection.cpp:
2741         (WebCore::RenderTableSection::addChild):
2742         * rendering/updating/RenderTreeBuilder.cpp:
2743         (WebCore::RenderTreeBuilder::insertChildToRenderTable):
2744         (WebCore::RenderTreeBuilder::insertChildToRenderTableSection):
2745         (WebCore::RenderTreeBuilder::insertChildToRenderTableRow):
2746         * rendering/updating/RenderTreeBuilder.h:
2747         * rendering/updating/RenderTreeBuilderTable.cpp:
2748         (WebCore::RenderTreeBuilder::Table::insertChild):
2749         * rendering/updating/RenderTreeBuilderTable.h:
2750
2751 2018-01-09  Zalan Bujtas  <zalan@apple.com>
2752
2753         [RenderTreeBuilder] Transition Render*::addChild() calls to RenderTreeBuilder::insertChildToRender*()
2754         https://bugs.webkit.org/show_bug.cgi?id=181407
2755         <rdar://problem/36361176>
2756
2757         Reviewed by Antti Koivisto.
2758
2759         Eventually all mutation will be going through the RenderTreeBuilder.
2760
2761         No change in functionality.
2762
2763         * rendering/RenderGrid.cpp:
2764         (WebCore::RenderGrid::addChild):
2765         * rendering/RenderMultiColumnFlow.cpp:
2766         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
2767         * rendering/RenderRubyRun.cpp:
2768         (WebCore::RenderRubyRun::rubyBaseSafe):
2769         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
2770         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
2771         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2772         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2773         * rendering/updating/RenderTreeBuilderRuby.cpp:
2774         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
2775
2776 2018-01-09  Philippe Normand  <pnormand@igalia.com>
2777
2778         [GStreamer] Ensure SleepDisabler is not held by pages in page cache
2779         https://bugs.webkit.org/show_bug.cgi?id=180197
2780
2781         Reviewed by Eric Carlson.
2782
2783         The sleep disabler is now checked again whenever the media player
2784         playback state or other characteristic has changed in the media
2785         engine.
2786
2787         * html/HTMLMediaElement.cpp:
2788         (WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
2789         Check if the sleep disabler state needs to be updated or not.
2790         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
2791         (WebCore::HTMLMediaElement::shouldDisableSleep const): Enable
2792         sleep disabler for GTK and WPE ports.
2793
2794 2018-01-09  Philippe Normand  <pnormand@igalia.com>
2795
2796         [GStreamer] Missing notifications to player client
2797         https://bugs.webkit.org/show_bug.cgi?id=181432
2798
2799         Reviewed by Carlos Garcia Campos.
2800
2801         We now properly emit playback state changes and characteristic
2802         updates to the client when the pipeline state changes and when
2803         audio/video tracks changes are detected.
2804
2805         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2806         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
2807         This debug message appears too often in logs. Demote.
2808         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): Ditto.
2809         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Emit
2810         charasteristicChanged notification.
2811         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
2812         (WebCore::MediaPlayerPrivateGStreamer::updateStates): Keep track
2813         of old and current pipeline state.
2814         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2815
2816
2817 2018-01-09  Youenn Fablet  <youenn@apple.com>
2818
2819         Add CSP support to service workers
2820         https://bugs.webkit.org/show_bug.cgi?id=181385
2821
2822         Reviewed by Chris Dumez.
2823
2824         Covered by rebased tests.
2825
2826         Added recovery of CSP information from WorkerScriptLoader.
2827         Added plumbing to pass the CSP information to Service Workers.
2828         Did not add persistency support for the CSP information as this requires changing the SQL database schema.
2829         This will be done in a follow-up.
2830
2831         * workers/WorkerScriptLoader.cpp:
2832         (WebCore::WorkerScriptLoader::loadAsynchronously):
2833         (WebCore::WorkerScriptLoader::didReceiveResponse):
2834         * workers/WorkerScriptLoader.h:
2835         (WebCore::WorkerScriptLoader::contentSecurityPolicy const):
2836         * workers/service/SWClientConnection.cpp:
2837         (WebCore::SWClientConnection::finishedFetchingScript):
2838         (WebCore::SWClientConnection::failedFetchingScript):
2839         * workers/service/SWClientConnection.h:
2840         * workers/service/ServiceWorkerContainer.cpp:
2841         (WebCore::ServiceWorkerContainer::addRegistration):
2842         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2843         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2844         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2845         * workers/service/ServiceWorkerContainer.h:
2846         * workers/service/ServiceWorkerContextData.cpp:
2847         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2848         * workers/service/ServiceWorkerContextData.h:
2849         (WebCore::ServiceWorkerContextData::encode const):
2850         (WebCore::ServiceWorkerContextData::decode):
2851         * workers/service/ServiceWorkerFetchResult.h:
2852         (WebCore::ServiceWorkerFetchResult::encode const):
2853         (WebCore::ServiceWorkerFetchResult::decode):
2854         * workers/service/ServiceWorkerGlobalScope.cpp:
2855         (WebCore::ServiceWorkerGlobalScope::create):
2856         * workers/service/ServiceWorkerGlobalScope.h:
2857         * workers/service/ServiceWorkerJob.cpp:
2858         (WebCore::ServiceWorkerJob::notifyFinished):
2859         * workers/service/ServiceWorkerJobClient.h:
2860         * workers/service/context/ServiceWorkerThread.cpp:
2861         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2862         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
2863         * workers/service/server/RegistrationDatabase.cpp:
2864         (WebCore::v1RecordsTableSchema):
2865         (WebCore::RegistrationDatabase::importRecords):
2866         * workers/service/server/SWServer.cpp:
2867         (WebCore::SWServer::updateWorker):
2868         (WebCore::SWServer::installContextData):
2869         * workers/service/server/SWServer.h:
2870         * workers/service/server/SWServerJobQueue.cpp:
2871         (WebCore::SWServerJobQueue::scriptFetchFinished):
2872         * workers/service/server/SWServerWorker.cpp:
2873         (WebCore::SWServerWorker::SWServerWorker):
2874         (WebCore::m_contentSecurityPolicy):
2875         (WebCore::SWServerWorker::contextData const):
2876         * workers/service/server/SWServerWorker.h:
2877
2878 2018-01-09  Antoine Quint  <graouts@apple.com>
2879
2880         Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
2881         https://bugs.webkit.org/show_bug.cgi?id=181429
2882
2883         Reviewed by Antti Koivisto.
2884
2885         The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
2886         animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
2887         as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
2888         values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
2889         towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
2890         ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.
2891
2892         No test as this is simply refactoring that doesn't change or add behavior.
2893
2894         * css/CSSComputedStyleDeclaration.cpp:
2895         (WebCore::ComputedStyleExtractor::propertyValue):
2896         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2897         * css/CSSComputedStyleDeclaration.h:
2898
2899 2018-01-09  Youenn Fablet  <youenn@apple.com>
2900
2901         SWClientConnection should not keep references to service worker jobs
2902         https://bugs.webkit.org/show_bug.cgi?id=181381
2903
2904         Reviewed by Chris Dumez.
2905
2906         Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
2907
2908         Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
2909         Instead pass job identifiers and related data to the main thread.
2910
2911         Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
2912
2913         * workers/service/SWClientConnection.cpp:
2914         (WebCore::SWClientConnection::scheduleJob):
2915         (WebCore::SWClientConnection::failedFetchingScript):
2916         (WebCore::SWClientConnection::postTaskForJob):
2917         (WebCore::SWClientConnection::jobRejectedInServer):
2918         (WebCore::SWClientConnection::registrationJobResolvedInServer):
2919         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
2920         (WebCore::SWClientConnection::startScriptFetchForServer):
2921         (WebCore::SWClientConnection::clearPendingJobs):
2922         (WebCore::SWClientConnection::finishedFetchingScript): Deleted.
2923         * workers/service/SWClientConnection.h:
2924         * workers/service/ServiceWorkerContainer.cpp:
2925         (WebCore::ServiceWorkerContainer::scheduleJob):
2926         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2927         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2928         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2929         * workers/service/ServiceWorkerContainer.h:
2930         * workers/service/server/SWServer.cpp:
2931         (WebCore::SWServer::rejectJob):
2932         (WebCore::SWServer::resolveRegistrationJob):
2933         (WebCore::SWServer::resolveUnregistrationJob):
2934         (WebCore::SWServer::startScriptFetch):
2935         * workers/service/server/SWServer.h:
2936
2937 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2938
2939         REGRESSION(r224460): Text fields sometimes get "messed up"
2940         https://bugs.webkit.org/show_bug.cgi?id=181115
2941
2942         Reviewed by Zalan Bujtas.
2943
2944         Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
2945         substracted after the clip rectangle was computed.
2946
2947         * rendering/LayoutState.cpp:
2948         (WebCore::LayoutState::computeClipRect):
2949
2950 2018-01-09  Ali Juma  <ajuma@chromium.org>
2951
2952         Implement VisualViewport API events
2953         https://bugs.webkit.org/show_bug.cgi?id=179386
2954
2955         Reviewed by Frédéric Wang.
2956
2957         Implement the events (resize and scroll) defined by the Visual Viewport API
2958         (https://wicg.github.io/visual-viewport/#events).
2959
2960         This is behind the VisualViewportAPI experimental feature flag.
2961
2962         In order to detect when events need to be fired, change the computation of
2963         Visual Viewport attributes to happen whenever the layout viewport is updated
2964         rather than only on-demand.
2965
2966         Tests: fast/visual-viewport/resize-event-fired-window-resized.html
2967                fast/visual-viewport/resize-event-fired.html
2968                fast/visual-viewport/scroll-event-fired.html
2969
2970         * dom/Document.cpp:
2971         (WebCore::Document::addListenerTypeIfNeeded):
2972         Add support for tracking resize event listeners.
2973         * dom/Document.h:
2974         * dom/DocumentEventQueue.cpp:
2975         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
2976         (WebCore::DocumentEventQueue::enqueueScrollEvent):
2977         Factored out of enqueueOrDispatchScrollEvent so that this logic can be reused
2978         for Visual Viewport scroll events.
2979         (WebCore::DocumentEventQueue::enqueueResizeEvent):
2980         (WebCore::DocumentEventQueue::pendingEventTimerFired):
2981         * dom/DocumentEventQueue.h:
2982         * page/FrameView.cpp:
2983         (WebCore::FrameView::updateLayoutViewport):
2984         * page/VisualViewport.cpp:
2985         (WebCore::VisualViewport::addEventListener):
2986         (WebCore::layoutIfNonNull):
2987         (WebCore::VisualViewport::offsetLeft const):
2988         Remove attribute computation logic since this now happens during update().
2989         (WebCore::VisualViewport::offsetTop const): Ditto.
2990         (WebCore::VisualViewport::pageLeft const): Ditto.
2991         (WebCore::VisualViewport::pageTop const): Ditto.
2992         (WebCore::VisualViewport::width const): Ditto.
2993         (WebCore::VisualViewport::height const): Ditto.
2994         (WebCore::VisualViewport::scale const):
2995         (WebCore::VisualViewport::update):
2996         Added. Computes all of the Visual Viewport attributes and determines
2997         whether events need to be fired.
2998         (WebCore::VisualViewport::enqueueResizeEvent):
2999         (WebCore::VisualViewport::enqueueScrollEvent):
3000         (WebCore::getFrameViewAndLayoutIfNonNull): Deleted.
3001         * page/VisualViewport.h:
3002
3003 2018-01-09  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3004
3005         [EME] Add the CENC initData support in ClearKey CDM
3006         https://bugs.webkit.org/show_bug.cgi?id=180081
3007
3008         Reviewed by Xabier Rodriguez-Calvar.
3009
3010         Add the "cenc" initDataType support in ClearKey CDM.
3011         Parse the CENC initData and extract the KIDs by following the W3C spec
3012         https://www.w3.org/TR/eme-initdata-cenc/#common-system
3013
3014         Tests: media/encrypted-media/clearKey/clearKey-message-cenc-event.html
3015                media/encrypted-media/clearKey/clearKey-message-cenc-event-mse.html
3016
3017         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3018         (WebCore::extractKeyidsLocationFromCencInitData):
3019         (WebCore::isCencInitData):
3020         (WebCore::extractKeyidsFromCencInitData):
3021         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
3022         (WebCore::CDMPrivateClearKey::supportsInitData const):
3023         (WebCore::CDMInstanceClearKey::requestLicense):
3024
3025 2018-01-09  Zan Dobersek  <zdobersek@igalia.com>
3026
3027         [Cairo] Pass state values directly to Cairo operations
3028         https://bugs.webkit.org/show_bug.cgi?id=181389
3029
3030         Reviewed by Carlos Garcia Campos.
3031
3032         Instead of passing reference to the GraphicsContextState object to
3033         various Cairo operations, only pass the required state values. This
3034         makes it explicit what state values are used in these operations, at the
3035         expense of some long parameter lists, but this will be better addressed
3036         by future refactoring of this code into more concise functions.
3037
3038         No new tests -- no change in functionality.
3039
3040         * platform/graphics/cairo/CairoOperations.cpp:
3041         (WebCore::Cairo::drawGlyphsShadow):
3042         (WebCore::Cairo::dashedLineCornerWidthForStrokeWidth):
3043         (WebCore::Cairo::dashedLinePatternWidthForStrokeWidth):
3044         (WebCore::Cairo::drawGlyphs):
3045         (WebCore::Cairo::drawRect):
3046         (WebCore::Cairo::drawLine):
3047         (WebCore::Cairo::drawEllipse):
3048         * platform/graphics/cairo/CairoOperations.h:
3049         * platform/graphics/cairo/FontCairo.cpp:
3050         (WebCore::FontCascade::drawGlyphs):
3051         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3052         (WebCore::GraphicsContext::drawRect):
3053         (WebCore::GraphicsContext::drawLine):
3054         (WebCore::GraphicsContext::drawEllipse):
3055
3056 2018-01-09  Ryosuke Niwa  <rniwa@webkit.org>
3057
3058         Release assert in addResourceTiming when a cache resource is requested during style recalc
3059         https://bugs.webkit.org/show_bug.cgi?id=181137
3060         <rdar://problem/35666574>
3061
3062         Reviewed by Simon Fraser.
3063
3064         Make the dispatching of resourcetimingbufferfull event asynchronous to avoid dispatching it
3065         synchronously during a style resolution when CachedResourceLoader::requestImage requests
3066         a previously loaded image.
3067
3068         We now schedule a timer when the resource timing buffer becomes full, and dispatch the event
3069         when the timer fires. Meanwhile, we have a backup buffer to which additional resource timing
3070         entries would be added. Once the event is dispatched, we refill the buffer exposed to author
3071         scripts. When refilling the buffer results in it becoming full again, we keep repeating the
3072         process of firing resourcetimingbufferfull and re-filling the buffer until either we stop
3073         making progress (i.e. the script didn't increase the number of empty entires in the buffer)
3074         or the backup buffer (at the time we started this process) becomes empty.
3075
3076         Also fixed a bug that we were firing resourcetimingbufferfull event when the last entry that
3077         fits within the buffer size was added instead of when an entry is being added to an already
3078         full buffer. To make this work, the patch introduces m_resourceTimingBufferFullFlag,
3079         representing the concept "resource timing buffer full" flag in the resource timing specification.
3080
3081         Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-crash.html
3082
3083         * page/Performance.cpp:
3084         (WebCore::Performance::Performance):
3085         (WebCore::Performance::clearResourceTimings):
3086         (WebCore::Performance::setResourceTimingBufferSize):
3087         (WebCore::Performance::addResourceTiming):
3088         (WebCore::Performance::resourceTimingBufferFullTimerFired):
3089         * page/Performance.h:
3090
3091 2018-01-08  Chris Nardi  <csnardi1@gmail.com>
3092
3093         ::first-letter incorrectly selects grapheme pairs
3094         https://bugs.webkit.org/show_bug.cgi?id=181315
3095
3096         Reviewed by Darin Adler.
3097
3098         Grapheme pairs were incorrectly selected by ::first-letter. This
3099         change fixes their selection.
3100
3101         Tests: Updated fast/css/first-letter-punctuation.html and imported
3102         LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo-4/first-letter-004.html
3103
3104         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
3105         (WebCore::isPunctuationForFirstLetter):
3106         (WebCore::shouldSkipForFirstLetter):
3107         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
3108
3109 2018-01-08  Darin Adler  <darin@apple.com>
3110
3111         Special list-item counter starts from an incorrect number for ::before and ::after
3112         https://bugs.webkit.org/show_bug.cgi?id=181084
3113
3114         Reviewed by Zalan Bujtas.
3115
3116         Test: fast/css/counters/counter-list-item.html
3117
3118         * Sources.txt: Removed CounterDirectives.cpp.
3119         * WebCore.xcodeproj/project.pbxproj: Ditto.
3120
3121         * css/CSSComputedStyleDeclaration.cpp:
3122         (WebCore::counterToCSSValue): Updated for changes to the CounterDirectives struct.
3123         * css/StyleBuilderCustom.h:
3124         (WebCore::StyleBuilderCustom::applyInheritCounter): Ditto.
3125         (WebCore::StyleBuilderCustom::applyValueCounter): Ditto.
3126
3127         * html/HTMLLIElement.cpp:
3128         (WebCore::HTMLLIElement::parseValue): Call setExplicitValue(std::nullopt) instead
3129         of clearExplicitValue since we are using std::optional now.
3130
3131         * rendering/RenderCounter.cpp:
3132         (WebCore::listItemCounterDirectives): Added. Computes the counter directives that
3133         express the effects on the list-item counter from list item and list elements.
3134         Used something as close to what the CSS 3 draft says as possible. This uses a
3135         negative increment when creating a list to counteract the positive increment done
3136         by a list element, except in the case of an unordered list. This is where the bug
3137         fix actually lies. Also fixed handling of reversed ordered lists at the same time.
3138         (WebCore::planCounter): Refactored to use the function above. Also changed the
3139         code to pay attention to both the counter directives and the implicit ones from
3140         list item and list elements, getting as close as possible to what the specification
3141         seems to call for.
3142
3143         * rendering/RenderListItem.cpp:
3144         (WebCore::RenderListItem::RenderListItem): Since we are using std::optional and no
3145         longer using bit fields, simplified the constructor for each list item.
3146         (WebCore::RenderListItem::calcValue const): Deleted.
3147         (WebCore::RenderListItem::updateValueNow const): Merged in all the code from the
3148         old calcValue function, but it is also simpler now since m_value is std::optional.
3149         (WebCore::RenderListItem::updateValue): Updated to use std::optional.
3150         (WebCore::RenderListItem::setExplicitValue): Ditto.
3151         (WebCore::RenderListItem::clearExplicitValue): Deleted.
3152         (WebCore::RenderListItem::updateListMarkerNumbers): Updated to use std::optional.
3153         (WebCore::RenderListItem::isInReversedOrderedList const): Added. This is used by
3154         the counter code so it can decrement instead of incrementing.
3155
3156         * rendering/RenderListItem.h: Updated to use std::optional. Also marked functions
3157         final instead of override and initialized m_notInList after making it not be a
3158         bitfield any more.
3159
3160         * rendering/style/CounterDirectives.cpp: Removed.
3161         * rendering/style/CounterDirectives.h: Removed most of the CounterDirectives
3162         class and replaced it with a struct with two std::optional. Added an addClamped
3163         function so the counter code can share it with the addIncrementValue function.
3164         If we want to make a faster version that doesn't use double, we can come back
3165         and do that. Also moved the == function to the header since the implementation
3166         is so trivial.
3167
3168         * rendering/style/StyleAllInOne.cpp: Removed CounterDirectives.cpp.
3169
3170         * rendering/style/StyleRareNonInheritedData.cpp:
3171         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated to
3172         use std::make_unique directly instead of using a clone function.
3173
3174 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3175
3176         [Attachment Support] Expose HTMLAttachmentElement.uniqueIdentifier to bindings
3177         https://bugs.webkit.org/show_bug.cgi?id=181420
3178         <rdar://problem/36365827>
3179
3180         Reviewed by Alex Christensen.
3181
3182         Add a new IDL definition for uniqueIdentifier on HTMLAttachmentElement. This allows clients to relate attachment
3183         elements in the DOM to _WKAttachments delivered via Objective-C SPI.
3184
3185         Adjusted existing tests in WKAttachmentTests.
3186
3187         * html/HTMLAttachmentElement.idl:
3188
3189 2018-01-08  Don Olmstead  <don.olmstead@sony.com>
3190
3191         AccessibilityARIAGrid does not compile when accessibility is disabled
3192         https://bugs.webkit.org/show_bug.cgi?id=181418
3193         <rdar://problem/36365398>
3194
3195         Reviewed by Chris Fleizach.
3196
3197         No new tests. No change in behavior.
3198
3199         * accessibility/AccessibilityARIAGrid.cpp:
3200
3201 2018-01-08  Commit Queue  <commit-queue@webkit.org>
3202
3203         Unreviewed, rolling out r226532 and r226540.
3204         https://bugs.webkit.org/show_bug.cgi?id=181422
3205
3206         jessie says basic browsing does not seem to work (Requested by
3207         alexchristensen on #webkit).
3208
3209         Reverted changesets:
3210
3211         "Add CSP support to service workers"
3212         https://bugs.webkit.org/show_bug.cgi?id=181385
3213         https://trac.webkit.org/changeset/226532
3214
3215         "SWClientConnection should not keep references to service
3216         worker jobs"
3217         https://bugs.webkit.org/show_bug.cgi?id=181381
3218         https://trac.webkit.org/changeset/226540
3219
3220 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3221
3222         [Attachment Support] Expose file name and content type of WKAttachment
3223         https://bugs.webkit.org/show_bug.cgi?id=181390
3224         <rdar://problem/36336837>
3225
3226         Reviewed by Tim Horton.
3227
3228         Add new structs in AttachmentTypes.h and refactor HTMLAttachmentElement::requestData to requestInfo. See below
3229         for more details. Augmented existing API tests in WKAttachmentTests.
3230
3231         * html/AttachmentTypes.h:
3232
3233         Add a struct to represent a snapshot of information about an attachment element.
3234
3235         * html/HTMLAttachmentElement.cpp:
3236         (WebCore::HTMLAttachmentElement::requestInfo):
3237         (WebCore::HTMLAttachmentElement::requestData): Deleted.
3238         * html/HTMLAttachmentElement.h:
3239
3240         Change requestData to requestInfo. Instead of fetching and delivering data via callback, requestInfo returns an
3241         AttachmentInfo.
3242
3243         * rendering/RenderThemeIOS.mm:
3244         (WebCore::RenderAttachmentInfo::addLine):
3245         (WebCore::RenderAttachmentInfo::buildWrappedLines):
3246         (WebCore::RenderAttachmentInfo::buildSingleLine):
3247         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
3248         (WebCore::RenderThemeIOS::attachmentBaseline const):
3249         (WebCore::paintAttachmentIcon):
3250         (WebCore::paintAttachmentText):
3251         (WebCore::paintAttachmentProgress):
3252         (WebCore::attachmentBorderPath):
3253         (WebCore::RenderThemeIOS::paintAttachment):
3254         (WebCore::AttachmentInfo::addLine): Deleted.
3255         (WebCore::AttachmentInfo::buildWrappedLines): Deleted.
3256         (WebCore::AttachmentInfo::buildSingleLine): Deleted.
3257         (WebCore::AttachmentInfo::AttachmentInfo): Deleted.
3258
3259         Rename AttachmentInfo to RenderAttachmentInfo to resolve a name conflict with the new AttachmentInfo struct.
3260
3261 2018-01-08  Saam Barati  <sbarati@apple.com>
3262
3263         Speculative build fix after r226600. We only use clflush on x86 and the `asm volatile` syntax is not available in the Windows build.
3264
3265         No new tests because this is a build fix.
3266
3267         * dom/Comment.cpp:
3268         (WebCore::Comment::clflushReadLength):
3269
3270 2018-01-08  Michael Saboff  <msaboff@apple.com>
3271
3272         Add a DOM gadget for Spectre testing
3273         https://bugs.webkit.org/show_bug.cgi?id=181351
3274
3275         Reviewed by Saam Barati.
3276
3277         This change is used to test Spectre mitigations.
3278
3279         Added a side data array to the Comment DOM node to test for Spectre issues in
3280         the DOM layer.  This additional functionality is disabled by default and must
3281         be enabled through the JSC option "enableSpectreGadgets".
3282
3283         * dom/Comment.cpp:
3284         (WebCore::Comment::Comment):
3285         (WebCore::Comment::setReadLength):
3286         (WebCore::Comment::charCodeAt):
3287         (WebCore::Comment::clflushReadLength):
3288         * dom/Comment.h:
3289         * dom/Comment.idl:
3290         * page/RuntimeEnabledFeatures.cpp:
3291         (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
3292         * page/RuntimeEnabledFeatures.h:
3293
3294 2018-01-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3295
3296         A canvas should not be tainted if it draws a data URL SVGImage with a <foreignObject>
3297         https://bugs.webkit.org/show_bug.cgi?id=180301
3298
3299         Reviewed by Dean Jackson.
3300
3301         Don't taint the canvas if it draws a data URL SVGImage with a <foreignObject>.
3302         There should not be a cross-origin data leak in this case.
3303
3304         Tests: svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html
3305                svg/as-image/svg-canvas-data-url-svg-with-foreign-object-not-tainted.html
3306                svg/as-image/svg-canvas-data-url-svg-with-image-not-tainted.html
3307
3308         * html/ImageBitmap.cpp:
3309         (WebCore::taintsOrigin):
3310         * html/canvas/CanvasRenderingContext.cpp:
3311         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
3312
3313 2018-01-08  Don Olmstead  <don.olmstead@sony.com>
3314
3315         Simplify platform checks in Graphics Context
3316         https://bugs.webkit.org/show_bug.cgi?id=181344
3317
3318         Reviewed by Alex Christensen.
3319
3320         No new tests. No change in behavior.
3321
3322         * platform/graphics/ANGLEWebKitBridge.h:
3323         * platform/graphics/GLContext.h:
3324         * platform/graphics/GraphicsContext3D.h:
3325         * platform/graphics/OpenGLESShims.h:
3326         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3327         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
3328
3329 2018-01-08  Zalan Bujtas  <zalan@apple.com>
3330
3331         [RenderTreeBuilder] Move SVG addChild logic to RenderTreeBuilder
3332         https://bugs.webkit.org/show_bug.cgi?id=181405
3333         <rdar://problem/36360476>
3334
3335         Reviewed by Antti Koivisto.
3336
3337         This is about moving the code, no cleanup and/or normalization (unfortunately it also means
3338         some temporary changes).  
3339
3340         No change in functionality.
3341
3342         * Sources.txt:
3343         * WebCore.xcodeproj/project.pbxproj:
3344         * rendering/svg/RenderSVGContainer.cpp:
3345         (WebCore::RenderSVGContainer::addChild):
3346         * rendering/svg/RenderSVGInline.cpp:
3347         (WebCore::RenderSVGInline::addChild):
3348         * rendering/svg/RenderSVGRoot.cpp:
3349         (WebCore::RenderSVGRoot::addChild):
3350         * rendering/svg/RenderSVGText.cpp:
3351         (WebCore::RenderSVGText::addChild):
3352         * rendering/updating/RenderTreeBuilder.cpp:
3353         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
3354         (WebCore::RenderTreeBuilder::insertChildToSVGContainer):
3355         (WebCore::RenderTreeBuilder::insertChildToSVGInline):
3356         (WebCore::RenderTreeBuilder::insertChildToSVGRoot):
3357         (WebCore::RenderTreeBuilder::insertChildToSVGText):
3358         * rendering/updating/RenderTreeBuilder.h:
3359         (WebCore::RenderTreeBuilder::SVGBuilder):
3360         * rendering/updating/RenderTreeBuilderSVG.cpp: Added.
3361         (WebCore::RenderTreeBuilder::SVG::SVG):
3362         (WebCore::RenderTreeBuilder::SVG::insertChild):
3363         * rendering/updating/RenderTreeBuilderSVG.h: Added.
3364
3365 2018-01-08  John Wilander  <wilander@apple.com>
3366
3367         Storage Access API: Remove access for all frames under a page when the page is closed
3368         https://bugs.webkit.org/show_bug.cgi?id=181398
3369         <rdar://problem/36357879>
3370
3371         Reviewed by Alex Christensen.
3372
3373         No new tests. Discussed with Alex Christensen and we concluded that
3374         both a layout test and an API test would require a lot of work and
3375         we have existing tests for clearing out storage access for frames.
3376
3377         * platform/network/NetworkStorageSession.h:
3378         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3379         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
3380
3381 2018-01-08  Matt Lewis  <jlewis3@apple.com>
3382
3383         Unreviewed, rolling out r226385.
3384
3385         The test introduced with this was a flaky since being added.
3386
3387         Reverted changeset:
3388
3389         "AX: when invert colors is on, double-invert certain media
3390         elements in UserAgentStyleSheet"
3391         https://bugs.webkit.org/show_bug.cgi?id=168447
3392         https://trac.webkit.org/changeset/226385
3393
3394 2018-01-08  Youenn Fablet  <youenn@apple.com>
3395
3396         SWClientConnection should not keep references to service worker jobs
3397         https://bugs.webkit.org/show_bug.cgi?id=181381
3398
3399         Reviewed by Chris Dumez.
3400
3401         Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
3402
3403         Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
3404         Instead pass job identifiers and related data to the main thread.
3405
3406         Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
3407
3408         * workers/service/SWClientConnection.cpp:
3409         (WebCore::SWClientConnection::scheduleJob):
3410         (WebCore::SWClientConnection::failedFetchingScript):
3411         (WebCore::SWClientConnection::postTaskForJob):
3412         (WebCore::SWClientConnection::jobRejectedInServer):
3413         (WebCore::SWClientConnection::registrationJobResolvedInServer):
3414         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
3415         (WebCore::SWClientConnection::startScriptFetchForServer):
3416         (WebCore::SWClientConnection::clearPendingJobs):
3417         (WebCore::SWClientConnection::finishedFetchingScript): Deleted.
3418         * workers/service/SWClientConnection.h:
3419         * workers/service/ServiceWorkerContainer.cpp:
3420         (WebCore::ServiceWorkerContainer::scheduleJob):
3421         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):