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