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