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