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