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