Fix bugs related to setting reflected floating point DOM attributes
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-08  Darin Adler  <darin@apple.com>
2
3         Fix bugs related to setting reflected floating point DOM attributes
4         https://bugs.webkit.org/show_bug.cgi?id=178061
5
6         Reviewed by Sam Weinig.
7
8         * html/HTMLProgressElement.cpp:
9         (WebCore::HTMLProgressElement::setValue): Changed the semantics to match what
10         the HTML specification calls for. When a caller passes a negative number or
11         zero, the value does get set on the element. Negative numbers are not allowed
12         when you get the current value, but are allowed to be set.
13         (WebCore::HTMLProgressElement::setMax): Changed the semantics to match what
14         the HTML specification calls for. When a caller passes a negative number or
15         zero, this should leave the attribute unchanged.
16
17         * html/shadow/MediaControlElementTypes.cpp:
18         (WebCore::MediaControlVolumeSliderElement::setVolume): Use
19         String::numberToStringECMAScript instead of String::number since that is what
20         we want any time we are setting an attribute value from a floating point value.
21         * html/shadow/MediaControlElements.cpp:
22         (WebCore::MediaControlTimelineElement::setPosition): Ditto.
23         (WebCore::MediaControlTimelineElement::setDuration): Removed unneeded check
24         of std::isfinite since the single caller already checks that.
25
26 2017-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
27
28         DataTransfer.items does not contain items for custom types supplied via add or setData
29         https://bugs.webkit.org/show_bug.cgi?id=178016
30
31         Reviewed by Darin Adler.
32
33         Minor tweaks to expose pasteboard types and data through DataTransfer's item list. This patch fixes two primary
34         issues: (1) custom pasteboard data is not exposed through the item list in any way, and (2) the "Files"
35         compatibility type is exposed as a separate data transfer item of kind 'string' when dropping or pasting files.
36
37         Tests: editing/pasteboard/data-transfer-items-add-custom-data.html
38                editing/pasteboard/data-transfer-items-drop-file.html
39
40         * dom/DataTransfer.cpp:
41         (WebCore::normalizeType):
42
43         Use stripLeadingAndTrailingHTMLSpaces instead of stripWhitespace.
44
45         (WebCore::shouldReadOrWriteTypeAsCustomData):
46         (WebCore::DataTransfer::getDataForItem const):
47         (WebCore::DataTransfer::getData const):
48
49         Add getDataForItem, a version of getData that does not normalize types before reading from the pasteboard. This
50         normalization step is only needed for backwards compatibility with legacy types (such as "text" and "url")
51         written to and read from using getData and setData; when using DataTransferItemList.add to set data, adding data
52         for these types should instead write as custom pasteboard data.
53
54         (WebCore::DataTransfer::setDataFromItemList):
55         (WebCore::DataTransfer::types const):
56         (WebCore::DataTransfer::typesForItemList const):
57
58         Add typesForItemList, which fetches the list of types to expose as items on the DataTransfer. Importantly, this
59         does not include the "Files" type added for compatibility when accessing DataTransfer.types, instead returning
60         an empty array. The actual files are added separately, by iterating over DataTransfer's files in ensureItems.
61
62         Note that when starting a drag or copying, we will still expose the full list of file and string types to
63         bindings and not just file-backed items. Since all of this information is supplied by the page in the first
64         place, we don't have to worry about exposing information, such as file paths, that may exist on the pasteboard.
65
66         * dom/DataTransfer.h:
67         * dom/DataTransferItem.cpp:
68         (WebCore::DataTransferItem::getAsString const):
69         * dom/DataTransferItemList.cpp:
70         (WebCore::shouldExposeTypeInItemList):
71         (WebCore::DataTransferItemList::add):
72         (WebCore::DataTransferItemList::ensureItems const):
73         (WebCore::isSupportedType): Deleted.
74
75 2017-10-08  Darin Adler  <darin@apple.com>
76
77         CustomElementRegistry.define was throwing a JavaScript syntax error instead of a DOM syntax error
78         https://bugs.webkit.org/show_bug.cgi?id=178055
79
80         Reviewed by Sam Weinig.
81
82         Both the JavaScript language and the DOM have "syntax error" exceptions, but
83         they are not the same thing.
84
85         Also, since the time a while back where we moved JavaScript error handling to
86         use WebCore::Exception and WebCore::ExceptionOr, there are a number of functions
87         that are no longer used and can be deleted.
88
89         * bindings/js/JSCustomElementRegistryCustom.cpp:
90         (WebCore::validateCustomElementNameAndThrowIfNeeded): Call throwDOMSyntaxError
91         instead of throwSyntaxError.
92
93         * bindings/js/JSDOMExceptionHandling.cpp:
94         (WebCore::reportDeprecatedGetterError): Deleted. Unused.
95         (WebCore::reportDeprecatedSetterError): Deleted. Unused.
96         (WebCore::throwNotSupportedError): Deleted the overload without an error message,
97         since it's unused. Changed the other overload to take an ASCIILiteral, since
98         that is what all the callers need.
99         (WebCore::throwInvalidStateError): Take ASCIILiteral as above.
100         (WebCore::throwArrayElementTypeError): Deleted. Unused.
101         (WebCore::throwDOMSyntaxError): Added an ASCIILiteral message argument. This
102         function was unused; it's now being used above, always with a literal message.
103         (WebCore::throwIndexSizeError): Deleted. Unused.
104         (WebCore::throwTypeMismatchError): Deleted. Unused.
105         * bindings/js/JSDOMExceptionHandling.h: Updated for the changes above.
106
107         * bindings/js/JSHTMLElementCustom.cpp:
108         (WebCore::constructJSHTMLElement): Fixed a typo in the error message.
109
110 2017-10-08  Ryosuke Niwa  <rniwa@webkit.org>
111
112         dragenter and dragleave shouldn't use the same data transfer object
113         https://bugs.webkit.org/show_bug.cgi?id=178056
114
115         Reviewed by Darin Adler.
116
117         This patch fixes the bug that we were using a single DataTransfer to fire dragleave and dragenter events
118         when the drag target moves from one element to another.
119
120         It alos refactors DragController and EventHandler code so that the construction of DataTransfer object
121         happens in EventHandler instead of DragController, and extracts createForUpdatingDropTarget out of
122         createForDrop to have a better encapsulation over the data store mode.
123
124         drag related functions in EventHandler now takes std::unique_ptr<Pasteboard>&&, drag operation mask set
125         by the drag source, and a boolean indicating whether this drag & drop is for files or not. updateDragAndDrop
126         takes a closure which makes a pasteboard because it has to create two instances of DataTransfer one for
127         dragleave event and another one for dragenter event in some cases.
128
129         Test: editing/pasteboard/data-transfer-is-unique-for-dragenter-and-dragleave.html
130
131         * dom/DataTransfer.cpp:
132         (WebCore::DataTransfer::createForDrop): Now takes Pasteboard instead of DragData.
133         (WebCore::DataTransfer::createForUpdatingDropTarget): Extracted out of createForDrop. Moved the code to
134         use Readonly mode in dashboad here from createDataTransferToUpdateDrag in DragController.cpp.
135         * dom/DataTransfer.h:
136         * page/DragController.cpp:
137         (WebCore::createDataTransferToUpdateDrag): Deleted.
138         (WebCore::DragController::dragExited):
139         (WebCore::DragController::performDragOperation):
140         (WebCore::DragController::tryDHTMLDrag):
141         * page/EventHandler.cpp:
142         (WebCore::EventHandler::dispatchDragEvent): Made this fucntion take DataTransfer& instead of DataTransfer*.
143         (WebCore::findDropZone): Ditto.
144         (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): Added.
145         (WebCore::EventHandler::updateDragAndDrop):
146         (WebCore::EventHandler::cancelDragAndDrop):
147         (WebCore::EventHandler::performDragAndDrop):
148         (WebCore::EventHandler::dispatchDragSrcEvent):
149         (WebCore::EventHandler::dispatchDragStartEventOnSourceElement):
150         * page/EventHandler.h:
151
152 2017-10-08  Jer Noble  <jer.noble@apple.com>
153
154         SourceBuffer remove throws out way more content than requested
155         https://bugs.webkit.org/show_bug.cgi?id=177884
156         <rdar://problem/34817104>
157
158         Reviewed by Darin Adler.
159
160         Test: media/media-source/media-source-remove-too-much.html
161
162         The end parameter is exclusive, not inclusive, of the range to be removed.
163
164         * Modules/mediasource/SourceBuffer.cpp:
165         (WebCore::SourceBuffer::removeCodedFrames):
166
167 2017-10-08  Brent Fulgham  <bfulgham@apple.com>
168
169         Nullptr deref in WebCore::Node::computeEditability
170         https://bugs.webkit.org/show_bug.cgi?id=177905
171         <rdar://problem/34138402>
172
173         Reviewed by Darin Adler.
174
175         Script can run when setting focus, because a blur event and a focus event are generated.
176         A handler for one of these events can cause the focused element to be cleared. We should
177         handle this possibility gracefully.
178
179         Test: fast/dom/focus-shift-crash.html
180
181         * dom/Document.cpp:
182         (WebCore::Document::setFocusedElement):
183
184 2017-10-07  Darin Adler  <darin@apple.com>
185
186         Update Document.createEvent for recent DOM specification changes
187         https://bugs.webkit.org/show_bug.cgi?id=178052
188
189         Reviewed by Chris Dumez.
190
191         * dom/BeforeUnloadEvent.cpp:
192         (WebCore::BeforeUnloadEvent::BeforeUnloadEvent): Added a constructor for
193         createForBindings.
194         (WebCore::BeforeUnloadEvent::~BeforeUnloadEvent): Deleted. Just let the
195         compiler generate this.
196         * dom/BeforeUnloadEvent.h: Added createForBindings. Also made more things private.
197
198         * dom/Document.cpp:
199         (WebCore::Document::createEvent): Updated comments for clarity. Responding to
200         changes to the DOM specification, added support for "beforeunloadevent", "focusevent",
201         and "svgevents", moved "keyboardevents" and "popstateevent" into the list of strings
202         we should remove, and moved "compositionevent", "devicemotionevent",
203         "deviceorientationevent", "hashchangeevent", "storageevent", and "textevent" into
204         the list of strings we should keep.
205
206         * dom/Event.h: Added a virtual setRelatedTarget alongside the virtual relatedTarget
207         to allow us to clean up the code that manipulates it.
208
209         * dom/EventContext.cpp:
210         (WebCore::MouseOrFocusEventContext::handleLocalEvents const): Call the virtual
211         setRelatedTarget instead of doing a little type casting dance.
212
213         * dom/FocusEvent.h: Added createForBindings. Made more functions private and
214         changed setRelatedTarget into a private final override.
215
216         * dom/MouseEvent.h: Changed setRelatedTarget into a private final override.
217
218 2017-10-07  Andy Estes  <aestes@apple.com>
219
220         [Payment Request] Implement PaymentRequest.show() and PaymentRequest.hide()
221         https://bugs.webkit.org/show_bug.cgi?id=178043
222         <rdar://problem/34076639>
223
224         Reviewed by Tim Horton.
225
226         Tests: http/tests/paymentrequest/payment-request-abort-method.https.html
227                http/tests/paymentrequest/payment-request-show-method.https.html
228
229         * Modules/applepay/PaymentSession.h: Virtually inherited from PaymentSessionBase to
230         accommodate ApplePayPaymentHandler inheriting from both this and PaymentHandler.
231         (WebCore::PaymentSession::~PaymentSession): Deleted.
232         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
233         (WebCore::paymentCoordinator): Virtually inherited from PaymentSessionBase to accommodate
234         ApplePayPaymentHandler inheriting from both this and PaymentSession.
235         (WebCore::ApplePayPaymentHandler::hasActiveSession): Added. Calls PaymentCoordinator::hasActiveSession().
236         (WebCore::ApplePayPaymentHandler::show): Added. Calls PaymentCoordinator::beginPaymentSession().
237         (WebCore::ApplePayPaymentHandler::hide): Added. Calls PaymentCoordinator::abortPaymentSession().
238         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Inherited from PaymentSession in
239         addition to PaymentHandler so that this can be PaymentCoordinator active session.
240         * Modules/paymentrequest/PaymentHandler.cpp:
241         (WebCore::PaymentHandler::create):
242         (WebCore::PaymentHandler::hasActiveSession):
243         * Modules/paymentrequest/PaymentHandler.h:
244         * Modules/paymentrequest/PaymentRequest.cpp:
245         (WebCore::PaymentRequest::~PaymentRequest):
246         (WebCore::PaymentRequest::show): Rejected the promise if PaymentCoordinator has an active session.
247         (WebCore::PaymentRequest::abort): Called stop().
248         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Returned true if state is
249         Interactive and there is an active handler showing.
250         (WebCore::PaymentRequest::stop): Hid the active session if it's showing, then set state to
251         Closed and rejected the show promise.
252         * Modules/paymentrequest/PaymentRequest.h:
253         * Modules/paymentrequest/PaymentSessionBase.h: Added. Inherits from
254         RefCounted<PaymentSessionBase> and defines a virtual destructor. This allows subclasses to
255         virtually inherit a single ref-count to support multiple inheritance.
256         * WebCore.xcodeproj/project.pbxproj:
257         * bindings/scripts/CodeGeneratorJS.pm:
258         (GetGnuVTableOffsetForType): Added ApplePaySession to the list of classes that need a vtable
259         offset of 3.
260
261 2017-10-07  Ryosuke Niwa  <rniwa@webkit.org>
262
263         WebContentReader::readHTML should be shared between macOS and iOS
264         https://bugs.webkit.org/show_bug.cgi?id=178044
265
266         Reviewed by Wenson Hsieh.
267
268         Merged the implementations for WebContentReader::readHTML between macOS and iOS.
269
270         * editing/cocoa/WebContentReaderCocoa.mm:
271         (WebCore::WebContentReader::readHTML):
272         * editing/ios/WebContentReaderIOS.mm:
273         (WebCore::WebContentReader::readHTML): Deleted.
274         * editing/mac/WebContentReaderMac.mm:
275         (WebCore::WebContentReader::readHTML): Deleted.
276
277 2017-10-06  Zalan Bujtas  <zalan@apple.com>
278
279         RenderTable should not hold a collection of raw pointers to RenderTableCaption
280         https://bugs.webkit.org/show_bug.cgi?id=178026
281         <rdar://problem/34863090>
282
283         Reviewed by Simon Fraser.
284
285         Similar to sections, RenderTable should not store captions as raw pointers. Their lifetimes are
286         not guaranteed to be sync with the RenderTable's.
287
288         Covered by existing tests.
289
290         * rendering/RenderTable.cpp:
291         (WebCore::RenderTable::addCaption):
292         (WebCore::RenderTable::removeCaption):
293         (WebCore::RenderTable::addOverflowFromChildren):
294         * rendering/RenderTable.h:
295         * rendering/RenderTableCaption.cpp:
296         (WebCore::RenderTableCaption::insertedIntoTree):
297         (WebCore::RenderTableCaption::willBeRemovedFromTree):
298
299 2017-10-06  Daniel Bates  <dabates@apple.com>
300
301         Spelling error annotation should encompass hyphen in misspelled word that wraps across multiple lines
302         https://bugs.webkit.org/show_bug.cgi?id=177980
303         <rdar://problem/34847454>
304
305         Reviewed by Simon Fraser.
306
307         On macOS the spelling and grammar annotations for a word or word phrase encompass
308         hyphenations added because the word or word phrase wraps across more than one line.
309         The effect tends to be more aesthetically pleasing and consistent with how these
310         annotations would be pointed out by a person in conversation: by identify the word
311         or phrase that has a spelling or grammar issue regardless of whether that word or
312         phrase is broken into halves due to line wrapping. The same argument applies to
313         other annotations on macOS, including text matches. Therefore, we should always
314         include any hyphens encompassed by a marker that were added due to line wrapping
315         when painting the marker.
316
317         Test: editing/spelling/spelling-marker-includes-hyphen.html
318
319         * rendering/InlineTextBox.cpp:
320         (WebCore::InlineTextBox::paintDocumentMarker): Compute the text run including any
321         added hyphens. If a hyphen was added then the inline text box represents that text
322         up to the hyphen. Adjust the end position of the marker to be the length of the text
323         run if its greater than or equal to the length of the text box.
324
325 2017-10-06  Zalan Bujtas  <zalan@apple.com>
326
327         RenderTable should not hold a collection of raw pointers to RenderTableCol
328         https://bugs.webkit.org/show_bug.cgi?id=178030
329         <rdar://problem/34865236>
330
331         Reviewed by Simon Fraser.
332
333         In addition to the m_columnRenderersValid flag, this patch ensures that
334         we don't dereference stale column renderers even when the flag is out of sync.
335
336         Covered by existing tests.
337
338         * rendering/RenderTable.cpp:
339         (WebCore::RenderTable::updateColumnCache const):
340         (WebCore::RenderTable::slowColElement const):
341         * rendering/RenderTable.h:
342
343 2017-10-06  Zalan Bujtas  <zalan@apple.com>
344
345         RootInlineBox should not hold a collection of raw pointers to RenderBox
346         https://bugs.webkit.org/show_bug.cgi?id=178025
347         <rdar://problem/34862488>
348
349         Reviewed by Simon Fraser.
350
351         There are already some assertions in place to check if the renderers are valid.
352
353         Covered by existing test cases.
354
355         * rendering/RenderBlockLineLayout.cpp:
356         (WebCore::RenderBlockFlow::reattachCleanLineFloats):
357         (WebCore::RenderBlockFlow::determineStartPosition):
358         (WebCore::RenderBlockFlow::determineEndPosition):
359         * rendering/RootInlineBox.h:
360         (WebCore::RootInlineBox::appendFloat):
361         (WebCore::RootInlineBox::floatsPtr):
362
363 2017-10-06  Zalan Bujtas  <zalan@apple.com>
364
365         Continuation map should not hold a raw pointer
366         https://bugs.webkit.org/show_bug.cgi?id=178021
367         <rdar://problem/34861590>
368
369         Reviewed by Simon Fraser.
370
371         This patch ensures proper lifetime management for renderers stored in the Continuation map
372         (currently they rely on the correctness of addChild/takeChild methods).
373
374         Covered by existing tests.
375
376         * rendering/RenderBoxModelObject.cpp:
377         (WebCore::RenderBoxModelObject::continuation const):
378         (WebCore::RenderBoxModelObject::setContinuation):
379
380 2017-10-06  Commit Queue  <commit-queue@webkit.org>
381
382         Unreviewed, rolling out r222791 and r222873.
383         https://bugs.webkit.org/show_bug.cgi?id=178031
384
385         Caused crashes with workers/wasm LayoutTests (Requested by
386         ryanhaddad on #webkit).
387
388         Reverted changesets:
389
390         "WebAssembly: no VM / JS version of everything but Instance"
391         https://bugs.webkit.org/show_bug.cgi?id=177473
392         http://trac.webkit.org/changeset/222791
393
394         "WebAssembly: address no VM / JS follow-ups"
395         https://bugs.webkit.org/show_bug.cgi?id=177887
396         http://trac.webkit.org/changeset/222873
397
398 2017-10-06  Alex Christensen  <achristensen@webkit.org>
399
400         Add more infrastructure to apply custom header fields to same-origin requests
401         https://bugs.webkit.org/show_bug.cgi?id=177629
402
403         Reviewed by Ryosuke Niwa.
404
405         Covered by new API tests.
406
407         * loader/DocumentLoader.h:
408         (WebCore::DocumentLoader::customHeaderFields):
409         * loader/HTTPHeaderField.cpp:
410         (WebCore::HTTPHeaderField::create):
411         (WebCore::HTTPHeaderField::HTTPHeaderField): Deleted.
412         * loader/HTTPHeaderField.h:
413         (WebCore::HTTPHeaderField::encode const):
414         (WebCore::HTTPHeaderField::decode):
415         
416         Change HTTPHeaderField from one String containing the name and value
417         to a string for the name and another for value.  This matches HTTPHeaderMap
418         and NSURLRequest more closely where names and values are treated as separate Strings.
419         
420         * loader/cache/CachedResourceLoader.cpp:
421         (WebCore::CachedResourceLoader::requestResource):
422         
423         If the DocumentLoader has custom header fields from the WebsitePolicies, apply them to any same-origin requests.
424         
425         * loader/cache/CachedResourceRequest.h:
426         (WebCore::CachedResourceRequest::resourceRequest):
427         * platform/network/ResourceRequestBase.cpp:
428         (WebCore::ResourceRequestBase::setCachePolicy):
429         (WebCore::ResourceRequestBase::setTimeoutInterval):
430         (WebCore::ResourceRequestBase::setHTTPMethod):
431         (WebCore::ResourceRequestBase::setHTTPHeaderField):
432         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
433         (WebCore::ResourceRequestBase::clearHTTPContentType):
434         (WebCore::ResourceRequestBase::clearHTTPReferrer):
435         (WebCore::ResourceRequestBase::clearHTTPOrigin):
436         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
437         (WebCore::ResourceRequestBase::clearHTTPAccept):
438         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
439         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
440         (WebCore::ResourceRequestBase::setHTTPBody):
441         (WebCore::ResourceRequestBase::setAllowCookies):
442         (WebCore::ResourceRequestBase::setPriority):
443         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
444         (WebCore::ResourceRequestBase::addHTTPHeaderField):
445         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
446         
447         non-HTTP/HTTPS ResourceRequests need to be updated, too, if header fields are added.
448         Skipping updating non-HTTP/HTTPS ResourceRequests is not a valid shortcut, and with the
449         growing importance of custom schemes with our new public API, we should update ResourceRequests
450         of custom schemes correctly.
451
452 2017-10-06  Sam Weinig  <sam@webkit.org>
453
454         Add basic support for getting a ImageBitmapRenderingContext
455         https://bugs.webkit.org/show_bug.cgi?id=177983
456
457         Reviewed by Dean Jackson.
458
459         Add initial support for ImageBitmapRenderingContext.
460
461         * CMakeLists.txt:
462         * DerivedSources.make:
463         * WebCore.xcodeproj/project.pbxproj:
464         
465             Add new files.
466         
467         * dom/Document.cpp:
468         * dom/Document.h:
469         * dom/Document.idl:
470         
471             Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
472             be used with Document.getCSSCanvasContext.
473         
474         * html/HTMLCanvasElement.h:
475         * html/HTMLCanvasElement.cpp:
476         (WebCore::HTMLCanvasElement::setHeight):
477         (WebCore::HTMLCanvasElement::setWidth):
478         
479             Throw an exception if the context is in the placeholder mode (which we
480             signify via a special PlaceholderRenderingContext) as speced. This can't
481             currently be hit, as setting a placeholder requires offscreen canvas
482             support, coming soon.
483         
484         (WebCore::HTMLCanvasElement::getContext):
485         
486             Re-work to match the spec's matrix of options, adding in support
487             for 'bitmaprenderer'/ ImageBitmapRenderingContext type as well as 
488             the placeholder mode.
489         
490         (WebCore::HTMLCanvasElement::createContext2d):
491         (WebCore::HTMLCanvasElement::getContext2d):
492         (WebCore::HTMLCanvasElement::isWebGLType):
493         (WebCore::HTMLCanvasElement::createContextWebGL):
494         (WebCore::HTMLCanvasElement::getContextWebGL):
495         (WebCore::HTMLCanvasElement::createContextWebGPU):
496         (WebCore::HTMLCanvasElement::getContextWebGPU):
497         (WebCore::HTMLCanvasElement::isBitmapRendererType):
498         (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
499         (WebCore::HTMLCanvasElement::getContextBitmapRenderer):
500
501             Split creation out of the get functions so it can be called
502             by getContext, where we know if the canvas is null or not.
503
504         * html/HTMLCanvasElement.idl:
505         
506             Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
507             be used with HTMLCanvasElement.getContext.
508
509         * html/canvas/CanvasRenderingContext.h:
510         (WebCore::CanvasRenderingContext::isBitmapRenderer const):
511         (WebCore::CanvasRenderingContext::isPlaceholder const):
512         
513             Add predicates for ImageBitmapRenderingContext and 
514             PlaceholderRenderingContext.
515         
516         * html/canvas/ImageBitmapRenderingContext.cpp: Added.
517         (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
518         * html/canvas/ImageBitmapRenderingContext.h: Added.
519         * html/canvas/ImageBitmapRenderingContext.idl: Added.
520         * html/canvas/PlaceholderRenderingContext.cpp: Added.
521         (WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext):
522         * html/canvas/PlaceholderRenderingContext.h: Added.
523         
524             Add stubbed out implementations for the new contexts.
525
526 2017-10-06  Jer Noble  <jer.noble@apple.com>
527
528         Netflix playback fails with S7353 error
529         https://bugs.webkit.org/show_bug.cgi?id=178023
530
531         Reviewed by Dean Jackson.
532
533         On certain platforms, WebCoreDecompressionSession will fail to produce CVImageBuffers when presented with
534         encrypted content. On those platforms, the seek() command will fail, because frames at the destination time
535         cannot be decoded. This occurs for Netflix because the <video> element is not in the DOM at decode time.
536
537         Only create a WebCoreDecompressionSession in MediaPlayerPrivateMediaSourceAVFObjC when we have explicitly
538         been asked to paint into a WebGL canvas.
539
540         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
541         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
542
543 2017-10-06  Jiewen Tan  <jiewen_tan@apple.com>
544
545         Replace some stack raw pointers with RefPtrs within WebCore/dom
546         https://bugs.webkit.org/show_bug.cgi?id=177852
547         <rdar://problem/34804487>
548
549         Reviewed by Ryosuke Niwa.
550
551         This is an effort to reduce raw pointer usage in DOM code. In this patch,
552         stack raw pointers that could be freed during their lifetime because of
553         event dispatching, layout updating and etc are selected. All selections are
554         basing on code speculation.
555
556         No changes in behaviours.
557
558         * dom/ContainerNodeAlgorithms.cpp:
559         (WebCore::addChildNodesToDeletionQueue):
560         Escalate the RefPtr to where node is first defined.
561         * dom/Document.cpp:
562         (WebCore::Document::setVisualUpdatesAllowed):
563         (WebCore::Document::updateLayout):
564         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
565         Possible layout updates during their lifetime.
566         (WebCore::Document::implicitClose):
567         Possible event dispatching during its lifetime.
568         (WebCore::Document::nodeChildrenWillBeRemoved):
569         (WebCore::Document::nodeWillBeRemoved):
570         Possible node removal during their lifetime.
571         (WebCore::command):
572         Possible layout updates during its lifetime.
573         * dom/DocumentMarkerController.cpp:
574         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
575         Possible layout updates during its lifetime.
576         * dom/Element.cpp:
577         (WebCore::Element::removedFrom):
578          Possible event dispatching during its lifetime.
579         (WebCore::checkForSiblingStyleChanges):
580         Possible layout updates during their lifetime.
581         * dom/MouseRelatedEvent.cpp:
582         (WebCore::MouseRelatedEvent::computeRelativePosition):
583         Possible layout updates during its lifetime.
584         * dom/RadioButtonGroups.cpp:
585         (WebCore::RadioButtonGroup::setCheckedButton):
586         Possible layout updates during its lifetime.
587         * dom/SlotAssignment.cpp:
588         (WebCore::SlotAssignment::didChangeSlot):
589         Possible layout updates during its lifetime.
590
591 2017-10-06  Zalan Bujtas  <zalan@apple.com>
592
593         RootInlineBox should not hold a raw pointer to RenderObject
594         https://bugs.webkit.org/show_bug.cgi?id=178018
595         <rdar://problem/34859256>
596
597         Reviewed by Simon Fraser.
598
599         Not resetting the line break object could lead to dereferencing a stale renderer.  
600
601         Covered by existing tests.
602
603         * rendering/RootInlineBox.cpp:
604         (WebCore::RootInlineBox::RootInlineBox):
605         (WebCore::RootInlineBox::setLineBreakInfo):
606         * rendering/RootInlineBox.h:
607         (WebCore::RootInlineBox::lineBreakObj const):
608
609 2017-10-06  Youenn Fablet  <youenn@apple.com>
610
611         Removing some dead code in RTCPeerConnection
612         https://bugs.webkit.org/show_bug.cgi?id=178011
613
614         Reviewed by Alejandro G. Castro.
615
616         No change of behavior.
617         Removing code used by non-libwebrtc WebRTC backends.
618
619         * Modules/mediastream/RTCPeerConnection.cpp:
620         (WebCore::RTCPeerConnection::addTrack):
621         (WebCore::RTCPeerConnection::removeTrack):
622         (WebCore::RTCPeerConnection::completeAddTransceiver):
623
624 2017-10-05  Dean Jackson  <dino@apple.com>
625
626         ImageBitmap API stubs
627         https://bugs.webkit.org/show_bug.cgi?id=177984
628         <rdar://problem/34848023>
629
630         Patch by Sam and Dean.
631         Reviewed by Dean and Sam.
632
633         Add the IDL for ImageBitmap and ImageBitmapOptions, plus some
634         stub implementations (complete with all the algorithms from
635         the HTML specification as comments).
636
637         * CMakeLists.txt: Add the new files.
638         * DerivedSources.make: Create the JS bindings for ImageBitmap and ImageBitmapOptions.
639         * WebCore.xcodeproj/project.pbxproj:
640         * bindings/js/CallTracerTypes.h:
641         * html/ImageBitmap.cpp: Added.
642         (WebCore::ImageBitmap::create):
643         (WebCore::ImageBitmap::createPromise):
644         (WebCore::ImageBitmap::ImageBitmap):
645         (WebCore::ImageBitmap::~ImageBitmap):
646         (WebCore::ImageBitmap::width const):
647         (WebCore::ImageBitmap::height const):
648         (WebCore::ImageBitmap::close):
649         * html/ImageBitmap.h: Added.
650         (WebCore::ImageBitmap::isDetached const):
651         * html/ImageBitmap.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
652         * html/ImageBitmapOptions.h: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
653         * html/ImageBitmapOptions.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
654         * html/canvas/CanvasDrawImage.idl:
655         * html/canvas/CanvasFillStrokeStyles.idl:
656         * html/canvas/CanvasRenderingContext2D.cpp:
657         (WebCore::size):
658         (WebCore::CanvasRenderingContext2D::drawImage):
659         (WebCore::CanvasRenderingContext2D::createPattern):
660         * html/canvas/CanvasRenderingContext2D.h:
661         * inspector/InspectorCanvas.cpp:
662         (WebCore::InspectorCanvas::indexForData):
663         (WebCore::InspectorCanvas::buildAction):
664         (WebCore::InspectorCanvas::buildArrayForImageBitmap):
665         * inspector/InspectorCanvas.h:
666         * inspector/RecordingSwizzleTypes.h:
667
668 2017-10-06  Ms2ger  <Ms2ger@igalia.com>
669
670         Create bindings for WebGL2's versions of texImage2D.
671         https://bugs.webkit.org/show_bug.cgi?id=178006
672
673         Reviewed by Dean Jackson.
674
675         No new tests: not much point in adding tests now; this method doesn't
676         do anything anyway.
677
678         * html/canvas/WebGL2RenderingContext.cpp:
679         (WebCore::WebGL2RenderingContext::texImage2D):
680         * html/canvas/WebGL2RenderingContext.h:
681         * html/canvas/WebGL2RenderingContext.idl:
682         * html/canvas/WebGLRenderingContext.idl:
683         * html/canvas/WebGLRenderingContextBase.idl:
684
685 2017-10-06  Brady Eidson  <beidson@apple.com>
686
687         Add (entirely incorrect) fetching of ServiceWorker scripts.
688         https://bugs.webkit.org/show_bug.cgi?id=176179
689
690         Reviewed by Andy Estes.
691
692         No new tests (Covered by changes to existing tests).
693
694         When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
695           - Messages back to the WebContent process that started the register/update job
696           - Executes a FetchLoad in that script context for the script
697           - Sends the results back to the Storage process
698
699         We don't do anything with the results yet.
700
701         Soon.
702
703         * WebCore.xcodeproj/project.pbxproj:
704
705         * workers/WorkerScriptLoader.cpp:
706         (WebCore::WorkerScriptLoader::didFail):
707         * workers/WorkerScriptLoader.h:
708         (WebCore::WorkerScriptLoader::error const):
709
710         * workers/WorkerScriptLoaderClient.h:
711         (WebCore::WorkerScriptLoaderClient::~WorkerScriptLoaderClient):
712         (WebCore::WorkerScriptLoaderClient::didReceiveResponse): Deleted.
713         (WebCore::WorkerScriptLoaderClient::notifyFinished): Deleted.
714
715         * workers/service/ServiceWorkerContainer.cpp:
716         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
717         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
718         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
719         * workers/service/ServiceWorkerContainer.h:
720
721         * workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
722         (WebCore::ServiceWorkerFetchResult::encode const):
723         (WebCore::ServiceWorkerFetchResult::decode):
724
725         * workers/service/ServiceWorkerJob.cpp:
726         (WebCore::ServiceWorkerJob::startScriptFetch):
727         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
728         (WebCore::ServiceWorkerJob::didReceiveResponse):
729         (WebCore::ServiceWorkerJob::notifyFinished):
730         * workers/service/ServiceWorkerJob.h:
731         * workers/service/ServiceWorkerJobClient.h:
732
733         * workers/service/server/SWClientConnection.cpp:
734         (WebCore::SWClientConnection::finishedFetchingScript):
735         (WebCore::SWClientConnection::failedFetchingScript):
736         (WebCore::SWClientConnection::startScriptFetchForServer):
737         * workers/service/server/SWClientConnection.h:
738
739         * workers/service/server/SWServer.cpp:
740         (WebCore::SWServer::Connection::finishFetchingScriptInServer):
741         (WebCore::SWServer::startScriptFetch):
742         (WebCore::SWServer::scriptFetchFinished):
743         * workers/service/server/SWServer.h:
744
745         * workers/service/server/SWServerRegistration.cpp:
746         (WebCore::SWServerRegistration::scriptFetchFinished):
747         (WebCore::SWServerRegistration::runUpdateJob):
748         (WebCore::SWServerRegistration::startScriptFetchFromMainThread):
749         (WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
750         * workers/service/server/SWServerRegistration.h:
751
752 2017-10-06  Zan Dobersek  <zdobersek@igalia.com>
753
754         [Cairo] Create Cairo patterns from Gradient objects on-the-fly
755         https://bugs.webkit.org/show_bug.cgi?id=177947
756
757         Reviewed by Carlos Garcia Campos.
758
759         Stop caching cairo_pattern_t objects for a specific global alpha value
760         in the Gradient class. Instead, create these as required, for whatever
761         alpha value. This drops some efficiency benefits in exchange for better
762         Cairo operation isolation, while also matching the same approach that
763         is used in the Pattern implementation for Cairo.
764
765         Introduce the createPlatformGradient() method for Cairo, resuing the
766         implementation of platformGradient() that's now removed. The
767         Cairo-specific setPlatformGradientSpaceTransform() method is also
768         removed since there's no cached cairo_pattern_t object that we can
769         update. The Cairo-specific m_platformGradientAlpha member float is also
770         deleted.
771
772         Gradient::fill() and prepareCairoContextSource() are the only two places
773         that need to create a cairo_pattern_t object off of Gradient, so they
774         are updated accordingly.
775
776         No new tests -- no changes in behavior.
777
778         * platform/graphics/Gradient.cpp:
779         (WebCore::Gradient::setGradientSpaceTransform):
780         (WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
781         * platform/graphics/Gradient.h:
782         * platform/graphics/cairo/GradientCairo.cpp:
783         (WebCore::Gradient::platformDestroy):
784         (WebCore::Gradient::createPlatformGradient):
785         (WebCore::Gradient::fill):
786         (WebCore::Gradient::platformGradient): Deleted.
787         (WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
788         * platform/graphics/cairo/PlatformContextCairo.cpp:
789         (WebCore::prepareCairoContextSource):
790
791 2017-10-06  Ms2ger  <Ms2ger@igalia.com>
792
793         Create bindings for WebGL2's versions of compressedTexImage2D.
794         https://bugs.webkit.org/show_bug.cgi?id=177481
795
796         Reviewed by Žan Doberšek.
797
798         No new tests: not much point in adding tests now; this method doesn't
799         do anything anyway.
800
801         * html/canvas/WebGL2RenderingContext.cpp:
802         (WebCore::WebGL2RenderingContext::compressedTexImage2D):
803         * html/canvas/WebGL2RenderingContext.h:
804         * html/canvas/WebGL2RenderingContext.idl:
805         * html/canvas/WebGLRenderingContext.idl:
806         * html/canvas/WebGLRenderingContextBase.idl:
807
808 2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>
809
810         [GStreamer][MSE] Likely race condition causes WTF::Deque to crash on debug
811         https://bugs.webkit.org/show_bug.cgi?id=177410
812
813         Reviewed by Xabier Rodriguez-Calvar.
814
815         Deque keeps a chain of iterators which is updated as iterators are
816         created/destroyed. This can cause problems when iterators are created
817         from multiple threads as they are now, sometimes without proper
818         locking because it's not actually needed.
819
820         For instance, the lock in PlaybackPipeline::enqueueSample() is not
821         needed because none of the accesses are actually risky. Locking there
822         just to make Deque happy would only cause a performance penalty on the
823         readers working in other threads.
824
825         No new tests.
826
827         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
828         (WebCore::PlaybackPipeline::addSourceBuffer): Use Vector instead of
829         Deque.
830         (WebCore::PlaybackPipeline::removeSourceBuffer): Ditto.
831         (WebCore::PlaybackPipeline::enqueueSample): Remove lock and explain
832         why it's not needed.
833         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
834         (webKitMediaSrcFinalize): Use Vector.
835         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
836         Use Vector.
837
838 2017-10-06  Zan Dobersek  <zdobersek@igalia.com>
839
840         Remove dead code from Pattern
841         https://bugs.webkit.org/show_bug.cgi?id=177945
842
843         Reviewed by Carlos Garcia Campos.
844
845         Drop the platormDestroy() and setPlatformPatternSpaceTransform() methods
846         from the Pattern class -- these were empty implementations, with no port
847         providing their own. The destructor is defaulted in the implementation
848         file. The m_pattern member variable is also dropped as it was unused.
849
850         No new tests -- no change in behavior.
851
852         * platform/graphics/Pattern.cpp:
853         (WebCore::Pattern::setPatternSpaceTransform):
854         (WebCore::Pattern::~Pattern): Deleted.
855         (WebCore::Pattern::platformDestroy): Deleted.
856         (WebCore::Pattern::setPlatformPatternSpaceTransform): Deleted.
857         * platform/graphics/Pattern.h:
858
859 2017-10-06  Carlos Alberto Lopez Perez  <clopez@igalia.com>
860
861         [GTK][Clang] Build fix after r222926
862         https://bugs.webkit.org/show_bug.cgi?id=175384
863
864         Unreviewed build fix.
865
866         * css/CSSFontFace.cpp:
867         (WebCore::CSSFontFace::setStatus):
868
869 2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>
870
871         [MSE][GStreamer] Seek on youtube.com/tv fails after r217185
872         https://bugs.webkit.org/show_bug.cgi?id=177976
873
874         Reviewed by Jer Noble.
875
876         Covered by existing tests.
877
878         * Modules/mediasource/MediaSource.cpp:
879         (WebCore::MediaSource::seekToTime): Only call waitForSeekCompleted()
880         when the time is not buffered when using GStreamer.
881
882 2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>
883
884         [MSE] Dead code in SourceBuffer::appendBufferTimerFired()
885         https://bugs.webkit.org/show_bug.cgi?id=177951
886
887         Reviewed by Jer Noble.
888
889         Covered by LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html.
890
891         * Modules/mediasource/SourceBuffer.cpp:
892         (WebCore::SourceBuffer::appendBufferTimerFired): Remove redundant code.
893
894 2017-10-06  Ryosuke Niwa  <rniwa@webkit.org>
895
896         Split StaticPasteboard::writeString into writeString and writeStringInCustomData
897         https://bugs.webkit.org/show_bug.cgi?id=177991
898
899         Reviewed by Wenson Hsieh.
900
901         Split writeString into the one that writes into the plaform pasteboard natively and the custom pasteboard data like we did
902         in r222680 for readString and readStringInCustomData.
903
904         * dom/DataTransfer.cpp:
905         (WebCore::DataTransfer::setData):
906         (WebCore::DataTransfer::setDataFromItemList): Extracted out of setData.
907         * dom/DataTransfer.h:
908         * dom/DataTransferItemList.cpp:
909         (WebCore::DataTransferItemList::add):
910         * platform/StaticPasteboard.cpp:
911         (WebCore::updateTypes): Extacted out of writeString.
912         (WebCore::StaticPasteboard::writeString):
913         (WebCore::StaticPasteboard::writeStringInCustomData):
914         * platform/StaticPasteboard.h:
915
916 2017-10-05  Dean Jackson  <dino@apple.com>
917
918         [WebGL] Safari performance is slow due to high MSAA usage
919         https://bugs.webkit.org/show_bug.cgi?id=177949
920         <rdar://problem/34835619>
921
922         Reviewed by Sam Weinig.
923
924         On some hardware, typically integrated GPUs, using MSAA with a sample
925         count above 4 produces bad performance. Limit the number of samples to
926         4 universally.
927
928         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
929         (WebCore::GraphicsContext3D::reshapeFBOs):
930
931 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
932
933         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
934         https://bugs.webkit.org/show_bug.cgi?id=168171
935
936         Reviewed by Chris Dumez.
937
938         Add an implementation of FileMonitor for GLib based ports.
939
940         * PlatformGTK.cmake:
941         * PlatformWPE.cmake:
942         * platform/FileMonitor.cpp:
943         * platform/FileMonitor.h:
944         * platform/glib/FileMonitorGLib.cpp: Added.
945         (WebCore::FileMonitor::FileMonitor):
946         (WebCore::FileMonitor::~FileMonitor):
947         (WebCore::FileMonitor::fileChangedCallback):
948         (WebCore::FileMonitor::didChange):
949
950 2017-10-05  Dean Jackson  <dino@apple.com>
951
952         Lots of missing frames in YouTube360 when fullscreen on MacBook
953         https://bugs.webkit.org/show_bug.cgi?id=177903
954         <rdar://problem/33273300>
955
956         Reviewed by Sam Weinig.
957
958         Our compositing path for WebGL on macOS was too slow, requiring a copy
959         of the framebuffer into another GL context. Replace this by having
960         WebGL render into a texture that is backed by an IOSurface, and then
961         set the WebGLLayer to use the IOSurface as contents.
962
963         Covered by the existing WebGL tests.
964
965         * platform/graphics/GraphicsContext3D.h:
966         (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
967         framebuffer object outside the class, so change this to return the GL texture
968         that the framebuffer is rendering in to. It was kind-of strange that it was
969         named this way originally.
970         Also make endPaint available on macOS, and add the definitions for
971         createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.
972
973         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
974         (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
975         we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
976         (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
977         so add a comment that explains the extra work that iOS needs to do. At some future
978         point it would be nice to make this slightly cleaner, so that iOS and macOS are
979         more similar.
980         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
981         into the corresponding WebGLLayer function.
982         (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.
983
984         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
985         (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
986         into another buffer need to fill out the alpha channel if this context was
987         created without one, otherwise the IOSurface backing store will happily provide
988         what might be non-zero values.
989         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
990         (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
991         function to use an IOSurface as the framebuffer texture.
992         (WebCore::GraphicsContext3D::readPixels): Call the helper above.
993
994         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
995         (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
996         deprecated setContentsChanged with reloadValueForKeyPath.
997
998         * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
999         inherits from CALayer directly rather than CAOpenGLLayer. It also adds
1000         a few member variables to handle the IOSurfaces used for triple buffering.
1001
1002         * platform/graphics/cocoa/WebGLLayer.mm:
1003         (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
1004         alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
1005         to identity, so that it calls into the code below to flip the contents.
1006         (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
1007         we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
1008         Instead we have to apply a scale(1, -1) transform on top of the layer transform to
1009         make sure the layer is rendered right-way up.
1010         (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
1011         at the bottom of the layer, so flip the Y value.
1012         (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
1013         then get a new buffer ready for display.
1014         (createAppropriateIOSurface): Helper.
1015         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
1016         IOSurfaces used for drawing buffers.
1017         (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
1018         make it the drawing buffer (binding in to WebGL at the same time).
1019         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
1020         (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
1021         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
1022
1023         * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.
1024
1025 2017-10-05  Frederic Wang  <fwang@igalia.com>
1026
1027         Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
1028         https://bugs.webkit.org/show_bug.cgi?id=177994
1029
1030         Reviewed by Michael Catanzaro.
1031
1032         No new tests, already covered by existing tests.
1033
1034         * CMakeLists.txt: Include the directory for public headers instead.
1035         * platform/graphics/WOFFFileFormat.cpp: Use the public header
1036         woff2/decode.h and do not use the "wOF2" constant from private headers.
1037         (WebCore::isWOFF):
1038         (WebCore::convertWOFFToSfnt):
1039
1040 2017-10-05  Commit Queue  <commit-queue@webkit.org>
1041
1042         Unreviewed, rolling out r222951 and r222952.
1043         https://bugs.webkit.org/show_bug.cgi?id=177992
1044
1045         "Broke the iOS build and introduced a webgl LayoutTest
1046         failure." (Requested by ryanhaddad on #webkit).
1047
1048         Reverted changesets:
1049
1050         "Lots of missing frames in YouTube360 when fullscreen on
1051         MacBook"
1052         https://bugs.webkit.org/show_bug.cgi?id=177903
1053         http://trac.webkit.org/changeset/222951
1054
1055         "Lots of missing frames in YouTube360 when fullscreen on
1056         MacBook"
1057         https://bugs.webkit.org/show_bug.cgi?id=177903
1058         http://trac.webkit.org/changeset/222952
1059
1060 2017-10-05  Ryosuke Niwa  <rniwa@webkit.org>
1061
1062         DataTransfer shouldn't contain text/html when performing Paste and Match Style
1063         https://bugs.webkit.org/show_bug.cgi?id=174165
1064         <rdar://problem/33138027>
1065
1066         Reviewed by Wenson Hsieh.
1067
1068         When performing Paste and Match Style, only expose the plain text by creating a StaticPasteboard with plain text content.
1069
1070         This patch introduces ClipboardEventKind enum class to differentiate regular paste and paste and match style (internally
1071         called as pasteAsPlainText) since both operations use "paste" event.
1072
1073         Tests: editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled.html
1074                editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text.html
1075
1076         * dom/DataTransfer.cpp:
1077         (WebCore::DataTransfer::createForCopyAndPaste): Made this function take Pasteboard as an argument.
1078         * dom/DataTransfer.h:
1079         * editing/Editor.cpp:
1080         (WebCore::ClipboardEventKind): Added.
1081         (WebCore::eventNameForClipboardEvent): Added.
1082         (WebCore::createDataTransferForClipboardEvent): Added.
1083         (WebCore::dispatchClipboardEvent):
1084         (WebCore::Editor::canDHTMLCut):
1085         (WebCore::Editor::canDHTMLCopy):
1086         (WebCore::Editor::canDHTMLPaste):
1087         (WebCore::Editor::tryDHTMLCopy):
1088         (WebCore::Editor::tryDHTMLCut):
1089         (WebCore::Editor::tryDHTMLPaste): Deleted.
1090         (WebCore::Editor::paste):
1091         (WebCore::Editor::pasteAsPlainText):
1092         * platform/ios/PasteboardIOS.mm:
1093         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Add "text/html" when public.html UTI is in the pasteboard
1094         even when the custom pasteboard data is disabled. We continue to add public.html in the case some app dependent on
1095         seeing "public.html" in dataTransfer.types.
1096
1097 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1098
1099         RenderTable should not hold section raw pointers
1100         https://bugs.webkit.org/show_bug.cgi?id=177977
1101         <rdar://problem/34846034>
1102
1103         Reviewed by Simon Fraser.
1104
1105         This enables us to remove forced recalcSections calls.
1106
1107         Covered by existing tests.
1108
1109         * rendering/RenderTable.cpp:
1110         (WebCore::RenderTable::RenderTable):
1111         (WebCore::resetSectionPointerIfNotBefore):
1112         (WebCore::RenderTable::addChild):
1113         (WebCore::RenderTable::recalcSections const):
1114         (WebCore::RenderTable::sectionAbove const):
1115         * rendering/RenderTable.h:
1116         (WebCore::RenderTable::header const):
1117         (WebCore::RenderTable::footer const):
1118         (WebCore::RenderTable::firstBody const):
1119         (WebCore::RenderTable::topSection const):
1120
1121 2017-10-05  Dean Jackson  <dino@apple.com>
1122
1123         Lots of missing frames in YouTube360 when fullscreen on MacBook
1124         https://bugs.webkit.org/show_bug.cgi?id=177903
1125         <rdar://problem/33273300>
1126
1127         iOS build fix.
1128
1129         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1130
1131 2017-10-05  Dean Jackson  <dino@apple.com>
1132
1133         Lots of missing frames in YouTube360 when fullscreen on MacBook
1134         https://bugs.webkit.org/show_bug.cgi?id=177903
1135         <rdar://problem/33273300>
1136
1137         Reviewed by Sam Weinig.
1138
1139         Our compositing path for WebGL on macOS was too slow, requiring a copy
1140         of the framebuffer into another GL context. Replace this by having
1141         WebGL render into a texture that is backed by an IOSurface, and then
1142         set the WebGLLayer to use the IOSurface as contents.
1143
1144         Covered by the existing WebGL tests.
1145
1146         * platform/graphics/GraphicsContext3D.h:
1147         (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
1148         framebuffer object outside the class, so change this to return the GL texture
1149         that the framebuffer is rendering in to. It was kind-of strange that it was
1150         named this way originally.
1151         Also make endPaint available on macOS, and add the definitions for
1152         createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.
1153
1154         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1155         (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
1156         we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
1157         (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
1158         so add a comment that explains the extra work that iOS needs to do. At some future
1159         point it would be nice to make this slightly cleaner, so that iOS and macOS are
1160         more similar.
1161         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
1162         into the corresponding WebGLLayer function.
1163         (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.
1164
1165         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1166         (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
1167         into another buffer need to fill out the alpha channel if this context was
1168         created without one, otherwise the IOSurface backing store will happily provide
1169         what might be non-zero values.
1170         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
1171         (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
1172         function to use an IOSurface as the framebuffer texture.
1173         (WebCore::GraphicsContext3D::readPixels): Call the helper above.
1174
1175         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1176         (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
1177         deprecated setContentsChanged with reloadValueForKeyPath.
1178
1179         * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
1180         inherits from CALayer directly rather than CAOpenGLLayer. It also adds
1181         a few member variables to handle the IOSurfaces used for triple buffering.
1182
1183         * platform/graphics/cocoa/WebGLLayer.mm:
1184         (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
1185         alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
1186         to identity, so that it calls into the code below to flip the contents.
1187         (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
1188         we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
1189         Instead we have to apply a scale(1, -1) transform on top of the layer transform to
1190         make sure the layer is rendered right-way up.
1191         (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
1192         at the bottom of the layer, so flip the Y value.
1193         (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
1194         then get a new buffer ready for display.
1195         (createAppropriateIOSurface): Helper.
1196         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
1197         IOSurfaces used for drawing buffers.
1198         (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
1199         make it the drawing buffer (binding in to WebGL at the same time).
1200         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
1201         (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
1202         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
1203
1204         * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.
1205
1206 2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
1207
1208         Add "display" to FontFace Javascript object
1209         https://bugs.webkit.org/show_bug.cgi?id=175383
1210         <rdar://problem/33813239>
1211
1212         Reviewed by Simon Fraser.
1213
1214         We already have all the necessary infrastructure. Just hook it up to the .idl file!
1215
1216         Test: fast/text/font-loading-font-display.html
1217
1218         * css/CSSFontFace.h:
1219         * css/CSSPrimitiveValueMappings.h:
1220         * css/FontFace.cpp:
1221         (WebCore::FontFace::create):
1222         (WebCore::FontFace::setDisplay):
1223         (WebCore::FontFace::display const):
1224         * css/FontFace.h:
1225         * css/FontFace.idl:
1226
1227 2017-10-05  Jer Noble  <jer.noble@apple.com>
1228
1229         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
1230         https://bugs.webkit.org/show_bug.cgi?id=177261
1231
1232         Reviewed by Eric Carlson.
1233
1234         Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
1235         to co-exist while both enabled simultaneously.
1236
1237         * Configurations/FeatureDefines.xcconfig:
1238         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
1239         (WebCore::LegacyCDM::registerCDMFactory):
1240         (WebCore::LegacyCDM::supportsKeySystem):
1241         (WebCore::LegacyCDM::keySystemSupportsMimeType):
1242         (WebCore::LegacyCDM::create):
1243         (WebCore::LegacyCDM::LegacyCDM):
1244         (WebCore::LegacyCDM::~LegacyCDM):
1245         (WebCore::LegacyCDM::supportsMIMEType const):
1246         (WebCore::LegacyCDM::createSession):
1247         (WebCore::LegacyCDM::mediaPlayer const):
1248         (WebCore::CDM::registerCDMFactory): Deleted.
1249         (WebCore::CDM::supportsKeySystem): Deleted.
1250         (WebCore::CDM::keySystemSupportsMimeType): Deleted.
1251         (WebCore::CDM::create): Deleted.
1252         (WebCore::CDM::CDM): Deleted.
1253         (WebCore::CDM::~CDM): Deleted.
1254         (WebCore::CDM::supportsMIMEType const): Deleted.
1255         (WebCore::CDM::createSession): Deleted.
1256         (WebCore::CDM::mediaPlayer const): Deleted.
1257         * Modules/encryptedmedia/legacy/LegacyCDM.h:
1258         (WebCore::LegacyCDMClient::~LegacyCDMClient):
1259         (WebCore::LegacyCDM::client const):
1260         (WebCore::LegacyCDM::setClient):
1261         (WebCore::CDMClient::~CDMClient): Deleted.
1262         (WebCore::CDM::keySystem const): Deleted.
1263         (WebCore::CDM::client const): Deleted.
1264         (WebCore::CDM::setClient): Deleted.
1265         * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
1266         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
1267         (WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
1268         (WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
1269         (WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
1270         (WebCore::LegacyCDMPrivateClearKey::createSession):
1271         (WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
1272         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
1273         (WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
1274         (WebCore::CDMPrivateClearKey::createSession): Deleted.
1275         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
1276         (WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
1277         (WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
1278         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
1279         (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
1280         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
1281         (WebCore::CDMPrivateMediaPlayer::createSession):
1282         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
1283         (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
1284         (WebCore::CDMPrivateMediaPlayer::cdm const):
1285         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1286         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
1287         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
1288         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1289         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1290         (WebCore::WebKitMediaKeys::create):
1291         (WebCore::WebKitMediaKeys::WebKitMediaKeys):
1292         (WebCore::WebKitMediaKeys::isTypeSupported):
1293         (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
1294         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1295         * WebCore.xcodeproj/project.pbxproj:
1296         * platform/encryptedmedia/CDMFactory.cpp:
1297         (WebCore::CDMFactory::platformRegisterFactories):
1298         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1299         (WebCore::ClearKeyState::singleton):
1300         (WebCore::parseJSONObject):
1301         (WebCore::parseLicenseFormat):
1302         (WebCore::parseLicenseReleaseAcknowledgementFormat):
1303         (WebCore::CDMFactoryClearKey::singleton):
1304         (WebCore::containsPersistentLicenseType):
1305         (WebCore::CDMInstanceClearKey::keySystem const):
1306         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1307         * platform/graphics/LegacyCDMSession.h:
1308         (WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
1309         (WebCore::CDMSession::type):
1310         (WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
1311         * platform/graphics/MediaPlayer.cpp:
1312         (WebCore::MediaPlayer::createSession):
1313         * platform/graphics/MediaPlayer.h:
1314         * platform/graphics/MediaPlayerPrivate.h:
1315         (WebCore::MediaPlayerPrivateInterface::createSession):
1316         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1317         (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
1318         (WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
1319         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1320         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
1321         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1322         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
1323         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1324         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
1325         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1326         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
1327         (WebCore::CDMSessionAVContentKeySession::update):
1328         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1329         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1330         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
1331         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1332         (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
1333         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1334         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1335         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
1336         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1337         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1338         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
1339         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
1340         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
1341         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1342         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1343         (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
1344         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
1345         * testing/Internals.cpp:
1346         (WebCore::Internals::initializeMockCDM):
1347         * testing/LegacyMockCDM.cpp:
1348         (WebCore::LegacyMockCDM::supportsKeySystem):
1349         (WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
1350         (WebCore::LegacyMockCDM::supportsMIMEType):
1351         (WebCore::LegacyMockCDM::createSession):
1352         (WebCore::MockCDMSession::MockCDMSession):
1353         (WebCore::MockCDM::supportsKeySystem): Deleted.
1354         (WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
1355         (WebCore::MockCDM::supportsMIMEType): Deleted.
1356         (WebCore::MockCDM::createSession): Deleted.
1357         * testing/LegacyMockCDM.h:
1358         (WebCore::LegacyMockCDM::LegacyMockCDM):
1359         (WebCore::LegacyMockCDM::~LegacyMockCDM):
1360         (WebCore::MockCDM::MockCDM): Deleted.
1361         (WebCore::MockCDM::~MockCDM): Deleted.
1362         * testing/MockCDMFactory.cpp:
1363         (WebCore::MockCDMInstance::keySystem const):
1364
1365 2017-10-05  John Wilander  <wilander@apple.com>
1366
1367         Storage Access API: Web process should ask UI process for grant/deny
1368         https://bugs.webkit.org/show_bug.cgi?id=176941
1369         <rdar://problem/34440036>
1370
1371         Reviewed by Chris Dumez and Sam Weinig.
1372
1373         Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html
1374                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
1375                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
1376
1377         This patch changes Document::requestStorageAccess() so that it
1378         calls the ChromeClient instead of the ResourceLoadObserver to
1379         request storage access on behalf of the iframe.
1380         The patch also changes how the promise is used, from returning
1381         a boolean to either resolving or rejecting to signal grant/deny
1382         access respectively.
1383
1384         * dom/Document.cpp:
1385         (WebCore::Document::requestStorageAccess):
1386         * dom/Document.idl:
1387         * loader/ResourceLoadObserver.cpp:
1388         (WebCore::ResourceLoadObserver::registerStorageAccess): Deleted.
1389         * loader/ResourceLoadObserver.h:
1390         * page/ChromeClient.h:
1391
1392 2017-10-05  Brian Burg  <bburg@apple.com>
1393
1394         Web Inspector: EventLoop::cycle() should not send nil NSEvents
1395         https://bugs.webkit.org/show_bug.cgi?id=177971
1396         <rdar://problem/20387399>
1397
1398         Reviewed by Joseph Pecoraro.
1399
1400         It is possible for the next matching event to be nil.
1401         WebKit clients don't expect to be sent a nil NSEvent, so add a null check here.
1402
1403         * platform/mac/EventLoopMac.mm:
1404         (WebCore::EventLoop::cycle):
1405
1406 2017-10-05  Chris Dumez  <cdumez@apple.com>
1407
1408         Drop unused parameters for CookiesStrategy::cookiesEnabled()
1409         https://bugs.webkit.org/show_bug.cgi?id=177957
1410
1411         Reviewed by Alex Christensen.
1412
1413         * loader/CookieJar.cpp:
1414         (WebCore::cookiesEnabled):
1415         * platform/CookiesStrategy.h:
1416         * platform/network/PlatformCookieJar.h:
1417         * platform/network/cf/CookieJarCFNet.cpp:
1418         (WebCore::cookiesEnabled):
1419         * platform/network/curl/CookieJarCurl.cpp:
1420         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
1421         (WebCore::cookiesEnabled):
1422         * platform/network/curl/CookieJarCurl.h:
1423         * platform/network/mac/CookieJarMac.mm:
1424         (WebCore::cookiesEnabled):
1425         * platform/network/soup/CookieJarSoup.cpp:
1426         (WebCore::cookiesEnabled):
1427
1428 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1429
1430         RenderListItem should not hold raw pointers to RenderListMarker.
1431         https://bugs.webkit.org/show_bug.cgi?id=177968
1432         <rdar://problem/34842943>
1433
1434         Reviewed by Antti Koivisto.
1435
1436         Now we don't need to unregister the marker from the list item explicitly.
1437
1438         Covered by existing tests.
1439
1440         * rendering/RenderListItem.cpp:
1441         (WebCore::RenderListItem::RenderListItem):
1442         (WebCore::RenderListItem::willBeDestroyed):
1443         (WebCore::RenderListItem::positionListMarker):
1444         * rendering/RenderListItem.h:
1445         * rendering/RenderListMarker.cpp:
1446         (WebCore::RenderListMarker::willBeDestroyed):
1447         * style/RenderTreeUpdaterListItem.cpp:
1448         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
1449
1450 2017-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1451
1452         RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testing if the overflow is visible
1453         https://bugs.webkit.org/show_bug.cgi?id=177953
1454         <rdar://problem/34788389>
1455
1456         Reviewed by Simon Fraser.
1457
1458         Test: svg/hittest/svg-visual-overflow-rect.html
1459
1460         If an SVGElement is positioned outside the rectangle of the root element,
1461         it can still be drawn if the root element has "overflow: visible" applied.
1462         But since SVGElement can be drawn in this case, it should be accessible
1463         through nodeAtPoint() which is used for hit testing.
1464
1465         * rendering/svg/RenderSVGRoot.cpp:
1466         (WebCore::RenderSVGRoot::nodeAtPoint):
1467
1468 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1469
1470         RenderButton should not hold raw pointers to its direct children.
1471         https://bugs.webkit.org/show_bug.cgi?id=177960
1472         <rdar://problem/34840807>
1473
1474         Reviewed by Antti Koivisto.
1475
1476         The correct way of destroying a renderer is to call ::removeFromParentAndDestroy().
1477
1478         Covered by existing tests.
1479
1480         * rendering/RenderButton.cpp:
1481         (WebCore::RenderButton::RenderButton):
1482         (WebCore::RenderButton::addChild):
1483         (WebCore::RenderButton::takeChild):
1484         (WebCore::RenderButton::updateAnonymousChildStyle const):
1485         (WebCore::RenderButton::setText):
1486         (WebCore::RenderButton::text const):
1487         * rendering/RenderButton.h:
1488
1489 2017-10-05  David Kilzer  <ddkilzer@apple.com>
1490
1491         Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
1492         <https://webkit.org/b/177893>
1493         <rdar://problem/33667497>
1494
1495         Reviewed by Tim Horton.
1496
1497         * Configurations/Base.xcconfig:
1498         (WARNING_CFLAGS): Remvoe -Wcast-qual until we can provide a safe
1499         cast function that lets us re-enable the warning.
1500
1501 2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
1502
1503         Implement font-display loading behaviors
1504         https://bugs.webkit.org/show_bug.cgi?id=175384
1505         <rdar://problem/33813243>
1506
1507         Reviewed by Darin Adler.
1508
1509         The font-display descriptors works off of the following model of font loading:
1510
1511         1. When a font loads, the @font-face enters the first phase, called the "block period." Here,
1512         text using this @font-face is rendered as invisible using a fallback font for metrics. If the
1513         file finishes loading during this period, it is swapped in (visibly).
1514         2. When the first phase is over, the @font-face enters the second phase, called the "swap
1515         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
1516         file finishes loading during this period, it is swapped in.
1517         3. When the second phase is over, the @font-face enters the third phase, called the "failure
1518         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
1519         file finishes loading during this period, it is not swapped in (but it does live in the
1520         network cache for subsequent page loads). This phase lasts forever.
1521
1522         The font-display descriptor changes the duration of these phases. For example, our default
1523         font loading behavior can be achieved by making the first phase 3 seconds long and making the
1524         second phase infinitely long (so the third phase is never reached).
1525
1526         Luckily, our CSSFontFace class already has states which correspond to each phase listed above:
1527         Loading, TimedOut, and Failure. This patch migrates our existing 3-second timer to have logic
1528         to correctly set the timeout duration based on the value of the font-display descriptor and
1529         the current status(). This occurs inside CSSFontFace::setStatus().
1530
1531         This has implications for testing. Previously, our tests for the font loading behavior had a
1532         single boolean that describes whether or not font loads should immediately jump to the "swap
1533         period". Clearly, this is insufficient for testing all aspects of the font-display descriptor.
1534         Instead, this patch deletes this existing infrastructure and instead creates three more fake
1535         values of font-display (achieved in tests by using window.internals). These fake values make
1536         fonts immediately jump into a particular state and stay there forever (so the timeout values
1537         are, for example, [0, infinity, infinity] to test the swap period). This works because
1538         CSSFontFace is smart enough to synchronously move between states that have a 0 timeout, so
1539         there is no race between these timers and font loads.
1540
1541         We also need to test the behavior when a file downloads and when a file hasn't been loaded
1542         yet (and the @font-face is in a particular state). Therefore, this patch adds another bool
1543         which indicates whether the font subsystem should totally ignore font load events. This means
1544         that a font will successfully download (and DOMContentLoaded will be fired, because that
1545         uses the loading subsystem), but the font subsystem will plug its ears and ignore the load.
1546         This means we can test the invisibility of text during the "block period" because DRT will
1547         see that the page load has completed, but the font subsystem will pretend like the font is
1548         still loading and draw invisibly.
1549
1550         Therefore, there are 6 tests: a test to test each of the 3 states an @font-face block may be
1551         in, times 2 for whether or not we are ignoring font loads. These are more comprehensive than
1552         the existing font loading tests which used internals.settings.setWebFontsAlwaysFallBack(),
1553         so I deleted those tests in favor of these new ones.
1554
1555         Tests: fast/text/loading-block-finish.html
1556                fast/text/loading-block-nofinish.html
1557                fast/text/loading-failure-finish.html
1558                fast/text/loading-failure-nofinish.html
1559                fast/text/loading-swap-finish.html
1560                fast/text/loading-swap-nofinish.html
1561
1562         * css/CSSFontFace.cpp:
1563         (WebCore::CSSFontFace::setLoadingBehavior):
1564         (WebCore::CSSFontFace::fontLoadEventOccurred): Remove old testing infrastructure.
1565         (WebCore::CSSFontFace::timeoutFired): Previously, the timer was only used for going
1566         from Loading -> TimedOut. Now, we have to ask the status() to figure out which
1567         state transition we should be performing.
1568         (WebCore::CSSFontFace::allSourcesFailed const): A Failed state needs to return true
1569         here, even if some of the sources successfully downloaded.
1570         (WebCore::CSSFontFace::setStatus): The logic to figure out how long to set the timer
1571         for. Also, if the timer value is 0, synchronously recurse to change the status instead
1572         of setting a 0-delay timer.
1573         (WebCore::CSSFontFace::fontLoaded): Remove old testing infrastructure.
1574         (WebCore::CSSFontFace::fontTimeoutIndex const): Implement new testing infrastructure.
1575         (WebCore::CSSFontFace::shouldIgnoreFontLoadCompletions const): Ditto.
1576         (WebCore::CSSFontFace::pump): See comment. Also, we're allowed to be in the Failure
1577         state in more scenarios now, so relax some of our ASSERT()s.
1578         (WebCore::CSSFontFace::font): Ditto.
1579         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack const): Deleted.
1580         * css/CSSFontFace.h: Migrate to new testing infrastructure.
1581         * css/CSSFontFaceSource.cpp:
1582         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Implement new testing infrastructure.
1583         (WebCore::CSSFontFaceSource::shouldIgnoreFontLoadCompletions const): Ditto.
1584         (WebCore::CSSFontFaceSource::fontLoaded): Ditto.
1585         * css/CSSFontFaceSource.h:
1586         * css/CSSFontSelector.cpp:
1587         (WebCore::CSSFontSelector::beginLoadingFontSoon): Remove old testing infrastructure.
1588         * css/CSSSegmentedFontFace.cpp: It's possible to get different values out of
1589         CSSFontFace::font() in successive calls during the same runloop. FontRanges will 
1590         include a raw pointer to one of the values, so all the values need to be kept alive.
1591         * page/Settings.cpp: Migrate to new testing infrastructure.
1592         (WebCore::Settings::Settings):
1593         (WebCore::Settings::setFontTimeoutIndex):
1594         (WebCore::Settings::setShouldIgnoreFontLoadCompletions):
1595         (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
1596         * page/Settings.h: Ditto.
1597         (WebCore::Settings::fontTimeoutIndex const):
1598         (WebCore::Settings::shouldIgnoreFontLoadCompletions const):
1599         (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
1600         * testing/InternalSettings.cpp: Ditto.
1601         (WebCore::InternalSettings::Backup::Backup):
1602         (WebCore::InternalSettings::Backup::restoreTo):
1603         (WebCore::InternalSettings::setFontTimeoutIndex):
1604         (WebCore::InternalSettings::setShouldIgnoreFontLoadCompletions):
1605         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Deleted.
1606         * testing/InternalSettings.h: Ditto.
1607         * testing/InternalSettings.idl: Ditto.
1608
1609 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1610
1611         RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
1612         https://bugs.webkit.org/show_bug.cgi?id=177950
1613         <rdar://problem/34837002>
1614
1615         Reviewed by Antti Koivisto.
1616
1617         Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
1618         RenderMathMLFenced.
1619
1620         Covered by existing test cases.
1621
1622         * rendering/mathml/RenderMathMLFenced.cpp:
1623         (WebCore::RenderMathMLFenced::RenderMathMLFenced):
1624         (WebCore::RenderMathMLFenced::makeFences):
1625         (WebCore::RenderMathMLFenced::addChild):
1626         * rendering/mathml/RenderMathMLFenced.h:
1627
1628 2017-10-05  Andy Estes  <aestes@apple.com>
1629
1630         [Payment Request] Add a payment method that supports Apple Pay
1631         https://bugs.webkit.org/show_bug.cgi?id=177850
1632
1633         Reviewed by Youenn Fablet.
1634
1635         This patch implements a payment method dictionary and a payment handler for Apple Pay.
1636
1637         It reuses existing Apple Pay code by:
1638         1. Moving shared properties from ApplePayPaymentRequest to ApplePayRequestBase and having
1639            ApplePayPaymentRequest inherit from ApplePayRequestBase.
1640         2. Creating an ApplePayRequest dictionary that inherits from ApplePayRequestBase and adds
1641            PaymentRequest-specific properties (right now that's just the version property).
1642         3. Moving validation logic from ApplePaySession into various places that can be reused by
1643            PaymentRequest and ApplePayPaymentHandler.
1644         4. Storing currency values for both ApplePaySession and PaymentRequest in Strings rather
1645            than integers representing whole cents, since PaymentRequest supports high-precision
1646            currency values.
1647
1648         This patch does not implement any event handling for merchant validation, payment method
1649         changes, or shipping address/option changes. That will be handled in a follow-on.
1650
1651         Test: http/tests/ssl/applepay/PaymentRequest.html
1652
1653         * DerivedSources.make:
1654         * Modules/applepay/ApplePayContactField.cpp: Added.
1655         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
1656         * Modules/applepay/ApplePayContactField.h: Added.
1657         * Modules/applepay/ApplePayContactField.idl: Added.
1658         * Modules/applepay/ApplePayMerchantCapability.cpp: Added.
1659         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
1660         * Modules/applepay/ApplePayMerchantCapability.h: Added.
1661         * Modules/applepay/ApplePayMerchantCapability.idl: Added.
1662         * Modules/applepay/ApplePayPaymentRequest.h: Moved fields shared with ApplePayRequest into ApplePayRequestBase.
1663         * Modules/applepay/ApplePayPaymentRequest.idl: Ditto.
1664         * Modules/applepay/ApplePayRequestBase.cpp: Added.
1665         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
1666         * Modules/applepay/ApplePayRequestBase.h: Added.
1667         * Modules/applepay/ApplePayRequestBase.idl: Added.
1668         * Modules/applepay/ApplePaySession.cpp:
1669         (WebCore::validateAmount): Renamed from parseAmount.
1670         (WebCore::convertAndValidateTotal):
1671         (WebCore::convertAndValidate):
1672         (WebCore::parseDigit): Deleted.
1673         (WebCore::parseAmount): Renamed to validateAmount.
1674         * Modules/applepay/ApplePaySessionPaymentRequest.h: Changed amount from an int64_t to a String.
1675         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
1676         (WebCore::convert):
1677         * Modules/applepay/PaymentRequestValidator.mm: Renamed from Source/WebCore/Modules/applepay/PaymentRequestValidator.cpp.
1678         (WebCore::PaymentRequestValidator::validateTotal): Used NSDecimalNumber to validate amounts.
1679         (WebCore::validateShippingMethod): Ditto.
1680         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: Added.
1681         (WebCore::ApplePayPaymentHandler::handlesIdentifier): Added. Returns true if identifier is a URL with host "apple.com" and path "/apple-pay".
1682         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
1683         (WebCore::convert): Added. Converts PaymentRequest types to ApplePaySessionPaymentRequest types.
1684         (WebCore::ApplePayPaymentHandler::convertData): Added. JSON-parses data into an ApplePayRequest,
1685         then uses that along with the PaymentRequest to construct and validate an ApplePaySessionPaymentRequest.
1686         (WebCore::ApplePayPaymentHandler::show): Added a FIXME.
1687         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Added.
1688         * Modules/applepay/paymentrequest/ApplePayRequest.h: Added.
1689         * Modules/applepay/paymentrequest/ApplePayRequest.idl: Added. Inherits from ApplePayRequestBase and adds a required version property.
1690         * Modules/paymentrequest/PaymentHandler.cpp: Added.
1691         (WebCore::PaymentHandler::create): Returns a PaymentHandler subclass based on the payment method identifier.
1692         (WebCore::PaymentHandler::~PaymentHandler):
1693         * Modules/paymentrequest/PaymentHandler.h: Added.
1694         * Modules/paymentrequest/PaymentRequest.cpp:
1695         (WebCore::convertAndValidatePaymentMethodIdentifier): Added.
1696         (WebCore::PaymentRequest::show): Removed an unnecessary call to RunLoop::dispatch().
1697         Created a PaymentHandler for each payment method and called show() on the first available PaymentHandler.
1698         (WebCore::PaymentRequest::abort): Removed an unnecessary call to RunLoop::dispatch().
1699         (WebCore::PaymentRequest::canMakePayment): Ditto.
1700         (WebCore::PaymentRequest::finishShowing): Deleted.
1701         * Modules/paymentrequest/PaymentRequest.h:
1702         * WebCore.xcodeproj/project.pbxproj:
1703
1704 2017-10-05  Antti Koivisto  <antti@apple.com>
1705
1706         Move more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
1707         https://bugs.webkit.org/show_bug.cgi?id=177942
1708
1709         Reviewed by Zalan Bujtas.
1710
1711         * rendering/RenderMultiColumnFlow.cpp:
1712         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
1713
1714             Use std::unique_ptr for the spanner map for safe owenership transfer.
1715
1716         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
1717         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
1718         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
1719         (WebCore::RenderMultiColumnFlow::populate): Deleted.
1720         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy): Deleted.
1721
1722             This code moves to RenderTreeUpdater::MultiColumn.
1723
1724         * rendering/RenderMultiColumnFlow.h:
1725         * style/RenderTreeUpdaterMultiColumn.cpp:
1726         (WebCore::RenderTreeUpdater::MultiColumn::update):
1727         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
1728         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
1729
1730             Use Hyatt's preferred 'fragmented flow' terminology.
1731
1732         * style/RenderTreeUpdaterMultiColumn.h:
1733
1734 2017-10-05  Darin Adler  <darin@apple.com>
1735
1736         Remove additional WebKitSystemInterface remnants
1737         https://bugs.webkit.org/show_bug.cgi?id=177948
1738
1739         Reviewed by Andy Estes.
1740
1741         * PlatformMac.cmake: Remove logic to select and link an appropriate
1742         WebKitSystemInterface library.
1743
1744         * html/shadow/MediaControlElementTypes.h: Remove comment about matching
1745         WebKitSystemInterface.h, now obsolete.
1746
1747         * rendering/RenderMediaControls.cpp: Wrap whole file in a single conditional
1748         to make it clear that it's only used at all in this one particular case.
1749         (wkHitTestMediaUIPart): Deleted.
1750         (wkMeasureMediaUIPart): Deleted.
1751         (wkDrawMediaUIPart): Deleted.
1752         (wkDrawMediaSliderTrack): Deleted.
1753         (WebCore::determineState): Deleted.
1754         (WebCore::getUnzoomedRectAndAdjustCurrentContext): Deleted.
1755         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Call the
1756         WKMeasureMediaUIPart instead of through an inline function to rename it.
1757         (WebCore::RenderMediaControls::paintMediaControlsPart): Deleted.
1758
1759         * rendering/RenderMediaControls.h: Wrap whole file in a single conditional
1760         to make it clear that it's only used at all in this one particular case.
1761         Removed unneeded includes, forward declarations, and function declaration.
1762
1763         * rendering/RenderThemeMac.mm: Removed include of RenderMediaControls.h.
1764
1765 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1766
1767         Remove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
1768         https://bugs.webkit.org/show_bug.cgi?id=177946
1769
1770         Reviewed by Simon Fraser.
1771
1772         First letter is updated prior to layout.
1773
1774         Covered by existing tests.
1775
1776         * style/RenderTreeUpdaterFirstLetter.cpp:
1777         (WebCore::updateFirstLetterStyle):
1778
1779 2017-10-05  Andy Estes  <aestes@apple.com>
1780
1781         [Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into a base class
1782         https://bugs.webkit.org/show_bug.cgi?id=177904
1783
1784         Reviewed by Daniel Bates.
1785
1786         In a follow-on patch, something other than ApplePaySession will need to be the
1787         PaymentCoordinator's active session during PaymentRequest sessions.
1788
1789         To support this, this patch factors out the ApplePaySession functions called by
1790         PaymentCoordinator into a new base class called PaymentSession.
1791
1792         * Modules/applepay/ApplePaySession.h:
1793         * Modules/applepay/PaymentCoordinator.cpp:
1794         (WebCore::PaymentCoordinator::beginPaymentSession):
1795         * Modules/applepay/PaymentCoordinator.h:
1796         * Modules/applepay/PaymentSession.h: Added.
1797         (WebCore::PaymentSession::~PaymentSession):
1798         * WebCore.xcodeproj/project.pbxproj:
1799
1800 2017-10-05  Zalan Bujtas  <zalan@apple.com>
1801
1802         Move multicolumn flow clear to RenderTreeUpdater
1803         https://bugs.webkit.org/show_bug.cgi?id=177898
1804         <rdar://problem/34820157>
1805
1806         Reviewed by Antti Koivisto.
1807
1808         There are 2 cases when we need to clear the the multicolumn flow from its container.
1809
1810         1. When the column renderer is not need anymore due to style change (evacuateAndDestroy).
1811         During the subtree reparenting (moving back the descendants to the original position),
1812         if we still had the multicolumn set on the RenderBlockFlow, RenderBlockFlow::addChild() would
1813         put the children back under the column. -> Move the clear call to the RenderTreeUpdater.
1814          
1815         2. When the column is detached from the tree/destroyed (willBeRemoveFromTree).
1816         Since it does not trigger reparenting, we don't need to clear the column immediately. 
1817         We call clear to avoid accessing state column renderer. -> Use WeakPtr to
1818         manage lifetime instead.
1819
1820         Covered by existing tests.
1821
1822         * rendering/RenderBlockFlow.cpp:
1823         (WebCore::RenderBlockFlow::setMultiColumnFlow):
1824         (WebCore::RenderBlockFlow::clearMultiColumnFlow):
1825         * rendering/RenderBlockFlow.h:
1826         * rendering/RenderMultiColumnFlow.cpp:
1827         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
1828         (WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
1829         * style/RenderTreeUpdaterMultiColumn.cpp:
1830         (WebCore::RenderTreeUpdater::MultiColumn::update):
1831         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
1832
1833 2017-10-05  Miguel Gomez  <magomez@igalia.com>
1834
1835         [GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
1836         https://bugs.webkit.org/show_bug.cgi?id=177864
1837
1838         Reviewed by Carlos Garcia Campos.
1839
1840         Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify
1841         GIFImageDecoder to be able to decode frames that are not requested in the expected order.
1842
1843         Covered by existent tests.
1844
1845         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1846         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
1847         (WebCore::GIFImageDecoder::frameBufferAtIndex):
1848         (WebCore::GIFImageDecoder::clearFrameBufferCache):
1849         * platform/image-decoders/gif/GIFImageDecoder.h:
1850         * platform/image-decoders/gif/GIFImageReader.cpp:
1851         (GIFImageReader::decode):
1852         * platform/image-decoders/gif/GIFImageReader.h:
1853         (GIFImageReader::frameContext const):
1854
1855 2017-10-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1856
1857         [WinCairo] Fix build after Bug 167956
1858         https://bugs.webkit.org/show_bug.cgi?id=177921
1859
1860         Reviewed by Carlos Garcia Campos.
1861
1862         FontCascade::fontForCombiningCharacterSequence wasn't defined for
1863         WinCairo port. It should be defined if !USE(HARFBUZZ).
1864
1865         No new tests because there is no behavior change.
1866
1867         * platform/graphics/FontCascade.cpp: Use !USE(HARFBUZZ) instead of !USE(CAIRO).
1868
1869 2017-10-05  Zan Dobersek  <zdobersek@igalia.com>
1870
1871         Align BitmapImage::LargeAnimationCutoff to a megabyte value
1872         https://bugs.webkit.org/show_bug.cgi?id=177924
1873
1874         Reviewed by Carlos Garcia Campos.
1875
1876         * platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate
1877         the LargeAnimationCutoff value. It was most likely a typo.
1878
1879 2017-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1880
1881         Address post-review feedback following r222885
1882         https://bugs.webkit.org/show_bug.cgi?id=177853
1883         <rdar://problem/34807346>
1884
1885         Reviewed by Ryosuke Niwa and Dan Bates.
1886
1887         * dom/DataTransfer.cpp:
1888         (WebCore::DataTransfer::updateFileList):
1889         (WebCore::DataTransfer::types const):
1890         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
1891         * dom/DataTransferItem.h:
1892         (WebCore::DataTransferItem::file):
1893         (WebCore::DataTransferItem::file const): Deleted.
1894         * dom/DataTransferItemList.cpp:
1895         (WebCore::DataTransferItemList::add):
1896         (WebCore::DataTransferItemList::remove):
1897
1898         When removing a data transfer item, capture it in a Ref for the scope of remove(), so that it won't be destroyed
1899         immediately after removing from the item list.
1900
1901 2017-10-05  Youenn Fablet  <youenn@apple.com>
1902
1903         Make LibWebRTCProvider port agnostic
1904         https://bugs.webkit.org/show_bug.cgi?id=177747
1905
1906         Reviewed by Alex Christensen & Alex Garcia.
1907
1908         No change of behavior.
1909
1910         LibWebRTCProvider had some Mac/iOS specific members that are now
1911         moved to LibWebRTCProviderCocoa.
1912         This consists in the codec factories that are VideoToolBox specific.
1913         Introducing LibWebRTCProvider::create to allow different port implementations of LibWebRTCProvider.
1914
1915         * WebCore.xcodeproj/project.pbxproj:
1916         * inspector/InspectorOverlay.cpp:
1917         (WebCore::InspectorOverlay::overlayPage):
1918         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1919         (WebCore::LibWebRTCProvider::create):
1920         (WebCore::LibWebRTCProvider::factory):
1921         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
1922         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1923         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1924         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1925         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1926         (WebCore::LibWebRTCProviderCocoa::setActive):
1927         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
1928         * svg/graphics/SVGImage.cpp:
1929         (WebCore::SVGImage::dataChanged):
1930
1931 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1932
1933         Remove WebCoreSystemInterface
1934         https://bugs.webkit.org/show_bug.cgi?id=177916
1935
1936         Reviewed by Antti Koivisto.
1937
1938         * Configurations/WebCore.xcconfig:
1939         * PlatformMac.cmake:
1940         * WebCore.xcodeproj/project.pbxproj:
1941         * accessibility/mac/AXObjectCacheMac.mm:
1942         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1943         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1944         * dom/Document.cpp:
1945         * editing/mac/DictionaryLookup.mm:
1946         * page/ios/FrameIOS.mm:
1947         * page/ios/UserAgentIOS.mm:
1948         * page/mac/EventHandlerMac.mm:
1949         * platform/cocoa/LocalizedStringsCocoa.mm:
1950         * platform/cocoa/ScrollController.mm:
1951         * platform/graphics/Font.h:
1952         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1953         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1954         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1955         * platform/graphics/ca/GraphicsLayerCA.cpp:
1956         * platform/graphics/cg/GraphicsContextCG.cpp:
1957         * platform/graphics/cg/ImageBufferCG.cpp:
1958         * platform/graphics/cg/PathCG.cpp:
1959         * platform/graphics/cg/PatternCG.cpp:
1960         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1961         * platform/graphics/cocoa/FontCocoa.mm:
1962         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1963         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1964         * platform/graphics/mac/FontCacheMac.mm:
1965         * platform/graphics/mac/GlyphPageMac.cpp:
1966         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1967         * platform/ios/LegacyTileCache.mm:
1968         * platform/ios/PlatformScreenIOS.mm:
1969         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1970         * platform/ios/WebCoreSystemInterfaceIOS.mm: Removed.
1971         * platform/ios/wak/WAKWindow.mm:
1972         * platform/mac/CursorMac.mm:
1973         * platform/mac/FileSystemMac.mm:
1974         * platform/mac/PlatformEventFactoryMac.mm:
1975         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1976         * platform/mac/ScrollAnimatorMac.mm:
1977         * platform/mac/ScrollbarThemeMac.mm:
1978         * platform/mac/ThemeMac.mm:
1979         * platform/mac/WebCoreNSURLExtras.mm:
1980         * platform/mac/WebCoreSystemInterface.h: Removed.
1981         * platform/mac/WebCoreSystemInterface.mm: Removed.
1982         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1983         * platform/mac/WebWindowAnimation.mm:
1984         * platform/network/cf/CookieStorageCFNet.cpp:
1985         * platform/network/cf/CredentialStorageCFNet.cpp:
1986         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1987         * platform/network/cf/ResourceHandleCFNet.cpp:
1988         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1989         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1990         * platform/network/cf/ResourceRequestCFNet.cpp:
1991         * platform/network/cf/ResourceResponseCFNet.cpp:
1992         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1993         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1994         * platform/network/cocoa/ResourceRequestCocoa.mm:
1995         * platform/network/ios/WebCoreURLResponseIOS.mm:
1996         * platform/network/mac/CookieJarMac.mm:
1997         * platform/network/mac/ResourceHandleMac.mm:
1998         * platform/network/mac/WebCoreURLResponse.mm:
1999         * platform/text/TextEncodingRegistry.cpp:
2000         * rendering/RenderThemeMac.mm:
2001
2002 2017-10-04  Alex Christensen  <achristensen@webkit.org>
2003
2004         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
2005         https://bugs.webkit.org/show_bug.cgi?id=177912
2006
2007         Reviewed by Saam Barati.
2008
2009         * WebCore.xcodeproj/project.pbxproj:
2010         Also stop compiling RenderMediaControls.cpp on Cocoa platforms.  It's not used.
2011
2012 2017-09-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2013
2014         [JSC] Introduce import.meta
2015         https://bugs.webkit.org/show_bug.cgi?id=177703
2016
2017         Reviewed by Filip Pizlo.
2018
2019         * bindings/js/JSDOMWindowBase.cpp:
2020         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2021
2022 2017-10-04  Tim Horton  <timothy_horton@apple.com>
2023
2024         Link WebCore against CFNetwork in the CMake build
2025         https://bugs.webkit.org/show_bug.cgi?id=177910
2026
2027         Reviewed by Ryosuke Niwa.
2028
2029         * PlatformMac.cmake:
2030         This is enough to get WebKit1 MiniBrowser running; otherwise, we
2031         crash trying to access the public suffix list.
2032
2033 2017-10-04  Daniel Bates  <dabates@apple.com>
2034
2035         Have TextDecorationPainter hold an OptionSet of decorations
2036         https://bugs.webkit.org/show_bug.cgi?id=177889
2037
2038         Reviewed by Simon Fraser.
2039
2040         Currently TextDecorationPainter implicitly maintains the set of one or more TextDecoration
2041         flags in a instance variable bitmask of type TextDecoration. Instead we should represent
2042         this set explicitly as an OptionSet to improve readability of the code.
2043
2044         For now we have the TextDecorationPainter constructor and TextDecorationPainter::stylesForRenderer()
2045         to take the set of decorations as an unsigned value to avoid the need to update callers.
2046         We will look to apply a similar change throughout the code in <https://bugs.webkit.org/show_bug.cgi?id=176844>.
2047
2048         No functionality changed. So, no new tests.
2049
2050         * rendering/TextDecorationPainter.cpp:
2051         (WebCore::TextDecorationPainter::TextDecorationPainter): For now, changed data type for passed
2052         decorations from TextDecoration to unsigned to convey that it is a bitmask.
2053         (WebCore::TextDecorationPainter::paintTextDecoration): Renamed linesAreOpaque to areLinesOpaque
2054         while I am here. Fixed some minor style issues.
2055         (WebCore::collectStylesForRenderer): Modified to take the remaining decorations as an OptionSet,
2056         and removed an unnecessary copy of these decorations by taking advantage of the fact that they
2057         are passed by value.
2058         (WebCore::TextDecorationPainter::stylesForRenderer): Convert the passed decorations to an OptionSet as needed to
2059         pass to collectStylesForRenderer().
2060         * rendering/TextDecorationPainter.h: Change m_decoration from TextDecoration to OptionSet<TextDecoration>
2061         and rename it to m_decorations to reflect that it is used as a set of one or more TextDecoration flags.
2062         Also remove unnecessary initializer for m_isPrinting while I am here and group it with the other boolean,
2063         m_isHorizontal. There is exactly one constructor for this class and it initializes m_isPrinting.
2064
2065 2017-10-04  Matt Baker  <mattbaker@apple.com>
2066
2067         Web Inspector: Improve CanvasManager recording events
2068         https://bugs.webkit.org/show_bug.cgi?id=177762
2069
2070         Reviewed by Devin Rousso.
2071
2072         Dispatch Canvas.recordingFinished regardless of whether any actions were
2073         recorded. Without this extra guarantee, the frontend has to keep track
2074         of additional state to determine whether a recording is in progress.
2075
2076         * inspector/InspectorCanvasAgent.cpp:
2077         (WebCore::InspectorCanvasAgent::startRecording):
2078         (WebCore::InspectorCanvasAgent::stopRecording):
2079         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2080         (WebCore::InspectorCanvasAgent::requestRecording): Deleted.
2081         (WebCore::InspectorCanvasAgent::cancelRecording): Deleted.
2082         * inspector/InspectorCanvasAgent.h:
2083
2084 2017-10-04  Nan Wang  <n_wang@apple.com>
2085
2086         AX: Make video objects accessible on iOS
2087         https://bugs.webkit.org/show_bug.cgi?id=177788
2088         <rdar://problem/34778028>
2089
2090         Reviewed by Chris Fleizach.
2091
2092         Exposed certain <video> elements on iOS:
2093         1. If they have no controls attribute set and have playsinline attribute set, that means
2094            normally there are custom controls provided. 
2095         2. Without autoplay attribute set. From iOS 10, with the motivation to improve performace by 
2096            replacing GIF with <video>, elements will now honor the autoplay attribute if they
2097            have no audio. So normally those <video> elements are not interactive.
2098
2099         Also provided functions to let iOS users interact with the video elements:
2100         - Play/Pause: accessibilityActivate
2101         - Fast forward: accessibilityIncrement
2102         - Rewind: accessibilityDecrement
2103
2104         Test: accessibility/ios-simulator/video-elements-ios.html
2105
2106         * WebCore.xcodeproj/project.pbxproj:
2107         * accessibility/AXObjectCache.cpp:
2108         (WebCore::createFromRenderer):
2109         * accessibility/AccessibilityMediaObject.cpp: Added.
2110         (WebCore::AccessibilityMediaObject::AccessibilityMediaObject):
2111         (WebCore::AccessibilityMediaObject::~AccessibilityMediaObject):
2112         (WebCore::AccessibilityMediaObject::create):
2113         (WebCore::AccessibilityMediaObject::computeAccessibilityIsIgnored const):
2114         (WebCore::AccessibilityMediaObject::mediaElement const):
2115         (WebCore::AccessibilityMediaObject::stringValue const):
2116         (WebCore::AccessibilityMediaObject::interactiveVideoDuration const):
2117         (WebCore::AccessibilityMediaObject::mediaSeek):
2118         (WebCore::AccessibilityMediaObject::toggleMute):
2119         (WebCore::AccessibilityMediaObject::increment):
2120         (WebCore::AccessibilityMediaObject::decrement):
2121         (WebCore::AccessibilityMediaObject::press):
2122         (WebCore::AccessibilityMediaObject::hasControlsAttributeSet const):
2123         (WebCore::AccessibilityMediaObject::isPlaying const):
2124         (WebCore::AccessibilityMediaObject::isMuted const):
2125         (WebCore::AccessibilityMediaObject::isAutoplayEnabled const):
2126         (WebCore::AccessibilityMediaObject::isPlayingInline const):
2127         (WebCore::AccessibilityMediaObject::enterFullscreen const):
2128         * accessibility/AccessibilityMediaObject.h: Added.
2129         * accessibility/AccessibilityObject.cpp:
2130         * accessibility/AccessibilityObject.h:
2131         (WebCore::AccessibilityObject::isMediaObject const):
2132         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2133         (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
2134         (-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
2135         (-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
2136         (-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
2137         (-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
2138         (-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
2139         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2140         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
2141         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
2142
2143 2017-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2144
2145         Add basic support for the version of DataTransferItemList.add that takes a File
2146         https://bugs.webkit.org/show_bug.cgi?id=177853
2147         <rdar://problem/34807346>
2148
2149         Reviewed by Ryosuke Niwa.
2150
2151         Adds very basic support for DataTransferItemList.add(File). So far, a File added in this way can only be read
2152         back from the same DataTransfer, during dragstart or copy. This File isn't written to the platform pasteboard
2153         yet, so even dropping or pasting in the same page will not transfer the File, but this brings us closer to
2154         parity with other browsers. See per-method comments for details.
2155
2156         Tests: editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html
2157                editing/pasteboard/data-transfer-item-list-add-file-on-copy.html
2158                editing/pasteboard/data-transfer-item-list-add-file-on-drag.html
2159
2160         * dom/DataTransfer.cpp:
2161         (WebCore::DataTransfer::updateFileList):
2162
2163         Recompute the DataTransfer's FileList. This behaves the same way as destroying the FileList altogether and
2164         building it from scratch, but we avoid that approach because the FileList object needs to maintain the same DOM
2165         wrapper after a File-backed item is removed.
2166
2167         (WebCore::DataTransfer::itemListDidAddFile):
2168
2169         Add the newly appended DataTransferItem's File to the DataTransfer's FileList.
2170
2171         (WebCore::DataTransfer::types const):
2172
2173         Return only the "Files" type if there are file-backed items in the DataTransfer's item list.
2174
2175         (WebCore::DataTransfer::updatedFilesForFileList const):
2176         (WebCore::DataTransfer::files const):
2177         * dom/DataTransfer.h:
2178         * dom/DataTransferItem.h:
2179         (WebCore::DataTransferItem::file const):
2180         * dom/DataTransferItemList.cpp:
2181         (WebCore::DataTransferItemList::add):
2182         (WebCore::DataTransferItemList::remove):
2183         (WebCore::DataTransferItemList::clear):
2184
2185         When removing a File, only clear from the DataTransfer's pasteboard if the removed item is not a File (otherwise,
2186         clearing a File that shares the same type as some other item in the pasteboard will erroneously clear that other
2187         item as well). Additionally, call out to the DataTransfer to update the FileList.
2188
2189         * dom/DataTransferItemList.h:
2190         (WebCore::DataTransferItemList::hasItems const):
2191         (WebCore::DataTransferItemList::items const):
2192
2193         Add helpers for directly accessing an item list's items. items() should be used in conjunction with hasItems().
2194         This route is taken to (1) avoid having to copy the vector of Files, and (2) to avoid generating m_items if it
2195         doesn't already exist.
2196
2197 2017-10-04  Zalan Bujtas  <zalan@apple.com>
2198
2199         RenderMultiColumnFlow populate/evacuate should not disable layout state.
2200         https://bugs.webkit.org/show_bug.cgi?id=177894
2201         <rdar://problem/34818696>
2202
2203         Reviewed by Antti Koivisto.
2204
2205         Populate/evacuate methods are not called at layout time.
2206
2207         Covered by existing tests.
2208
2209         * rendering/RenderMultiColumnFlow.cpp:
2210         (WebCore::RenderMultiColumnFlow::populate):
2211         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
2212
2213 2017-10-04  Zalan Bujtas  <zalan@apple.com>
2214
2215         RenderMultiColumnFlow::m_beingEvacuated is redundant.
2216         https://bugs.webkit.org/show_bug.cgi?id=177886
2217         <rdar://problem/34815997>
2218
2219         Reviewed by Simon Fraser.
2220
2221         m_beingEvacuated was introduced to protect RenderMultiColumnFlow from triggering
2222         remove/insert code while the column is being destroyed and the descendants are getting reparented.
2223         However, 
2224         1. the setMultiColumnFlow(nullptr) call already protects from triggering the remove callback
2225         2. When adding the children back to their original position, we should not be able to find
2226         this column as the enclosing block anymore (simply because we are moving the children as siblings
2227         to the multicol renderer) 
2228
2229         Covered by existing tests.
2230
2231         * rendering/RenderMultiColumnFlow.cpp:
2232         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
2233         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
2234         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2235         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
2236         * rendering/RenderMultiColumnFlow.h:
2237
2238 2017-10-04  Antti Koivisto  <antti@apple.com>
2239
2240         Fix typo.
2241
2242         Unreviewed.
2243
2244         * rendering/RenderView.cpp:
2245         (WebCore::RenderView::willBeDestroyed):
2246
2247 2017-10-04  Daniel Bates  <dabates@apple.com>
2248
2249         Teach TextDecorationPainter about pseudo styles
2250         https://bugs.webkit.org/show_bug.cgi?id=177882
2251
2252         Reviewed by Simon Fraser.
2253
2254         As a step towards implementing support for CSS pseudo elements ::spelling-error and ::grammar-error
2255         (https://bugs.webkit.org/show_bug.cgi?id=175784) teach TextDecorationPainter about pseudo styles.
2256
2257         * rendering/TextDecorationPainter.cpp:
2258         (WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional
2259         pseudo style (defaults to NOPSEUDO - no pseudo style).
2260         (WebCore::collectStylesForRenderer): Modified to take a pseudo style. Note that getCachedPseudoStyle()
2261         is only defined on RenderText and RenderElement objects (i.e. it is not a virtual function on RenderObject).
2262         So, we must explicitly type check the renderer and cast appropriately before calling it. We may want
2263         to consider making it virtual in the future if we find there are more call sites that would benefit
2264         from polymorphism.
2265         (WebCore::TextDecorationPainter::stylesForRenderer): Modified to take an optional
2266         pseudo style (defaults to NOPSEUDO - no pseudo style).
2267         * rendering/TextDecorationPainter.h:
2268
2269 2017-10-04  Antti Koivisto  <antti@apple.com>
2270
2271         Add assert verifying all renderers get destroyed
2272         https://bugs.webkit.org/show_bug.cgi?id=177870
2273
2274         Reviewed by Zalan Bujtas.
2275
2276         * rendering/RenderView.cpp:
2277         (WebCore::RenderView::willBeDestroyed):
2278
2279             Add assert to verify all renderers for this tree have been destroyed before the RenderView is.
2280
2281         * rendering/RenderView.h:
2282
2283 2017-10-04  Daniel Bates  <dabates@apple.com>
2284
2285         TextDecorationPainter::m_wavyOffset should be a float
2286         https://bugs.webkit.org/show_bug.cgi?id=177883
2287
2288         Reviewed by Simon Fraser.
2289
2290         In r194447 we extracted the text decoration painting code from InlineTextBox into
2291         TextDecorationPainter and changed the data type of the wavy offset from float to int.
2292         We use floating point numbers throughout the painting code and should store the wavy
2293         offset as a float.
2294
2295         * rendering/TextDecorationPainter.cpp:
2296         (WebCore::TextDecorationPainter::TextDecorationPainter): Use C++ uniform initializer
2297         syntax to initialize member fields.
2298         (WebCore::TextDecorationPainter::paintTextDecoration): Change int to float.
2299         * rendering/TextDecorationPainter.h: Remove unnecessary equal initializer for m_wavyOffset
2300         as this class has exactly one constructor and it always initializes it.
2301
2302 2017-10-04  Youenn Fablet  <youenn@apple.com>
2303
2304         Remove OpenWebRTC backend
2305         https://bugs.webkit.org/show_bug.cgi?id=177868
2306
2307         Reviewed by Alejandro G. Castro.
2308
2309         * CMakeLists.txt:
2310         * DerivedSources.make:
2311         * Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
2312         * Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
2313         * Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
2314         * Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
2315         * Modules/mediastream/SDPProcessor.cpp: Removed.
2316         * Modules/mediastream/SDPProcessor.h: Removed.
2317         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2318         * WebCore.xcodeproj/project.pbxproj:
2319         * platform/GStreamer.cmake:
2320         * platform/graphics/MediaPlayer.cpp:
2321         (WebCore::buildMediaEnginesVector):
2322         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2323         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
2324         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
2325         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
2326         * platform/mediastream/MediaEndpoint.cpp: Removed.
2327         * platform/mediastream/MediaEndpoint.h: Removed.
2328         * platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
2329         * platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
2330         * platform/mediastream/SDPProcessorScriptResource.h: Removed.
2331         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
2332         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
2333         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
2334         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
2335         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
2336         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
2337         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
2338         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
2339         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
2340         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
2341         * platform/mock/MockMediaEndpoint.cpp: Removed.
2342         * platform/mock/MockMediaEndpoint.h: Removed.
2343         * platform/mock/MockRealtimeMediaSource.cpp:
2344         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
2345         * platform/mock/MockRealtimeMediaSource.h:
2346         * testing/Internals.cpp:
2347         (WebCore::Internals::Internals):
2348         (WebCore::Internals::enableMockMediaEndpoint): Deleted.
2349         * testing/Internals.h:
2350
2351 2017-10-04  Zalan Bujtas  <zalan@apple.com>
2352
2353         Remove RenderTreeInternalMutationScope
2354         https://bugs.webkit.org/show_bug.cgi?id=177875
2355         <rdar://problem/34813088>
2356
2357         Reviewed by Antti Koivisto.
2358
2359         RenderTree mutation is in the past now. -and we've got assertions in place.
2360
2361         Not testable.
2362
2363         * page/FrameView.cpp:
2364         (WebCore::FrameView::layout):
2365         * rendering/RenderMultiColumnFlow.cpp:
2366         (WebCore::RenderMultiColumnFlow::populate):
2367         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
2368         * rendering/RenderQuote.cpp:
2369         (WebCore::RenderQuote::updateTextRenderer):
2370         (WebCore::RenderQuote::updateRenderer):
2371         * rendering/RenderView.h:
2372         (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope): Deleted.
2373         (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope): Deleted.
2374
2375 2017-10-04  Miguel Gomez  <magomez@igalia.com>
2376
2377         Unreviewed: fix GTK debug build after r222841.
2378
2379         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2380         (WebCore::WEBPImageDecoder::initFrameBuffer):
2381
2382 2017-10-04  Zalan Bujtas  <zalan@apple.com>
2383
2384         RenderFragmentContainerRange should not hold raw pointers.
2385         https://bugs.webkit.org/show_bug.cgi?id=177854
2386         <rdar://problem/34805954>
2387
2388         Reviewed by Antti Koivisto.
2389
2390         m_startFragment and m_endFragment object's lifetimes are not tied to the lifetime of
2391         RenderFragmentContainerRange.
2392
2393         Covered by existing tests.
2394
2395         * rendering/RenderFragmentedFlow.cpp:
2396         (WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
2397         * rendering/RenderFragmentedFlow.h:
2398
2399 2017-10-04  Zalan Bujtas  <zalan@apple.com>
2400
2401         RenderMultiColumnSpannerPlaceholder should not hold raw pointers.
2402         https://bugs.webkit.org/show_bug.cgi?id=177840
2403         <rdar://problem/34800109>
2404
2405         Reviewed by Sam Weinig.
2406
2407         Though we should always have a spanner as long as there's a RenderMultiColumnSpannerPlaceholder,
2408         the spanner inject/removal logic is complicated enough to protect them with WeakPtr.  
2409
2410         Covered by existing tests.
2411
2412         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
2413         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
2414         * rendering/RenderMultiColumnSpannerPlaceholder.h:
2415
2416 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2417
2418         [GTK] GtkUtilities.h should not be included in libs not linked to GTK
2419         https://bugs.webkit.org/show_bug.cgi?id=177860
2420
2421         Reviewed by Carlos Garcia Campos.
2422
2423         * platform/FreeType.cmake:
2424         * platform/gtk/GtkUtilities.cpp:
2425         (WebCore::topLevelPath): Deleted.
2426         (WebCore::webkitBuildDirectory): Deleted.
2427         * platform/gtk/GtkUtilities.h:
2428         (WebCore::wallTimeForEvent):
2429         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2430         (WebCore::topLevelPath):
2431         (WebCore::webkitBuildDirectory):
2432
2433 2017-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2434
2435         [Harfbuzz] Implement ComplexTextController on top of HarfBuzz
2436         https://bugs.webkit.org/show_bug.cgi?id=167956
2437
2438         Reviewed by Myles C. Maxfield.
2439
2440         Implement ComplexTextController using HarfBuzz and remove HarfBuzzShaper.
2441
2442         Covered by existing tests, a rebaseline will be neeed.
2443
2444         * platform/FreeType.cmake:
2445         * platform/graphics/ComplexTextController.cpp:
2446         (WebCore::TextLayoutDeleter::operator() const): Enable TextLayout when using HarfBuzz.
2447         (WebCore::FontCascade::createLayout const): Ditto.
2448         (WebCore::FontCascade::width): Ditto.
2449         * platform/graphics/ComplexTextController.h:
2450         (WebCore::ComplexTextController::ComplexTextRun::create): Add constructor that receives an hb_buffer_t.
2451         * platform/graphics/Font.cpp:
2452         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Simple implementation for non-cocoa ports.
2453         * platform/graphics/FontCascade.cpp:
2454         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Moved from FontCascadeCocoa.mm.
2455         (WebCore::FontCascade::floatWidthForComplexText const): Ditto.
2456         (WebCore::FontCascade::adjustSelectionRectForComplexText const): Ditto.
2457         (WebCore::FontCascade::offsetForPositionForComplexText const): Ditto.
2458         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2459         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Normalize the sequence and get the font of the
2460         base character.
2461         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2462         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2463         (WebCore::harfBuzzPositionToFloat):
2464         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2465         (WebCore::fontFeatures):
2466         (WebCore::characterScript):
2467         (WebCore::scriptsAreCompatibleForCharacters):
2468         (WebCore::findNextRun):
2469         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2470         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2471         (WebCore::harfBuzzGetGlyph): Check here if the character is a white space and use the space or zeroWidthSpace
2472         to ensure we get a glyph.
2473         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Removed.
2474         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Removed.
2475         * platform/graphics/harfbuzz/HbUniquePtr.h: Added.
2476         (WebCore::HbPtrDeleter::operator() const):
2477         (WebCore::HbPtrDeleter<hb_font_t>::operator() const):
2478         (WebCore::HbPtrDeleter<hb_buffer_t>::operator() const):
2479         * platform/graphics/opentype/OpenTypeMathData.h: Use HbUniquePtr.
2480
2481 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2482
2483         Unreviewed, fix typo in function name scanDirectoryForDicionaries
2484         https://bugs.webkit.org/show_bug.cgi?id=177866
2485
2486         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2487         (WebCore::scanDirectoryForDictionaries):
2488         (WebCore::scanTestDictionariesDirectoryIfNecessary):
2489         (WebCore::availableLocales):
2490         (WebCore::scanDirectoryForDicionaries): Deleted.
2491
2492 2017-10-04  Miguel Gomez  <magomez@igalia.com>
2493
2494         Add animation support for WebP images
2495         https://bugs.webkit.org/show_bug.cgi?id=113124
2496
2497         Reviewed by Žan Doberšek.
2498
2499         Implement decoding of WebP animations.
2500
2501         Test: fast/images/animated-webp.html
2502
2503         * platform/graphics/ImageBackingStore.h:
2504         (WebCore::ImageBackingStore::blendPixel):
2505         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2506         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
2507         (WebCore::WEBPImageDecoder::~WEBPImageDecoder):
2508         (WebCore::WEBPImageDecoder::setData):
2509         (WebCore::WEBPImageDecoder::repetitionCount const):
2510         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
2511         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
2512         (WebCore::WEBPImageDecoder::decode):
2513         (WebCore::WEBPImageDecoder::decodeFrame):
2514         (WebCore::WEBPImageDecoder::initFrameBuffer):
2515         (WebCore::WEBPImageDecoder::applyPostProcessing):
2516         (WebCore::WEBPImageDecoder::parseHeader):
2517         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
2518         * platform/image-decoders/webp/WEBPImageDecoder.h:
2519
2520 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
2521
2522         Use blob URL when pasting RTFD instead of overriding DocumentLoader
2523         https://bugs.webkit.org/show_bug.cgi?id=177801
2524         <rdar://problem/34542270>
2525
2526         Reviewed by Wenson Hsieh.
2527
2528         Before this patch, pasting RTFD resulted in images and other subresources in RTFD are being placed
2529         into the document using WebKit fake URL, and DocumentLoader was overridden to return the appropriate
2530         data upon resource requests. This is bad because there is no mechanism for websites to access its content.
2531
2532         Like r222119 and r208451, this patch fixes thie problem by using a blob URL instead of a WebKit fake URL.
2533         This patch also adds a Blob::create variant which takes a SharedBuffer.
2534
2535         API Tests: PasteRTFD
2536
2537         * editing/WebCorePasteboardFileReader.cpp:
2538         (WebCore::WebCorePasteboardFileReader::readBuffer):
2539         * editing/cocoa/WebContentReaderCocoa.mm:
2540         (WebCore::DeferredLoadingScope): Extracted out of createFragmentAndAddResources for clarity.
2541         (WebCore::DeferredLoadingScope::DeferredLoadingScope):
2542         (WebCore::DeferredLoadingScope::~DeferredLoadingScope):
2543         (WebCore::createFragmentAndAddResources): Instead of adding resources to document loader, replace each
2544         URL in the document by a blob URL.
2545         (WebCore::WebContentReader::readImage):
2546         * editing/markup.cpp:
2547         (WebCore::replaceSubresourceURLs): Added. A helper to replace each URL in the document fragment by a blob
2548         URL created for each subresource. This won't work for iframes or srcset but that's okay for now since DOM
2549         constructed from RTFD doesn't use either.
2550         * editing/markup.h:
2551         * fileapi/Blob.cpp:
2552         (WebCore::Blob::Blob): Added a variant which takes a SharedBuffer.
2553         * fileapi/Blob.h:
2554         (WebCore::Blob::create): Ditto.
2555
2556 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2557
2558         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2559         https://bugs.webkit.org/show_bug.cgi?id=177449
2560
2561         Reviewed by Chris Dumez.
2562
2563         * platform/gtk/GtkUtilities.cpp:
2564         (WebCore::wallTimeForEvent):
2565         * platform/gtk/GtkUtilities.h:
2566         (WebCore::wallTimeForEvent):
2567
2568 2017-10-04  Miguel Gomez  <magomez@igalia.com>
2569
2570         [GTK][WPE] Fix playback of GIFs
2571         https://bugs.webkit.org/show_bug.cgi?id=176089
2572
2573         Reviewed by Carlos Garcia Campos.
2574
2575         Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
2576         need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
2577         called, and the we don't need the lock to avoid crashes in that situation.
2578
2579         Covered by existent tests.
2580
2581         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2582         (WebCore::GIFImageDecoder::clearFrameBufferCache):
2583         (WebCore::GIFImageDecoder::decode):
2584         * platform/image-decoders/gif/GIFImageDecoder.h:
2585         * platform/image-decoders/gif/GIFImageReader.cpp:
2586         (GIFImageReader::decode):
2587
2588 2017-10-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2589
2590         Unreviewed build fix.
2591
2592         Use different enum value for the check. UP_DEVICE_LEVEL_NORMAL is only available on newer
2593         upower.
2594
2595         * platform/glib/LowPowerModeNotifierGLib.cpp:
2596         (WebCore::LowPowerModeNotifier::updateState):
2597
2598 2017-10-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2599
2600         [GLib] Let WebCore know of low power situations
2601         https://bugs.webkit.org/show_bug.cgi?id=177810
2602
2603         Reviewed by Carlos Garcia Campos.
2604
2605         WebCore can use knowledge of low power situations to throttle timers and avoid expensive
2606         checks, lowering power usage. We can use upower's warning level to let WebCore know we are
2607         in such a situation.
2608
2609         No tests as there is no way to mock upower.
2610
2611         * PlatformGTK.cmake: add new file.
2612         * PlatformWPE.cmake: add new file.
2613         * platform/LowPowerModeNotifier.cpp: use upower-glib to know about low power situations.
2614         * platform/LowPowerModeNotifier.h: includes upower header as UpClient and UpDevice are not forward
2615         declaration-friendly.
2616         * platform/glib/LowPowerModeNotifierGLib.cpp: Added.
2617         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2618         (WebCore::LowPowerModeNotifier::updateState): update low power mode from warning-level.
2619         (WebCore::LowPowerModeNotifier::warningLevelCallback): track upower's warning-level to know when
2620         a low power situation occurs.
2621         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): stop tracking the warning-level signal.
2622         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
2623
2624 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
2625
2626         AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
2627         https://bugs.webkit.org/show_bug.cgi?id=177807
2628
2629         Reviewed by Chris Fleizach.
2630
2631         Include toggle buttons in the element types for which the mixed state is checked
2632         and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when
2633         AccessibilityObject::isIndeterminate() has returned false.
2634
2635         Test: accessibility/gtk/aria-pressed-mixed-value.html
2636
2637         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2638         (setAtkStateSetFromCoreObject):
2639
2640 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
2641
2642         AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
2643         https://bugs.webkit.org/show_bug.cgi?id=177815
2644
2645         Reviewed by Chris Fleizach.
2646
2647         Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE.
2648
2649         No new tests because this mapping is already covered by aria-tab-roles.html and
2650         roles-exposed.html. The platform expectations for each test have been updated.
2651
2652         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2653         (atkRole):
2654
2655 2017-10-03  Antti Koivisto  <antti@apple.com>
2656
2657         Use WeakPtr in RenderFullScreen
2658         https://bugs.webkit.org/show_bug.cgi?id=177827
2659
2660         Reviewed by Zalan Bujtas.
2661
2662         Make Document::m_fullScreenRenderer RenderFullScreen::m_placeholder WeakPtrs
2663         and get rid of the custom nulling code.
2664
2665         * dom/Document.cpp:
2666         (WebCore::Document::destroyRenderTree):
2667         (WebCore::Document::webkitWillEnterFullScreenForElement):
2668         (WebCore::Document::webkitDidExitFullScreenForElement):
2669         (WebCore::Document::setFullScreenRenderer):
2670         (WebCore::Document::fullScreenRendererDestroyed): Deleted.
2671         * dom/Document.h:
2672         (WebCore::Document::fullScreenRenderer const):
2673         * rendering/RenderFullScreen.cpp:
2674         (WebCore::RenderFullScreen::RenderFullScreen):
2675         (WebCore::RenderFullScreen::willBeDestroyed):
2676         (WebCore::RenderFullScreen::createPlaceholder):
2677         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Deleted.
2678         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
2679         * rendering/RenderFullScreen.h:
2680
2681 2017-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2682
2683         Enable pasteboard custom data in macOS 10.12 and earlier
2684         https://bugs.webkit.org/show_bug.cgi?id=177855
2685
2686         Reviewed by Wenson Hsieh.
2687
2688         Make customPasteboardDataEnabled return true on macOS 10.12 and earlier as long as the app is Safari.
2689
2690         * page/Settings.cpp:
2691         (WebCore::Settings::customPasteboardDataEnabled):
2692
2693 2017-10-03  Jon Davis  <jond@apple.com>
2694
2695         Update several features to "Supported"
2696         https://bugs.webkit.org/show_bug.cgi?id=177831
2697
2698         Reviewed by Alexey Proskuryakov.
2699
2700         Update Media Capture and Streams, Performance Observer, Resource Timing, User Timing, 
2701         Web Cryptography, and WebRTC.
2702
2703         * features.json:
2704
2705 2017-10-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2706
2707         [Curl] Reimplement CurlDownload with CurlRequest
2708         https://bugs.webkit.org/show_bug.cgi?id=177779
2709
2710         Reviewed by Alex Christensen.
2711
2712         * platform/network/curl/CurlContext.cpp:
2713         (WebCore::CurlHandle::enableAllowedProtocols):
2714         (WebCore::CurlHandle::enableFollowLocation): Deleted.
2715         (WebCore::CurlHandle::getEffectiveURL): Deleted.
2716         * platform/network/curl/CurlContext.h:
2717         * platform/network/curl/CurlDownload.cpp:
2718         (WebCore::CurlDownload::~CurlDownload):
2719         (WebCore::CurlDownload::init):
2720         (WebCore::CurlDownload::start):
2721         (WebCore::CurlDownload::cancel):
2722         (WebCore::CurlDownload::createCurlRequest):
2723         (WebCore::CurlDownload::curlDidReceiveResponse):
2724         (WebCore::CurlDownload::curlDidReceiveBuffer):
2725         (WebCore::CurlDownload::curlDidComplete):
2726         (WebCore::CurlDownload::curlDidFailWithError):
2727         (WebCore::CurlDownload::shouldRedirectAsGET):
2728         (WebCore::CurlDownload::willSendRequest):
2729         (WebCore::CurlDownload::getResponse const): Deleted.
2730         (WebCore::CurlDownload::retain): Deleted.
2731         (WebCore::CurlDownload::release): Deleted.
2732         (WebCore::CurlDownload::setupTransfer): Deleted.
2733         (WebCore::CurlDownload::didCompleteTransfer): Deleted.
2734         (WebCore::CurlDownload::didCancelTransfer): Deleted.
2735         (WebCore::CurlDownload::closeFile): Deleted.
2736         (WebCore::CurlDownload::moveFileToDestination): Deleted.
2737         (WebCore::CurlDownload::writeDataToFile): Deleted.
2738         (WebCore::CurlDownload::didReceiveHeader): Deleted.
2739         (WebCore::CurlDownload::didReceiveData): Deleted.
2740         (WebCore::CurlDownload::didReceiveResponse): Deleted.
2741         (WebCore::CurlDownload::didReceiveDataOfLength): Deleted.
2742         (WebCore::CurlDownload::didFinish): Deleted.
2743         (WebCore::CurlDownload::didFail): Deleted.
2744         (WebCore::CurlDownload::writeCallback): Deleted.
2745         (WebCore::CurlDownload::headerCallback): Deleted.
2746         * platform/network/curl/CurlDownload.h:
2747         (WebCore::CurlDownloadListener::didReceiveResponse):
2748         * platform/network/curl/CurlRequest.cpp:
2749         (WebCore::CurlRequest::didReceiveData):
2750         (WebCore::CurlRequest::finalizeTransfer):
2751         (WebCore::CurlRequest::enableDownloadToFile):
2752         (WebCore::CurlRequest::getDownloadedFilePath):
2753         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
2754         (WebCore::CurlRequest::closeDownloadFile):
2755         * platform/network/curl/CurlRequest.h:
2756         (WebCore::CurlRequest::create):
2757         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2758         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
2759         * platform/network/curl/ResourceHandleCurlDelegate.h:
2760
2761 2017-10-03  Zalan Bujtas <zalan@apple.com>
2762
2763         Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
2764         https://bugs.webkit.org/show_bug.cgi?id=177830
2765         <rdar://problem/34796065>
2766
2767         Reviewed by Antti Koivisto.
2768
2769         willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.
2770
2771         Covered by existing tests.
2772
2773         * rendering/RenderBox.cpp:
2774         (WebCore::RenderBox::willBeDestroyed):
2775         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
2776         * rendering/RenderBox.h:
2777
2778 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
2779
2780         AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
2781         https://bugs.webkit.org/show_bug.cgi?id=177811
2782
2783         Reviewed by Chris Fleizach.
2784
2785         AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
2786         MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
2787         the ATK code was not handling that remapped role value. As a result, the element
2788         was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
2789         types exposed as ATK_ROLE_MENU_ITEM.
2790
2791         Test: accessibility/gtk/menu-with-group-child-tree.html
2792
2793         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2794         (atkRole):
2795
2796 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
2797
2798         AX: [ATK] aria-rowindex set on row element is not being exposed
2799         https://bugs.webkit.org/show_bug.cgi?id=177821
2800
2801         Reviewed by Chris Fleizach.
2802
2803         Expose the value of aria-rowindex when set on a row as an object
2804         attribute, as we already do when it's set on a cell.
2805
2806         Test: accessibility/gtk/aria-rowindex-on-row.html
2807
2808         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2809         (webkitAccessibleGetAttributes):
2810
2811 2017-10-03  Daniel Bates  <dabates@apple.com>
2812
2813         Share code to normalize an HTTP method
2814         https://bugs.webkit.org/show_bug.cgi?id=177837
2815
2816         Reviewed by Andy Estes.
2817
2818         Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
2819         We should add a common helper function and update both classes to make use of it.
2820
2821         No functionality changed. So, no new tests.
2822
2823         * Modules/fetch/FetchRequest.cpp:
2824         (WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
2825         * platform/network/HTTPParsers.cpp:
2826         (WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
2827         * platform/network/HTTPParsers.h:
2828         * xml/XMLHttpRequest.cpp:
2829         (WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
2830         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
2831         * xml/XMLHttpRequest.h:
2832
2833 2017-10-03  Daniel Bates  <dabates@apple.com>
2834
2835         Share code to determine a forbidden method
2836         https://bugs.webkit.org/show_bug.cgi?id=177833
2837
2838         Reviewed by Andy Estes.
2839
2840         Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
2841         forbidden. We should add a common helper function and update both classes to make use of it.
2842
2843         No functionality changed. So, no new tests.
2844
2845         * Modules/fetch/FetchRequest.cpp:
2846         (WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
2847         * platform/network/HTTPParsers.cpp:
2848         (WebCore::isForbiddenMethod): Added.
2849         * platform/network/HTTPParsers.h:
2850         * xml/XMLHttpRequest.cpp:
2851         (WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
2852         (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
2853         * xml/XMLHttpRequest.h:
2854
2855 2017-10-03  Zalan Bujtas  <zalan@apple.com>
2856
2857         RenderMenuList should not hold raw pointers
2858         https://bugs.webkit.org/show_bug.cgi?id=177836
2859
2860         Reviewed by Antti Koivisto.
2861
2862         While both m_buttonText and m_innerBlock are child renderers of
2863         the RenderMenuList, so the their lifecycles are supposed to tied
2864         to the parent object, this patch removes some manual raw pointer managing.
2865
2866         Covered by existing tests.
2867
2868         * rendering/RenderMenuList.cpp:
2869         (WebCore::RenderMenuList::RenderMenuList):
2870         (WebCore::RenderMenuList::createInnerBlock):
2871         (RenderMenuList::takeChild):
2872         (RenderMenuList::setText):
2873         * rendering/RenderMenuList.h:
2874
2875 2017-10-03  Timothy Horton  <timothy_horton@apple.com>
2876
2877         Include a few widespread WTF headers in WebCorePrefix.h
2878         https://bugs.webkit.org/show_bug.cgi?id=173481
2879
2880         * WebCorePrefix.h:
2881         Turn this off on Windows because it doesn't work; needs further investigation.
2882
2883 2017-10-03  Tim Horton  <timothy_horton@apple.com>
2884
2885         Include a few widespread WTF headers in WebCorePrefix.h
2886         https://bugs.webkit.org/show_bug.cgi?id=173481
2887
2888         Reviewed by Alex Christensen.
2889
2890         * WebCorePrefix.h:
2891         These are four of the headers that contribute the most pre-processed
2892         source to the WebCore build. They (and their dependents) change infrequently
2893         enough that a world rebuild of WebCore when they change seems like an
2894         acceptable tradeoff for the ~9% reduction in WebCore build time that I
2895         measure from this change.
2896
2897         We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.
2898
2899 2017-10-03  Daniel Bates  <dabates@apple.com>
2900
2901         XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
2902         duplicate logic to check for a forbidden XHR header field
2903         https://bugs.webkit.org/show_bug.cgi?id=177829
2904
2905         Reviewed by Alexey Proskuryakov.
2906
2907         Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
2908         to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
2909         of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
2910         the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
2911         no longer forbids setting the header Content-Transfer-Encoding. This header has not been
2912         considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.
2913
2914         * xml/XMLHttpRequest.cpp:
2915         (WebCore::XMLHttpRequest::setRequestHeader):
2916         (WebCore::isForbiddenRequestHeader): Deleted.
2917         (WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
2918         * xml/XMLHttpRequest.h:
2919
2920 2017-10-03  Commit Queue  <commit-queue@webkit.org>
2921
2922         Unreviewed, rolling out r222686, r222695, and r222698.
2923         https://bugs.webkit.org/show_bug.cgi?id=177835
2924
2925         Caused LayoutTests to crash in
2926         WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
2927         on #webkit).
2928
2929         Reverted changesets:
2930
2931         "[Settings] Replace SettingsMacros.h with a generated base
2932         class for Settings"
2933         https://bugs.webkit.org/show_bug.cgi?id=177681
2934         http://trac.webkit.org/changeset/222686
2935
2936         "[Settings] Enums should not be passed by const reference"
2937         https://bugs.webkit.org/show_bug.cgi?id=177727
2938         http://trac.webkit.org/changeset/222695
2939
2940         "[Settings] Move remaining simple settings to Settings.in"
2941         https://bugs.webkit.org/show_bug.cgi?id=177730
2942         http://trac.webkit.org/changeset/222698
2943
2944 2017-10-03  Jer Noble  <jer.noble@apple.com>
2945
2946         Implement quality-of-service tiers in WebCoreDecompressionSession
2947         https://bugs.webkit.org/show_bug.cgi?id=177769
2948
2949         Reviewed by Dean Jackson.
2950
2951         VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
2952         can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
2953         determine when to move up and down the tiers.
2954
2955         Drive-by fix: When frames are so late that they miss the display deadline, mark them as
2956         dropped rather than just delayed.
2957
2958         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2959         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2960         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
2961         (WebCore::WebCoreDecompressionSession::decodeSample):
2962         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2963         (WebCore::WebCoreDecompressionSession::automaticDequeue):
2964         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
2965         (WebCore::WebCoreDecompressionSession::resetQosTier):
2966         (WebCore::WebCoreDecompressionSession::increaseQosTier):
2967         (WebCore::WebCoreDecompressionSession::decreaseQosTier):
2968         (WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
2969         * platform/cocoa/VideoToolboxSoftLink.cpp:
2970         * platform/cocoa/VideoToolboxSoftLink.h:
2971
2972 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
2973
2974         [GTK] Support the "system" CSS font family
2975         https://bugs.webkit.org/show_bug.cgi?id=177755
2976
2977         Reviewed by Carlos Garcia Campos.
2978
2979         Obtain the system UI font from the GtkSettings::gtk-font-name property
2980
2981         Test: platform/gtk/fonts/systemFont.html
2982
2983         * platform/graphics/freetype/FontCacheFreeType.cpp:
2984         (WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
2985         to handle -webkit-system-font and -webkit-system-ui.
2986         (WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
2987         -webkit-system-ui as generic family names.
2988         * platform/graphics/gtk/GtkUtilities.cpp:
2989         (WebCore::defaultGtkSystemFont): Added.
2990         * platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().
2991
2992 2017-10-03  Daniel Bates  <dabates@apple.com>
2993
2994         [XHR] Only exempt Dashboard widgets from XHR header restrictions
2995         https://bugs.webkit.org/show_bug.cgi?id=177824
2996         <rdar://problem/34384301>
2997
2998         Reviewed by Alexey Proskuryakov.
2999
3000         Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
3001         restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
3002         URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
3003         apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.
3004
3005         Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
3006                fast/xmlhttprequest/set-dangerous-headers.html
3007
3008         * xml/XMLHttpRequest.cpp:
3009         (WebCore::XMLHttpRequest::setRequestHeader):
3010
3011 2017-10-03  Fujii Hironori  <Hironori.Fujii@sony.com>
3012
3013         REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
3014         https://bugs.webkit.org/show_bug.cgi?id=177364
3015
3016         Reviewed by Carlos Garcia Campos.
3017
3018         Range.getClientRects returned an incorrect rect for a last
3019         collapsed space of RenderText in HarfBuzz port.
3020
3021         HarfBuzzShaper::selectionRect needs to return a valid value even
3022         if the arguments 'from' and 'to' point to the just after the end
3023         of the text run.
3024
3025         Tests: fast/text/international/iso-8859-8.html
3026
3027         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3028         (WebCore::HarfBuzzShaper::shape): Do not check the return value of
3029         fillGlyphBuffer.
3030         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
3031         value type from bool to void.
3032         (WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
3033         position to fromX if foundFromX is false.
3034         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
3035         value type of fillGlyphBuffer from bool to void.
3036
3037 2017-10-03  JF Bastien  <jfbastien@apple.com>
3038
3039         WebAssembly: no VM / JS version of everything but Instance
3040         https://bugs.webkit.org/show_bug.cgi?id=177473
3041
3042         Reviewed by Filip Pizlo.
3043
3044         * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
3045         included in JSWebAssemblyModule.h.
3046         * bindings/js/SerializedScriptValue.cpp: Update postMessage code
3047         according to C++ API changes.
3048
3049 2017-10-03  Zalan Bujtas  <zalan@apple.com>
3050
3051         [AX] Do not trigger redundant layout on tables.
3052         https://bugs.webkit.org/show_bug.cgi?id=177781
3053         <rdar://problem/34777030>
3054
3055         Reviewed by Antti Koivisto.
3056
3057         RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
3058         Every time AccessibilityTable asks for the table element (including during construction),
3059         we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
3060         up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
3061         let's just use the first child to find the table element. The first child always points to a valid
3062         renderer (or nullptr), while m_firstBody is the result of section computation.
3063
3064         Covered by existing tests.
3065
3066         * accessibility/AccessibilityTable.cpp:
3067         (WebCore::AccessibilityTable::tableElement const):
3068
3069 2017-10-03  Daniel Bates  <dabates@apple.com>
3070
3071         [CSP] Check policy before opening a new window to a JavaScript URL
3072         https://bugs.webkit.org/show_bug.cgi?id=176815
3073         <rdar://problem/34400057>
3074
3075         Reviewed by Brent Fulgham.
3076
3077         Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL
3078         before opening a new window to it.
3079
3080         Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html
3081
3082         * loader/FrameLoader.cpp:
3083         (WebCore::createWindow):
3084
3085 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
3086
3087         AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
3088         https://bugs.webkit.org/show_bug.cgi?id=177763
3089
3090         Reviewed by Chris Fleizach.
3091
3092         Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
3093         AtkObject attributes.
3094
3095         Test: accessibility/gtk/aria-drag-and-drop.html
3096
3097         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3098         (webkitAccessibleGetAttributes):
3099
3100 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
3101
3102         Unreviewed test fix after r222779.
3103
3104         * testing/cocoa/WebArchiveDumpSupport.mm:
3105         (WebCoreTestSupport::createCFURLResponseFromResponseData): Setting NSSecureCoding in this test code should be
3106         done based on build system, just like it is in the actual WebArchive handling code.
3107
3108 2017-10-03  Youenn Fablet  <youenn@apple.com>
3109
3110         Clean-up RealtimeIncomingVideoSource
3111         https://bugs.webkit.org/show_bug.cgi?id=177782
3112
3113         Reviewed by Alejandro G. Castro.
3114
3115         No change of behavior.
3116         Removing code that is no longer needed.
3117
3118         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3119         (WebCore::RealtimeIncomingVideoSource::create):
3120         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
3121         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
3122
3123 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
3124
3125         [Mac] Use safer decoding practices for NSKeyedUnarchiver
3126         https://bugs.webkit.org/show_bug.cgi?id=175887
3127         <rdar://problem/33435281>
3128
3129         Reviewed by Daniel Bates.
3130
3131         * loader/archive/cf/LegacyWebArchiveMac.mm:
3132         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
3133         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
3134         * testing/cocoa/WebArchiveDumpSupport.mm:
3135         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
3136
3137 2017-10-03  Ryan Haddad  <ryanhaddad@apple.com>
3138
3139         Unreviewed, rolling out r222760.
3140
3141         This change caused LayoutTest crashes.
3142
3143         Reverted changeset:
3144
3145         "[Mac] Use safer decoding practices for NSKeyedUnarchiver"
3146         https://bugs.webkit.org/show_bug.cgi?id=175887
3147         http://trac.webkit.org/changeset/222760
3148
3149 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3150
3151         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
3152         https://bugs.webkit.org/show_bug.cgi?id=177449
3153
3154         Reviewed by Chris Dumez.
3155
3156         * platform/gtk/GtkUtilities.cpp:
3157         (WebCore::wallTimeForEvent):
3158         * platform/gtk/GtkUtilities.h:
3159         (WebCore::wallTimeForEvent):
3160         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3161         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3162         * platform/gtk/PlatformMouseEventGtk.cpp:
3163         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3164         * platform/gtk/PlatformWheelEventGtk.cpp:
3165         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3166
3167 2017-10-03  Youenn Fablet  <youenn@apple.com>
3168
3169         Use vector map routine in WebCore CacheStorage implementation
3170         https://bugs.webkit.org/show_bug.cgi?id=177002
3171
3172         Reviewed by Darin Adler.
3173
3174         No change of behavior.
3175         Replacing use of reserveInitialCapacity/uncheckedAppend by use of map.
3176
3177         * Modules/cache/CacheStorage.cpp:
3178         (WebCore::copyCache):
3179         (WebCore::CacheStorage::match):
3180         (WebCore::CacheStorage::retrieveCaches):
3181         (WebCore::CacheStorage::keys):
3182         (WebCore::copyCaches): Deleted.
3183         * Modules/cache/DOMCache.cpp:
3184         (WebCore::DOMCache::matchAll):
3185         (WebCore::copyRequestRef):
3186         (WebCore::DOMCache::keys):
3187         * Modules/cache/DOMCacheEngine.cpp:
3188         (WebCore::DOMCacheEngine::isolateCacheInfo):
3189         (WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
3190         * Modules/cache/WorkerCacheStorageConnection.cpp:
3191         (WebCore::recordsDataFromRecords):
3192         (WebCore::recordsFromRecordsData):
3193
3194 2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
3195
3196         Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
3197         https://bugs.webkit.org/show_bug.cgi?id=176575
3198
3199         Reviewed by Alex Christensen.
3200
3201         No new tests because there is no behavior change.
3202
3203         * WebCore.xcodeproj/project.pbxproj:
3204         * fileapi/BlobBuilder.cpp:
3205         * html/FormDataList.cpp:
3206
3207 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
3208
3209         Web Inspector: Rename methods ending in *Json() as *JSON()
3210         https://bugs.webkit.org/show_bug.cgi?id=177793
3211
3212         Reviewed by Matt Baker.
3213
3214         * inspector/InspectorNetworkAgent.cpp:
3215         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
3216         (WebCore::InspectorNetworkAgent::willSendRequest):
3217         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3218         * inspector/InspectorPageAgent.cpp:
3219         (WebCore::InspectorPageAgent::resourceTypeJSON):
3220         (WebCore::InspectorPageAgent::cachedResourceTypeJSON):
3221         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
3222         (WebCore::InspectorPageAgent::resourceTypeJson): Deleted.
3223         (WebCore::InspectorPageAgent::cachedResourceTypeJson): Deleted.
3224         * inspector/InspectorPageAgent.h:
3225
3226 2017-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3227
3228         REGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
3229         https://bugs.webkit.org/show_bug.cgi?id=177791
3230         <rdar://problem/34781456>
3231
3232         Reviewed by Ryosuke Niwa.
3233
3234         DataTransfer::moveDragState() currently attempts to move the other DataTransfer's DataTransferItemList and
3235         DragImageLoader as members of its own. This is incorrect, since both of these entities hold raw references of
3236         some form to the other DataTransfer, yet they are held as unique_ptrs in the new DataTransfer. To fix this, we
3237         (1) remove the line of code that moves the item list, since item lists will be lazily generated on the new
3238         DataTransfer anyways, and (2) update the DataTransfer pointer on the old DataTransfer's DragImageLoader after
3239         moving it to the new DataTransfer.
3240
3241         Test: editing/pasteboard/drag-end-crash-accessing-item-list.html
3242
3243         * dom/DataTransfer.cpp:
3244         (WebCore::DragImageLoader::moveToDataTransfer):
3245         (WebCore::DataTransfer::moveDragState):
3246
3247 2017-10-02  Chris Dumez  <cdumez@apple.com>
3248
3249         Rename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
3250         https://bugs.webkit.org/show_bug.cgi?id=177776
3251
3252         Reviewed by Alex Christensen.
3253
3254         * dom/VisitedLinkState.cpp:
3255         (WebCore::linkHashForElement):
3256         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3257         * html/HTMLAnchorElement.h:
3258         (WebCore::HTMLAnchorElement::visitedLinkHash const):
3259         * platform/SharedStringHash.cpp:
3260         (WebCore::computeVisitedLinkHash):
3261         * platform/SharedStringHash.h:
3262
3263 2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>
3264
3265         AX: [ATK] The value of aria-level is not exposed on non-heading roles
3266         https://bugs.webkit.org/show_bug.cgi?id=177775
3267
3268         Reviewed by Chris Fleizach.
3269
3270         Expose the value of aria-level via the "level" AtkObject attribute, as is currently
3271         done for headings.
3272
3273         Test: accessibility/gtk/aria-level.html
3274
3275         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3276         (webkitAccessibleGetAttributes):
3277
3278 2017-10-02  Andy Estes  <aestes@apple.com>
3279
3280         [Payment Request] Validate payment method identifiers
3281         https://bugs.webkit.org/show_bug.cgi?id=177794
3282
3283         Reviewed by Sam Weinig.
3284
3285         * Modules/paymentrequest/PaymentRequest.cpp:
3286         (WebCore::isValidStandardizedPaymentMethodIdentifier):
3287         (WebCore::isValidURLBasedPaymentMethodIdentifier):
3288         (WebCore::convertAndValidatePaymentMethodIdentifier):
3289         (WebCore::PaymentRequest::create):
3290         * Modules/paymentrequest/PaymentRequest.h:
3291
3292 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
3293
3294         Move more code into PasteboardCustomData
3295         https://bugs.webkit.org/show_bug.cgi?id=177795
3296
3297         Reviewed by Wenson Hsieh.
3298
3299         Moved sharedBufferFromCustomData, customDataFromSharedBuffer, and customWebKitPasteboardDataType into
3300         PasteboardCustomData as createSharedBuffer, fromSharedBuffer, and cocoaType respectively.
3301
3302         * platform/Pasteboard.cpp:
3303         (WebCore::PasteboardCustomData::createSharedBuffer const): Renamed from sharedBufferFromCustomData.
3304         (WebCore::PasteboardCustomData::fromSharedBuffer): Renamed from customDataFromSharedBuffer.
3305         * platform/Pasteboard.h:
3306         * platform/StaticPasteboard.cpp:
3307         (WebCore::StaticPasteboard::commitToPasteboard): Now initializes with an empty origin string.
3308         * platform/cocoa/PasteboardCocoa.mm:
3309         (WebCore::PasteboardCustomData::cocoaType): Moved here from Pasteboard.h
3310         (WebCore::Pasteboard::readStringInCustomData):
3311         * platform/ios/PlatformPasteboardIOS.mm:
3312         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3313         (WebCore::PlatformPasteboard::write):
3314         * platform/ios/WebItemProviderPasteboard.mm:
3315         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
3316         * platform/mac/PlatformPasteboardMac.mm:
3317         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3318         (WebCore::PlatformPasteboard::write):
3319
3320 2017-10-02  Brent Fulgham  <bfulgham@apple.com>
3321
3322         [Mac] Use safer decoding practices for NSKeyedUnarchiver
3323         https://bugs.webkit.org/show_bug.cgi?id=175887
3324         <rdar://problem/33435281>
3325
3326         Reviewed by Daniel Bates.
3327
3328         * loader/archive/cf/LegacyWebArchiveMac.mm:
3329         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
3330         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
3331         * testing/cocoa/WebArchiveDumpSupport.mm:
3332         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
3333
3334 2017-10-02  Daniel Bates  <dabates@apple.com>
3335
3336         Use InlineTextBox::lineFont() in more places
3337         https://bugs.webkit.org/show_bug.cgi?id=177749
3338
3339         Reviewed by Zalan Bujtas.
3340
3341         Currently InlineTextBox::paint() calls InlineTextBox::lineFont() to compute the font for the
3342         line and then passes this value to various paint helper functions. The computation is not
3343         expensive and it is sufficient to have the individual paint helper functions compute it
3344         directly. We should have the individual paint helper functions compute it directly. This
3345         will help towards sharing more code throughout InlineTextBox by reducing the noise of
3346         passing the font for the line.
3347
3348         No functionality changed. So, no new tests.
3349
3350         * rendering/InlineTextBox.cpp:
3351         (WebCore::InlineTextBox::paint):
3352         (WebCore::InlineTextBox::paintSelection):
3353         (WebCore::InlineTextBox::paintTextSubrangeBackground):
3354         (WebCore::InlineTextBox::paintCompositionBackground):
3355         (WebCore::InlineTextBox::paintTextMatchMarker):
3356         (WebCore::InlineTextBox::paintDecoration):
3357         (WebCore::InlineTextBox::paintDocumentMarker):
3358         (WebCore::InlineTextBox::paintDocumentMarkers):
3359         * rendering/InlineTextBox.h:
3360
3361 2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3362
3363         [Curl] Implement missing async method in RecourceHandle and make it actually async
3364         https://bugs.webkit.org/show_bug.cgi?id=173964
3365
3366         Reviewed by Alex Christensen.
3367
3368         * platform/network/ResourceHandle.cpp:
3369         (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
3370         (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
3371         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3372         * platform/network/curl/CurlRequest.cpp:
3373         (WebCore::CurlRequest::start):
3374         (WebCore::CurlRequest::cancel):
3375         (WebCore::CurlRequest::suspend):
3376         (WebCore::CurlRequest::resume):
3377         (WebCore::CurlRequest::didReceiveHeader):
3378         (WebCore::CurlRequest::didReceiveData):
3379         (WebCore::CurlRequest::didCompleteTransfer):
3380         (WebCore::CurlRequest::didCancelTransfer):
3381         (WebCore::CurlRequest::finalizeTransfer):
3382         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
3383         (WebCore::CurlRequest::invokeDidReceiveResponse):
3384         (WebCore::CurlRequest::completeDidReceiveResponse):
3385         (WebCore::CurlRequest::setRequestPaused):
3386         (WebCore::CurlRequest::setCallbackPaused):
3387         (WebCore::CurlRequest::pausedStatusChanged):
3388         (WebCore::CurlRequest::setPaused): Deleted.
3389         * platform/network/curl/CurlRequest.h:
3390         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
3391         (WebCore::CurlRequest::isPaused const):
3392         * platform/network/curl/ResourceHandleCurl.cpp:
3393         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3394         (WebCore::ResourceHandle::continueDidReceiveResponse):
3395         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3396         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3397         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
3398         (WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse):
3399         (WebCore::ResourceHandleCurlDelegate::platformContinueSynchronousDidReceiveResponse):
3400         (WebCore::ResourceHandleCurlDelegate::continueAfterDidReceiveResponse):
3401         (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
3402         * platform/network/curl/ResourceHandleCurlDelegate.h:
3403         * platform/network/curl/ResourceResponseCurl.cpp:
3404         (WebCore::ResourceResponse::shouldRedirect):
3405         (WebCore::ResourceResponse::isMovedPermanently const):
3406         (WebCore::ResourceResponse::isFound const):
3407         (WebCore::ResourceResponse::isSeeOther const):
3408         (WebCore::ResourceResponse::isNotModified const):
3409         (WebCore::ResourceResponse::isUnauthorized const):