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