9b48d834bc8e34c0e135cc6a765d4660fc1b24f1
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-06  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC] Add BlockFormattingContext::computeStaticPosition
4         https://bugs.webkit.org/show_bug.cgi?id=185352
5
6         Reviewed by Antti Koivisto.
7
8         This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
9
10         * layout/blockformatting/BlockFormattingContext.cpp:
11         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
12         * layout/displaytree/DisplayBox.h:
13
14 2018-05-05  Sam Weinig  <sam@webkit.org>
15
16         Cleanup XMLHttpRequestUpload a little
17         https://bugs.webkit.org/show_bug.cgi?id=185344
18
19         Reviewed by Yusuke Suzuki.
20
21         * bindings/js/JSXMLHttpRequestCustom.cpp:
22         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
23         Use auto to reduce redundancy.
24
25         * xml/XMLHttpRequest.cpp:
26         (WebCore::XMLHttpRequest::upload):
27         * xml/XMLHttpRequest.h:
28         Switch upload() to return a reference.
29         
30         * xml/XMLHttpRequestUpload.cpp:
31         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
32         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
33         * xml/XMLHttpRequestUpload.h:
34         Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
35         to a reference.
36
37 2018-05-05  Dean Jackson  <dino@apple.com>
38
39         Draw a drop-shadow behind the system preview badge
40         https://bugs.webkit.org/show_bug.cgi?id=185356
41         <rdar://problem/40004936>
42
43         Reviewed by Wenson Hsieh.
44
45         Draw a very subtle drop-shadow under the system
46         preview badge so that it is more visible on a pure
47         white background.
48
49         I also moved some code around to make it more clear
50         and improved comments.
51
52         * rendering/RenderThemeIOS.mm:
53         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
54
55 2018-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
56
57         [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
58         https://bugs.webkit.org/show_bug.cgi?id=185289
59         <rdar://problem/35756912>
60
61         Reviewed by Tim Horton and Darin Adler.
62
63         When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
64         (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
65         tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
66         the first item to be inserted in the resulting document fragment.
67
68         Augments existing API tests in DataInteractionTests.
69
70         * editing/ios/WebContentReaderIOS.mm:
71
72         Additionally remove some extraneous header imports from this implementation file.
73
74         (WebCore::WebContentReader::readURL):
75
76 2018-05-02  Dean Jackson  <dino@apple.com>
77
78         Use IOSurfaces for CoreImage operations where possible
79         https://bugs.webkit.org/show_bug.cgi?id=185230
80         <rdar://problem/39926929>
81
82         Reviewed by Jon Lee.
83
84         On iOS hardware, we can use IOSurfaces as a rendering destination
85         for CoreImage, which means we're keeping data on the GPU
86         for rendering.
87
88         As a drive-by fix, I used a convenience method for Gaussian blurs.
89
90         * rendering/RenderThemeIOS.mm:
91         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
92
93 2018-05-04  Tim Horton  <timothy_horton@apple.com>
94
95         Shift to a lower-level framework for simplifying URLs
96         https://bugs.webkit.org/show_bug.cgi?id=185334
97
98         Reviewed by Dan Bernstein.
99
100         * Configurations/WebCore.xcconfig:
101         * platform/mac/DragImageMac.mm:
102         (WebCore::LinkImageLayout::LinkImageLayout):
103
104 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
105
106         Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
107         https://bugs.webkit.org/show_bug.cgi?id=185288
108
109         Reviewed by Jer Noble.
110
111         The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
112         which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
113         Speculatively fix the crash by scheduling the check instead.
114
115         In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
116
117         Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
118
119         * html/HTMLMediaElement.cpp:
120         (WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
121         (WebCore::HTMLMediaElementDestructorScope): Added.
122         (WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
123         (WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
124         (WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
125         * html/HTMLMediaElement.h:
126         * loader/FrameLoader.cpp:
127         (WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
128         checkCompleted if we're in the middle of destructing a HTMLMediaElement.
129
130 2018-05-04  Ryosuke Niwa  <rniwa@webkit.org>
131
132         Rename DocumentOrderedMap to TreeScopeOrderedMap
133         https://bugs.webkit.org/show_bug.cgi?id=185290
134
135         Reviewed by Zalan Bujtas.
136
137         Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
138
139         * Sources.txt:
140         * WebCore.xcodeproj/project.pbxproj:
141         * dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
142         * dom/TreeScope.cpp:
143         (WebCore::TreeScope::addElementById):
144         (WebCore::TreeScope::addElementByName):
145         (WebCore::TreeScope::addImageMap):
146         (WebCore::TreeScope::addImageElementByUsemap):
147         (WebCore::TreeScope::labelElementForId):
148         * dom/TreeScope.h:
149         * dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
150         * dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
151         * html/HTMLDocument.h:
152
153 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
154
155         [Win][WebKit] Fix forwarding headers for Windows build
156         https://bugs.webkit.org/show_bug.cgi?id=184412
157
158         Reviewed by Alex Christensen.
159
160         No new tests. No change in behavior.
161
162         * PlatformWin.cmake:
163
164 2018-05-04  Zalan Bujtas  <zalan@apple.com>
165
166         [Simple line layout] Add support for line layout box generation with multiple text renderers.
167         https://bugs.webkit.org/show_bug.cgi?id=185276
168
169         Reviewed by Antti Koivisto.
170
171         Covered by existing tests.
172
173         * rendering/SimpleLineLayoutFunctions.cpp:
174         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
175         (WebCore::SimpleLineLayout::generateLineBoxTree):
176         * rendering/SimpleLineLayoutResolver.cpp:
177         (WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
178         (WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
179         (WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
180         * rendering/SimpleLineLayoutResolver.h:
181
182 2018-05-04  Timothy Hatcher  <timothy@apple.com>
183
184         Deprecate legacy WebView and friends
185         https://bugs.webkit.org/show_bug.cgi?id=185279
186         rdar://problem/33268700
187
188         Reviewed by Tim Horton.
189
190         * Configurations/WebCore.xcconfig:
191         Added BUILDING_WEBKIT define to disable the deprecation macros.
192         * bridge/objc/WebScriptObject.h:
193         Added deprecation macros to WebScriptObject and WebUndefined.
194         * platform/cocoa/WebKitAvailability.h:
195         Added more macros and a way to disable deprecation warnings for
196         WebKit build and in clients like Safari.
197
198 2018-05-04  Eric Carlson  <eric.carlson@apple.com>
199
200         Log media time range as JSON
201         https://bugs.webkit.org/show_bug.cgi?id=185321
202         <rdar://problem/39986746>
203
204         Reviewed by Youenn Fablet.
205
206         No new tests, tested manually.
207
208         * html/HTMLMediaElement.cpp:
209         (WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
210         (WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
211
212         * platform/graphics/MediaPlayer.h:
213         (WTF::LogArgument<MediaTime>::toString):
214         (WTF::LogArgument<MediaTimeRange>::toString):
215
216         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
217         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
218
219 2018-05-04  Zalan Bujtas  <zalan@apple.com>
220
221         Use the containing block to compute the pagination gap when the container is inline.
222         https://bugs.webkit.org/show_bug.cgi?id=184724
223         <rdar://problem/39521800>
224
225         Reviewed by Simon Fraser.
226
227         Test: fast/overflow/page-overflow-with-inline-body-crash.html
228
229         * page/FrameView.cpp:
230         (WebCore::FrameView::applyPaginationToViewport):
231
232 2018-05-04  Tim Horton  <timothy_horton@apple.com>
233
234         Don't use GSFont* in minimal simulator mode
235         https://bugs.webkit.org/show_bug.cgi?id=185320
236         <rdar://problem/39734478>
237
238         Reviewed by Beth Dakin.
239
240         * page/cocoa/MemoryReleaseCocoa.mm:
241         (WebCore::platformReleaseMemory):
242
243 2018-05-04  Chris Dumez  <cdumez@apple.com>
244
245         Unreviewed, rolling out r231331.
246
247         Caused a few tests to assert
248
249         Reverted changeset:
250
251         "Stop using an iframe's id as fallback if its name attribute
252         is not set"
253         https://bugs.webkit.org/show_bug.cgi?id=11388
254         https://trac.webkit.org/changeset/231331
255
256 2018-05-04  Youenn Fablet  <youenn@apple.com>
257
258         Use more references in updateTracksOfType
259         https://bugs.webkit.org/show_bug.cgi?id=185305
260
261         Reviewed by Eric Carlson.
262
263         No change of behavior.
264
265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
266         (WebCore::updateTracksOfType):
267         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
268
269 2018-05-04  Myles C. Maxfield  <mmaxfield@apple.com>
270
271         Text shaping in the simple path is flipped in the y direction
272         https://bugs.webkit.org/show_bug.cgi?id=185062
273         <rdar://problem/39778678>
274
275         Reviewed by Simon Fraser.
276
277         Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
278         code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
279         because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
280         neither of which move glyphs vertically in the common case.
281
282         Test: fast/text/vertical-displacement-simple-codepath.html
283
284         * platform/graphics/Font.cpp:
285         (WebCore::Font::applyTransforms const):
286         * platform/graphics/WidthIterator.cpp:
287         (WebCore::WidthIterator::applyFontTransforms):
288
289 2018-05-04  Chris Nardi  <cnardi@chromium.org>
290
291         Serialize all URLs with double-quotes per CSSOM spec
292         https://bugs.webkit.org/show_bug.cgi?id=184935
293
294         Reviewed by Antti Koivisto.
295
296         According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
297         which means they should have double quotes around the text of the URL. Update our implementation to match
298         this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
299
300         Tests: Many LayoutTests updated to use double quotes.
301
302         * css/CSSMarkup.cpp:
303         (WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
304         (WebCore::serializeURL): Remove FIXME and update implementation.
305
306 2018-05-04  Youenn Fablet  <youenn@apple.com>
307
308         LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
309         https://bugs.webkit.org/show_bug.cgi?id=185303
310
311         Reviewed by Eric Carlson.
312
313         We need to stop observing the audio track like we do for video track once we are no longer interested in it.
314         Covered by test no longer crashing.
315
316         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
317         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
318
319 2018-05-04  Zalan Bujtas  <zalan@apple.com>
320
321         [LFC] Set the invalidation root as the result of style change.
322         https://bugs.webkit.org/show_bug.cgi?id=185301
323
324         Reviewed by Antti Koivisto.
325
326         Compute/propagate the update type on the ancestor chain and return the invalidation root
327         so that LayoutContext could use it as the entry point for the next layout frame.
328
329         * layout/LayoutContext.cpp:
330         (WebCore::Layout::LayoutContext::updateLayout):
331         (WebCore::Layout::LayoutContext::styleChanged):
332         * layout/LayoutContext.h: order is not important.
333         * layout/blockformatting/BlockInvalidation.cpp:
334         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
335         (WebCore::Layout::computeUpdateType):
336         (WebCore::Layout::computeUpdateTypeForAncestor):
337         (WebCore::Layout::BlockInvalidation::invalidate):
338         * layout/blockformatting/BlockInvalidation.h:
339         * layout/inlineformatting/InlineInvalidation.cpp:
340         (WebCore::Layout::InlineInvalidation::invalidate):
341         * layout/inlineformatting/InlineInvalidation.h:
342
343 2018-05-04  Youenn Fablet  <youenn@apple.com>
344
345         PeerConnection should have its connectionState closed even if doing gathering
346         https://bugs.webkit.org/show_bug.cgi?id=185267
347
348         Reviewed by Darin Adler.
349
350         Test: webrtc/addICECandidate-closed.html
351
352         In case m_iceConnectionState is closed, m_connectionState should also be set to closed
353         and RTCPeerConnection should be closed so as to reject any other call.
354
355         * Modules/mediastream/RTCPeerConnection.cpp:
356         (WebCore::RTCPeerConnection::close):
357         (WebCore::RTCPeerConnection::updateConnectionState):
358
359 2018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
360
361         [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
362         https://bugs.webkit.org/show_bug.cgi?id=185242
363
364         Reviewed by Xabier Rodriguez-Calvar.
365
366         When the sourceBuffer is removed from mediasource, the appropriate stream is not
367         properly deleted from WebKitMediaSource, because the appsrc and parser elements
368         of the stream are not removed from the WebKitMediaSource bin.
369
370         This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
371
372         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
373         (webKitMediaSrcFreeStream):
374
375 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
376
377         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
378         https://bugs.webkit.org/show_bug.cgi?id=174730
379
380         Reviewed by Michael Catanzaro.
381
382         Export ResourceRequestBase::hasHTTPHeaderField().
383
384         * platform/network/ResourceRequestBase.h:
385
386 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
387
388         Use subprocess.call instead of os.system to handle path with spaces
389         https://bugs.webkit.org/show_bug.cgi?id=185291
390
391         Reviewed by Darin Adler.
392
393         If gperf path includes spaces, these python scripts fail to execute gperf.
394         We use subprocess module instead of os.system to invoke gperf.
395
396         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
397         * css/makeSelectorPseudoElementsMap.py:
398         * platform/network/create-http-header-name-table:
399
400 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
401
402         Unreviewed, attempt to fix WinCairo build failure
403         https://bugs.webkit.org/show_bug.cgi?id=185218
404
405         * platform/text/win/LocaleWin.cpp:
406         (WebCore::LocaleWin::getLocaleInfoString):
407
408 2018-05-03  Filip Pizlo  <fpizlo@apple.com>
409
410         Strings should not be allocated in a gigacage
411         https://bugs.webkit.org/show_bug.cgi?id=185218
412
413         Reviewed by Saam Barati.
414
415         No new tests because no new behavior.
416
417         * Modules/indexeddb/server/IDBSerialization.cpp:
418         (WebCore::decodeKey):
419         * bindings/js/SerializedScriptValue.cpp:
420         (WebCore::CloneDeserializer::readString):
421         * html/canvas/CanvasRenderingContext2D.cpp:
422         (WebCore::normalizeSpaces):
423         * html/parser/HTMLTreeBuilder.cpp:
424         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
425         * platform/URLParser.cpp:
426         (WebCore::percentEncodeByte):
427         (WebCore::serializeURLEncodedForm):
428         (WebCore::URLParser::serialize):
429         * platform/URLParser.h:
430         * platform/graphics/FourCC.cpp:
431         (WebCore::FourCC::toString const):
432         * platform/graphics/ca/GraphicsLayerCA.cpp:
433         (WebCore::GraphicsLayerCA::ReplicaState::cloneID const):
434         * platform/text/LocaleICU.cpp:
435         (WebCore::LocaleICU::decimalSymbol):
436         (WebCore::LocaleICU::decimalTextAttribute):
437         (WebCore::getDateFormatPattern):
438         (WebCore::LocaleICU::createLabelVector):
439         (WebCore::getFormatForSkeleton):
440         * platform/win/FileSystemWin.cpp:
441         (WebCore::FileSystem::getFinalPathName):
442         (WebCore::FileSystem::pathByAppendingComponent):
443         (WebCore::FileSystem::storageDirectory):
444
445 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
446
447         Widgets should hold a WeakPtr to their parents
448         https://bugs.webkit.org/show_bug.cgi?id=185239
449         <rdar://problem/39741250>
450
451         Reviewed by Zalan Bujtas.
452
453         * platform/ScrollView.h:
454         (WebCore::ScrollView::weakPtrFactory): Added.
455         * platform/Widget.cpp:
456         (WebCore::Widget::init): Don't perform an unnecessary assignment.
457         (WebCore::Widget::setParent): Grab a WeakPtr to the parent ScrollView.
458         * platform/Widget.h:
459         (WebCore::Widget::parent const): Change type to a WeakPtr.
460
461 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
462
463         Use pointer instead of std::optional<T&>
464         https://bugs.webkit.org/show_bug.cgi?id=185186
465
466         Reviewed by Alex Christensen.
467
468         std::optional<T&> is not accepted in C++17 spec.
469         In this patch, we replace it with T*, which is well-aligned to
470         WebKit's convention.
471
472         * Modules/mediastream/RTCPeerConnection.cpp:
473         (WebCore::iceServersFromConfiguration):
474         (WebCore::RTCPeerConnection::initializeConfiguration):
475         (WebCore::RTCPeerConnection::setConfiguration):
476         * css/parser/CSSParser.cpp:
477         (WebCore::CSSParser::parseSystemColor):
478         * css/parser/CSSParser.h:
479         * dom/DatasetDOMStringMap.cpp:
480         (WebCore::DatasetDOMStringMap::item const):
481         (WebCore::DatasetDOMStringMap::namedItem const):
482         (WebCore:: const): Deleted.
483         * dom/DatasetDOMStringMap.h:
484         * dom/Element.cpp:
485         (WebCore::Element::insertAdjacentHTML):
486         * dom/Element.h:
487         * html/canvas/CanvasStyle.cpp:
488         (WebCore::parseColor):
489         * inspector/DOMEditor.cpp:
490         * platform/network/curl/CurlFormDataStream.cpp:
491         (WebCore::CurlFormDataStream::getPostData):
492         (): Deleted.
493         * platform/network/curl/CurlFormDataStream.h:
494         * platform/network/curl/CurlRequest.cpp:
495         (WebCore::CurlRequest::setupPOST):
496         * testing/MockCDMFactory.cpp:
497         (WebCore::MockCDMFactory::keysForSessionWithID const):
498         (WebCore::MockCDMInstance::updateLicense):
499         (WebCore:: const): Deleted.
500         * testing/MockCDMFactory.h:
501
502 2018-05-03  Chris Dumez  <cdumez@apple.com>
503
504         Stop using an iframe's id as fallback if its name attribute is not set
505         https://bugs.webkit.org/show_bug.cgi?id=11388
506
507         Reviewed by Geoff Garen.
508
509         WebKit had logic to use an iframe's id as fallback name when its name
510         content attribute is not set. This behavior was not standard and did not
511         match other browsers:
512         - https://html.spec.whatwg.org/#attr-iframe-name
513
514         Gecko / Trident never behaved this way. Blink was aligned with us until
515         they started to match the specification in:
516         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
517
518         This WebKit quirk was causing some Web-compatibility issues because it
519         would affect the behavior of Window's name property getter when trying
520         to look up an iframe by id. Because of Window's named property getter
521         behavior [1], we would return the frame's contentWindow instead of the
522         iframe element itself.
523
524         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
525
526         Test: fast/dom/Window/named-getter-frame-id.html
527
528         * html/HTMLFrameElementBase.cpp:
529         (WebCore::HTMLFrameElementBase::openURL):
530         (WebCore::HTMLFrameElementBase::parseAttribute):
531         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
532         * html/HTMLFrameElementBase.h:
533
534 2018-05-03  Eric Carlson  <eric.carlson@apple.com>
535
536         [iOS] Internal text and audio tracks not in fullscreen menu
537         https://bugs.webkit.org/show_bug.cgi?id=185268
538         <rdar://problem/38673440>
539
540         Reviewed by Jer Noble.
541
542         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
543         (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
544         events are fired at the track lists, not the media element.
545
546 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
547
548         Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
549         https://bugs.webkit.org/show_bug.cgi?id=185238
550
551         Reviewed by Antti Koivisto.
552
553         The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
554         even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
555
556         Test: fast/images/imagemap-in-nested-shadow-tree.html
557               fast/images/imagemap-in-shadow-tree.html
558
559         * dom/Document.cpp:
560         (WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
561         (WebCore::Document::removeImageElementByUsemap): Ditto.
562         (WebCore::Document::imageElementByUsemap const): Ditto.
563         * dom/Document.h:
564         * dom/TreeScope.cpp:
565         (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
566         (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
567         which used to call this function with the raw value of the usemap content attribute now calls it
568         via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
569         (WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
570         (WebCore::TreeScope::removeImageElementByUsemap): Ditto.
571         (WebCore::TreeScope::imageElementByUsemap const): Ditto.
572         * dom/TreeScope.h:
573         * html/HTMLImageElement.cpp:
574         (WebCore::HTMLImageElement::parseAttribute):
575         (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
576         if it's connected to a document.
577         (WebCore::HTMLImageElement::removedFromAncestor):
578         (WebCore::HTMLImageElement::associatedMapElement const):
579         * html/HTMLImageElement.h:
580         * html/HTMLMapElement.cpp:
581         (WebCore::HTMLMapElement::imageElement):
582         * rendering/RenderImage.cpp:
583         (WebCore::RenderImage::imageMap const):
584
585 2018-05-03  Justin Fan  <justin_fan@apple.com>
586
587         [WebGL] Add runtime flag for enabling ASTC support in WebGL
588         https://bugs.webkit.org/show_bug.cgi?id=184840
589
590         Reviewed by Myles C. Maxfield.
591
592         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
593
594         * page/RuntimeEnabledFeatures.h:
595         (WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
596         (WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
597
598 2018-05-03  Chris Nardi  <cnardi@chromium.org>
599
600         Remove [NoInterfaceObject] from DOMRectList
601         https://bugs.webkit.org/show_bug.cgi?id=185255
602
603         Reviewed by Chris Dumez.
604
605         In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
606         from DOMRectList. Remove it from our implementation to match the spec, as well as
607         Chrome and Firefox.
608
609         Updated web platform tests IDL test for the Geometry spec.
610
611         * dom/DOMRectList.idl:
612
613 2018-05-03  Chris Dumez  <cdumez@apple.com>
614
615         REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
616         https://bugs.webkit.org/show_bug.cgi?id=185073
617         <rdar://problem/39821223>
618
619         Reviewed by Alexey Proskuryakov.
620
621         The following changes were made:
622         - Make sure SocketStream callbacks are always scheduled on the right runloop:
623           WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
624           main runloop otherwise.
625         - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
626           before calling methods on the SocketStream client. Previously, this code path
627           was specific to Windows but there is no reason to have platform-specific code here.
628           callOnMainThreadAndWait() calls the function right away if we're already on the main
629           thread, which will be the case on other platform than Windows.
630
631         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
632         (WebCore::callbacksRunLoop):
633         (WebCore::callbacksRunLoopMode):
634         (WebCore::SocketStreamHandleImpl::scheduleStreams):
635         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
636         (WebCore::SocketStreamHandleImpl::executePACFileURL):
637         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
638         (WebCore::SocketStreamHandleImpl::readStreamCallback):
639         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
640         (WebCore::SocketStreamHandleImpl::platformClose):
641
642 2018-05-03  Zalan Bujtas  <zalan@apple.com>
643
644         [LFC] Enable multiple layout roots for incremental layout.
645         https://bugs.webkit.org/show_bug.cgi?id=185185
646
647         Reviewed by Antti Koivisto.
648
649         With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
650         When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
651         the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
652
653         * layout/FormattingState.h:
654         * layout/LayoutContext.cpp:
655         (WebCore::Layout::LayoutContext::updateLayout):
656         (WebCore::Layout::LayoutContext::addLayoutEntryPoint):
657         * layout/LayoutContext.h:
658
659 2018-05-03  Zalan Bujtas  <zalan@apple.com>
660
661         [LFC] Box invalidation logic should go to dedicated classes.
662         https://bugs.webkit.org/show_bug.cgi?id=185249
663
664         Reviewed by Antti Koivisto.
665
666         Each formatting context can initiate a different type of invalidation when
667         style attribute changes in a box.
668
669         * Sources.txt:
670         * WebCore.xcodeproj/project.pbxproj:
671         * layout/FormattingState.cpp:
672         (WebCore::Layout::FormattingState::FormattingState):
673         * layout/FormattingState.h:
674         (WebCore::Layout::FormattingState::isBlockFormattingState const):
675         (WebCore::Layout::FormattingState::isInlineFormattingState const):
676         * layout/LayoutContext.cpp:
677         (WebCore::Layout::LayoutContext::styleChanged):
678         (WebCore::Layout::LayoutContext::markNeedsUpdate):
679         * layout/LayoutContext.h:
680         * layout/blockformatting/BlockFormattingState.cpp:
681         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
682         * layout/blockformatting/BlockFormattingState.h:
683         * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
684         (WebCore::Layout::BlockInvalidation::invalidate):
685         * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
686         * layout/inlineformatting/InlineFormattingState.cpp:
687         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
688         * layout/inlineformatting/InlineFormattingState.h:
689         * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
690         (WebCore::Layout::InlineInvalidation::invalidate):
691         * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
692
693 2018-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
694
695         WebKit should send fake macOS user agent to docs.google.com
696         https://bugs.webkit.org/show_bug.cgi?id=185165
697
698         Reviewed by Carlos Garcia Campos.
699
700         * platform/UserAgentQuirks.cpp:
701         (WebCore::urlRequiresMacintoshPlatform):
702         (WebCore::urlRequiresLinuxDesktopPlatform):
703
704 2018-05-03  Commit Queue  <commit-queue@webkit.org>
705
706         Unreviewed, rolling out r231223 and r231288.
707         https://bugs.webkit.org/show_bug.cgi?id=185256
708
709         The change in r231223 breaks internal builds, and r231288 is a
710         dependent change. (Requested by ryanhaddad on #webkit).
711
712         Reverted changesets:
713
714         "Use default std::optional if it is provided"
715         https://bugs.webkit.org/show_bug.cgi?id=185159
716         https://trac.webkit.org/changeset/231223
717
718         "Use pointer instead of
719         std::optional<std::reference_wrapper<>>"
720         https://bugs.webkit.org/show_bug.cgi?id=185186
721         https://trac.webkit.org/changeset/231288
722
723 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
724
725         Unreviewed, rolling out r231253.
726
727         The API test added with this change is crashing on the bots.
728
729         Reverted changeset:
730
731         "Web Inspector: opt out of process swap on navigation if a Web
732         Inspector frontend is connected"
733         https://bugs.webkit.org/show_bug.cgi?id=184861
734         https://trac.webkit.org/changeset/231253
735
736 2018-05-03  Youenn Fablet  <youenn@apple.com>
737
738         A MediaStream being played should allow removing some of its tracks
739         https://bugs.webkit.org/show_bug.cgi?id=185233
740
741         Reviewed by Eric Carlson.
742
743         Update the tracks out of the for loop.
744         Test: fast/mediastream/change-tracks-media-stream-being-played.html
745
746         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
747         (WebCore::updateTracksOfType):
748
749 2018-05-03  Miguel Gomez  <magomez@igalia.com>
750
751         WebCore::TextureMapperLayer object used after freed
752         https://bugs.webkit.org/show_bug.cgi?id=184729
753
754         Reviewed by Michael Catanzaro.
755
756         Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
757         inside TextureMapperLayer.
758
759         * platform/graphics/texmap/TextureMapperLayer.cpp:
760         (WebCore::TextureMapperLayer::~TextureMapperLayer):
761         (WebCore::TextureMapperLayer::setMaskLayer):
762         (WebCore::TextureMapperLayer::setReplicaLayer):
763         * platform/graphics/texmap/TextureMapperLayer.h:
764
765 2018-05-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
766
767         [Curl] Add OpenSSL/LibreSSL multi-threading support
768         https://bugs.webkit.org/show_bug.cgi?id=185138
769
770         The older OpenSSL manual says the locking_function and threadid_function should
771         be set when use it in multi-threading environment. This applies to LibreSSL also.
772         https://www.openssl.org/docs/man1.0.2/crypto/threads.html
773
774         For unix and other similar os, the default threadId_function implementation is
775         good enough. We'll set custom callback only for Windows OS.
776
777         Note it's not required for OpenSSL 1.1.0 and after.
778         https://www.openssl.org/blog/blog/2017/02/21/threads/
779
780         Reviewed by Per Arne Vollan.
781
782         * platform/network/curl/CurlSSLHandle.cpp:
783         (WebCore::CurlSSLHandle::CurlSSLHandle):
784         (WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
785         (WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
786         (WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
787         * platform/network/curl/CurlSSLHandle.h:
788         (WebCore::CurlSSLHandle::ThreadSupport::setup):
789         (WebCore::CurlSSLHandle::ThreadSupport::singleton):
790         (WebCore::CurlSSLHandle::ThreadSupport::lock):
791         (WebCore::CurlSSLHandle::ThreadSupport::unlock):
792
793 2018-05-02  Ryosuke Niwa  <rniwa@webkit.org>
794
795         Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
796         https://bugs.webkit.org/show_bug.cgi?id=185227
797
798         Reviewed by Chris Dumez.
799
800         Removed the check. The attribute value string can never be null.
801
802         * dom/Element.cpp:
803         (WebCore::Element::removeAttributeInternal):
804
805 2018-05-02  Zalan Bujtas  <zalan@apple.com>
806
807         [LFC] Implement LayoutContext::createDisplayBox
808         https://bugs.webkit.org/show_bug.cgi?id=185158
809
810         Reviewed by Antti Koivisto.
811
812         Now compute*() functions take both the const layout and the corresponding non-const display boxes.
813         Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
814         (This might need to change in the future if we decide to arrange them in some sort of painting order)
815
816         * layout/FloatingContext.cpp:
817         (WebCore::Layout::FloatingContext::computePosition):
818         * layout/FloatingContext.h:
819         * layout/FormattingContext.cpp:
820         (WebCore::Layout::FormattingContext::computeStaticPosition const):
821         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
822         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
823         (WebCore::Layout::FormattingContext::computeWidth const):
824         (WebCore::Layout::FormattingContext::computeHeight const):
825         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
826         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
827         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
828         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
829         * layout/FormattingContext.h:
830         * layout/LayoutContext.cpp:
831         (WebCore::Layout::LayoutContext::createDisplayBox):
832         * layout/LayoutContext.h:
833         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
834         * layout/blockformatting/BlockFormattingContext.cpp:
835         (WebCore::Layout::BlockFormattingContext::layout const):
836         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
837         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
838         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
839         * layout/blockformatting/BlockFormattingContext.h:
840         * layout/displaytree/DisplayBox.h:
841         (WebCore::Display::Box::parent const): Deleted.
842         (WebCore::Display::Box::nextSibling const): Deleted.
843         (WebCore::Display::Box::previousSibling const): Deleted.
844         (WebCore::Display::Box::firstChild const): Deleted.
845         (WebCore::Display::Box::lastChild const): Deleted.
846         (WebCore::Display::Box::setParent): Deleted.
847         (WebCore::Display::Box::setNextSibling): Deleted.
848         (WebCore::Display::Box::setPreviousSibling): Deleted.
849         (WebCore::Display::Box::setFirstChild): Deleted.
850         (WebCore::Display::Box::setLastChild): Deleted.
851         (): Deleted.
852         * layout/inlineformatting/InlineFormattingContext.cpp:
853         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
854         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
855         * layout/inlineformatting/InlineFormattingContext.h:
856
857 2018-05-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
858
859         Hiding then showing an <object> of type image makes the underlaying image disappear
860         https://bugs.webkit.org/show_bug.cgi?id=185216
861         <rdar://problem/39055630>
862
863         Reviewed by Youenn Fablet.
864
865         Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
866         RenderImage with the CachedImage of its ImageLoader when the RenderImage
867         is recreated.
868
869         Test: fast/images/object-image-hide-show.html
870
871         * html/HTMLPlugInImageElement.cpp:
872         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
873         This is very similar to what we do in HTMLImageElement::didAttachRenderers().
874
875
876 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
877
878         Use RetainPtr for form input type
879         https://bugs.webkit.org/show_bug.cgi?id=185210
880         <rdar://problem/39734040>
881
882         Reviewed by Ryosuke Niwa.
883
884         Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
885
886         Test: fast/forms/access-key-mutation-2.html.
887
888         * html/HTMLInputElement.cpp:
889         (WebCore::HTMLInputElement::HTMLInputElement):
890         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
891         (WebCore::HTMLInputElement::accessKeyAction):
892         (WebCore::HTMLInputElement::parseAttribute):
893         (WebCore::HTMLInputElement::appendFormData):
894         * html/HTMLInputElement.h:
895         * html/InputType.cpp:
896         (WebCore::createInputType):
897         (WebCore::InputType::create):
898         (WebCore::InputType::createText):
899         * html/InputType.h:
900
901 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
902
903         Use pointer instead of std::optional<std::reference_wrapper<>>
904         https://bugs.webkit.org/show_bug.cgi?id=185186
905
906         Reviewed by Alex Christensen.
907
908         std::optional<T&> is not accepted in C++17 spec. So we replaced it
909         with std::optional<std::reference_wrapper<T>>.
910
911         In this patch, we replace it with T*, which is well-aligned to
912         WebKit's convention.
913
914         * Modules/mediastream/RTCPeerConnection.cpp:
915         (WebCore::iceServersFromConfiguration):
916         (WebCore::RTCPeerConnection::initializeConfiguration):
917         (WebCore::RTCPeerConnection::setConfiguration):
918         * css/parser/CSSParser.cpp:
919         (WebCore::CSSParser::parseSystemColor):
920         * css/parser/CSSParser.h:
921         * dom/DatasetDOMStringMap.cpp:
922         (WebCore::DatasetDOMStringMap::item const):
923         (WebCore::DatasetDOMStringMap::namedItem const):
924         * dom/DatasetDOMStringMap.h:
925         * dom/Element.cpp:
926         (WebCore::Element::insertAdjacentHTML):
927         * dom/Element.h:
928         * html/canvas/CanvasStyle.cpp:
929         (WebCore::parseColor):
930         * inspector/DOMEditor.cpp:
931         * platform/network/curl/CurlFormDataStream.cpp:
932         (WebCore::CurlFormDataStream::getPostData):
933         * platform/network/curl/CurlFormDataStream.h:
934         * platform/network/curl/CurlRequest.cpp:
935         (WebCore::CurlRequest::setupPOST):
936         * testing/MockCDMFactory.cpp:
937         (WebCore::MockCDMFactory::keysForSessionWithID const):
938         (WebCore::MockCDMInstance::updateLicense):
939         * testing/MockCDMFactory.h:
940
941 2018-05-02  Keith Rollin  <krollin@apple.com>
942
943         Add facility for tracking times and results of page and resource loading
944         https://bugs.webkit.org/show_bug.cgi?id=184838
945         <rdar://problem/36548974>
946
947         Reviewed by Brent Fulgham.
948
949         Update FrameProgressTracker to send the necessary page load start/stop
950         signals so that we can track the entire page load at a network level.
951         Add an empty override of the pure virtual
952         LoaderStrategy::pageLoadCompleted method.
953
954         No new tests. There is no testable effect from these changes. On
955         Cocoa, measurable changes take place in another (non-WebKit) process.
956         On non-Cocoa systems, this facility is currently disabled.
957
958         * loader/FrameLoader.cpp:
959         (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
960         * loader/LoaderStrategy.h:
961
962 2018-05-02  Aditya Keerthi  <akeerthi@apple.com>
963
964         Can't copy and paste URLs that have no title into Mail (macOS)
965         https://bugs.webkit.org/show_bug.cgi?id=185205
966         <rdar://problem/36352406>
967
968         Reviewed by Tim Horton.
969
970         The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
971
972         To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.
973
974         Augmented WebKitLegacy.ContextMenuCanCopyURL test
975
976         * platform/mac/PasteboardMac.mm:
977         (WebCore::writeURLForTypes):
978
979 2018-05-01  Ryosuke Niwa  <rniwa@webkit.org>
980
981         REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
982         https://bugs.webkit.org/show_bug.cgi?id=182188
983         <rdar://problem/36689240>
984
985         Reviewed by Antti Koivisto.
986
987         Fixed the crash by removing up the release assert.
988
989         The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
990         Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
991         without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
992         in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
993         invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
994         whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
995
996         There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
997         true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
998         this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
999
1000         This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
1001         since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
1002         and there is no evidence that r225868 has led to new UAFs even after five months.
1003
1004         No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
1005
1006         * dom/Document.cpp:
1007         (WebCore::Document::removeSVGUseElement):
1008
1009 2018-05-02  Dirk Schulze  <dschulze@chromium.org>
1010
1011         getCharNumAtPosition should take DOMPointInit as argument
1012         https://bugs.webkit.org/show_bug.cgi?id=184695
1013
1014         Reviewed by Antti Koivisto.
1015
1016         Extend existing tests for getCharNumAtPosition.
1017
1018         * svg/SVGTextContentElement.cpp:
1019         (WebCore::SVGTextContentElement::getCharNumAtPosition):
1020         * svg/SVGTextContentElement.h:
1021         * svg/SVGTextContentElement.idl: Use DOMPointInit argument.
1022
1023 2018-05-02  Youenn Fablet  <youenn@apple.com>
1024
1025         Use NetworkLoadChecker for navigation loads
1026         https://bugs.webkit.org/show_bug.cgi?id=184892
1027         <rdar://problem/39652686>
1028
1029         Reviewed by Chris Dumez.
1030
1031         Sanitize headers according response tainting.
1032         If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
1033         If tainting is Opaque, we filter all uncommon headers.
1034         If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
1035         Covered by updated test.
1036
1037         * platform/network/ResourceResponseBase.cpp:
1038         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
1039         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
1040         * platform/network/ResourceResponseBase.h:
1041
1042 2018-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
1043
1044         Collection fragment identifiers don't use PostScript names
1045         https://bugs.webkit.org/show_bug.cgi?id=184624
1046         <rdar://problem/39432089>
1047
1048         Reviewed by Simon Fraser.
1049
1050         In a previous version of the CSS Fonts spec, there was text saying that items in font collections
1051         should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
1052         inserting an item into the middle of a collection would throw off all content that uses the file.
1053         Instead, the spec has since changed to use PostScript names (so the content instead would say
1054         MyFonts.ttc#MyFont-Regular).
1055
1056         Test: fast/text/font-collection.html
1057
1058         * css/CSSFontFaceSource.cpp:
1059         (WebCore::CSSFontFaceSource::load):
1060         * loader/cache/CachedFont.cpp:
1061         (WebCore::CachedFont::calculateItemInCollection const):
1062         (WebCore::CachedFont::ensureCustomFontData):
1063         (WebCore::CachedFont::createCustomFontData):
1064         (WebCore::CachedFont::calculateIndex const): Deleted.
1065         * loader/cache/CachedFont.h:
1066         * platform/graphics/mac/FontCustomPlatformData.cpp:
1067         (WebCore::createFontCustomPlatformData):
1068         * platform/graphics/mac/FontCustomPlatformData.h:
1069
1070 2018-05-02  Brian Burg  <bburg@apple.com>
1071
1072         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
1073         https://bugs.webkit.org/show_bug.cgi?id=184861
1074         <rdar://problem/39153768>
1075
1076         Reviewed by Ryosuke Niwa.
1077
1078         Notify the client of the current connection count whenever a frontend connects or disconnects.
1079
1080         Covered by new API test.
1081
1082         * inspector/InspectorClient.h:
1083         (WebCore::InspectorClient::frontendCountChanged):
1084         * inspector/InspectorController.cpp:
1085         (WebCore::InspectorController::connectFrontend):
1086         (WebCore::InspectorController::disconnectFrontend):
1087         (WebCore::InspectorController::disconnectAllFrontends):
1088         * inspector/InspectorController.h:
1089
1090 2018-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1091
1092         [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
1093         https://bugs.webkit.org/show_bug.cgi?id=185207
1094
1095         Reviewed by Michael Catanzaro.
1096
1097         Remove unneeded include of gstgldisplay_wayland.h
1098
1099         No new tests, no change in behaviour.
1100
1101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1102
1103 2018-05-02  Chris Dumez  <cdumez@apple.com>
1104
1105         document.open() event listener removal is not immediate
1106         https://bugs.webkit.org/show_bug.cgi?id=185191
1107
1108         Reviewed by Darin Adler.
1109
1110         We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
1111         whenever they get removed from the EventListenerMap. We were doing so correctly
1112         in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
1113         updates clear() accordingly.
1114
1115         The reason we need to set this flag is that RegisteredEventListeners is RefCounted
1116         and EventTarget::fireEventListeners() may be currently running and calling
1117         each listener one by one, holding a reference to all listener of a given event.
1118
1119         Test: fast/dom/Document/document-open-removes-all-listeners.html
1120
1121         * dom/EventListenerMap.cpp:
1122         (WebCore::EventListenerMap::clear):
1123
1124 2018-05-02  Zalan Bujtas <zalan@apple.com>
1125
1126         Use WeakPtr in GridCell
1127         https://bugs.webkit.org/show_bug.cgi?id=185180
1128         <rdar://problem/39432165>
1129
1130         Reviewed by Antti Koivisto.
1131
1132         Since GridCell does not own the renderers, it should
1133         construct weak pointers.
1134
1135         Unable to create a reliably reproducible test case.
1136
1137         * rendering/Grid.cpp:
1138         (WebCore::Grid::insert):
1139         (WebCore::GridIterator::nextGridItem):
1140         * rendering/Grid.h:
1141         * rendering/RenderGrid.cpp:
1142         (WebCore::RenderGrid::firstLineBaseline const):
1143
1144 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
1145
1146         [iOS] Provide audio route information when invoking AirPlay picker
1147         https://bugs.webkit.org/show_bug.cgi?id=185199
1148         <rdar://problem/39853103>
1149
1150         Reviewed by Jer Noble.
1151
1152         No new tests, this requires a specific hardware setup.
1153
1154         * dom/Document.cpp:
1155         (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
1156         * dom/Document.h:
1157
1158         * html/MediaElementSession.cpp:
1159         (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
1160
1161         * loader/EmptyClients.h:
1162         * page/ChromeClient.h:
1163
1164         * page/Page.cpp:
1165         (WebCore::Page::showPlaybackTargetPicker): Ditto.
1166         * page/Page.h:
1167
1168         * platform/audio/AudioSession.cpp:
1169         (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
1170         (WebCore::routingContextUID const): Ditto.
1171         * platform/audio/AudioSession.h:
1172
1173         * platform/audio/ios/AudioSessionIOS.mm:
1174         (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
1175         (WebCore::AudioSession::routingContextUID const): Return the route context UID.
1176
1177 2018-05-02  Dean Jackson  <dino@apple.com>
1178
1179         Draw SystemPreview badge to specification on iOS
1180         https://bugs.webkit.org/show_bug.cgi?id=185203
1181         <rdar://problem/39908855>
1182
1183         Reviewed by Tim Horton.
1184
1185         Use CoreImage to render a badge with a blurred background,
1186         at particular sizes.
1187
1188         This will be tested internally while we're getting artwork
1189         from WebKitAdditions.
1190
1191         * Configurations/WebCore.xcconfig: Link against CoreImage.
1192         * rendering/RenderThemeIOS.h:
1193         * rendering/RenderThemeIOS.mm:
1194         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
1195         in the iOS platform RenderTheme that draws the system preview.
1196
1197 2018-05-01  Brent Fulgham  <bfulgham@apple.com>
1198
1199         Prevent Debug ASSERT when changing forms
1200         https://bugs.webkit.org/show_bug.cgi?id=185173
1201         <rdar://problem/39738669>
1202
1203         Reviewed by Ryosuke Niwa.
1204
1205         Form submission could trigger a debug assertion during validation when
1206         a form is changed during an input submission. Fix this by cleaning up
1207         the event handling logic and make it more consistent with modern WebKit
1208         coding style.
1209
1210         Test: fast/forms/form-submission-crash-3.html
1211
1212         * html/HTMLButtonElement.cpp:
1213         (WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
1214         attempting to perform event handling.
1215         * html/HTMLFormElement.cpp:
1216         (WebCore::HTMLFormElement::reportValidity): Ditto.
1217         (WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
1218         since we expect this to happen earlier in the layout pass. Add an assertion that the
1219         tree is not dirty.
1220         * html/ImageInputType.cpp:
1221         (WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
1222         attempting to perform event handling.
1223         * html/SubmitInputType.cpp:
1224         (WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
1225
1226 2018-05-02  Jer Noble  <jer.noble@apple.com>
1227
1228         Unreviewed; address review comments made before landing r231231.
1229
1230         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1231         (VideoFullscreenControllerContext::volume const):
1232
1233 2018-05-02  Jer Noble  <jer.noble@apple.com>
1234
1235         Pipe volume through PlaybackSessionManager/Proxy.
1236         https://bugs.webkit.org/show_bug.cgi?id=185182
1237
1238         Reviewed by Eric Carlson.
1239
1240         Add support for the volume property to PlaybackSessionModel, and all its clients.
1241
1242         * platform/cocoa/PlaybackSessionModel.h:
1243         (WebCore::PlaybackSessionModelClient::volumeChanged):
1244         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1245         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1246         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
1247         (WebCore::PlaybackSessionModelMediaElement::setVolume):
1248         (WebCore::PlaybackSessionModelMediaElement::volume const):
1249         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1250         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1251         (WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
1252         * platform/ios/WebAVPlayerController.h:
1253         * platform/ios/WebAVPlayerController.mm:
1254         (-[WebAVPlayerController volume]):
1255         (-[WebAVPlayerController setVolume:]):
1256         (-[WebAVPlayerController volumeChanged:]):
1257         (-[WebAVPlayerController resetMediaState]):
1258         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1259         (VideoFullscreenControllerContext::volumeChanged):
1260         (VideoFullscreenControllerContext::volume const):
1261         (VideoFullscreenControllerContext::setVolume):
1262
1263 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1264
1265         Unreviewed, fix build in WinCairo
1266         https://bugs.webkit.org/show_bug.cgi?id=185169
1267
1268         * bindings/js/JSDOMWindowBase.cpp:
1269         (WebCore::JSDOMWindowBase::instantiateStreaming):
1270         * bindings/js/JSDOMWindowBase.h:
1271
1272 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1273
1274         Use default std::optional if it is provided
1275         https://bugs.webkit.org/show_bug.cgi?id=185159
1276
1277         Reviewed by JF Bastien.
1278
1279         * Modules/mediastream/RTCPeerConnection.cpp:
1280         (WebCore::iceServersFromConfiguration):
1281         (WebCore::RTCPeerConnection::setConfiguration):
1282         * css/parser/CSSParser.cpp:
1283         (WebCore::CSSParser::parseSystemColor):
1284         * css/parser/CSSParser.h:
1285         * dom/DatasetDOMStringMap.cpp:
1286         (WebCore::DatasetDOMStringMap::item const):
1287         (WebCore::DatasetDOMStringMap::namedItem const):
1288         (WebCore:: const): Deleted.
1289         * dom/DatasetDOMStringMap.h:
1290         * dom/Element.cpp:
1291         (WebCore::Element::insertAdjacentHTML):
1292         * dom/Element.h:
1293         * inspector/DOMEditor.cpp:
1294         * platform/network/curl/CurlFormDataStream.cpp:
1295         (WebCore::CurlFormDataStream::getPostData):
1296         (): Deleted.
1297         * platform/network/curl/CurlFormDataStream.h:
1298         * testing/MockCDMFactory.cpp:
1299         (WebCore::MockCDMFactory::keysForSessionWithID const):
1300         (WebCore::MockCDMInstance::updateLicense):
1301         (WebCore:: const): Deleted.
1302         * testing/MockCDMFactory.h:
1303
1304 2018-05-01  Chris Dumez  <cdumez@apple.com>
1305
1306         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
1307         https://bugs.webkit.org/show_bug.cgi?id=185181
1308
1309         Reviewed by Geoffrey Garen.
1310
1311         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
1312         on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
1313         which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
1314         to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
1315         the UIthread instead of the WebThread on iOS WebKitLegacy.
1316
1317         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1318         (WebCore::SocketStreamHandleImpl::scheduleStreams):
1319         (WebCore::SocketStreamHandleImpl::readStreamCallback):
1320
1321 2018-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1322
1323         Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
1324
1325         * page/RuntimeEnabledFeatures.h:
1326
1327 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
1328
1329         Fix build error after r231194
1330         https://bugs.webkit.org/show_bug.cgi?id=185169
1331
1332         Reviewed by JF Bastien.
1333
1334         Prevent compile error in iOS Simulator debug build
1335         by tagging function
1336
1337         * bindings/js/JSDOMWindowBase.cpp:
1338         (WebCore::JSDOMWindowBase::compileStreaming):
1339         (WebCore::JSDOMWindowBase::instantiateStreaming):
1340
1341 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
1342
1343         WebAssembly: add support for stream APIs - JavaScript API
1344         https://bugs.webkit.org/show_bug.cgi?id=183442
1345
1346         Reviewed by Yusuke Suzuki and JF Bastien.
1347
1348         Add WebAssembly streaming API to WebCore.
1349
1350         * Configurations/FeatureDefines.xcconfig:
1351         * bindings/js/JSDOMWindowBase.cpp:
1352         (WebCore::tryAllocate):
1353         (WebCore::isResponseCorrect):
1354         (WebCore::handleResponseOnStreamingAction):
1355         (WebCore::JSDOMWindowBase::compileStreaming):
1356         (WebCore::JSDOMWindowBase::instantiateStreaming):
1357         * bindings/js/JSDOMWindowBase.h:
1358         * bindings/js/JSRemoteDOMWindowBase.cpp:
1359         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1360
1361 2018-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
1362
1363         Improve the performance of FontCascadeDescription's effectiveFamilies
1364         https://bugs.webkit.org/show_bug.cgi?id=184720
1365         <rdar://problem/38970927>
1366
1367         Reviewed by Simon Fraser.
1368
1369         The page that had the performance problem renders many different Chinese characters in system-ui
1370         with only a small number of individual fonts. It turns out we were calling into the system-ui
1371         machinery for each character in order to opportunistically start loading data URLs (see also:
1372         https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
1373         font, so we don't need to invoke the system-ui machinery at all.
1374
1375         This patch makes a 92x performance improvement on the associated performance test. This test is
1376         designed to test Chinese text rendered with system-ui.
1377
1378         Performance test: Layout/system-ui.html
1379
1380         * platform/graphics/FontCascadeFonts.cpp:
1381         (WebCore::opportunisticallyStartFontDataURLLoading):
1382
1383 2018-04-30  Jer Noble  <jer.noble@apple.com>
1384
1385         <img src=mp4> does not display on ios despite Accept: video/* advertisement
1386         https://bugs.webkit.org/show_bug.cgi?id=185029
1387         <rdar://problem/39771989>
1388
1389         Reviewed by Eric Carlson.
1390
1391         Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
1392         even if the resource request is successfully fulfilled prior to the return. Always return YES in
1393         the case that loading succeeded.
1394
1395         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1396         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
1397
1398 2018-04-30  Zalan Bujtas  <zalan@apple.com>
1399
1400         REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
1401         https://bugs.webkit.org/show_bug.cgi?id=185142
1402         <rdar://problem/39821446>
1403
1404         Reviewed by Simon Fraser.
1405
1406         Set the overflow rect on the inline textbox when needed.
1407
1408         Test: fast/text/simple-line-layout-selection-with-overflow.html
1409
1410         * rendering/SimpleLineLayoutFunctions.cpp:
1411         (WebCore::SimpleLineLayout::initializeInlineTextBox):
1412         (WebCore::SimpleLineLayout::generateLineBoxTree):
1413         (WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
1414
1415 2018-04-30  JF Bastien  <jfbastien@apple.com>
1416
1417         Use some C++17 features
1418         https://bugs.webkit.org/show_bug.cgi?id=185135
1419
1420         Reviewed by Alex Christensen.
1421
1422         As discussed here [0] let's move WebKit to a subset of C++17. We
1423         now require GCC 6 [1] which means that, according to [2] we can
1424         use the following C++17 language features (I removed some
1425         uninteresting ones):
1426
1427          - New auto rules for direct-list-initialization
1428          - static_assert with no message
1429          - typename in a template template parameter
1430          - Nested namespace definition
1431          - Attributes for namespaces and enumerators
1432          - u8 character literals
1433          - Allow constant evaluation for all non-type template arguments
1434          - Fold Expressions
1435          - Unary fold expressions and empty parameter packs
1436          - __has_include in preprocessor conditional
1437          - Differing begin and end types in range-based for
1438          - Improving std::pair and std::tuple
1439
1440         Consult the Tony Tables [3] to see before / after examples.
1441
1442         Of course we can use any library feature if we're willing to
1443         import them to WTF (and they don't require language support).
1444
1445
1446           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
1447           [1]: https://trac.webkit.org/changeset/231152/webkit
1448           [2]: https://en.cppreference.com/w/cpp/compiler_support
1449           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
1450
1451         * DerivedSources.make:
1452         * platform/URLParser.cpp: work around an odd GCC 6 bug with class
1453           static value as a template parameter.
1454         (WebCore::URLParser::percentDecode):
1455         (WebCore::URLParser::domainToASCII):
1456         (WebCore::URLParser::hasForbiddenHostCodePoint):
1457         (WebCore::URLParser::parseHostAndPort):
1458         * platform/URLParser.h:
1459
1460 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1461
1462         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
1463         https://bugs.webkit.org/show_bug.cgi?id=185132
1464         <rdar://problem/39834562>
1465
1466         Reviewed by Tim Horton.
1467
1468         Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
1469         `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
1470         behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
1471
1472         Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
1473
1474         * dom/ViewportArguments.cpp:
1475         (WebCore::setViewportFeature):
1476         (WebCore::operator<<):
1477         * dom/ViewportArguments.h:
1478
1479         Removes the `minDeviceWidth` viewport argument.
1480
1481         * page/RuntimeEnabledFeatures.h:
1482         (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
1483         (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
1484
1485         Removes the runtime switch for `min-device-width`.
1486
1487         * page/ViewportConfiguration.cpp:
1488         (WebCore::platformDeviceWidthOverride):
1489
1490         Hard-code the override device width in extra zoom mode.
1491
1492         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
1493
1494         In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
1495         device width is less than the override device width.
1496
1497         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1498         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
1499         (WebCore::ViewportConfiguration::updateConfiguration):
1500         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1501
1502         Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
1503         device width is greater than the override device width.
1504
1505         (WebCore::computedMinDeviceWidth): Deleted.
1506         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
1507         * page/ViewportConfiguration.h:
1508
1509 2018-04-30  Chris Nardi  <cnardi@chromium.org>
1510
1511         Serialize font-variation-settings with double-quotes per spec
1512         https://bugs.webkit.org/show_bug.cgi?id=182542
1513
1514         Reviewed by Myles C. Maxfield.
1515
1516         According to the CSSOM spec [1], all strings should be serialized with double-quotes.
1517         The axis name in font-variation-settings was previously serialized with single-quotes;
1518         change this to double-quotes to match the spec and non-WebKit browsers.
1519
1520         [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
1521
1522         Updated fast/text/variations/getComputedStyle.html to test the change.
1523
1524         * css/CSSFontVariationValue.cpp:
1525         (WebCore::CSSFontVariationValue::customCSSText const):
1526
1527 2018-04-30  Chris Dumez  <cdumez@apple.com>
1528
1529         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
1530         https://bugs.webkit.org/show_bug.cgi?id=185134
1531
1532         Reviewed by Geoffrey Garen.
1533
1534         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
1535         and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
1536         the WebThread.
1537
1538         * dom/MessagePort.cpp:
1539         (WebCore::MessagePort::dispatchMessages):
1540
1541 2018-04-30  Simon Fraser  <simon.fraser@apple.com>
1542
1543         Make color-filter affect caret-color
1544         https://bugs.webkit.org/show_bug.cgi?id=185129
1545         rdar://problem/39829066
1546
1547         Reviewed by Tim Horton.
1548         
1549         Transform the colors used to compare the caret color with the background through
1550         color-filter (since we want contrasting colors after filters are applied), and
1551         transform caret-color itself.
1552
1553         Test: css3/color-filters/color-filter-caret-color.html
1554
1555         * editing/FrameSelection.cpp:
1556         (WebCore::CaretBase::paintCaret const):
1557
1558 2018-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1559
1560         [GTK] Webkit should spoof as Safari on a Mac when on Chase.com
1561         https://bugs.webkit.org/show_bug.cgi?id=185103
1562
1563         Reviewed by Carlos Garcia Campos.
1564
1565         Send a fake user agent to chase.com to make it work.
1566
1567         * platform/UserAgentQuirks.cpp:
1568         (WebCore::urlRequiresMacintoshPlatform):
1569         (WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
1570
1571 2018-04-29  Simon Fraser  <simon.fraser@apple.com>
1572
1573         Make color-filter affect <attachment>
1574         https://bugs.webkit.org/show_bug.cgi?id=185122
1575         rdar://problem/39818763
1576
1577         Reviewed by Tim Horton.
1578         
1579         Convert the colors used to render <attachment> through color-filter, except
1580         for those parts that render over the icon (like the progress bar).
1581
1582         Not easily testable.
1583
1584         * rendering/RenderThemeMac.mm:
1585         (WebCore::titleTextColorForAttachment):
1586         (WebCore::AttachmentLayout::layOutTitle):
1587         (WebCore::AttachmentLayout::layOutSubtitle):
1588         (WebCore::paintAttachmentIconBackground):
1589         (WebCore::paintAttachmentTitleBackground):
1590         (WebCore::paintAttachmentPlaceholderBorder):
1591
1592 2018-04-28  Simon Fraser  <simon.fraser@apple.com>
1593
1594         Fix color-filter to apply to SVG colors
1595         https://bugs.webkit.org/show_bug.cgi?id=185113
1596         rdar://problem/39665082
1597
1598         Reviewed by Dean Jackson.
1599         
1600         Convert SVG colors through color-filter operations for the places in SVG
1601         that use color, namely fill and stroke, gradients, lighting colors and
1602         drop-shadow.
1603
1604         Test: css3/color-filters/svg/color-filter-inline-svg.html
1605
1606         * rendering/svg/RenderSVGResourceGradient.cpp:
1607         (WebCore::RenderSVGResourceGradient::applyResource):
1608         * rendering/svg/RenderSVGResourceGradient.h:
1609         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
1610         (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
1611         * rendering/svg/RenderSVGResourceLinearGradient.h:
1612         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
1613         (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
1614         * rendering/svg/RenderSVGResourceRadialGradient.h:
1615         * rendering/svg/RenderSVGResourceSolidColor.cpp:
1616         (WebCore::RenderSVGResourceSolidColor::applyResource):
1617         * svg/SVGFEDiffuseLightingElement.cpp:
1618         (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
1619         (WebCore::SVGFEDiffuseLightingElement::build):
1620         * svg/SVGFEDropShadowElement.cpp:
1621         (WebCore::SVGFEDropShadowElement::build):
1622         * svg/SVGFEFloodElement.cpp:
1623         (WebCore::SVGFEFloodElement::build):
1624         * svg/SVGFESpecularLightingElement.cpp:
1625         (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
1626         (WebCore::SVGFESpecularLightingElement::build):
1627
1628 2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
1629
1630         [CMake] Require GCC 6
1631         https://bugs.webkit.org/show_bug.cgi?id=184985
1632
1633         Reviewed by Alex Christensen.
1634
1635         Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
1636
1637         * platform/graphics/FourCC.h:
1638         (WebCore::FourCC::FourCC):
1639
1640 2018-04-29  Zalan Bujtas  <zalan@apple.com>
1641
1642         [LFC] Implement Display::Box functions
1643         https://bugs.webkit.org/show_bug.cgi?id=185116
1644
1645         Reviewed by Antti Koivisto.
1646
1647         * layout/displaytree/DisplayBox.cpp:
1648         (WebCore::Display::Box::Box):
1649         (WebCore::Display::Box::~Box):
1650         (WebCore::Display::Box::marginBox const):
1651         (WebCore::Display::Box::borderBox const):
1652         (WebCore::Display::Box::paddingBox const):
1653         (WebCore::Display::Box::contentBox const):
1654         * layout/displaytree/DisplayBox.h:
1655         (WebCore::Display::Box::rect const):
1656         (WebCore::Display::Box::top const):
1657         (WebCore::Display::Box::left const):
1658         (WebCore::Display::Box::bottom const):
1659         (WebCore::Display::Box::right const):
1660         (WebCore::Display::Box::topLeft const):
1661         (WebCore::Display::Box::bottomRight const):
1662         (WebCore::Display::Box::size const):
1663         (WebCore::Display::Box::width const):
1664         (WebCore::Display::Box::height const):
1665         (WebCore::Display::Box::marginTop const):
1666         (WebCore::Display::Box::marginLeft const):
1667         (WebCore::Display::Box::marginBottom const):
1668         (WebCore::Display::Box::marginRight const):
1669         (WebCore::Display::Box::parent const):
1670         (WebCore::Display::Box::nextSibling const):
1671         (WebCore::Display::Box::previousSibling const):
1672         (WebCore::Display::Box::firstChild const):
1673         (WebCore::Display::Box::lastChild const):
1674         (WebCore::Display::Box::setRect):
1675         (WebCore::Display::Box::setTopLeft):
1676         (WebCore::Display::Box::setTop):
1677         (WebCore::Display::Box::setLeft):
1678         (WebCore::Display::Box::setSize):
1679         (WebCore::Display::Box::setWidth):
1680         (WebCore::Display::Box::setHeight):
1681         (WebCore::Display::Box::setMarginTop):
1682         (WebCore::Display::Box::setMarginLeft):
1683         (WebCore::Display::Box::setMarginBottom):
1684         (WebCore::Display::Box::setMarginRight):
1685         (WebCore::Display::Box::setBorderTop):
1686         (WebCore::Display::Box::setBorderLeft):
1687         (WebCore::Display::Box::setBorderBottom):
1688         (WebCore::Display::Box::setBorderRight):
1689         (WebCore::Display::Box::setPaddingTop):
1690         (WebCore::Display::Box::setPaddingLeft):
1691         (WebCore::Display::Box::setPaddingBottom):
1692         (WebCore::Display::Box::setPaddingRight):
1693         (WebCore::Display::Box::setParent):
1694         (WebCore::Display::Box::setNextSibling):
1695         (WebCore::Display::Box::setPreviousSibling):
1696         (WebCore::Display::Box::setFirstChild):
1697         (WebCore::Display::Box::setLastChild):
1698
1699 2018-04-29  Youenn Fablet  <youenn@apple.com>
1700
1701         Make RestrictedHTTPResponseAccess flag true by default
1702         https://bugs.webkit.org/show_bug.cgi?id=185089
1703
1704         Reviewed by Geoffrey Garen.
1705
1706         * page/RuntimeEnabledFeatures.h:
1707
1708 2018-04-28  Sihui Liu  <sihui_liu@apple.com>
1709
1710         [Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
1711         https://bugs.webkit.org/show_bug.cgi?id=185052
1712
1713         Reviewed by Geoffrey Garen.
1714
1715         Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could 
1716         create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
1717         function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
1718         its equal function. 
1719
1720         Modified API test: WebKit.WKHTTPCookieStoreHttpOnly
1721
1722         * platform/network/cocoa/CookieCocoa.mm:
1723         (WebCore::Cookie::operator NSHTTPCookie * const):
1724         (WebCore::Cookie::operator== const):
1725         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1726         (WebCore::NetworkStorageSession::deleteCookie):
1727
1728 2018-04-28  Zalan Bujtas  <zalan@apple.com>
1729
1730         [LFC] Add LayoutTreeBuilder class to generate the layout tree
1731         https://bugs.webkit.org/show_bug.cgi?id=185108
1732
1733         Reviewed by Antti Koivisto.
1734
1735         This is for testing purposes.
1736
1737         * WebCore.xcodeproj/project.pbxproj:
1738         * layout/FormattingState.cpp:
1739         (WebCore::Layout::FormattingState::~FormattingState):
1740         * layout/FormattingState.h:
1741         * layout/LayoutContext.h:
1742         * layout/blockformatting/BlockFormattingState.cpp:
1743         (WebCore::Layout::BlockFormattingState::~BlockFormattingState):
1744         * layout/blockformatting/BlockFormattingState.h:
1745         * layout/inlineformatting/InlineFormattingState.cpp:
1746         (WebCore::Layout::InlineFormattingState::~InlineFormattingState):
1747         * layout/inlineformatting/InlineFormattingState.h:
1748         * layout/layouttree/LayoutBlockContainer.h:
1749         * layout/layouttree/LayoutBox.h:
1750         * layout/layouttree/LayoutContainer.h:
1751         * layout/layouttree/LayoutInlineContainer.h:
1752         * layout/layouttree/LayoutTreeBuilder.cpp: Added.
1753         (WebCore::Layout::TreeBuilder::createLayoutTree):
1754         (WebCore::Layout::TreeBuilder::createSubTree):
1755         (WebCore::Layout::outputLayoutBox):
1756         (WebCore::Layout::outputLayoutTree):
1757         (WebCore::Layout::TreeBuilder::showLayoutTree):
1758         (WebCore::Layout::printLayoutTreeForLiveDocuments):
1759         * layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
1760         * page/mac/PageMac.mm:
1761         (WebCore::Page::platformInitialize):
1762
1763 2018-04-28  Zalan Bujtas  <zalan@apple.com>
1764
1765         [LFC] Implement BlockMarginCollapse functions.
1766         https://bugs.webkit.org/show_bug.cgi?id=185036
1767
1768         Reviewed by Antti Koivisto.
1769
1770         * layout/blockformatting/BlockMarginCollapse.cpp:
1771         (WebCore::Layout::marginValue):
1772         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
1773         (WebCore::Layout::BlockMarginCollapse::marginTop const):
1774         (WebCore::Layout::BlockMarginCollapse::marginBottom const):
1775         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
1776         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
1777         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
1778         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
1779         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
1780         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
1781         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
1782         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
1783         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
1784         * layout/blockformatting/BlockMarginCollapse.h:
1785         * layout/layouttree/LayoutBox.h:
1786         (WebCore::Layout::Box::style const):
1787
1788 2018-04-27  David Kilzer  <ddkilzer@apple.com>
1789
1790         Add logging when SpringBoard enables WebThread
1791         <https://webkit.org/b/185100>
1792         <rdar://problem/39746542>
1793
1794         Reviewed by Daniel Bates.
1795
1796         * platform/RuntimeApplicationChecks.h:
1797         (WebCore::IOSApplication::isSpringBoard): Add declaration.
1798         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1799         (WebCore::IOSApplication::isSpringBoard): Add implementation.
1800         * platform/ios/wak/WebCoreThread.mm:
1801         (WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
1802         SpringBoard.
1803
1804 2018-04-27  Keith Rollin  <krollin@apple.com>
1805
1806         Fix crash in DocumentLoader::startLoadingMainResource
1807         https://bugs.webkit.org/show_bug.cgi?id=185088
1808         rdar://problem/39689263
1809
1810         Reviewed by Chris Dumez.
1811
1812         Add a "protectedThis" to address a case where a deleted "this" was
1813         accessed in a RELEASE_LOG statement.
1814
1815         No new tests -- covered by existing tests, which now pass.
1816
1817         * loader/DocumentLoader.cpp:
1818         (WebCore::DocumentLoader::startLoadingMainResource):
1819
1820 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
1821
1822         Implement color-filter for text stroke
1823         https://bugs.webkit.org/show_bug.cgi?id=185098
1824
1825         Reviewed by Alan Bujtas.
1826         
1827         Transform the text stroke color through color-filter.
1828
1829         Test: css3/color-filters/color-filter-text-stroke.html
1830
1831         * rendering/TextPaintStyle.cpp:
1832         (WebCore::computeTextPaintStyle):
1833
1834 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
1835
1836         Implement animation for color-filter
1837         https://bugs.webkit.org/show_bug.cgi?id=185092
1838         rdar://problem/39773810
1839
1840         Reviewed by Tim Horton.
1841         
1842         Implement animation of color-filter.
1843         
1844         This requires tracking whether the color-filter function lists match for both old and new
1845         animation code paths.
1846         
1847         The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
1848         which has to pass the propertyID to the blend function so we know which "lists match" to check.
1849         This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.
1850
1851         Test: css3/color-filters/color-filter-animation.html
1852
1853         * animation/CSSPropertyBlendingClient.h:
1854         * animation/KeyframeEffectReadOnly.cpp:
1855         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1856         (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
1857         * animation/KeyframeEffectReadOnly.h:
1858         * page/animation/AnimationBase.h:
1859         * page/animation/CSSPropertyAnimation.cpp:
1860         (WebCore::blendFunc):
1861         (WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
1862         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1863         (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
1864         (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
1865         (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
1866         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
1867         * page/animation/ImplicitAnimation.cpp:
1868         (WebCore::ImplicitAnimation::reset):
1869         (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
1870         * page/animation/ImplicitAnimation.h:
1871         * page/animation/KeyframeAnimation.cpp:
1872         (WebCore::KeyframeAnimation::KeyframeAnimation):
1873         (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
1874         * page/animation/KeyframeAnimation.h:
1875
1876 2018-04-27  Zalan Bujtas  <zalan@apple.com>
1877
1878         [LFC] Add FormattingContext::computeWidth/computeHeight logic.
1879         https://bugs.webkit.org/show_bug.cgi?id=185091
1880
1881         Reviewed by Antti Koivisto.
1882
1883         Inflow width and height can't really be computed without knowing the exact context. 
1884
1885         * layout/FormattingContext.cpp:
1886         (WebCore::Layout::FormattingContext::computeWidth const):
1887         (WebCore::Layout::FormattingContext::computeHeight const):
1888         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1889         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1890         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1891         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1892         * layout/FormattingContext.h:
1893         * layout/blockformatting/BlockFormattingContext.cpp:
1894         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1895         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1896         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
1897         (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
1898         * layout/blockformatting/BlockFormattingContext.h:
1899         * layout/inlineformatting/InlineFormattingContext.cpp:
1900         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
1901         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
1902         * layout/inlineformatting/InlineFormattingContext.h:
1903
1904 2018-04-27  Chris Dumez  <cdumez@apple.com>
1905
1906         Use WindowProxy instead of DOMWindow in our IDL
1907         https://bugs.webkit.org/show_bug.cgi?id=185022
1908
1909         Reviewed by Sam Weinig.
1910
1911         Stop using DOMWindow in all of our IDL files and use WindowProxy as
1912         per their respective specifications. As a result, the implementation
1913         as also updated to use WindowProxy type instead of DOMWindow.
1914
1915         * WebCore.xcodeproj/project.pbxproj:
1916         * bindings/js/JSDOMConvertWindowProxy.h: Removed.
1917         * bindings/js/JSWindowProxy.cpp:
1918         (WebCore::JSWindowProxy::windowProxy const):
1919         (WebCore::JSWindowProxy::toWrapped):
1920         * bindings/js/JSWindowProxy.h:
1921         (WebCore::window):
1922         Use static_cast<>() instead of jsCast<>() because jsCast<>()
1923         relies on classInfo() which is not allowed to be called during
1924         JS sweep due to an assertion inside classInfo(). The JSWindowProxy
1925         objects are held strongly by the WindowProxy so we know the JSWindowProxy
1926         object is not getting destroyed here.
1927
1928         (WebCore::toJS):
1929         * bindings/js/WindowProxy.cpp:
1930         (WebCore::WindowProxy::globalObject):
1931         * bindings/js/WindowProxy.h:
1932         (WebCore::WindowProxy::frame const):
1933         * bindings/scripts/CodeGenerator.pm:
1934         (IsBuiltinType):
1935         (ComputeIsCallbackInterface):
1936         (ComputeIsCallbackFunction):
1937         * bindings/scripts/CodeGeneratorJS.pm:
1938         (AddToIncludesForIDLType):
1939         (GetBaseIDLType):
1940         (NativeToJSValueDOMConvertNeedsState):
1941         * bindings/scripts/test/JS/JSTestObj.cpp:
1942         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
1943         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1944         * bindings/scripts/test/TestObj.idl:
1945         * dom/CompositionEvent.cpp:
1946         (WebCore::CompositionEvent::CompositionEvent):
1947         (WebCore::CompositionEvent::initCompositionEvent):
1948         * dom/CompositionEvent.h:
1949         * dom/CompositionEvent.idl:
1950         * dom/Document.cpp:
1951         (WebCore::Document::defaultView const):
1952         * dom/Document.h:
1953         * dom/Document.idl:
1954         * dom/DocumentTouch.cpp:
1955         (WebCore::DocumentTouch::createTouch):
1956         * dom/DocumentTouch.h:
1957         * dom/DocumentTouch.idl:
1958         * dom/FocusEvent.cpp:
1959         (WebCore::FocusEvent::FocusEvent):
1960         * dom/FocusEvent.h:
1961         * dom/InputEvent.cpp:
1962         (WebCore::InputEvent::create):
1963         (WebCore::InputEvent::InputEvent):
1964         * dom/InputEvent.h:
1965         * dom/KeyboardEvent.cpp:
1966         (WebCore::KeyboardEvent::KeyboardEvent):
1967         (WebCore::KeyboardEvent::create):
1968         (WebCore::KeyboardEvent::initKeyboardEvent):
1969         (WebCore::KeyboardEvent::charCode const):
1970         * dom/KeyboardEvent.h:
1971         * dom/KeyboardEvent.idl:
1972         * dom/MessageEvent.h:
1973         * dom/MessageEvent.idl:
1974         * dom/MouseEvent.cpp:
1975         (WebCore::MouseEvent::create):
1976         (WebCore::MouseEvent::MouseEvent):
1977         (WebCore::MouseEvent::initMouseEvent):
1978         (WebCore::MouseEvent::initMouseEventQuirk):
1979         * dom/MouseEvent.h:
1980         * dom/MouseEvent.idl:
1981         * dom/MouseRelatedEvent.cpp:
1982         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1983         (WebCore::MouseRelatedEvent::init):
1984         (WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
1985         (WebCore::MouseRelatedEvent::initCoordinates):
1986         (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
1987         (WebCore::MouseRelatedEvent::computePageLocation):
1988         (WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
1989         * dom/MouseRelatedEvent.h:
1990         * dom/Node.cpp:
1991         * dom/SimulatedClick.cpp:
1992         * dom/TextEvent.cpp:
1993         (WebCore::TextEvent::create):
1994         (WebCore::TextEvent::createForPlainTextPaste):
1995         (WebCore::TextEvent::createForFragmentPaste):
1996         (WebCore::TextEvent::createForDrop):
1997         (WebCore::TextEvent::createForDictation):
1998         (WebCore::TextEvent::TextEvent):
1999         (WebCore::TextEvent::initTextEvent):
2000         * dom/TextEvent.h:
2001         * dom/TextEvent.idl:
2002         * dom/TouchEvent.idl:
2003         * dom/UIEvent.cpp:
2004         (WebCore::UIEvent::UIEvent):
2005         (WebCore::UIEvent::initUIEvent):
2006         * dom/UIEvent.h:
2007         (WebCore::UIEvent::create):
2008         (WebCore::UIEvent::view const):
2009         * dom/UIEvent.idl:
2010         * dom/UIEventInit.h:
2011         * dom/UIEventInit.idl:
2012         * dom/UIEventWithKeyState.h:
2013         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2014         * dom/WheelEvent.cpp:
2015         (WebCore::WheelEvent::WheelEvent):
2016         (WebCore::WheelEvent::create):
2017         (WebCore::WheelEvent::initWebKitWheelEvent):
2018         * dom/WheelEvent.h:
2019         * dom/WheelEvent.idl:
2020         * editing/AlternativeTextController.cpp:
2021         (WebCore::AlternativeTextController::insertDictatedText):
2022         * editing/Editor.cpp:
2023         (WebCore::Editor::pasteAsPlainText):
2024         (WebCore::Editor::pasteAsFragment):
2025         (WebCore::Editor::setComposition):
2026         * html/HTMLDocument.cpp:
2027         (WebCore::HTMLDocument::namedItem):
2028         * html/HTMLDocument.h:
2029         * html/HTMLDocument.idl:
2030         * html/HTMLFrameElement.idl:
2031         * html/HTMLFrameOwnerElement.cpp:
2032         (WebCore::HTMLFrameOwnerElement::contentWindow const):
2033         * html/HTMLFrameOwnerElement.h:
2034         * html/HTMLFrameSetElement.cpp:
2035         (WebCore::HTMLFrameSetElement::namedItem):
2036         * html/HTMLFrameSetElement.h:
2037         * html/HTMLFrameSetElement.idl:
2038         * html/HTMLIFrameElement.idl:
2039         * html/ImageDocument.cpp:
2040         * page/DOMWindow.cpp:
2041         (WebCore::PostMessageTimer::PostMessageTimer):
2042         (WebCore::PostMessageTimer::event):
2043         (WebCore::DOMWindow::postMessage):
2044         * page/DragController.cpp:
2045         (WebCore::DragController::dispatchTextInputEventFor):
2046         * page/EventHandler.cpp:
2047         (WebCore::EventHandler::handleTextInputEvent):
2048
2049 2018-04-27  Nan Wang  <n_wang@apple.com>
2050
2051         AX: Accessibility needs to know which part of the content view is visible on iOS
2052         https://bugs.webkit.org/show_bug.cgi?id=185085
2053         <rdar://problem/39801363>
2054
2055         Reviewed by Chris Fleizach.
2056
2057         Exposed unobscuredContentRect() to iOS accessibility object wrapper.
2058
2059         Test: accessibility/ios-simulator/unobscured-content-rect.html
2060
2061         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2062         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2063
2064 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2065
2066         Refactor filter list checking code
2067         https://bugs.webkit.org/show_bug.cgi?id=185087
2068
2069         Reviewed by Alan Bujtas.
2070
2071         Deduplicate code between filter and backdrop-filter for checking whether function lists
2072         match, by making a shared function that takes a std::function.
2073         
2074         The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
2075         converting the return type into a value.
2076
2077         * animation/KeyframeEffectReadOnly.cpp:
2078         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
2079         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
2080         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
2081         * animation/KeyframeEffectReadOnly.h:
2082         * page/animation/KeyframeAnimation.cpp:
2083         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
2084         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
2085         (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
2086         * page/animation/KeyframeAnimation.h:
2087
2088 2018-04-27  Chris Dumez  <cdumez@apple.com>
2089
2090         Regression(r222392?): Events can have a negative timestamp which causes app breakage
2091         https://bugs.webkit.org/show_bug.cgi?id=185040
2092         <rdar://problem/39638051>
2093
2094         Reviewed by Wenson Hsieh.
2095
2096         The real fix is in UIKit when generating the touch timestamps. However, this patch
2097         does some hardening to make sure that Event.timestamp can never return a negative
2098         value even if something goes wrong.
2099
2100         * dom/Event.cpp:
2101         (WebCore::Event::timeStampForBindings const):
2102
2103 2018-04-27  Christopher Reid  <chris.reid@sony.com>
2104
2105         URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
2106         https://bugs.webkit.org/show_bug.cgi?id=184836
2107
2108         Reviewed by Alex Christensen.
2109
2110         Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.
2111
2112         Test: LayoutTests\fast\url\url-hostname-encoding.html
2113
2114         * platform/URL.cpp:
2115
2116 2018-04-27  Youenn Fablet  <youenn@apple.com>
2117
2118         CachedRawResource is not handling incremental data computation correctly
2119         https://bugs.webkit.org/show_bug.cgi?id=184936
2120         <rdar://problem/38798141>
2121
2122         Reviewed by Darin Adler.
2123
2124         * loader/cache/CachedRawResource.cpp:
2125         (WebCore::CachedRawResource::updateBuffer): Fixing style.
2126
2127 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2128
2129         [LFC] Implement BlockFormattingContext::layout logic and its dependencies
2130         https://bugs.webkit.org/show_bug.cgi?id=185024
2131
2132         Reviewed by Antti Koivisto.
2133
2134         This patch implements the logic for block formatting context according to
2135         https://www.w3.org/TR/CSS22/visuren.html#block-formatting
2136
2137         1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
2138         we visit the descendant nodes until we hit a leaf node.
2139         2. Compute the position/geometry of the leaf node and move over to its sibling(s).
2140         3. Finalize the container's height/final position as we climb back on the tree.
2141         4. Run layout on the out-of-flow descendants.  
2142
2143         Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
2144         The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
2145         in a separate formatting context (excluding out-of-flow boxes that don't belong to the root). 
2146
2147         * layout/FloatingContext.cpp:
2148         (WebCore::Layout::FloatingContext::FloatingContext):
2149         (WebCore::Layout::FloatingContext::computePosition):
2150         * layout/FormattingContext.cpp:
2151         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2152         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2153         * layout/FormattingContext.h:
2154         * layout/LayoutContext.cpp:
2155         (WebCore::Layout::LayoutContext::updateLayout):
2156         (WebCore::Layout::LayoutContext::establishedFormattingState):
2157         * layout/LayoutContext.h:
2158         * layout/blockformatting/BlockFormattingContext.cpp:
2159         (WebCore::Layout::BlockFormattingContext::layout const):
2160         (WebCore::Layout::BlockFormattingContext::layout): Deleted.
2161         * layout/blockformatting/BlockFormattingContext.h:
2162         * layout/inlineformatting/InlineFormattingContext.cpp:
2163         (WebCore::Layout::InlineFormattingContext::layout const):
2164         (WebCore::Layout::InlineFormattingContext::layout): Deleted.
2165         * layout/inlineformatting/InlineFormattingContext.h:
2166
2167 2018-04-27  Youenn Fablet  <youenn@apple.com>
2168
2169         Use NetworkLoadChecker for XHR/fetch loads
2170         https://bugs.webkit.org/show_bug.cgi?id=184741
2171
2172         Reviewed by Chris Dumez.
2173
2174         Covered by existing tests.
2175
2176         * loader/DocumentThreadableLoader.cpp:
2177         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
2178         We need to set this option for CORS done in NetworkProcess.
2179         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2180         Set httpHeadersTokeep when needed (service worker or CORS loads).
2181         Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
2182         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
2183         Helper routine to make the same check for both simple and preflight case.
2184         This allows more consistent error logging between WK1 and WK2.
2185         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2186         Skip preflight in case this is done in NetworkProcess.
2187         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
2188         (WebCore::isResponseComingFromNetworkProcess):
2189         (WebCore::DocumentThreadableLoader::redirectReceived):
2190         Bypass security checks when they are already done in NetworkProcess.
2191         (WebCore::DocumentThreadableLoader::didFail):
2192         In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
2193         Check it again to enable specific CSP console logging and error reporting.
2194         (WebCore::DocumentThreadableLoader::loadRequest):
2195         Recreating the error in case of synchronous loads to be able to log it adequately.
2196         (WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
2197         * loader/DocumentThreadableLoader.h:
2198         * loader/SubresourceLoader.cpp:
2199         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
2200         Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
2201         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2202         We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
2203         * loader/cache/CachedResourceLoader.cpp:
2204         (WebCore::CachedResourceLoader::requestResource):
2205         DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
2206         as applications are not supposed to set these headers.
2207
2208 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2209
2210         Add an experimental feature flag for viewport "min-device-width"
2211         https://bugs.webkit.org/show_bug.cgi?id=185050
2212         <rdar://problem/39624038>
2213
2214         Reviewed by Tim Horton.
2215
2216         Add MinDeviceWidthEnabled as a new runtime-enabled feature.
2217
2218         * dom/ViewportArguments.cpp:
2219         (WebCore::setViewportFeature):
2220
2221         Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.
2222
2223         * page/RuntimeEnabledFeatures.h:
2224         (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
2225         (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):
2226
2227 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2228
2229         Make color-filter transform gradient colors
2230         https://bugs.webkit.org/show_bug.cgi?id=185080
2231
2232         Reviewed by Zalan Bujtas.
2233         
2234         In CSSGradientValue::computeStops(), transform the color of each gradient color
2235         stop through the color filter. Having a color filter makes the gradient uncacheable.
2236         
2237         Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
2238         to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
2239         functions to take const RenderStyle&.
2240
2241         Test: css3/color-filters/color-filter-gradients.html
2242
2243         * css/CSSCrossfadeValue.cpp:
2244         (WebCore::subimageKnownToBeOpaque):
2245         * css/CSSFilterImageValue.cpp:
2246         (WebCore::CSSFilterImageValue::knownToBeOpaque const):
2247         * css/CSSFilterImageValue.h:
2248         * css/CSSGradientValue.cpp:
2249         (WebCore::CSSGradientValue::image):
2250         (WebCore::CSSGradientValue::computeStops):
2251         (WebCore::CSSGradientValue::knownToBeOpaque const):
2252         (WebCore::CSSLinearGradientValue::createGradient):
2253         (WebCore::CSSRadialGradientValue::createGradient):
2254         * css/CSSGradientValue.h:
2255         * css/CSSImageGeneratorValue.cpp:
2256         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
2257         * css/CSSImageValue.cpp:
2258         (WebCore::CSSImageValue::knownToBeOpaque const):
2259         * css/CSSImageValue.h:
2260
2261 2018-04-26  Simon Fraser  <simon.fraser@apple.com>
2262
2263         Fix color-filter to apply to text decorations
2264         https://bugs.webkit.org/show_bug.cgi?id=185068
2265         <rdar://problem/39782136>
2266
2267         Reviewed by Alan Bujtas.
2268         
2269         Transform the colors of text shadows, and the shadows of text-decorations through
2270         the color-filter.
2271         
2272         Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
2273         (which would have awkward ownership implications) we pass the color filters through
2274         and just map the color through it before painting.
2275         
2276         Re-order the members of TextPainter a little to optimize padding.
2277         
2278         Also fix a bug where FilterOperations::transformColor() could transform an invalid
2279         color to a valid one; we never want this.
2280
2281         Tests: css3/color-filters/color-filter-text-decoration-shadow.html
2282                css3/color-filters/color-filter-text-shadow.html
2283
2284         * platform/graphics/filters/FilterOperations.cpp:
2285         (WebCore::FilterOperations::transformColor const):
2286         * rendering/InlineTextBox.cpp:
2287         (WebCore::InlineTextBox::paintMarkedTextForeground):
2288         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2289         * rendering/TextDecorationPainter.cpp:
2290         (WebCore::TextDecorationPainter::paintTextDecoration):
2291         * rendering/TextDecorationPainter.h:
2292         (WebCore::TextDecorationPainter::setTextShadow):
2293         (WebCore::TextDecorationPainter::setShadowColorFilter):
2294         (WebCore::TextDecorationPainter::addTextShadow): Deleted.
2295         * rendering/TextPainter.cpp:
2296         (WebCore::ShadowApplier::ShadowApplier):
2297         (WebCore::TextPainter::paintTextWithShadows):
2298         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
2299         on the first iteration.
2300         (WebCore::TextPainter::paintRange):
2301         * rendering/TextPainter.h:
2302         (WebCore::TextPainter::setShadowColorFilter):
2303         * rendering/svg/SVGInlineTextBox.cpp:
2304         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2305
2306 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2307
2308         Rename minimumLayoutSize to viewLayoutSize
2309         https://bugs.webkit.org/show_bug.cgi?id=185050
2310         <rdar://problem/39624038>
2311
2312         Reviewed by Tim Horton.
2313
2314         See WebKit/ChangeLog for more information. No change in behavior.
2315
2316         * page/ViewportConfiguration.cpp:
2317         (WebCore::ViewportConfiguration::ViewportConfiguration):
2318         (WebCore::ViewportConfiguration::setViewLayoutSize):
2319
2320         Remove a FIXME comment that is addressed by this refactoring.
2321
2322         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
2323         (WebCore::ViewportConfiguration::initialScaleFromSize const):
2324         (WebCore::ViewportConfiguration::minimumScale const):
2325         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
2326         (WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
2327         * page/ViewportConfiguration.h:
2328         (WebCore::ViewportConfiguration::viewLayoutSize const):
2329         (WebCore::ViewportConfiguration::viewSize const): Deleted.
2330
2331 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2332
2333         [LFC] Formatting contexts should create floating states.
2334         https://bugs.webkit.org/show_bug.cgi?id=185032
2335
2336         Reviewed by Antti Koivisto.
2337
2338         This patch implements the logic for sharing floating states across multiple formatting contexts.
2339         At this point this is mostly about inline formatting contexts. They either create a new floating state
2340         or inherit it from the parent formatting context.
2341
2342         * layout/FloatingState.cpp:
2343         (WebCore::Layout::FloatingState::FloatingState):
2344         * layout/FloatingState.h:
2345         (WebCore::Layout::FloatingState::create):
2346         * layout/FormattingContext.cpp:
2347         (WebCore::Layout::FormattingContext::FormattingContext):
2348         * layout/FormattingContext.h:
2349         (WebCore::Layout::FormattingContext::layoutContext const):
2350         * layout/FormattingState.cpp:
2351         (WebCore::Layout::FormattingState::FormattingState):
2352         * layout/FormattingState.h:
2353         (WebCore::Layout::FormattingState::floatingState const):
2354         * layout/LayoutContext.cpp:
2355         (WebCore::Layout::LayoutContext::updateLayout):
2356         (WebCore::Layout::LayoutContext::formattingStateForBox const):
2357         (WebCore::Layout::LayoutContext::establishedFormattingState):
2358         (WebCore::Layout::LayoutContext::formattingContext):
2359         (WebCore::Layout::LayoutContext::formattingState): Deleted.
2360         * layout/LayoutContext.h:
2361         * layout/blockformatting/BlockFormattingContext.cpp:
2362         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2363         (WebCore::Layout::BlockFormattingContext::createFormattingState const):
2364         (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
2365         (WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
2366         * layout/blockformatting/BlockFormattingContext.h:
2367         * layout/blockformatting/BlockFormattingState.cpp:
2368         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2369         * layout/blockformatting/BlockFormattingState.h:
2370         * layout/inlineformatting/InlineFormattingContext.cpp:
2371         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2372         (WebCore::Layout::InlineFormattingContext::createFormattingState const):
2373         (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
2374         (WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
2375         * layout/inlineformatting/InlineFormattingContext.h:
2376         * layout/inlineformatting/InlineFormattingState.cpp:
2377         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2378         * layout/inlineformatting/InlineFormattingState.h:
2379         * layout/layouttree/LayoutBox.cpp:
2380         (WebCore::Layout::Box::formattingContextRoot const):
2381         * layout/layouttree/LayoutBox.h:
2382
2383 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2384
2385         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
2386         https://bugs.webkit.org/show_bug.cgi?id=185050
2387         <rdar://problem/39624038>
2388
2389         Reviewed by Tim Horton.
2390
2391         Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
2392         (namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
2393         patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
2394         automatically clamping the web view width to a greater value for the device width in this scenario.
2395
2396         Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
2397         will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
2398         size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.
2399
2400         See per-method comments below for more detail.
2401
2402         Test: fast/viewport/extrazoom/viewport-change-min-device-width.html
2403
2404         * dom/ViewportArguments.cpp:
2405         (WebCore::setViewportFeature):
2406         (WebCore::operator<<):
2407         * dom/ViewportArguments.h:
2408
2409         Removes `m_forceHorizontalShrinkToFit` (more detail below).
2410
2411         * page/ViewportConfiguration.cpp:
2412         (WebCore::computedMinDeviceWidth):
2413         (WebCore::ViewportConfiguration::ViewportConfiguration):
2414         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
2415
2416         Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
2417         size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.
2418
2419         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
2420
2421         Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
2422         min-device-width attribute is actively clamping the width of the view.
2423
2424         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
2425         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
2426         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
2427
2428         Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
2429         needed.
2430
2431         (WebCore::ViewportConfiguration::description const):
2432         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
2433         * page/ViewportConfiguration.h:
2434
2435 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2436
2437         [LFC] Formatting contexts should take const Box&
2438         https://bugs.webkit.org/show_bug.cgi?id=185031
2439
2440         Reviewed by Sam Weinig.
2441
2442         The formatting root boxes are supposed to be all const. The only reason why
2443         they are not is because WeakPtr<> does not support const objects yet.
2444         Use const_cast instead (remove it when WeakPtr<> gains const support).
2445
2446         * layout/FormattingContext.cpp:
2447         (WebCore::Layout::FormattingContext::FormattingContext):
2448         * layout/FormattingContext.h:
2449         * layout/LayoutContext.cpp:
2450         (WebCore::Layout::LayoutContext::LayoutContext):
2451         (WebCore::Layout::LayoutContext::formattingContext):
2452         * layout/LayoutContext.h:
2453         * layout/blockformatting/BlockFormattingContext.cpp:
2454         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2455         * layout/blockformatting/BlockFormattingContext.h:
2456         * layout/inlineformatting/InlineFormattingContext.cpp:
2457         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2458         * layout/inlineformatting/InlineFormattingContext.h:
2459
2460 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2461
2462         [LFC] Add layout tree iterators.
2463         https://bugs.webkit.org/show_bug.cgi?id=185058
2464
2465         Reviewed by Antti Koivisto.
2466
2467         They work exactly like the renderer tree iterators.
2468
2469         * WebCore.xcodeproj/project.pbxproj:
2470         * layout/layouttree/LayoutAncestorIterator.h: Added.
2471         (WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
2472         (WebCore::Layout::LayoutAncestorIterator<T>::operator):
2473         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
2474         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
2475         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
2476         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
2477         (WebCore::Layout::ancestorsOfType):
2478         (WebCore::Layout::lineageOfType):
2479         * layout/layouttree/LayoutBox.cpp:
2480         * layout/layouttree/LayoutChildIterator.h: Added.
2481         (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
2482         (WebCore::Layout::LayoutChildtIterator<T>::operator):
2483         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
2484         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
2485         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
2486         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
2487         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
2488         (WebCore::Layout::childrenOfType):
2489         * layout/layouttree/LayoutIterator.h: Added.
2490         (WebCore::Layout::isLayoutBoxOfType):
2491         (WebCore::Layout::Traversal::firstChild):
2492         (WebCore::Layout::Traversal::lastChild):
2493         (WebCore::Layout::Traversal::nextSibling):
2494         (WebCore::Layout::Traversal::previousSibling):
2495         (WebCore::Layout::Traversal::findAncestorOfType):
2496         (WebCore::Layout::Traversal::nextAncestorSibling):
2497         (WebCore::Layout::Traversal::nextWithin):
2498         (WebCore::Layout::Traversal::firstWithin):
2499         (WebCore::Layout::Traversal::next):
2500         (WebCore::Layout::LayoutIterator<T>::LayoutIterator):
2501         (WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
2502         (WebCore::Layout::LayoutIterator<T>::traverseNext):
2503         (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
2504         (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
2505         (WebCore::Layout::LayoutIterator<T>::operator const):
2506         (WebCore::Layout:: const):
2507         (WebCore::Layout::= const):
2508
2509 2018-04-27  Commit Queue  <commit-queue@webkit.org>
2510
2511         Unreviewed, rolling out r231089.
2512         https://bugs.webkit.org/show_bug.cgi?id=185071
2513
2514         Broke and made crash some WPE EME tests (Requested by calvaris
2515         on #webkit).
2516
2517         Reverted changeset:
2518
2519         "[EME][GStreamer] Move the decryptor from AppendPipeline to
2520         PlaybackPipeline."
2521         https://bugs.webkit.org/show_bug.cgi?id=181855
2522         https://trac.webkit.org/changeset/231089
2523
2524 2018-04-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2525
2526         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
2527         https://bugs.webkit.org/show_bug.cgi?id=181855
2528
2529         Reviewed by Xabier Rodriguez-Calvar.
2530
2531         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
2532
2533         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
2534         the decrypted GstBuffers that are in SVP memory.
2535         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
2536
2537         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
2538         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
2539
2540         This new architecture also allows to start the buffering before obtaining the DRM license
2541         and it makes easier to manage dynamic change of the license or Key.
2542
2543         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
2544
2545         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
2546         protected by a hardware access control engine, it is not accessible to other unauthorised
2547         software or hardware components.
2548
2549         Tests:
2550             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
2551             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
2552
2553         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2554         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2555         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2556         (WebCore::dumpAppendState):
2557         (WebCore::AppendPipeline::AppendPipeline):
2558         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
2559         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
2560         (WebCore::AppendPipeline::setAppendState):
2561         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2562         (WebCore::AppendPipeline::appsinkNewSample):
2563         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2564         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2565         (WebCore::appendPipelineElementMessageCallback): Deleted.
2566         (WebCore::AppendPipeline::handleElementMessage): Deleted.
2567         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
2568         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
2569         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2570         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2571         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2572         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2573
2574 2018-04-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2575
2576         [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
2577         https://bugs.webkit.org/show_bug.cgi?id=181858
2578
2579         Reviewed by Xabier Rodriguez-Calvar.
2580
2581         Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
2582         This message should be handled by the application in order to dispatch or send the key to the decryptor.
2583         This patch is a preparation for the patch 181855.
2584         With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
2585         get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
2586         When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
2587         the DRM license or key by using this new message "decrypt-key-needed".
2588
2589
2590         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2591         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2592         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2593         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
2594         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2595         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2596         (webkitMediaCommonEncryptionDecryptTransformInPlace):
2597
2598 2018-04-26  Justin Fan  <justin_fan@apple.com>
2599
2600         tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
2601         https://bugs.webkit.org/show_bug.cgi?id=184843
2602         <rdar://problem/34898868>
2603
2604         Reviewed by Simon Fraser.
2605
2606         On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread. 
2607         For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
2608         This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these. 
2609
2610         * platform/graphics/FormatConverter.cpp:
2611         (WebCore::FormatConverter::convert):
2612
2613 2018-04-26  Simon Fraser  <simon.fraser@apple.com>
2614
2615         Implement rendering support for the color-filter CSS property
2616         https://bugs.webkit.org/show_bug.cgi?id=185047
2617         rdar://problem/39664967
2618
2619         Reviewed by Tim Horton.
2620         
2621         The color-filter property transforms CSS colors just before painting. To support this,
2622         add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
2623         At most calls sites that transform colors for rendering, replace calls to
2624         visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
2625         that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().
2626         
2627         Color transformation is implemented via a new virtual function on FilterOperation;
2628         BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
2629         do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
2630         transfer operations. The math in both cases matches that for SVG filters, with the exception
2631         that color components are stored as floats through multiple filters and then mapped to
2632         normal 0-255 color components at the end.
2633
2634         Tests: css3/color-filters/color-filter-backgrounds-borders.html
2635                css3/color-filters/color-filter-box-shadow.html
2636                css3/color-filters/color-filter-brightness.html
2637                css3/color-filters/color-filter-color-property-list-item.html
2638                css3/color-filters/color-filter-color-property.html
2639                css3/color-filters/color-filter-color-text-decorations.html
2640                css3/color-filters/color-filter-column-rule.html
2641                css3/color-filters/color-filter-contrast.html
2642                css3/color-filters/color-filter-current-color.html
2643                css3/color-filters/color-filter-filter-list.html
2644                css3/color-filters/color-filter-grayscale.html
2645                css3/color-filters/color-filter-hue-rotate.html
2646                css3/color-filters/color-filter-inherits.html
2647                css3/color-filters/color-filter-invert.html
2648                css3/color-filters/color-filter-opacity.html
2649                css3/color-filters/color-filter-outline.html
2650                css3/color-filters/color-filter-saturate.html
2651                css3/color-filters/color-filter-sepia.html
2652                css3/color-filters/color-filter-text-emphasis.html
2653
2654         * html/HTMLTextFormControlElement.cpp:
2655         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
2656         * page/FrameView.cpp:
2657         (WebCore::FrameView::documentBackgroundColor const):
2658         * platform/graphics/ColorUtilities.cpp:
2659         (WebCore::ColorMatrix::ColorMatrix):
2660         (WebCore::ColorMatrix::makeIdentity):
2661         (WebCore::ColorMatrix::grayscaleMatrix):
2662         (WebCore::ColorMatrix::saturationMatrix):
2663         (WebCore::ColorMatrix::hueRotateMatrix):
2664         (WebCore::ColorMatrix::sepiaMatrix):
2665         (WebCore::ColorMatrix::transformColorComponents const):
2666         * platform/graphics/ColorUtilities.h:
2667         * platform/graphics/filters/FilterOperation.cpp:
2668         (WebCore::BasicColorMatrixFilterOperation::transformColor const):
2669         (WebCore::BasicComponentTransferFilterOperation::transformColor const):
2670         * platform/graphics/filters/FilterOperation.h:
2671         (WebCore::FilterOperation::transformColor const):
2672         * platform/graphics/filters/FilterOperations.cpp:
2673         (WebCore::FilterOperations::transformColor const):
2674         * platform/graphics/filters/FilterOperations.h:
2675         * rendering/BorderEdge.cpp:
2676         (WebCore::BorderEdge::getBorderEdgeInfo):
2677         * rendering/EllipsisBox.cpp:
2678         (WebCore::EllipsisBox::paint):
2679         (WebCore::EllipsisBox::paintSelection):
2680         * rendering/InlineFlowBox.cpp:
2681         (WebCore::InlineFlowBox::paintBoxDecorations):
2682         * rendering/InlineTextBox.cpp:
2683         (WebCore::InlineTextBox::paintMarkedTextForeground):
2684         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2685         (WebCore::InlineTextBox::paintCompositionUnderline const):
2686         * rendering/RenderBox.cpp:
2687         (WebCore::RenderBox::paintRootBoxFillLayers):
2688         (WebCore::RenderBox::paintBackground):
2689         (WebCore::RenderBox::getBackgroundPaintedExtent const):
2690         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
2691         (WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
2692         * rendering/RenderBoxModelObject.cpp:
2693         (WebCore::applyBoxShadowForBackground):
2694         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2695         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
2696         (WebCore::RenderBoxModelObject::paintBoxShadow):
2697         * rendering/RenderDetailsMarker.cpp:
2698         (WebCore::RenderDetailsMarker::paint):
2699         * rendering/RenderElement.cpp:
2700         (WebCore::RenderElement::selectionColor const):
2701         (WebCore::RenderElement::selectionBackgroundColor const):
2702         (WebCore::RenderElement::paintFocusRing):
2703         (WebCore::RenderElement::paintOutline):
2704         * rendering/RenderFileUploadControl.cpp:
2705         (WebCore::RenderFileUploadControl::paintObject):
2706         * rendering/RenderFrameSet.cpp:
2707         (WebCore::RenderFrameSet::paintColumnBorder):
2708         (WebCore::RenderFrameSet::paintRowBorder):
2709         * rendering/RenderImage.cpp:
2710         (WebCore::RenderImage::paintReplaced):
2711         (WebCore::RenderImage::paintAreaElementFocusRing):
2712         * rendering/RenderInline.cpp:
2713         (WebCore::RenderInline::paintOutline):
2714         * rendering/RenderLayerBacking.cpp:
2715         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
2716         (WebCore::RenderLayerBacking::rendererBackgroundColor const):
2717         * rendering/RenderLayerCompositor.cpp:
2718         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
2719         * rendering/RenderListBox.cpp:
2720         (WebCore::RenderListBox::paintItemForeground):
2721         (WebCore::RenderListBox::paintItemBackground):
2722         * rendering/RenderListMarker.cpp:
2723         (WebCore::RenderListMarker::paint):
2724         * rendering/RenderMenuList.cpp:
2725         (RenderMenuList::itemStyle const):
2726         (RenderMenuList::getItemBackgroundColor const):
2727         (RenderMenuList::menuStyle const):
2728         * rendering/RenderMultiColumnSet.cpp:
2729         (WebCore::RenderMultiColumnSet::paintColumnRules):
2730         * rendering/RenderSearchField.cpp:
2731         (WebCore::RenderSearchField::menuStyle const):
2732         * rendering/RenderTable.h:
2733         (WebCore::RenderTable::bgColor const):
2734         * rendering/RenderTableCell.cpp:
2735         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
2736         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
2737         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
2738         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
2739         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2740         * rendering/RenderTableSection.cpp:
2741         (WebCore::RenderTableSection::paintRowGroupBorder):
2742         * rendering/RenderTheme.cpp:
2743         (WebCore::RenderTheme::paintSliderTicks):
2744         * rendering/TextDecorationPainter.cpp:
2745         (WebCore::decorationColor):
2746         * rendering/TextPaintStyle.cpp:
2747         (WebCore::computeTextPaintStyle):
2748         * rendering/mathml/MathOperator.cpp:
2749         (WebCore::MathOperator::paint):
2750         * rendering/mathml/RenderMathMLFraction.cpp:
2751         (WebCore::RenderMathMLFraction::paint):
2752         * rendering/mathml/RenderMathMLMenclose.cpp:
2753         (WebCore::RenderMathMLMenclose::paint):
2754         * rendering/mathml/RenderMathMLRoot.cpp:
2755         (WebCore::RenderMathMLRoot::paint):
2756         * rendering/mathml/RenderMathMLToken.cpp:
2757         (WebCore::RenderMathMLToken::paint):
2758         * rendering/style/RenderStyle.cpp:
2759         (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
2760         (WebCore::RenderStyle::colorByApplyingColorFilter const):
2761         * rendering/style/RenderStyle.h:
2762
2763 2018-04-26  Mark Lam  <mark.lam@apple.com>
2764
2765         Gardening: Speculative build fix for Windows.
2766         https://bugs.webkit.org/show_bug.cgi?id=184976
2767         <rdar://problem/39723901>
2768
2769         Not reviewed.
2770
2771         * cssjit/CSSPtrTag.h:
2772
2773 2018-04-26  Brent Fulgham  <bfulgham@apple.com>
2774
2775         Show punycode if URL contains Latin small letter o with dot below character
2776         https://bugs.webkit.org/show_bug.cgi?id=185051
2777         <rdar://problem/39459297>
2778
2779         Reviewed by David Kilzer.
2780
2781         Revise our "lookalike character" logic to include the small Latin o
2782         with dot below character.
2783
2784         Test: fast/url/host.html
2785
2786         * platform/mac/WebCoreNSURLExtras.mm:
2787         (WebCore::isLookalikeCharacter):
2788
2789 2018-04-26  Daniel Bates  <dabates@apple.com>
2790
2791         Fix the build following r231068
2792         (https://bugs.webkit.org/show_bug.cgi?id=185002)
2793
2794         Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
2795         latter does not exist.
2796
2797         * loader/DocumentLoader.cpp:
2798         (WebCore::DocumentLoader::loadMainResource):
2799
2800 2018-04-26  Daniel Bates  <dabates@apple.com>
2801
2802         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
2803         https://bugs.webkit.org/show_bug.cgi?id=185002
2804
2805         Reviewed by Youenn Fablet and Alex Christensen.
2806
2807         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2808         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2809         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2810         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2811         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2812         Instead we should WTFMove() the passed request into the CachedResourceRequest.
2813
2814         * loader/DocumentLoader.cpp:
2815         (WebCore::DocumentLoader::loadMainResource):
2816
2817 2018-04-26  Sihui Liu  <sihui_liu@apple.com>
2818
2819         -[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
2820         https://bugs.webkit.org/show_bug.cgi?id=184938
2821         <rdar://problem/34737395>
2822
2823         Reviewed by Geoffrey Garen.
2824
2825         When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
2826         was lost so the delete function cannot find the proper cookie to delete.
2827         This patch implements a workaround that compares Cookie object instead of NSHTTPCookie 
2828         object. We might want to add the ability to set HTTPOnly header during conversion if there
2829         is an easy way to do it later.
2830         
2831         New API test: WebKit.WKHTTPCookieStoreHttpOnly
2832
2833         * platform/network/cocoa/CookieCocoa.mm:
2834         (WebCore::Cookie::operator== const):
2835         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2836         (WebCore::NetworkStorageSession::deleteCookie):
2837
2838 2018-04-26  Commit Queue  <commit-queue@webkit.org>
2839
2840         Unreviewed, rolling out r231052.
2841         https://bugs.webkit.org/show_bug.cgi?id=185044
2842
2843         Broke test http/tests/security/credentials-main-resource.html
2844         (Requested by dydz on #webkit).
2845
2846         Reverted changeset:
2847
2848         "DocumentLoader::loadMainResource() should WTFMove() the
2849         passed ResourceRequest"
2850         https://bugs.webkit.org/show_bug.cgi?id=185002
2851         https://trac.webkit.org/changeset/231052
2852
2853 2018-04-26  Jer Noble  <jer.noble@apple.com>
2854
2855         WK_COCOA_TOUCH all the things.
2856         https://bugs.webkit.org/show_bug.cgi?id=185006
2857
2858         Reviewed by Tim Horton.
2859
2860         * Configurations/WebCore.xcconfig:
2861
2862 2018-04-26  David Kilzer  <ddkilzer@apple.com>
2863
2864         Make WAKScrollView delegate a weak property
2865         <https://webkit.org/b/184799>
2866         <rdar://problem/39469669>
2867
2868         Reviewed by Simon Fraser.
2869
2870         * platform/ios/wak/WAKScrollView.h:
2871         - Remove `delegate` instance variable declaration.
2872         - Declare `delegate` property as weak.
2873         (-[WAKScrollView setDelegate:]): Delete declaration.
2874         (-[WAKScrollView delegate]): Ditto.
2875         * platform/ios/wak/WAKScrollView.mm:
2876         - Synthesize getter/setter methods for `delegate` property.
2877         (-[WAKScrollView setDelegate:]): Delete implementation.
2878         (-[WAKScrollView delegate]): Ditto.
2879
2880 2018-04-26  Youenn Fablet  <youenn@apple.com>
2881
2882         CORS preflight checker should add a console message when preflight load is blocked
2883         https://bugs.webkit.org/show_bug.cgi?id=185021
2884
2885         Reviewed by Chris Dumez.
2886
2887         No change of behavior, adding a JS console message when preflight load is blocked.
2888         This mirrors what is being done in preflighting done from NetworkProcess.
2889         Covered by existing tests.
2890
2891         * loader/CrossOriginPreflightChecker.cpp:
2892         (WebCore::CrossOriginPreflightChecker::notifyFinished):
2893         (WebCore::CrossOriginPreflightChecker::doPreflight):
2894
2895 2018-04-26  Daniel Bates  <dabates@apple.com>
2896
2897         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
2898         https://bugs.webkit.org/show_bug.cgi?id=185002
2899
2900         Reviewed by Youenn Fablet and Alex Christensen.
2901
2902         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2903         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2904         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2905         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2906         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2907         Instead we should WTFMove() the passed request into the CachedResourceRequest.
2908
2909         * loader/DocumentLoader.cpp:
2910         (WebCore::DocumentLoader::loadMainResource):
2911
2912 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
2913
2914         Disable content filtering in minimal simulator mode
2915         https://bugs.webkit.org/show_bug.cgi?id=185027
2916         <rdar://problem/39736091>
2917
2918         Reviewed by Jer Noble.
2919
2920         * Configurations/FeatureDefines.xcconfig:
2921
2922 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
2923
2924         Add port 548 (afpovertcp) to port blacklist
2925         https://bugs.webkit.org/show_bug.cgi?id=185000
2926         <rdar://problem/39540481>
2927
2928         Reviewed by David Kilzer.
2929
2930         Tested by security/block-test.html.
2931
2932         * platform/URL.cpp:
2933         (WebCore::portAllowed):Also block port 548.
2934
2935 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
2936
2937         [INTL] Implement Intl.PluralRules
2938         https://bugs.webkit.org/show_bug.cgi?id=184312
2939
2940         Reviewed by JF Bastien.
2941
2942         Added Intl.PluralRules feature flag.
2943
2944         Test: js/intl-pluralrules.html
2945
2946         * Configurations/FeatureDefines.xcconfig:
2947
2948 2018-04-15  Darin Adler  <darin@apple.com>
2949
2950         [Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
2951         https://bugs.webkit.org/show_bug.cgi?id=184637
2952
2953         Reviewed by Alexey Proskuryakov.
2954
2955         * crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
2956         HAVE(CCRSAGetCRTComponents) is true.
2957
2958         * crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
2959         enough versions of iOS and macOS that have it and add declarations of the
2960         function for the non-Apple-internal-SDK case. Also don't define the
2961         WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
2962
2963         * crypto/mac/CryptoKeyRSAMac.cpp:
2964         (WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
2965
2966 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
2967
2968         Add lazy initialization of caption display mode for videos.
2969         https://bugs.webkit.org/show_bug.cgi?id=184993
2970
2971         The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
2972         is showing up in samples when called from HTMLMediaElement::finishInitialization().
2973
2974         Reviewed by Eric Carlson.
2975
2976         No new tests, covered by existing tests.
2977
2978         * html/HTMLMediaElement.cpp:
2979         (WebCore::HTMLMediaElement::finishInitialization):
2980         (WebCore::HTMLMediaElement::setSelectedTextTrack):
2981         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2982         (WebCore::HTMLMediaElement::captionPreferencesChanged):
2983         (WebCore::HTMLMediaElement::captionDisplayMode):
2984         * html/HTMLMediaElement.h:
2985
2986 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
2987
2988         [GTK][WPE] Initial ASYNC_SCROLLING support
2989         https://bugs.webkit.org/show_bug.cgi?id=184961
2990
2991         Reviewed by Carlos Garcia Campos.
2992
2993         Add CoordinatedGraphics-specific code that will be required for async
2994         scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
2995         ScrollingTreeCoordinatedGraphics classes are mostly complete already,
2996         but the new ScrollingTreeNode-inheriting classes will need further
2997         work that will have to be done in parallel with other improvements
2998         planned for the CoordinatedGraphics subsystem.
2999
3000         While the build-time flag is enabled, the feature is still not enabled
3001         at runtime due to being marked as unsupported by the DrawingArea
3002         implementation in the WebKit layer. It would also not work yet if it
3003         were enabled due to the before-mentioned pending changes.
3004
3005         Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
3006         code are included.
3007
3008         * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
3009         * SourcesCocoa.txt:
3010         * SourcesGTK.txt: Add new files to build.
3011         * SourcesWPE.txt: Ditto.
3012         * page/scrolling/AsyncScrollingCoordinator.cpp:
3013         Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
3014         * page/scrolling/ScrollingTree.h:
3015         * page/scrolling/ThreadedScrollingTree.cpp:
3016         * page/scrolling/ThreadedScrollingTree.h:
3017         currentSnapPointIndicesDidChange() method is only invoked in
3018         Cocoa-specific code, and its implementation calls Cocoa-specific method
3019         on the AsyncScrollingCoordinator class.
3020         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
3021         (WebCore::ScrollingCoordinator::create):
3022         (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
3023         (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
3024         (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
3025         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
3026         (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
3027         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
3028         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
3029         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
3030         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
3031         (WebCore::ScrollingTreeCoordinatedGraphics::create):
3032         (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
3033         (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
3034         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
3035         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
3036         (WebCore::ScrollingTreeFixedNode::create):
3037         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
3038         (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
3039         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
3040         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
3041         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
3042         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
3043         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
3044         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
3045         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
3046         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
3047         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
3048         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
3049         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
3050         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
3051         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
3052         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
3053         (WebCore::ScrollingTreeStickyNode::create):
3054         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
3055         (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
3056         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
3057         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
3058         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
3059         * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
3060         for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
3061         * platform/TextureMapper.cmake: Two build targets have been moved to
3062         SourcesGTK.txt and SourcesWPE.txt.
3063
3064 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3065
3066         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
3067         https://bugs.webkit.org/show_bug.cgi?id=184643
3068
3069         Reviewed by Žan Doberšek.
3070
3071         Adapt to single-header WPE includes.
3072
3073         * platform/graphics/egl/GLContextEGLWPE.cpp:
3074         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
3075         * platform/wpe/PlatformPasteboardWPE.cpp:
3076
3077 2018-04-25  Youenn Fablet  <youenn@apple.com>
3078
3079         Use NetworkLoadChecker for all subresource loads except fetch/XHR
3080         https://bugs.webkit.org/show_bug.cgi?id=184870
3081         <rdar://problem/39370034>
3082
3083         Reviewed by Chris Dumez.
3084
3085         No change of behavior.
3086         Update CachedResourceLoader error messages to match NetworkProcess error messages.
3087
3088         * loader/cache/CachedResourceLoader.cpp:
3089         (WebCore::CachedResourceLoader::printAccessDeniedMessage const):
3090
3091 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3092
3093         [LFC] Add support for is<> and downcast<>
3094         https://bugs.webkit.org/show_bug.cgi?id=185016
3095
3096         Reviewed by Antti Koivisto.
3097
3098         * layout/layouttree/LayoutBlockContainer.cpp:
3099         (WebCore::Layout::BlockContainer::BlockContainer):
3100         * layout/layouttree/LayoutBlockContainer.h:
3101         * layout/layouttree/LayoutBox.cpp:
3102         (WebCore::Layout::Box::Box):
3103         * layout/layouttree/LayoutBox.h:
3104         (WebCore::Layout::Box::isContainer const):
3105         (WebCore::Layout::Box::isBlockContainer const):
3106         (WebCore::Layout::Box::isInlineBox const):
3107         (WebCore::Layout::Box::isInlineContainer const):
3108         * layout/layouttree/LayoutContainer.cpp:
3109         (WebCore::Layout::Container::Container):
3110         * layout/layouttree/LayoutContainer.h:
3111         * layout/layouttree/LayoutInlineBox.cpp:
3112         (WebCore::Layout::InlineBox::InlineBox):
3113         * layout/layouttree/LayoutInlineBox.h:
3114         * layout/layouttree/LayoutInlineContainer.cpp:
3115         (WebCore::Layout::InlineContainer::InlineContainer):
3116         * layout/layouttree/LayoutInlineContainer.h:
3117
3118 2018-04-25  Chris Dumez  <cdumez@apple.com>
3119
3120         window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
3121         https://bugs.webkit.org/show_bug.cgi?id=184981
3122
3123         Reviewed by Sam Weinig.
3124
3125         window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
3126         complaining that |this| is not a Window. This was caused by a copy & paste mistake in
3127         JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
3128         ones.
3129
3130         No new tests, updated existing tests.
3131
3132         * bindings/js/JSDOMWindowCustom.cpp:
3133         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3134         * page/RemoteDOMWindow.cpp:
3135         (WebCore::RemoteDOMWindow::postMessage):
3136         * page/RemoteDOMWindow.h:
3137         * page/RemoteDOMWindow.idl:
3138
3139 2018-04-25  Simon Fraser  <simon.fraser@apple.com>
3140
3141         brightness() filter should default to 1, and not allow negative values
3142         https://bugs.webkit.org/show_bug.cgi?id=184937
3143
3144         Reviewed by Dean Jackson.
3145
3146         Remove the special-casing for brightness() in consumeFilterFunction(), so it now
3147         follows the same logic as the other color-related filters in not allowing negative
3148         values.
3149
3150         Removed the special-casing for brightness() in createFilterOperations() so its default
3151         value is now 1.
3152
3153         Modified existing tests.
3154
3155         * css/StyleResolver.cpp:
3156         (WebCore::StyleResolver::createFilterOperations):
3157         * css/parser/CSSPropertyParserHelpers.cpp:
3158         (WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
3159         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
3160
3161 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3162
3163         Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
3164         https://bugs.webkit.org/show_bug.cgi?id=184999
3165
3166         Reviewed by Tim Horton.
3167
3168         Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
3169
3170         * Configurations/WebCore.xcconfig:
3171
3172 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3173
3174         [LFC] Implement LayoutContexet::layout() and its dependencies.
3175         https://bugs.webkit.org/show_bug.cgi?id=184951
3176
3177         Reviewed by Antti Koivisto.
3178
3179         * layout/FormattingContext.cpp:
3180         (WebCore::Layout::FormattingContext::FormattingContext):
3181         (WebCore::Layout::FormattingContext::~FormattingContext):
3182         (WebCore::Layout::FormattingContext::computeStaticPosition):
3183         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
3184         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
3185         (WebCore::Layout::FormattingContext::computeWidth):
3186         (WebCore::Layout::FormattingContext::computeHeight):
3187         (WebCore::Layout::FormattingContext::marginTop):
3188         (WebCore::Layout::FormattingContext::marginLeft):
3189         (WebCore::Layout::FormattingContext::marginBottom):
3190         (WebCore::Layout::FormattingContext::marginRight):
3191         * layout/FormattingContext.h:
3192         * layout/FormattingState.cpp:
3193         (WebCore::Layout::FormattingState::FormattingState):
3194         * layout/FormattingState.h:
3195         * layout/LayoutContext.cpp:
3196         (WebCore::Layout::LayoutContext::LayoutContext):
3197         (WebCore::Layout::LayoutContext::updateLayout):
3198         (WebCore::Layout::LayoutContext::formattingState):
3199         (WebCore::Layout::LayoutContext::formattingContext):
3200         * layout/LayoutContext.h:
3201         * layout/blockformatting/BlockFormattingContext.cpp:
3202         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
3203         (WebCore::Layout::BlockFormattingContext::layout):
3204         (WebCore::Layout::BlockFormattingContext::formattingState const):
3205         (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
3206         (WebCore::Layout::BlockFormattingContext::computeWidth):
3207         (WebCore::Layout::BlockFormattingContext::computeHeight):
3208         (WebCore::Layout::BlockFormattingContext::marginTop):
3209         (WebCore::Layout::BlockFormattingContext::marginBottom):
3210         * layout/blockformatting/BlockFormattingContext.h:
3211         * layout/blockformatting/BlockFormattingState.cpp:
3212         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3213         * layout/blockformatting/BlockFormattingState.h:
3214         * layout/inlineformatting/InlineFormattingContext.cpp:
3215         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
3216         (WebCore::Layout::InlineFormattingContext::layout):
3217         (WebCore::Layout::InlineFormattingContext::formattingState const):
3218         * layout/inlineformatting/InlineFormattingContext.h:
3219         * layout/inlineformatting/InlineFormattingState.cpp:
3220         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3221         * layout/inlineformatting/InlineFormattingState.h:
3222
3223 2018-04-25  Mark Lam  <mark.lam@apple.com>
3224
3225         Push the definition of PtrTag down to the WTF layer.
3226         https://bugs.webkit.org/show_bug.cgi?id=184976
3227         <rdar://problem/39723901>
3228
3229         Reviewed by Saam Barati.
3230
3231         No new tests needed.  This is covered by existing tests.
3232
3233         * cssjit/CSSPtrTag.h:
3234         * cssjit/SelectorCompiler.h:
3235         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
3236         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
3237         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
3238         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
3239
3240 2018-04-25  Eric Carlson  <eric.carlson@apple.com>
3241
3242         [iOS] remove media element parameter from MediaElementSession methods
3243         https://bugs.webkit.org/show_bug.cgi?id=184992
3244         <rdar://problem/39731624>
3245
3246         Reviewed by Jon Lee.
3247
3248         No new tests, no behavior change.
3249
3250         * Modules/mediacontrols/MediaControlsHost.cpp:
3251         (WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
3252         (WebCore::MediaControlsHost::userGestureRequired const):
3253         * accessibility/AccessibilityMediaObject.cpp:
3254         (WebCore::AccessibilityMediaObject::isPlayingInline const):
3255         * html/HTMLMediaElement.cpp:
3256         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3257         (WebCore::HTMLMediaElement::parseAttribute):
3258         (WebCore::HTMLMediaElement::prepareForLoad):
3259         (WebCore::HTMLMediaElement::selectMediaResource):
3260         (WebCore::HTMLMediaElement::loadResource):
3261         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
3262         (WebCore::HTMLMediaElement::setReadyState):
3263         (WebCore::HTMLMediaElement::play):
3264         (WebCore::HTMLMediaElement::pause):
3265         (WebCore::HTMLMediaElement::pauseInternal):
3266         (WebCore::HTMLMediaElement::setVolume):
3267         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
3268         (WebCore::HTMLMediaElement::sourceWasAdded):
3269         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
3270         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3271         (WebCore::HTMLMediaElement::updatePlayState):
3272         (WebCore::HTMLMediaElement::clearMediaPlayer):
3273         (WebCore::HTMLMediaElement::resume):
3274         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
3275         (WebCore::HTMLMediaElement::addEventListener):
3276         (WebCore::HTMLMediaElement::removeEventListener):
3277         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
3278         (WebCore::HTMLMediaElement::exitFullscreen):
3279         (WebCore::HTMLMediaElement::configureMediaControls):
3280         (WebCore::HTMLMediaElement::createMediaPlayer):
3281         (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
3282         (WebCore::HTMLMediaElement::updateMediaState):
3283         (WebCore::HTMLMediaElement::mediaState const):
3284         (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
3285         (WebCore::HTMLMediaElement::updateShouldPlay):
3286         * html/HTMLVideoElement.cpp:
3287         (WebCore::HTMLVideoElement::parseAttribute):
3288         (WebCore::HTMLVideoElement::supportsFullscreen const):
3289         (WebCore::HTMLVideoElement::webkitEnterFullscreen):
3290         (WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
3291         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
3292         (WebCore::HTMLVideoElement::setFullscreenMode):
3293         * html/MediaElementSession.cpp:
3294         (WebCore::MediaElementSession::playbackPermitted const):
3295         (WebCore::MediaElementSession::dataLoadingPermitted const):
3296         (WebCore::MediaElementSession::fullscreenPermitted const):
3297         (WebCore::MediaElementSession::pageAllowsDataLoading const):
3298         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
3299         (WebCore::MediaElementSession::canShowControlsManager const):
3300         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3301         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
3302         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
3303         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
3304         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
3305         (WebCore::MediaElementSession::mediaStateDidChange):
3306         (WebCore::MediaElementSession::effectivePreloadForElement const):
3307         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
3308         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
3309         (WebCore::MediaElementSession::mediaEngineUpdated):
3310         (WebCore::MediaElementSession::allowsPictureInPicture const):
3311         * html/MediaElementSession.h:
3312         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3313         (WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):
3314
3315 2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>
3316
3317         Remove access to keychain from the WebContent process
3318         https://bugs.webkit.org/show_bug.cgi?id=184428
3319         <rdar://problem/13150903>
3320
3321         Reviewed by Brent Fulgham.
3322
3323         Part 2.
3324
3325         This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
3326         Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
3327         localized string is marked WEBCORE_EXPORT as well to support the API test.
3328
3329         Covered by existing tests and api tests.
3330
3331         * WebCore.xcodeproj/project.pbxproj:
3332         * dom/Document.cpp:
3333         (WebCore::Document::signedPublicKeyAndChallengeString):
3334         * dom/Document.h:
3335         * html/HTMLKeygenElement.cpp:
3336         (WebCore::HTMLKeygenElement::appendFormData):
3337         * page/ChromeClient.h:
3338         * platform/LocalizedStrings.h:
3339         * platform/SSLKeyGenerator.h:
3340
3341 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
3342
3343         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
3344         https://bugs.webkit.org/show_bug.cgi?id=184962
3345
3346         Reviewed by Youenn Fablet.
3347
3348         Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
3349         a new WebContent process when navigating to a blob URL, data URL, and about:blank.
3350
3351         Tests: ProcessSwap.SameOriginBlobNavigation
3352                ProcessSwap.CrossOriginBlobNavigation
3353                ProcessSwap.NavigateToAboutBlank
3354                ProcessSwap.NavigateToDataURL
3355
3356         * loader/NavigationAction.cpp:
3357         (WebCore::treatAsSameOriginNavigation):
3358         * loader/NavigationAction.h:
3359         (WebCore::NavigationAction::treatAsSameOriginNavigation const):
3360
3361 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3362
3363         [LFC] Implement Layout::BlockContainer functions.
3364         https://bugs.webkit.org/show_bug.cgi?id=184994
3365
3366         Reviewed by Antti Koivisto.
3367
3368         * layout/layouttree/LayoutBlockContainer.cpp:
3369         (WebCore::Layout::BlockContainer::BlockContainer):
3370         (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
3371
3372 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3373
3374         [LFC] Implement Layout::Container functions.
3375         https://bugs.webkit.org/show_bug.cgi?id=184988
3376
3377         Reviewed by Antti Koivisto.
3378
3379         * layout/layouttree/LayoutContainer.cpp:
3380         (WebCore::Layout::Container::Container):
3381         (WebCore::Layout::Container::firstInFlowChild const):
3382         (WebCore::Layout::Container::firstInFlowOrFloatingChild const):
3383         (WebCore::Layout::Container::lastInFlowChild const):
3384         (WebCore::Layout::Container::lastInFlowOrFloatingChild const):
3385         (WebCore::Layout::Container::setFirstChild):
3386         (WebCore::Layout::Container::setLastChild):
3387         (WebCore::Layout::Container::setOutOfFlowDescendants):
3388         * layout/layouttree/LayoutContainer.h:
3389         (WebCore::Layout::Container::firstChild const):
3390         (WebCore::Layout::Container::lastChild const):
3391         (WebCore::Layout::Container::hasChild const):
3392         (WebCore::Layout::Container::hasInFlowChild const):
3393         (WebCore::Layout::Container::hasInFlowOrFloatingChild const):
3394         (WebCore::Layout::Container::outOfFlowDescendants):
3395
3396 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
3397
3398         Don't Block First Party Cookies on Redirects
3399         https://bugs.webkit.org/show_bug.cgi?id=184948
3400         <rdar://problem/39534099>
3401
3402         Reviewed by Youenn Fablet.
3403
3404         The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.
3405
3406         Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
3407
3408         * loader/NavigationScheduler.cpp:
3409
3410 2018-04-25  Youenn Fablet  <youenn@apple.com>
3411
3412         CachedRawResource is not handling incremental data computation correctly
3413         https://bugs.webkit.org/show_bug.cgi?id=184936
3414
3415         Reviewed by Chris Dumez.
3416
3417         Covered by updated test.
3418
3419         The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
3420         In service worker case, a SharedBuffer may contain more than one segment.
3421         This is fixed by iterating until all new data is sent to clients.
3422
3423         * loader/cache/CachedRawResource.cpp:
3424         (WebCore::CachedRawResource::updateBuffer):
3425
3426 2018-04-25  Andy Estes  <aestes@apple.com>
3427
3428         [Mac] Number of drop items is always 0 when performing a DHTML drag
3429         https://bugs.webkit.org/show_bug.cgi?id=184943
3430
3431         Reviewed by Ryosuke Niwa.
3432
3433         New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop
3434
3435         DragController tracks the number of items to be accepted by a file input element, taking
3436         into account whether the control is disabled or accepts multiple files. When this number
3437         changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
3438         calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
3439         rendered next to the dragging item thumbnails.
3440
3441         When performing a DHTML drag, we don't know how many items the page will accept, so prior
3442         to this patch we would render a "0" in the badge. This is misleading, because the page is
3443         more likely to accept all the items (or at least one of them) rather than none of them.
3444
3445         Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
3446         files in the drag operation when performing a DHTML file drag.
3447
3448         * page/DragController.cpp:
3449         (WebCore::DragController::tryDocumentDrag):
3450
3451 2018-04-25  Eric Carlson  <eric.carlson@apple.com>
3452
3453         [iOS] Set route sharing policy when setting audio session category
3454         https://bugs.webkit.org/show_bug.cgi?id=184979
3455         <rdar://problem/39709577>
3456
3457         Reviewed by Jer Noble.
3458
3459         * platform/audio/ios/AudioSessionIOS.mm:
3460         (WebCore::AudioSession::setCategory):
3461
3462 2018-04-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3463
3464         [Curl] Fix wrong schema checking on r230973
3465         https://bugs.webkit.org/show_bug.cgi?id=184977
3466
3467         Did write a wrong condition when making a string.
3468
3469         Reviewed by Alex Christensen.
3470
3471         No new tests because test interface is not ready.
3472
3473         * platform/network/curl/CurlProxySettings.cpp:
3474         (WebCore::createProxyUrl):
3475
3476 2018-04-25  Youenn Fablet  <youenn@apple.com>
3477
3478         Make DocumentThreadableLoader error logging more consistent
3479         https://bugs.webkit.org/show_bug.cgi?id=184853
3480
3481         Reviewed by Chris Dumez.
3482
3483         Covered by rebased tests.
3484         Make EventSource, XHR and Fetch log error messages consistently.
3485         This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
3486         will issue more and more errors in places different from WK1.
3487         This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.
3488
3489         Update ImageLoader error message to be more general than CORS.
3490
3491         * loader/CrossOriginPreflightChecker.cpp:
3492         (WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
3493         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
3494         * loader/DocumentThreadableLoader.cpp:
3495         (WebCore::DocumentThreadableLoader::didFail):
3496         (WebCore::DocumentThreadableLoader::preflightFailure):
3497         (WebCore::DocumentThreadableLoader::logErrorAndFail):
3498         * loader/ImageLoader.cpp:
3499         (WebCore::ImageLoader::notifyFinished):
3500         * loader/SubresourceLoader.cpp:
3501         (WebCore::SubresourceLoader::didFail):
3502         * loader/ThreadableLoader.cpp:
3503         (WebCore::ThreadableLoader::logError):
3504         * loader/cache/CachedResource.cpp:
3505         (WebCore::CachedResource::load):
3506         * loader/cache/CachedResourceRequestInitiators.cpp:
3507         (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
3508         * loader/cache/CachedResourceRequestInitiators.h:
3509         * page/EventSource.cpp:
3510         (WebCore::EventSource::connect):
3511         (WebCore::EventSource::didFail):
3512         * xml/XMLHttpRequest.cpp:
3513         (WebCore::XMLHttpRequest::didFail):
3514
3515 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3516
3517         [LFC] Implement Layout::Box functions.
3518         https://bugs.webkit.org/show_bug.cgi?id=184974
3519
3520         Reviewed by Antti Koivisto.
3521
3522         * layout/layouttree/LayoutBlockContainer.h:
3523         * layout/layouttree/LayoutBox.cpp:
3524         (WebCore::Layout::Box::Box):
3525         (WebCore::Layout::Box::~Box):
3526         (WebCore::Layout::Box::establishesFormattingContext const):
3527         (WebCore::Layout::Box::establishesBlockFormattingContext const):
3528         (WebCore::Layout::Box::isRelativelyPositioned const):
3529         (WebCore::Layout::Box::isStickyPositioned const):
3530         (WebCore::Layout::Box::isAbsolutelyPositioned const):
3531         (WebCore::Layout::Box::isFixedPositioned const):
3532         (WebCore::Layout::Box::isFloatingPositioned const):
3533         (WebCore::Layout::Box::containingBlock const):
3534         (WebCore::Layout::Box::isDescendantOf const):
3535         (WebCore::Layout::Box::isAnonymous const):
3536         (WebCore::Layout::Box::isInlineBlockBox const):
3537         (WebCore::Layout::Box::isBlockLevelBox const):
3538         (WebCore::Layout::Box::isInlineLevelBox const):
3539         (WebCore::Layout::Box::isBlockContainerBox const):
3540         (WebCore::Layout::Box::isInitialContainingBlock const):
3541         (WebCore::Layout::Box::nextInFlowSibling const):
3542         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
3543         (WebCore::Layout::Box::previousInFlowSibling const):
3544         (WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
3545         (WebCore::Layout::Box::setParent):
3546         (WebCore::Layout::Box::setNextSibling):
3547         (WebCore::Layout::Box::setPreviousSibling):
3548         (WebCore::Layout::Box::isOverflowVisible const):
3549         * layout/layouttree/LayoutBox.h:
3550         (WebCore::Layout::Box::establishesInlineFormattingContext const):
3551         (WebCore::Layout::Box::isInFlow const):
3552         (WebCore::Layout::Box::isPositioned const):
3553         (WebCore::Layout::Box::isInFlowPositioned const):
3554         (WebCore::Layout::Box::isOutOfFlowPositioned const):
3555         (WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
3556         (WebCore::Layout::Box::parent const):
3557         (WebCore::Layout::Box::nextSibling const):
3558         (WebCore::Layout::Box::previousSibling const):
3559         (WebCore::Layout::Box::weakPtrFactory const):
3560         * layout/layouttree/LayoutContainer.h:
3561         * layout/layouttree/LayoutInlineBox.h:
3562         * layout/layouttree/LayoutInlineContainer.h:
3563
3564 2018-04-25  Per Arne Vollan  <pvollan@apple.com>
3565
3566         [Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
3567         https://bugs.webkit.org/show_bug.cgi?id=184953
3568
3569         This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
3570         The crash is only happening in release builds, which also is an indication of this being a
3571         compiler issue.
3572
3573         Reviewed by Zalan Bujtas.
3574
3575         No new tests, covered by existing tests.
3576
3577         * rendering/SimpleLineLayoutFunctions.cpp:
3578         (WebCore::SimpleLineLayout::generateLineBoxTree):
3579
3580 2018-04-25  Dean Jackson  <dino@apple.com>
3581
3582         Make a better flag for system preview, and disable it where necessary
3583         https://bugs.webkit.org/show_bug.cgi?id=184968
3584         <rdar://problem/39686506>
3585
3586         Reviewed by Eric Carlson.
3587
3588         Use USE(SYSTEM_PREVIEW).
3589
3590         * html/HTMLAnchorElement.cpp:
3591         (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
3592         * html/HTMLAnchorElement.h:
3593         * html/HTMLImageElement.cpp:
3594         * html/HTMLImageElement.h:
3595         * html/HTMLPictureElement.cpp:
3596         * html/HTMLPictureElement.h:
3597         * rendering/RenderImage.cpp:
3598         (WebCore::RenderImage::paintIntoRect):
3599         * rendering/RenderTheme.cpp:
3600         * rendering/RenderTheme.h:
3601         * testing/Internals.cpp:
3602         (WebCore::Internals::systemPreviewRelType):
3603         (WebCore::Internals::isSystemPreviewLink const):
3604         (WebCore::Internals::isSystemPreviewImage const):
3605
3606 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3607
3608         Fix project file after r230931.
3609
3610         * WebCore.xcodeproj/project.pbxproj:
3611
3612 2018-04-25  Miguel Gomez  <magomez@igalia.com>
3613
3614         [GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
3615         https://bugs.webkit.org/show_bug.cgi?id=184780
3616
3617         Reviewed by Žan Doberšek.
3618
3619         Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.
3620
3621         Covered by existent tests.
3622
3623         * platform/graphics/texmap/TextureMapperLayer.h:
3624
3625 2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3626
3627         [GTK] Implement MouseEvent.buttons
3628         https://bugs.webkit.org/show_bug.cgi?id=184913
3629
3630         Reviewed by Žan Doberšek.
3631
3632         Add helper function to get the state modifier of a GDK button.
3633
3634         * platform/gtk/GtkUtilities.cpp:
3635         (WebCore::stateModifierForGdkButton):
3636         * platform/gtk/GtkUtilities.h:
3637
3638 2018-04-24  Ryosuke Niwa  <rniwa@webkit.org>
3639
3640         Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
3641         Document::updateStyleIfNeeded
3642         https://bugs.webkit.org/show_bug.cgi?id=184950
3643
3644         Reviewed by Zalan Bujtas.
3645
3646         Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
3647         by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.
3648
3649         Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
3650         there is no security implication to execute scripts in this isolated document.
3651
3652         Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
3653         style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
3654         I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
3655         by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.
3656
3657         * dom/ScriptDisallowedScope.h: Updated the comment.
3658         * loader/cache/CachedSVGFont.cpp:
3659         (WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.
3660
3661 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
3662
3663         visitedDependentColor() should take a CSSPropertyID
3664         https://bugs.webkit.org/show_bug.cgi?id=184949
3665
3666         Reviewed by Sam Weinig.
3667         
3668         Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
3669         and RenderElement::selectionColor() to take CSSPropertyID rather than int.
3670
3671         No behavior change.
3672
3673         * rendering/RenderElement.cpp:
3674         (WebCore::RenderElement::selectionColor const):
3675         * rendering/RenderElement.h:
3676         * rendering/RenderTableCell.cpp:
3677         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
3678         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
3679         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
3680         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
3681         * rendering/style/RenderStyle.cpp:
3682         (WebCore::RenderStyle::colorIncludingFallback const):
3683         (WebCore::RenderStyle::visitedDependentColor const):
3684         * rendering/style/RenderStyle.h:
3685
3686 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
3687
3688         Add a new "color-filter" CSS property as an experimental feature
3689         https://bugs.webkit.org/show_bug.cgi?id=184940
3690         rdar://problem/39664904
3691
3692         Reviewed by Jon Lee.
3693         
3694         Add a new CSS property called "color-filter" as an experimental feature (off by default).
3695         
3696         This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
3697         to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
3698         Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.
3699         
3700         Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.
3701         
3702         This patch adds support for parsing color-filter.
3703
3704         Test: css3/color-filters/color-filter-parsing.html
3705
3706         * css/CSSComputedStyleDeclaration.cpp:
3707         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3708         * css/CSSProperties.json:
3709         * css/parser/CSSParser.cpp:
3710         (WebCore::CSSParserContext::CSSParserContext):
3711         (WebCore::operator==):
3712         * css/parser/CSSParserMode.h:
3713         * css/parser/CSSPropertyParser.cpp:
3714         (WebCore::CSSPropertyParser::parseSingleValue):
3715         * css/parser/CSSPropertyParserHelpers.cpp:
3716         (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
3717         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
3718         (WebCore::CSSPropertyParserHelpers::consumeFilter):
3719         * css/parser/CSSPropertyParserHelpers.h:
3720         * page/Settings.yaml:
3721         * rendering/style/RenderStyle.cpp:
3722         (WebCore::RenderStyle::changeRequiresRepaint const):
3723         * rendering/style/RenderStyle.h:
3724         (WebCore::RenderStyle::mutableColorFilter):
3725         (WebCore::RenderStyle::colorFilter const):
3726         (WebCore::RenderStyle::hasColorFilter const):
3727         (WebCore::RenderStyle::setColorFilter):
3728         (WebCore::RenderStyle::initialColorFilter):
3729         * rendering/style/StyleRareInheritedData.cpp:
3730         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3731         (WebCore::StyleRareInheritedData::operator== const):
3732         (WebCore::StyleRareInheritedData::hasColorFilters const):
3733         * rendering/style/StyleRareInheritedData.h:
3734
3735 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
3736
3737         shape-outside and filter styles occur twice in the result of getComputedStyle
3738         https://bugs.webkit.org/show_bug.cgi?id=184931
3739
3740         Reviewed by Antti Koivisto.
3741
3742         CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
3743         used by getComputedStyle. Remove the duplication.
3744         
3745         Tested by existing tests.
3746
3747         * css/CSSComputedStyleDeclaration.cpp:
3748
3749 2018-04-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3750
3751         [Curl] Extract proxy settings into a separate class to hold advanced information.
3752         https://bugs.webkit.org/show_bug.cgi?id=184714
3753
3754         It was simplely structure to hold proxy setting. To support advanced feature of proxy
3755         such as authentication, more inteligent object is required to store intermediate state
3756         or errors. That's why we've introduced new class for that purpose.
3757
3758         Reviewed by Youenn Fablet.
3759
3760         No new tests because there's no new behavior.
3761
3762         * platform/Curl.cmake:
3763         * platform/network/curl/CurlContext.cpp:
3764         (WebCore::CurlHandle::enableProxyIfExists):
3765         (WebCore::CurlContext::ProxyInfo::url const): Deleted.
3766         (WebCore::CurlContext::setProxyInfo): Deleted.
3767         * platform/network/curl/CurlContext.h:
3768         (WebCore::CurlContext::proxySettings const):
3769         (WebCore::CurlContext::setProxySettings):
3770         (WebCore::CurlContext::setProxyUserPass):
3771         (WebCore::CurlContext::proxyInfo const): Deleted.
3772         (WebCore::CurlContext::setProxyInfo): Deleted.
3773         * platform/network/curl/CurlProxySettings.cpp: Added.
3774         (WebCore::CurlProxySettings::CurlProxySettings):
3775         (WebCore::CurlProxySettings::rebuildUrl):
3776         (WebCore::CurlProxySettings::setUserPass):
3777         (WebCore::protocolIsInSocksFamily):
3778         (WebCore::getProxyPort):
3779         (WebCore::createProxyUrl):
3780         * platform/network/curl/CurlProxySettings.h: Added.
3781         (WebCore::CurlProxySettings::CurlProxySettings):
3782         (WebCore::CurlProxySettings::isEmpty const):
3783         (WebCore::CurlProxySettings::mode const):
3784         (WebCore::CurlProxySettings::url const):
3785         (WebCore::CurlProxySettings::ignoreHosts const):
3786         (WebCore::CurlProxySettings::user const):
3787         (WebCore::CurlProxySettings::password const):
3788         * platform/network/curl/CurlRequest.cpp:
3789         (WebCore::CurlRequest::didReceiveHeader):
3790         * platform/network/curl/CurlResponse.h:
3791         (WebCore::CurlResponse::isolatedCopy const):
3792         * platform/network/curl/ResourceResponseCurl.cpp:
3793         (WebCore::ResourceResponse::ResourceResponse):
3794
3795 2018-04-24  Youenn Fablet  <youenn@apple.com>
3796
3797         Throw in case of PeerConnection created for detached documents
3798         https://bugs.webkit.org/show_bug.cgi?id=184921
3799         <rdar://problem/39629216>
3800
3801         Reviewed by Eric Carlson.
3802
3803         Add a check to ensure that page is not null when creating a peer connection backend.
3804         In that case, the peer connection constructor will later on throw.
3805         The same for setConfiguration is done.
3806         Behavior is consistent with Chrome.
3807
3808         Test: webrtc/pc-detached-document.html
3809
3810         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3811         (WebCore::createLibWebRTCPeerConnectionBackend):
3812         (WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
3813         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
3814         (WebCore::libWebRTCProvider): Deleted.
3815         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3816
3817 2018-04-24  John Wilander  <wilander@apple.com>
3818
3819         From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
3820         https://bugs.webkit.org/show_bug.cgi?id=184560
3821         <rdar://problem/38901344>
3822
3823         Reviewed by Youenn Fablet and Daniel Bates.
3824
3825         Tests: http/tests/from-origin/document-from-origin-same-accepted.html
3826                http/tests/from-origin/document-from-origin-same-blocked.html
3827                http/tests/from-origin/document-from-origin-same-site-accepted.html
3828                http/tests/from-origin/document-from-origin-same-site-blocked.html
3829                http/tests/from-origin/document-nested-from-origin-same-accepted.html
3830                http/tests/from-origin/document-nested-from-origin-same-blocked.html
3831                http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
3832                http/tests/from-origin/fetch-from-origin-same-accepted.html
3833                http/tests/from-origin/fetch-from-origin-same-blocked.html
3834                http/tests/from-origin/fetch-from-origin-same-site-accepted.html
3835                http/tests/from-origin/fetch-from-origin-same-site-blocked.html
3836                http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
3837                http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
3838                http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
3839                http/tests/from-origin/image-from-origin-same-accepted.html
3840                http/tests/from-origin/image-from-origin-same-blocked.html
3841                http/tests/from-origin/image-from-origin-same-site-accepted.html
3842                http/tests/from-origin/image-from-origin-same-site-blocked.html
3843                http/tests/from-origin/redirect-document-from-origin-same-blocked.html
3844                http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
3845                http/tests/from-origin/redirect-image-from-origin-same-blocked.html
3846                http/tests/from-origin/redirect-script-from-origin-same-blocked.html
3847                http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
3848                http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
3849                http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
3850                http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
3851                http/tests/from-origin/script-from-origin-same-accepted.html
3852                http/tests/from-origin/script-from-origin-same-blocked.html
3853                http/tests/from-origin/script-from-origin-same-site-accepted.html
3854                http/tests/from-origin/script-from-origin-same-site-blocked.html
3855                http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
3856                http/tests/from-origin/xhr-from-origin-same-accepted.html
3857                http/tests/from-origin/xhr-from-origin-same-blocked.html
3858                http/tests/from-origin/xhr-from-origin-same-site-accepted.html
3859                http/tests/from-origin/xhr-from-origin-same-site-blocked.html
3860
3861         * loader/SubresourceLoader.cpp:
3862         (WebCore::SubresourceLoader::didFail):
3863             Outputs the error's localized description in a console message except when the destination
3864             is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
3865         * page/RuntimeEnabledFeatures.h:
3866         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
3867         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
3868             Added From-Origin support as an experimental feature.
3869         * platform/network/HTTPHeaderNames.in:
3870             Added From-Origin.
3871         * platform/network/HTTPParsers.cpp:
3872         (WebCore::parseFromOriginHeader):
3873             Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
3874         * platform/network/HTTPParsers.h:
3875
3876 2018-04-24  Antti Koivisto  <antti@apple.com>
3877
3878         Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
3879         https://bugs.webkit.org/show_bug.cgi?id=184922
3880
3881         Reviewed by Zalan Bujtas.
3882
3883         To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.
3884
3885         * Sources.txt:
3886         * WebCore.xcodeproj/project.pbxproj:
3887         * layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
3888         * layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
3889         * layout/LayoutCtx.cpp: Removed.
3890         * layout/LayoutCtx.h: Removed.
3891         * page/FrameView.cpp:
3892         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
3893         (WebCore::FrameView::updateLayoutViewport):
3894         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
3895         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
3896         (WebCore::FrameView::availableContentSizeChanged):
3897         * page/FrameView.h:
3898         * page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
3899         (WebCore::LayoutScope::LayoutScope):
3900         (WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
3901         (WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
3902         (WebCore::FrameViewLayoutContext::layout):
3903         (WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
3904         (WebCore::FrameViewLayoutContext::runAsynchronousTasks):
3905         (WebCore::FrameViewLayoutContext::flushAsynchronousTasks):
3906         (WebCore::FrameViewLayoutContext::reset):
3907         (WebCore::FrameViewLayoutContext::needsLayout const):
3908         (WebCore::FrameViewLayoutContext::setNeedsLayout):
3909         (WebCore::FrameViewLayoutContext::enableSetNeedsLayout):
3910         (WebCore::FrameViewLayoutContext::disableSetNeedsLayout):
3911         (WebCore::FrameViewLayoutContext::scheduleLayout):
3912         (WebCore::FrameViewLayoutContext::unscheduleLayout):
3913         (WebCore::FrameViewLayoutContext::scheduleSubtreeLayout):
3914         (WebCore::FrameViewLayoutContext::layoutTimerFired):
3915         (WebCore::FrameViewLayoutContext::convertSubtreeLayoutToFullLayout):
3916         (WebCore::FrameViewLayoutContext::setSubtreeLayoutRoot):
3917         (WebCore::FrameViewLayoutContext::canPerformLayout const):
3918         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
3919         (WebCore::FrameViewLayoutContext::updateStyleForLayout):
3920         (WebCore::FrameViewLayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
3921         (WebCore::FrameViewLayoutContext::startLayoutAtMainFrameViewIfNeeded):
3922         (WebCore::FrameViewLayoutContext::layoutDelta const):
3923         (WebCore::FrameViewLayoutContext::addLayoutDelta):
3924         (WebCore::FrameViewLayoutContext::layoutDeltaMatches):
3925         (WebCore::FrameViewLayoutContext::layoutState const):
3926         (WebCore::FrameViewLayoutContext::pushLayoutState):
3927         (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
3928         (WebCore::FrameViewLayoutContext::popLayoutState):
3929         (WebCore::FrameViewLayoutContext::checkLayoutState):
3930         (WebCore::FrameViewLayoutContext::frame const):
3931         (WebCore::FrameViewLayoutContext::view const):
3932         (WebCore::FrameViewLayoutContext::renderView const):
3933         (WebCore::FrameViewLayoutContext::document const):
3934         (WebCore::LayoutContext::LayoutContext): Deleted.
3935         (WebCore::LayoutContext::~LayoutContext): Deleted.
3936         (WebCore::LayoutContext::layout): Deleted.
3937         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Deleted.
3938         (WebCore::LayoutContext::runAsynchronousTasks): Deleted.
3939         (WebCore::LayoutContext::flushAsynchronousTasks): Deleted.
3940         (WebCore::LayoutContext::reset): Deleted.
3941         (WebCore::LayoutContext::needsLayout const): Deleted.
3942         (WebCore::LayoutContext::setNeedsLayout): Deleted.
3943         (WebCore::LayoutContext::enableSetNeedsLayout): Deleted.
3944         (WebCore::LayoutContext::disableSetNeedsLayout): Deleted.
3945         (WebCore::LayoutContext::scheduleLayout): Deleted.
3946         (WebCore::LayoutContext::unscheduleLayout): Deleted.
3947         (WebCore::LayoutContext::scheduleSubtreeLayout): Deleted.
3948         (WebCore::LayoutContext::layoutTimerFired): Deleted.
3949         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout): Deleted.
3950         (WebCore::LayoutContext::setSubtreeLayoutRoot): Deleted.
3951         (WebCore::LayoutContext::canPerformLayout const): Deleted.
3952         (WebCore::LayoutContext::applyTextSizingIfNeeded): Deleted.
3953         (WebCore::LayoutContext::updateStyleForLayout): Deleted.
3954         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
3955         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded): Deleted.
3956         (WebCore::LayoutContext::layoutDelta const): Deleted.
3957         (WebCore::LayoutContext::addLayoutDelta): Deleted.
3958         (WebCore::LayoutContext::layoutDeltaMatches): Deleted.
3959         (WebCore::LayoutContext::layoutState const): Deleted.
3960         (WebCore::LayoutContext::pushLayoutState): Deleted.
3961         (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): Deleted.
3962         (WebCore::LayoutContext::popLayoutState): Deleted.
3963         (WebCore::LayoutContext::checkLayoutState): Deleted.
3964         (WebCore::LayoutContext::frame const): Deleted.
3965         (WebCore::LayoutContext::view const): Deleted.
3966         (WebCore::LayoutContext::renderView const): Deleted.
3967         (WebCore::LayoutContext::document const): Deleted.
3968         * page/FrameViewLayoutContext.h: Copied from Source/WebCore/page/LayoutContext.h.
3969         (WebCore::LayoutContext::startDisallowingLayout): Deleted.
3970         (WebCore::LayoutContext::endDisallowingLayout): Deleted.
3971         (WebCore::LayoutContext::layoutPhase const): Deleted.
3972         (WebCore::LayoutContext::isLayoutNested const): Deleted.
3973         (WebCore::LayoutContext::isLayoutPending const): Deleted.
3974         (WebCore::LayoutContext::isInLayout const): Deleted.
3975         (WebCore::LayoutContext::isInRenderTreeLayout const): Deleted.
3976         (WebCore::LayoutContext::inPaintableState const): Deleted.
3977         (WebCore::LayoutContext::layoutCount const): Deleted.
3978         (WebCore::LayoutContext::subtreeLayoutRoot const): Deleted.
3979         (WebCore::LayoutContext::clearSubtreeLayoutRoot): Deleted.
3980         (WebCore::LayoutContext::resetFirstLayoutFlag): Deleted.
3981         (WebCore::LayoutContext::didFirstLayout const): Deleted.
3982         (WebCore::LayoutContext::setNeedsFullRepaint): Deleted.
3983         (WebCore::LayoutContext::needsFullRepaint const): Deleted.
3984         (WebCore::LayoutContext::isPaintOffsetCacheEnabled const): Deleted.
3985         (WebCore::LayoutContext::layoutDisallowed const): Deleted.
3986         (WebCore::LayoutContext::isLayoutSchedulingEnabled const): Deleted.
3987         (WebCore::LayoutContext::inAsynchronousTasks const): Deleted.
3988         (WebCore::LayoutContext::disablePaintOffsetCache): Deleted.
3989         (WebCore::LayoutContext::enablePaintOffsetCache): Deleted.
3990         * page/LayoutContext.cpp: Removed.
3991         * page/LayoutContext.h: Removed.
3992         * rendering/LayoutState.cpp:
3993         (WebCore::LayoutState::LayoutState):
3994         (WebCore::LayoutState::computePaginationInformation):
3995         (WebCore::LayoutState::establishLineGrid):
3996         (WebCore::LayoutStateDisabler::LayoutStateDisabler):
3997         * rendering/LayoutState.h:
3998
3999 2018-04-24  Mark Lam  <mark.lam@apple.com>
4000
4001         Need to acquire the VM lock before calling toNumber on a JSValue.
4002         https://bugs.webkit.org/show_bug.cgi?id=184924
4003         <rdar://problem/39690679>
4004
4005         Reviewed by Saam Barati.
4006
4007         * bridge/objc/objc_utility.mm:
4008         (JSC::Bindings::convertValueToObjcValue):
4009
4010 2018-04-24  Tadeu Zagallo  <tzagallo@apple.com>
4011
4012         REGRESSION(r221839): Fix requests with FormData containing empty files
4013         https://bugs.webkit.org/show_bug.cgi?id=184490
4014         <rdar://problem/39385169>
4015
4016         Reviewed by Geoffrey Garen.
4017
4018         We should not append the blob to the FormData when it is a file but has no path. It broke
4019         the submission since the request was failing to read the file in FormDataStreamCFNet.h:156
4020
4021         Test: http/tests/local/formdata/send-form-data-with-empty-file.html
4022
4023         * platform/network/FormData.cpp:
4024         (WebCore::FormData::appendMultiPartFileValue):
4025
4026 2018-04-24  Zalan Bujtas  <zalan@apple.com>
4027
4028         Fix project file after r230931.
4029
4030         * WebCore.xcodeproj/project.pbxproj:
4031
4032 2018-04-24  Jer Noble  <jer.noble@apple.com>
4033
4034         Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
4035         https://bugs.webkit.org/show_bug.cgi?id=184786
4036
4037         Reviewed by Tim Horton.
4038
4039         * Configurations/WebCore.xcconfig:
4040         * DerivedSources.make:
4041         * WebCore.xcodeproj/project.pbxproj:
4042
4043 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
4044
4045         [CoordGraphics] Remove dead fixed layer code
4046         https://bugs.webkit.org/show_bug.cgi?id=184912
4047
4048    &nb